{"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 // 先頭0以外\n // 下2桁 00 25 50 75\n\n int ans = int.MaxValue;\n\n // 先頭\n for (int i = 0; i < n.Length; i++)\n {\n if (n[i] == '0') continue;\n // 2桁目\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]にnを加算\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)の和を求める\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)の和を求める\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": "using 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": "\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": "using 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 // Находит проекцию точки на прямую\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": "using 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": "using 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": "using 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.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": "using 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": "using 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": "using 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 покупка_телевизора\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 * Сделано в SharpDevelop.\n * Пользователь: alexey\n * Дата: 16.11.2012\n * Время: 19:15\n * \n * Для изменения этого шаблона используйте Сервис | Настройка | Кодирование | Правка стандартных заголовков.\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": "using System;\nusing System.Collections.Generic;\nusing System.Globalization;\nusing System.IO;\nusing System.Linq;\nusing System.Text;\nusing System.Threading;\n\n// (づ°ω°)づミe★゜・。。・゜゜・。。・゜☆゜・。。・゜゜・。。・゜\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": "using 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": "using 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": "using 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": "using 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": "using 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": "using 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": "using 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": "using 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": "using 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": "using 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)の部分列に含まれるS[j,i)の数の和\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 //端はとっても取らなくてもいいので2\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": "using 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": "/*\nУ вас есть два друга. Вы хотите подарить каждому другу некоторое количество целых положительных чисел. Первому другу вы хотите подарить cnt1 чисел, второму — cnt2 чисел. Более того, вы хотите, чтобы все подаренные числа были различными, в частности, ни одно число не должно достаться обоим друзьям.\n\nКроме этого, первый друг не любит числа, которые делятся без остатка на простое число x. Второй друг не любит числа, которые делятся без остатка на простое число y. Конечно, вы не будете дарить друзьям числа, которые они не любят.\n\nВаша задача — найти такое минимальное число v, такое что из набора чисел 1, 2, ..., v можно составить подарки друзьям. Естественно, некоторые числа можно не дарить никому из них.\n\nПоложительное целое число, большее единицы, называется простым, если оно не делится нацело ни на одно положительное целое число кроме единицы и себя самого.\nВходные данные\n\nВ первой строке записано четыре целых положительных числа cnt1, cnt2, x, y (1 ≤ cnt1, cnt2 < 109; cnt1 + cnt2 ≤ 109; 2 ≤ x < y ≤ 3·104) — описанные в условии числа. Гарантируется, что числа x, y являются простыми числами.\nВыходные данные\n\nВыведите единственное целое число — ответ на задачу.*/\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": "// 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": "\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": "using 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;//階乗\n private static ModInt[] inv;//逆数\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(this T[] A) => Create(A.Length, i => A[i]);\n public static void Fail(T s) { Console.WriteLine(s); Console.Out.Close(); Environment.Exit(0); }\n}\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 public Pair PairMake() => new Pair(Next(), Next());\n public Pair PairMake() => new Pair(Next(), Next(), Next());\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}\n\npublic class Pair : IComparable>\n{\n public T1 v1;\n public T2 v2;\n public Pair() { }\n public Pair(T1 v1, T2 v2)\n { this.v1 = v1; this.v2 = v2; }\n\n [MethodImpl(MethodImplOptions.AggressiveInlining)]\n public int CompareTo(Pair p)\n {\n var c = Comparer.Default.Compare(v1, p.v1);\n if (c == 0)\n c = Comparer.Default.Compare(v2, p.v2);\n return c;\n }\n public override string ToString() => $\"{v1.ToString()} {v2.ToString()}\";\n public void Tie(out T1 a, out T2 b) { a = v1; b = v2; }\n}\n\npublic class Pair : Pair, IComparable>\n{\n public T3 v3;\n public Pair() : base() { }\n public Pair(T1 v1, T2 v2, T3 v3) : base(v1, v2)\n { this.v3 = v3; }\n\n [MethodImpl(MethodImplOptions.AggressiveInlining)]\n public int CompareTo(Pair p)\n {\n var c = base.CompareTo(p);\n if (c == 0)\n c = Comparer.Default.Compare(v3, p.v3);\n return c;\n }\n public override string ToString() => $\"{base.ToString()} {v3.ToString()}\";\n public void Tie(out T1 a, out T2 b, out T3 c) { Tie(out a, out b); c = v3; }\n}\n#endregion\n", "lang": "Mono C#", "bug_code_uid": "5432c2f764d140c1a358761f950edd72", "src_uid": "61f88159762cbc7c51c36e7b56ecde48", "apr_id": "56fb023fcafce7249d8a4607f01dc314", "difficulty": 2200, "tags": ["dp", "bitmasks"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.39937839937839936, "equal_cnt": 20, "replace_cnt": 12, "delete_cnt": 4, "insert_cnt": 3, "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 N = sc.Int;S = ReadLine();\n dp = Create(N, () => new ModInt[1 << 20]);\n use = Create(N, () => new bool[1 << 20]);\n ModInt res = 0;\n for (var i = 0; i < N; i++)\n res += memo(0, i);\n WriteLine(res);\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 if (i == N)\n return ToInt32(ct != 0 && (1 << ct) - 1 == s);\n if (use[i][s]) return dp[i][s];\n ModInt res = 0;\n if (S[i] == '0') return dp[i][s] = memo(s, i + 1);\n var c = 0;\n for (var j = i; j < N; j++)\n {\n c <<= 1;c += S[j] - '0';\n if (c > 20) break;\n res += memo(s | (1 << (c - 1)), j + 1);\n }\n if (ct != 0 && (1 << ct)-1 == s) res++;\n return dp[i][s] = res;\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;//階乗\n private static ModInt[] inv;//逆数\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(this T[] A) => Create(A.Length, i => A[i]);\n public static void Fail(T s) { Console.WriteLine(s); Console.Out.Close(); Environment.Exit(0); }\n}\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 public Pair PairMake() => new Pair(Next(), Next());\n public Pair PairMake() => new Pair(Next(), Next(), Next());\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}\n\npublic class Pair : IComparable>\n{\n public T1 v1;\n public T2 v2;\n public Pair() { }\n public Pair(T1 v1, T2 v2)\n { this.v1 = v1; this.v2 = v2; }\n\n [MethodImpl(MethodImplOptions.AggressiveInlining)]\n public int CompareTo(Pair p)\n {\n var c = Comparer.Default.Compare(v1, p.v1);\n if (c == 0)\n c = Comparer.Default.Compare(v2, p.v2);\n return c;\n }\n public override string ToString() => $\"{v1.ToString()} {v2.ToString()}\";\n public void Tie(out T1 a, out T2 b) { a = v1; b = v2; }\n}\n\npublic class Pair : Pair, IComparable>\n{\n public T3 v3;\n public Pair() : base() { }\n public Pair(T1 v1, T2 v2, T3 v3) : base(v1, v2)\n { this.v3 = v3; }\n\n [MethodImpl(MethodImplOptions.AggressiveInlining)]\n public int CompareTo(Pair p)\n {\n var c = base.CompareTo(p);\n if (c == 0)\n c = Comparer.Default.Compare(v3, p.v3);\n return c;\n }\n public override string ToString() => $\"{base.ToString()} {v3.ToString()}\";\n public void Tie(out T1 a, out T2 b, out T3 c) { Tie(out a, out b); c = v3; }\n}\n#endregion\n", "lang": "Mono C#", "bug_code_uid": "fd35c6f490d91963fdf22a57a029581a", "src_uid": "61f88159762cbc7c51c36e7b56ecde48", "apr_id": "56fb023fcafce7249d8a4607f01dc314", "difficulty": 2200, "tags": ["dp", "bitmasks"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.7192523364485981, "equal_cnt": 21, "replace_cnt": 17, "delete_cnt": 0, "insert_cnt": 4, "fix_ops_cnt": 21, "bug_source_code": "using System;\nusing System.Collections.Generic;\n\nnamespace tmpRound2\n{\n class Program\n {\n static int Main(string[] args)\n {\n string[] line = Console.ReadLine().Split(' ');\n int n = int.Parse(line[0]), l = int.Parse(line[1]);\n int[] s = new int[n], k = new int[n];\n line = Console.ReadLine().Split(' ');\n\t for (int i = 0; i < n; i++)\n\t\t s[i] = int.Parse(line[i]);\n line = Console.ReadLine().Split(' ');\n\t for (int i = 0; i < n; i++)\n\t\t k[i] = int.Parse(line[i]);;\n\t List sOne = new List(),\n\t\t kOne = new List();\n sOne.Add(l - s[n - 1] + s[0]);\n kOne.Add(l - k[n - 1] + k[0]);\n\t for (int i = 0; i < n - 1; i++)\n\t {\n\t\t sOne.Add(s[i + 1] - s[i]);\n\t\t kOne.Add(k[i + 1] - k[i]);\n }\n sOne.Sort();\n kOne.Sort();\n for (int i = 0; i < sOne.Count; i++)\n {\n\t\t if (sOne[i] != kOne[i])\n\t\t {\n\t\t\t Console.WriteLine(\"NO\");\n\t\t\t return 0;\n\t\t }\n\t }\n Console.WriteLine(\"YES\");\n\t return 0;\n }\n }\n}", "lang": "MS C#", "bug_code_uid": "76b1ffc234df88b7c3cca55ace5c376f", "src_uid": "3d931684ca11fe6141c6461e85d91d63", "apr_id": "7f668524017e2acdce935b28e90a9efd", "difficulty": 1300, "tags": ["math", "brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.8104728409534975, "equal_cnt": 9, "replace_cnt": 4, "delete_cnt": 1, "insert_cnt": 3, "fix_ops_cnt": 8, "bug_source_code": "using System;\n\nusing System.Linq;\n\n\nnamespace SomeTask\n{\n class Program\n {\n static void Main(string[] args)\n {\n var s = Console.ReadLine().Split().Select(int.Parse).ToArray();\n var n = s[0];\n var len = s[1];\n var arr1 = Console.ReadLine().Split().Select(int.Parse).ToList();\n var arr2 = Console.ReadLine().Split().Select(int.Parse).ToList();\n var t1 = new int[n];\n var t2 = new int[n];\n\n\n for (var i = 0; i < n - 1; i++)\n {\n t1[i] = arr1[i + 1] - arr1[i];\n t2[i] = arr2[i + 1] - arr2[i];\n }\n t1[n - 1] = arr1[0] + len - arr1[n - 1];\n t2[n - 1] = arr2[0] + len - arr2[n - 1];\n t1 = t1.OrderBy(x => x).ToArray();\n t2 = t2.OrderBy(x => x).ToArray();\n for (int i = 0; i < n; i++)\n {\n if (t1[i] != t2[i])\n {\n Console.WriteLine(\"NO\");\n return;\n }\n }\n Console.WriteLine(\"YES\");\n\n\n }\n\n static int Func()\n {\n return 0;\n }\n\n\n\n }\n}\n", "lang": "MS C#", "bug_code_uid": "4e5dcf36c850d9355a6bd1ccf91b8c66", "src_uid": "3d931684ca11fe6141c6461e85d91d63", "apr_id": "392bc18d536f189e45a550ec1d53b6a1", "difficulty": 1300, "tags": ["math", "brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.6696113074204947, "equal_cnt": 1, "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 ConsoleApplication1\n{\n class Program\n {\n internal static void MyMain()\n {\n var ints = RInts();\n var a = ints[0];\n var b = ints[1];\n var stepps = ints[2];\n\n if (Math.Abs(a) + Math.Abs(b) <= stepps && (a + b - stepps) % 2 == 0)\n {\n WLine(\"Yes\");\n }\n else\n {\n WLine(\"No\");\n }\n\n\n }\n\n static void Main()\n {\n#if !HOME\n MyMain();\n#else\n Secret.Run();\n#endif\n }\n\n #region Utils\n static string RLine()\n {\n return Console.ReadLine();\n }\n\n static int RInt()\n {\n var str = Console.ReadLine();\n return Convert.ToInt32(str);\n }\n static int[] RInts()\n {\n return Array.ConvertAll(Console.ReadLine().Split(' '), s => Convert.ToInt32(s));\n }\n static void RInts(out int a, out int b)\n {\n var ints = RInts();\n a = ints[0];\n b = ints[1];\n }\n static void RLongs(out long a, out long b)\n {\n var ints = Array.ConvertAll(Console.ReadLine().Split(' '), s => Convert.ToInt64(s));\n a = ints[0];\n b = ints[1];\n }\n public static void WLine(T s)\n {\n Console.WriteLine(s);\n }\n #endregion\n }\n}\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\n\nnamespace ConsoleApplication1\n{\n class Program\n {\n internal static void MyMain()\n {\n var ints = RInts();\n var a = ints[0];\n var b = ints[1];\n var stepps = ints[2];\n\n if (a + b <= stepps && (a + b - stepps) % 2 == 0)\n {\n WLine(\"Yes\");\n }\n else\n {\n WLine(\"No\");\n }\n\n\n }\n\n static void Main()\n {\n#if !HOME\n MyMain();\n#else\n Secret.Run();\n#endif\n }\n\n #region Utils\n static string RLine()\n {\n return Console.ReadLine();\n }\n\n static int RInt()\n {\n var str = Console.ReadLine();\n return Convert.ToInt32(str);\n }\n static int[] RInts()\n {\n return Array.ConvertAll(Console.ReadLine().Split(' '), s => Convert.ToInt32(s));\n }\n static void RInts(out int a, out int b)\n {\n var ints = RInts();\n a = ints[0];\n b = ints[1];\n }\n static void RLongs(out long a, out long b)\n {\n var ints = Array.ConvertAll(Console.ReadLine().Split(' '), s => Convert.ToInt64(s));\n a = ints[0];\n b = ints[1];\n }\n public static void WLine(T s)\n {\n Console.WriteLine(s);\n }\n #endregion\n }\n}\n", "lang": "MS C#", "bug_code_uid": "1f8af9a28107c521c147725c5374ed9c", "src_uid": "9a955ce0775018ff4e5825700c13ed36", "apr_id": "ebcd42d88494dcc9112241242dfd0980", "difficulty": 1000, "tags": ["math"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C#"} {"similarity_score": 0.9812393405343945, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 3, "bug_source_code": "using System;\nusing System.Text;\n\nnamespace CodeForces\n{\n class Program\n {\n public static bool IsPrim(int n, int k)\n {\n if(k == 1)\n return false;\n \n if(n==2 && k <=2)\n return true;\n\n for (int i = 2; i < n; i++)\n if (n % i == 0 && i >= k)\n return false;\n return true;\n }\n static void Main()\n {\n var input = Console.ReadLine().Split(' ');\n var n = Int32.Parse(input[0]);\n var m = Int32.Parse(input[1]);\n var k = Int32.Parse(input[2]);\n\n if (m < 2 * k || n % 2 == 0 || IsPrim(m, k))\n {\n Console.WriteLine(\"Marsel\");\n return;\n }\n Console.WriteLine(\"Timur\"); \n }\n }\n}", "lang": "Mono C#", "bug_code_uid": "0502562e83dfa19b1cd649a94acd2f86", "src_uid": "4a3767011ddac874efa021fff7c94432", "apr_id": "5871d166413390c035439601c29f4290", "difficulty": 2000, "tags": ["dp", "games", "number theory"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.9968954812004139, "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.Text;\nusing System.ComponentModel;\n\nnamespace CodeForces\n{\n public class _78C\n {\n public static void Main()\n {\n ConsoleReader consoleReader = new ConsoleReader();\n\n int n, m, k;\n consoleReader.Read(out n, out m, out k);\n\n winsCache = new Dictionary(1000000);\n primes = new List();\n GeneratePrimes(primes);\n\n if (FirstTurnWins(n, m, k))\n Console.WriteLine(\"Timur\");\n else\n Console.WriteLine(\"Marsel\");\n }\n\n private static void GeneratePrimes(List primes)\n {\n primes.Add(2);\n\n for (int i = 3; i <= 100000; i+=2)\n {\n bool isPrime = true;\n\n for (int j = 0; j < primes.Count; j++)\n {\n if (i % primes[j] == 0)\n {\n isPrime = false;\n break;\n }\n }\n\n if (isPrime)\n primes.Add(i);\n }\n }\n\n private static List primes;\n private static Dictionary winsCache;\n\n private static bool FirstTurnWins(int n, int m, int k)\n {\n bool isFirstWinM = IsFirstWinM(m, k);\n\n return isFirstWinM && (n % 2 == 1);\n }\n\n private static bool IsFirstWinM(int m, int k)\n {\n bool cachedWin;\n if (winsCache.TryGetValue(m, out cachedWin))\n {\n return cachedWin;\n }\n\n bool result = false;\n\n foreach (var divisor in GetAllDivisors(m))\n {\n int part = m / divisor;\n if (part >= k && !FirstTurnWins(divisor, part, k))\n {\n result = true;\n break;\n }\n }\n\n winsCache[m] = result;\n return result;\n }\n\n private static IEnumerable GetAllDivisors(int m)\n {\n foreach (var prime in primes)\n {\n if (m % prime == 0)\n {\n yield return prime;\n\n m /= prime;\n int maxPrime = prime;\n while (m % prime == 0)\n {\n m /= prime;\n maxPrime *= prime;\n yield return maxPrime;\n }\n\n var remainingDivisors = GetAllDivisors(m).ToList();\n\n int mul = 1;\n while (mul <= maxPrime)\n {\n foreach (var remainingDivisor in remainingDivisors)\n {\n yield return mul * remainingDivisor;\n }\n\n mul *= prime;\n }\n }\n }\n\n yield return m;\n }\n\n private class ConsoleReader\n {\n public void Read(out T value)\n {\n var s = Console.ReadLine().Split(new[] { ' ' }, StringSplitOptions.RemoveEmptyEntries);\n value = (T)TypeDescriptor.GetConverter(typeof(T)).ConvertFromInvariantString(s[0]);\n }\n\n public void Read(out T value1, out T value2)\n {\n var s = Console.ReadLine().Split(new[] { ' ' }, StringSplitOptions.RemoveEmptyEntries);\n value1 = (T)TypeDescriptor.GetConverter(typeof(T)).ConvertFromInvariantString(s[0]);\n value2 = (T)TypeDescriptor.GetConverter(typeof(T)).ConvertFromInvariantString(s[1]);\n }\n\n public void Read(out T value1, out T value2, out T value3)\n {\n var s = Console.ReadLine().Split(new[] { ' ' }, StringSplitOptions.RemoveEmptyEntries);\n value1 = (T)TypeDescriptor.GetConverter(typeof(T)).ConvertFromInvariantString(s[0]);\n value2 = (T)TypeDescriptor.GetConverter(typeof(T)).ConvertFromInvariantString(s[1]);\n value3 = (T)TypeDescriptor.GetConverter(typeof(T)).ConvertFromInvariantString(s[2]);\n }\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "b8b9f7bfa666785673bf59f371144c5c", "src_uid": "4a3767011ddac874efa021fff7c94432", "apr_id": "2424daf2527550a3f65810165f1610b4", "difficulty": 2000, "tags": ["dp", "games", "number theory"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.9502431724653947, "equal_cnt": 6, "replace_cnt": 4, "delete_cnt": 1, "insert_cnt": 0, "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 Codeforces\n{\n\n class Program\n {\n public static readonly int MOD = Convert.ToInt32(1e9 + 7);\n public static readonly int oo = Convert.ToInt32(1e9);\n public static readonly long OO = Convert.ToInt64(1e18);\n\n static void Main(string[] args)\n {\n int weights = int.Parse(Console.ReadLine());\n int[] masses = Console.ReadLine().Split(' ').Select(s => int.Parse(s)).ToArray();\n int[] cnt = new int[101];\n foreach (int mass in masses)\n {\n cnt[mass]++;\n }\n\n if (masses.Select(mass => mass > 0).Count() <= 2)\n {\n Console.WriteLine(weights);\n return;\n }\n\n int[,] C = new int[101, 101];\n C[0, 0] = 1;\n for (int i = 1; i <= 100; i++)\n {\n C[i, 0] = C[i, i] = 1;\n for (int j = 1; j < i; j++)\n {\n C[i, j] = (C[i - 1, j] + C[i - 1, j - 1]) % MOD;\n }\n }\n\n\n int sum = masses.Sum();\n int[,] ways = new int[weights + 1, sum + 1];\n ///\n /// dp(i, j, k) = dp(i - 1, j - 1, k - masses[j])\n ///\n\n ways[0, 0] = 1;\n for (int i = 0; i < weights; i++)\n {\n int[,] nways = new int[weights + 1, sum + 1];\n nways[0, 0] = 1;\n for (int j = 1; j <= i + 1; j++)\n {\n for (int k = sum; k > 0; k--)\n {\n nways[j, k] = ways[j, k];\n if (k >= masses[i])\n {\n nways[j, k] = (nways[j, k] + ways[j - 1, k - masses[i]]) % MOD;\n }\n }\n }\n \n ways = nways;\n }\n \n\n int ans = 1;\n for (int i = 1; i <= 100; i++)\n {\n if (cnt[i] > 0)\n {\n for (int j = i; j <= sum; j += i)\n {\n if (j / i <= weights && ways[j / i, j] > 0 && ways[j / i, j] == C[cnt[i], j / i])\n {\n ans = Math.Max(ans, j / i);\n }\n }\n }\n }\n\n Console.WriteLine(ans);\n\n\n }\n\n }\n\n}\n", "lang": "Mono C#", "bug_code_uid": "f2ec1b85253bd59c0c76c266d4e83666", "src_uid": "ccc4b27889598266e8efe73b8aa3666c", "apr_id": "da1f7eb881d9e3312c6de73e19ac435a", "difficulty": 2100, "tags": ["dp", "math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.7098919368246052, "equal_cnt": 9, "replace_cnt": 3, "delete_cnt": 2, "insert_cnt": 4, "fix_ops_cnt": 9, "bug_source_code": "using System;\nusing System.Linq;\nusing System.IO;\nclass Program\n{\n static void Main()\n {\n //Console.SetIn(new StreamReader(Console.OpenStandardInput(8192)));\n var n = int.Parse(Console.ReadLine());\n var x = Console.ReadLine().Split().Select(int.Parse).ToArray();\n while (true)\n {\n x = x.OrderByDescending(i => i).ToArray();\n x[0] = x[0] - x[1];\n if (x.Min()==x.Max())\n {\n break;\n }\n }\n Console.WriteLine(x.Max() * n);\n }\n}", "lang": "MS C#", "bug_code_uid": "8a5ec77ba5adc7e98f02025346f5ff46", "src_uid": "042cf938dc4a0f46ff33d47b97dc6ad4", "apr_id": "0cc43cd118c4bb47899e7e7b90f4d47b", "difficulty": 1000, "tags": ["math", "greedy"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.9992917847025495, "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;\n\nnamespace CFTraining.C_s\n{\n class ClearSymmetry127\n {\n public static void Main(string[] args)\n {\n int x = Convert.ToInt32(Console.ReadLine());\n int[] sharpToDim = new int[101]; // x -> n\n sharpToDim[1] = 1;\n sharpToDim[2] = 2;\n sharpToDim[3] = 5;\n sharpToDim[4] = 3;\n sharpToDim[5] = 3;\n for (int i = 6; i < 101; i++) sharpToDim[i] = int.MaxValue;\n int odd = 5, currentX = 6;\n while (currentX <= 100)\n {\n int Sm = Math.Min(((odd / 2) / 2 * 4 + 1) + ((((odd - 1) / 2) * ((odd - 1) / 2))/2 + ((odd - 1)/2)%2) * 4, 100);\n while (currentX <= Sm) sharpToDim[currentX] = Math.Min(sharpToDim[currentX++], odd);\n odd += 2;\n }\n int even = 6;\n currentX = 4;\n while (currentX <= 100)\n {\n int Sm = Math.Min(((((even - 2) / 2) * ((even - 2) / 2)) / 2 + ((even - 2) / 2) % 2) * 4, 100);\n while (currentX <= Sm)\n {\n sharpToDim[currentX] = Math.Min(sharpToDim[currentX], even);\n currentX += 4;\n }\n even += 2;\n }\n Console.WriteLine(sharpToDim[x]);\n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "d2e8381466f1e743dbd7290b57f73ff1", "src_uid": "01eccb722b09a0474903b7e5abc4c47a", "apr_id": "6661fb52edea9b15b019247a89f24195", "difficulty": 1700, "tags": ["math", "binary search"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.7083798882681565, "equal_cnt": 10, "replace_cnt": 6, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 9, "bug_source_code": "using System;\n\nusing System.Collections.Generic;\n\nusing System.Linq;\n\nusing System.Text;\n\n \n\nnamespace application1\n\n{\n\n class Program\n\n {\n\n static void Main(string[] args)\n\n {\n Int64 n, m, a;\n\t\t n = Console.Read();\n\t\t m = Console.Read();\n\t\t a = Console.Read();\n\n Console.WriteLine(Math.Ceiling((n-1)/a) + Math.Ceiling((m-1)/a));\n\n }\n\n }\n\n} ", "lang": "MS C#", "bug_code_uid": "4b29c631ccf08f9a432df1b6895a6fc8", "src_uid": "ef971874d8c4da37581336284b688517", "apr_id": "bc7a5b0a128723e3e80aa529fc8b1c6a", "difficulty": 1000, "tags": ["math"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.012487992315081652, "equal_cnt": 12, "replace_cnt": 12, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 12, "bug_source_code": "\nMicrosoft Visual Studio Solution File, Format Version 12.00\n# Visual Studio 15\nVisualStudioVersion = 15.0.28307.329\nMinimumVisualStudioVersion = 10.0.40219.1\nProject(\"{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}\") = \"a\", \"a\\a.csproj\", \"{CBFEABD5-FB3E-42E4-98A8-F172C8F71D94}\"\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{CBFEABD5-FB3E-42E4-98A8-F172C8F71D94}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{CBFEABD5-FB3E-42E4-98A8-F172C8F71D94}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{CBFEABD5-FB3E-42E4-98A8-F172C8F71D94}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{CBFEABD5-FB3E-42E4-98A8-F172C8F71D94}.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 = {02962193-0A70-4443-BFFD-BE7E7C93A88C}\n\tEndGlobalSection\nEndGlobal\n", "lang": "Mono C#", "bug_code_uid": "7e9d6d77adc291f10f2d5ca2c93969da", "src_uid": "8aef4947322438664bd8610632fe0947", "apr_id": "1df77fcbe59d4f8dd5eed52d5805ab97", "difficulty": 800, "tags": ["dp", "brute force"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.4887005649717514, "equal_cnt": 13, "replace_cnt": 5, "delete_cnt": 3, "insert_cnt": 5, "fix_ops_cnt": 13, "bug_source_code": "using System;\n\nnamespace Test\n{\n class Program\n {\n int Main(string[] args)\n {\n int m = int.Parse(Console.ReadLine());\n int n = int.Parse(Console.ReadLine());\n int x = m*n;\n Console.WriteLine(x%2 == 0 ? \"Malvika\" : \"Akshat\");\n return 0;\n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "09281bdfce4c41d2f30ed6528c8291bf", "src_uid": "a4b9ce9c9f170a729a97af13e81b5fe4", "apr_id": "a8bcb16a9602b710c3dfea648714dc4d", "difficulty": 900, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.613588110403397, "equal_cnt": 9, "replace_cnt": 5, "delete_cnt": 4, "insert_cnt": 0, "fix_ops_cnt": 9, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace A\n{\n class Program\n {\n static void Main(string[] args)\n {\n Program p = new Program();\n int numbers = int.Parse(Console.ReadLine());\n List n = Console.ReadLine().Split(' ').OrderByDescending(x => int.Parse(x)).Select(x => int.Parse(x)).ToList();\n while (!p.equals(n))\n {\n for (int i = 0; i < n.Count - 1; i++)\n {\n n[i] -= n[i + 1];\n }\n n = n.OrderByDescending(x => x).Select(x => x).ToList();\n }\n Console.WriteLine(n.Sum());\n Console.ReadLine();\n }\n\n public bool equals(List list)\n {\n int temp = list[0];\n return list.All(x => x == temp);\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "a5bc14f018df372ad01f31b5d181af66", "src_uid": "042cf938dc4a0f46ff33d47b97dc6ad4", "apr_id": "0e09d6d85383800018ddc24527d5d26c", "difficulty": 1000, "tags": ["math", "greedy"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9772727272727273, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 1, "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 ConsoleApplication2\n{\n class Program\n {\n\n static void Main(string[] args)\n {\n int n = int.Parse(Console.ReadLine());\n string s = Console.ReadLine();\n string[] x = new string[n];\n int j = 0;\n for (int i = 0; i < s.Length; i++)\n {\n if (s.ElementAt(i) == ' ')\n {\n j++;\n }\n else x[j] += s.ElementAt(i);\n }\n\n int r = 0;\n if (x[0] == \"1\") r += 1;\n for (int i = 1; i < x.Length-1; i++) \n {\n if (x[i] == \"0\")\n {\n if (r == 0) { }\n else if (x[i - 1] == \"0\") { }\n else\n {\n if (x[i + 1] != \"0\") r += 1;\n }\n }\n else r += 1;\n }\n \n if (x[x.Length - 1] == \"1\") r += 1;\n Console.WriteLine(r);\n }\n }\n}\n\n\n", "lang": "MS C#", "bug_code_uid": "385c665693dc25c6dac3f9dc6d9f57e9", "src_uid": "2896aadda9e7a317d33315f91d1ca64d", "apr_id": "0e2090b6f7f8286364380071cb55f670", "difficulty": 900, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9843173431734318, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "using System;\nusing System.Linq;\nclass Program\n{\n static void Main(string[] args)\n {\n Problem1154B();\n }\n\n static void Problem1154B()\n {\n string s = Console.ReadLine();\n int n = Convert.ToInt32(s);\n s = Console.ReadLine();\n var arr = s.Split(' ').Select(x => Convert.ToInt32(x));\n Console.WriteLine(Problem1154B(arr));\n }\n static int Problem1154B(IEnumerable ar)\n {\n int[] arr = ar.Distinct().OrderBy(x => x).ToArray();\n if (arr.Length == 3)\n {\n if (arr[2] - arr[1] == arr[1] - arr[0])\n return arr[2] - arr[1];\n else\n return -1;\n }\n else\n {\n if (arr.Length == 2)\n {\n if ((arr[1] - arr[0]) % 2 == 0)\n return (arr[1] - arr[0]) / 2;\n else\n return arr[1] - arr[0];\n }\n else\n if (arr.Length == 1)\n return 0;\n else\n return -1;\n }\n }\n}", "lang": ".NET Core C#", "bug_code_uid": "6b0d4bdb4e73b0b8f77cc459eaf59801", "src_uid": "d486a88939c132848a7efdf257b9b066", "apr_id": "d7cb0a12675bb248e95914a81d72a1a9", "difficulty": 1200, "tags": ["math"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.2233793282999219, "equal_cnt": 19, "replace_cnt": 15, "delete_cnt": 1, "insert_cnt": 4, "fix_ops_cnt": 20, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace mochila\n{\n class Rick\n {\n public int Grito { get; set; }\n\n public Rick(int grito)\n {\n Grito = grito;\n }\n }\n\n class Program\n {\n static bool verificaGritos(int a, int b, int c, int d)\n {\n int SomaRick = a + b;\n int SomaMorty = c + d;\n int diferenca = 0;\n \n if (SomaRick > SomaMorty)\n {\n diferenca = SomaRick - SomaMorty;\n\n if (diferenca > c)\n return false;\n else\n return true;\n }\n else\n {\n diferenca = SomaMorty - SomaRick;\n\n if (diferenca > a)\n return false;\n else\n return true;\n }\n }\n\n static int comparaComRick(List lista, int morty)\n {\n int igual = -1;\n\n for (int i = 0; i < lista.Count; i++)\n {\n if (lista[i].Grito == morty)\n {\n igual = morty;\n }\n }\n\n return igual;\n }\n\n static void verificaGritosIguais(int a, int b, int c, int d)\n {\n List lista = new List();\n int cont = 1, rick = 0, morty = 0, igual = -1; // Igual j� come�a com -1, caso n�o entre no if, j� sai -1 igual o problema pede\n\n if (verificaGritos(a, b, c, d))\n {\n do\n {\n rick = b + (a * cont); // sequ�ncia de gritos de Rick.\n morty = c + (d * cont); // sequ�ncia de gritos de Morty.\n\n cont++; // contador da sequ�ncia.\n\n lista.Add(new Rick(rick)); // Somente o grito do Rick � guardado\n\n igual = comparaComRick(lista, morty); // Vai comparar o grito do morty com os gritos guardados do Rick\n\n } while (igual != morty); // Enquanto n�o gritarem ao mesmo tempo\n\n Console.WriteLine(igual);\n }\n else\n {\n Console.WriteLine(igual);\n }\n }\n\n\n static void Main(string[] args)\n {\n string R = Console.ReadLine();\n int a = int.Parse(r.split()[0]);\n int b = int.Parse(r.split()[1]);\n\n string M = Console.ReadLine();\n int c = int.Parse(r.split()[0]);\n int d = int.Parse(r.split()[1]);\n\n verificaGritosIguais(a, b, c, d);\n }\n }\n}", "lang": "Mono C#", "bug_code_uid": "4e430365e2f2fd5d719bd3ccce9069f8", "src_uid": "158cb12d45f4ee3368b94b2b622693e7", "apr_id": "22ff105db652cb9762b758f0dd989e17", "difficulty": 1200, "tags": ["math", "brute force", "number theory"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.931237721021611, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 3, "bug_source_code": "using System.Text;\nusing System.Threading.Tasks;\n\nnamespace ConsoleApplication13\n{\n class Program\n {\n static void Main(string[] args)\n {\n string s=\"\";\n for (int i = 1; i < 371; i++)\n {\n s = s + i.ToString();\n }\n int a=int.Parse( Console.ReadLine());\n // Console.WriteLine(s.Length);\n \n Console.Write(s[a-1]);\n Console.ReadKey();\n }\n }\n}", "lang": "MS C#", "bug_code_uid": "bd6c665dc1ebbdb9ff7487d35d5a2916", "src_uid": "2d46e34839261eda822f0c23c6e19121", "apr_id": "80f7103ded72b558d024232333d3245b", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.4380561259411362, "equal_cnt": 11, "replace_cnt": 7, "delete_cnt": 2, "insert_cnt": 3, "fix_ops_cnt": 12, "bug_source_code": "static void Main(string[] args)\n {\n Console.Write(\"n: \");\n int n = int.Parse(Console.ReadLine());\n Console.Write(\"k: \");\n int k = int.Parse(Console.ReadLine());\n Console.WriteLine(Func(n, k));\n }\n static int Func(int n, int k)\n {\n int cnt1 = 0, cnt2 = 0;\n while (n > 0 && cnt2 < k)\n {\n cnt1++;\n if (n % 10 == 0)\n cnt2++;\n n /= 10;\n }\n if (cnt2 < k)\n return cnt1 - 1;\n return cnt1 - cnt2;\n }", "lang": "MS C#", "bug_code_uid": "46fc0b9a41cad28b590312dccceee8af", "src_uid": "7a8890417aa48c2b93b559ca118853f9", "apr_id": "e382f8a94be04ae842aad6ef5e4ef28c", "difficulty": 1100, "tags": ["brute force", "greedy"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9918670438472419, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\n\nnamespace Task49B\n{\n class Program\n {\n static void Main(string[] args)\n {\n int[] tm = Console.ReadLine().Split().Select(int.Parse).ToArray();\n int a = tm[0], b = tm[1];\n int BDa = FindBiggestDigit(a);\n int BDb = FindBiggestDigit(b);\n int BD = Math.Max(BDa, BDb);\n int nbase = BD + 1;\n\n Console.WriteLine(SumInBase(a,b,nbase).Length);\n //Console.ReadKey();\n }\n\n private static int FindBiggestDigit(int a)\n {\n int ans = 0, helper;\n while (a > 0)\n {\n helper = a % 10;\n if (ans < helper)\n ans = helper;\n a /= 10;\n }\n\n return ans;\n }\n\n private static string SumInBase(int a, int b, int nbase)\n {\n string ans = \"\";\n if (a < b)\n {\n int temp = a;\n a = b;\n b = temp;\n }\n\n int leftOver = 0;\n while (b > 0)\n {\n int lastDigitA = a % 10;\n int lastDigitB = b % 10;\n\n int helper = lastDigitA + lastDigitB + leftOver;\n\n if (helper >= nbase)\n {\n helper = ConvertToBase(helper, nbase);\n ans = (helper % 10).ToString() + ans;\n leftOver = helper / 10;\n }\n else {\n ans = helper.ToString() + ans;\n leftOver = 0;\n }\n \n\n\n a /= 10;\n b /= 10;\n\n }\n\n\n while (a > 0)\n {\n int lastDigitA = a % 10;\n int helper = lastDigitA + leftOver;\n if(helper >= nbase)\n {\n helper = ConvertToBase(helper, nbase);\n ans = (helper % 10).ToString() + ans;\n leftOver = helper / 10;\n }\n else\n {\n ans = helper.ToString() + ans;\n leftOver = 0;\n }\n \n }\n\n\n if (leftOver != 0)\n ans = leftOver.ToString() + ans;\n\n\n return ans;\n }\n\n private static int ConvertToBase(int num, int nbase)\n {\n int ans = 0;\n List lefts = new List();\n\n while (num > 0)\n {\n lefts.Add(num % nbase);\n num /= nbase;\n }\n\n for (int i = lefts.Count - 1; i >= 0; i--)\n ans = ans * 10 + lefts[i];\n\n return ans;\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "f027f99c031d4067740be1d662b2d2e8", "src_uid": "8ccfb9b1fef6a992177cc49bd56fab7b", "apr_id": "48a7d93398ccb9f3462321c8c01c1072", "difficulty": 1500, "tags": ["math"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.8559271953669779, "equal_cnt": 30, "replace_cnt": 10, "delete_cnt": 1, "insert_cnt": 18, "fix_ops_cnt": 29, "bug_source_code": "//#undef DEBUG\n\nusing System;\nusing System.Collections.Generic;\nusing System.Text;\nusing System.Diagnostics;\n\nnamespace codeforces\n{\n class C\n {\n // test\n static CodeforcesUtils CF = new CodeforcesUtils(\n@\"\n1 1\n\");\n\n class Solver\n {\n public void Solve()\n {\n string[] ss = CF.ReadLine().Split(' ');\n int a = int.Parse(ss[0]);\n int b = int.Parse(ss[1]);\n\n int sum = a + b;\n\n int bs=2;\n for (; ; )\n {\n if (a == 0)\n break;\n int d = a%10;\n bs = Math.Max(d + 1, bs);\n a /= 10;\n }\n for (; ; )\n {\n if (b == 0)\n break;\n int d = b % 10;\n bs = Math.Max(d + 1, bs);\n b /= 10;\n }\n\n int len = 0;\n for (; ; )\n {\n if (sum == 0)\n break;\n sum /=bs;\n len++;\n }\n CF.WriteLine(len);\n\n\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": "0b806de1937e2f54ce150ceffa387a26", "src_uid": "8ccfb9b1fef6a992177cc49bd56fab7b", "apr_id": "0ac97211771100a69f8d84815e3cdcff", "difficulty": 1500, "tags": ["math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.5371428571428571, "equal_cnt": 14, "replace_cnt": 8, "delete_cnt": 0, "insert_cnt": 5, "fix_ops_cnt": 13, "bug_source_code": "using System;\nusing System.Linq;\n\nnamespace _1080A\n{\n class Program\n {\n static void Main(string[] args)\n {\n string s = Console.ReadLine().Split(' ').ToString();\n int n = Convert.ToInt32(s[0]), k = Convert.ToInt32(s[1]);\n\n int temp = k;\n\n temp = (n * 2) / k + (n * 5) / k + (n * 8) / k;\n\n Console.WriteLine(temp);\n\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "325ec5ef02402990f2abd1e0d67efd9f", "src_uid": "d259a3a5c38af34b2a15d61157cc0a39", "apr_id": "2aa3cfc8d7dac51f372baa29740cad72", "difficulty": 800, "tags": ["math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.953405017921147, "equal_cnt": 4, "replace_cnt": 0, "delete_cnt": 2, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "using System;\nusing System.Linq;\n\nnamespace CodeForces\n{\n class Program\n {\n\n static void Main(string[] args)\n {\n int[] mas = Console.ReadLine().Split(' ').Select(x => Convert.ToInt32(x)).ToArray();\n Array.Sort(mas);\n\n bool b = mas[0] + mas[2] == mas[1] + mas[3] || mas[0] + mas[1] + mas[2] == mas[3];\n Console.WriteLine(b? \"YES\":\"NO\");\n\n }\n\n }\n}", "lang": "Mono C#", "bug_code_uid": "570cad8418fad2b5627015744d3c8d54", "src_uid": "5a623c49cf7effacfb58bc82f8eaff37", "apr_id": "d1a4c73c68112773d274fd8ed51b33eb", "difficulty": 800, "tags": ["brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "C#"} {"similarity_score": 0.5906344410876133, "equal_cnt": 7, "replace_cnt": 1, "delete_cnt": 3, "insert_cnt": 2, "fix_ops_cnt": 6, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\n\nnamespace Vs_code_test\n{\n class Program\n {\n static void Main(string[] args)\n {\n var input = Array.ConvertAll(Console.ReadLine().Split(' '), int.Parse);\n \n int sum = input.Sum();\n if(sum % 2 == 1)\n {\n Console.WriteLine(\"NO\");\n return;\n }\n\n int firstFriend = 0,\n secondFriend = 0,\n max = input.Max(),\n maxIndex = Array.IndexOf(input, max);\n\n if(sum - max >= max)\n {\n Array.Sort(input);\n \n for(int i = 0, j = input.Length - 1; i < j; i++, j--)\n {\n if(i % 2 == 0)\n {\n firstFriend += input[i] + input[j];\n }\n else\n {\n secondFriend += input[i] + input[j];\n }\n }\n\n Console.WriteLine(firstFriend == secondFriend ? \"YES\" : \"NO\");\n }\n else\n {\n Console.WriteLine(\"NO\");\n return;\n }\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "8b687a0c1cd4fa03eb45b8f73136511e", "src_uid": "5a623c49cf7effacfb58bc82f8eaff37", "apr_id": "94d66238ae1469c2bcc9167ed480c17d", "difficulty": 800, "tags": ["brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "C#"} {"similarity_score": 0.9927536231884058, "equal_cnt": 1, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "using System;\n\nnamespace ConsoleApp1\n{\n class Program\n {\n static void Main(string[] args)\n {\n int[] nk = Array.ConvertAll(Console.ReadLine().Split(), int.Parse);\n int time = 240, numberOfProblems = 0;\n\n time -= nk[1];\n\n while ((time - (5 * (numberOfProblems + 1))) >= 0 && nk[0] > 0)\n {\n time -= 5 * (numberOfProblems + 1);\n numberOfProblems++;\n nk[0]--;\n }\n\n Console.WriteLine(numberOfProblems);\n }", "lang": "Mono C#", "bug_code_uid": "ee3a198e88f61cd651c66cb5f414f0d5", "src_uid": "41e554bc323857be7b8483ee358a35e2", "apr_id": "4fa72b4c006893f1d2014378920f6faa", "difficulty": 800, "tags": ["math", "brute force", "implementation", "binary search"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.8968421052631579, "equal_cnt": 20, "replace_cnt": 2, "delete_cnt": 17, "insert_cnt": 2, "fix_ops_cnt": 21, "bug_source_code": "class Program\n {\n static void Main(string[] args)\n {\n string str = Console.ReadLine();\n string[] s = str.Split(\" \");\n int n = Convert.ToInt32(s[0]);\n int k = Convert.ToInt32(s[1]);\n\n int time = 240 - k;\n int i;\n for (i = 1; i <= n; i++)\n {\n int task = i * 5;\n if (time - task < 0)\n {\n break;\n }\n\n else\n {\n time -= task;\n\n }\n }\n i--;\n Console.WriteLine(i);\n }\n }", "lang": "Mono C#", "bug_code_uid": "45a6bdd5355e36a0f04bd826b5eafab6", "src_uid": "41e554bc323857be7b8483ee358a35e2", "apr_id": "a6b54669d2a93c84f27c3998533f420c", "difficulty": 800, "tags": ["math", "brute force", "implementation", "binary search"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C#"} {"similarity_score": 0.9994438264738599, "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.Text;\n\nnamespace Application\n{\n class Program\n {\n static void Main(string[] args)\n {\n string lev = Console.ReadLine();\n int n = 0;\n char l ;\n int level = 1;\n int count1 = 1;\n int count2 = 1;\n\n l = lev[0];\n level = int.Parse(l.ToString());\n count1 = Con(level, count1);\n l = lev[1];\n level = int.Parse(l.ToString());\n count2 = Con(level, count2);\n n = count1 * count2;\n\n\n Console.Write(n);\n lev = Console.ReadLine();\n\n }\n\n private static int Con(int level, int count1)\n {\n switch (level10)\n {\n case 0:\n count1 = 2;\n break;\n case 1:\n count1 = 7;\n break;\n case 2:\n count1 = 2;\n break;\n case 3:\n count1 = 3;\n break;\n case 4:\n count1 = 3;\n break;\n case 5:\n count1 = 4;\n break;\n case 6:\n count1 = 2;\n break;\n case 7:\n count1 = 5;\n break;\n case 8:\n count1 = 1;\n break;\n case 9:\n count1 = 2;\n break;\n default:\n Console.WriteLine(\"Default case\");\n break;\n }\n return count1;\n }\n\n }\n}\n", "lang": "MS C#", "bug_code_uid": "6c130f25fe46e28fea73b07268967d88", "src_uid": "76c8bfa6789db8364a8ece0574cd31f5", "apr_id": "5c28efd612cd7d352ee9843f3bd159cb", "difficulty": 1100, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.9969655172413793, "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 A\n{\n class Program\n {\n static void Main(string[] args)\n {\n string s;\n s = Console.ReadLine();\n char d, f;\n d = s[0];\n f = s[1];\n int a = (int)Char.GetNumericValue(d);\n int b = (int)Char.GetNumericValue(f);\n if (a == b)\n {\n if (a == 0) a = 2;\n else if (a == 1) a = 7;\n else if (a == 2) a = 2;\n else if (a == 3) a = 3;\n else if (a == 4) a = 3;\n else if (a == 5) a = 4;\n else if (a == 6) a = 2;\n else if (a == 7) a = 5;\n else if (a == 8) a = 1;\n else if (a == 9) a = 2;\n Console.WriteLine(a*a);\n }\n else\n {\n if (a == 0) a = 2;\n else if (a == 1) a = 7;\n else if (a == 2) a = 2;\n else if (a == 3) a = 3;\n else if (a == 4) a = 3;\n else if (a == 5) a = 4;\n else if (a == 6) a = 2;\n else if (a == 7) a = 5;\n else if (a == 8) a = 1;\n else if (a == 9) a = 2;\n if (b == 0) b = 2;\n else if (b == 1) b = 7;\n else if (b == 2) b = 2;\n else if (b == 3) b = 3;\n else if (b == 4) b = 3;\n else if (b == 5) b = 4;\n else if (b == 6) b = 2;\n else if (b == 7) b = 5;\n else if (b == 8) b = 1;\n else if (b == 9) b = 2;\n Console.WriteLine(a*b);\n }\n \n }\n }", "lang": "MS C#", "bug_code_uid": "c2aba4121dfd9410bd297a3706ecf461", "src_uid": "76c8bfa6789db8364a8ece0574cd31f5", "apr_id": "a6eb671af8cd3983ac345e9c2d3702fd", "difficulty": 1100, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C#"} {"similarity_score": 0.9837002184506806, "equal_cnt": 8, "replace_cnt": 4, "delete_cnt": 3, "insert_cnt": 0, "fix_ops_cnt": 7, "bug_source_code": "using System;\nusing System.Linq;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Text;\n\nclass Modular\n{\n private const int M = 998244353;\n private long value;\n public Modular(long value) { this.value = value; }\n public static implicit operator Modular(long a)\n {\n var m = a % M;\n return new Modular((m < 0) ? m + M : m);\n }\n public static Modular operator +(Modular a, Modular b)\n {\n return a.value + b.value;\n }\n public static Modular operator -(Modular a, Modular b)\n {\n return a.value - b.value;\n }\n public static Modular operator *(Modular a, Modular b)\n {\n return a.value * b.value;\n }\n public static Modular Pow(Modular a, int n)\n {\n switch (n)\n {\n case 0:\n return 1;\n case 1:\n return a;\n default:\n var p = Pow(a, n / 2);\n return p * p * Pow(a, n % 2);\n }\n }\n public static Modular operator /(Modular a, Modular b)\n {\n return a * Pow(b, M - 2);\n }\n private static readonly List facs = new List { 1 };\n public static Modular Fac(int n)\n {\n for (int i = facs.Count; i <= n; ++i)\n {\n facs.Add((int)(Math.BigMul(facs.Last(), i) % M));\n }\n return facs[n];\n }\n public static Modular Ncr(int n, int r)\n {\n return (n < r) ? 0\n : (n == r) ? 1\n : Fac(n) / (Fac(r) * Fac(n - r));\n }\n public static explicit operator int(Modular a)\n {\n return (int)a.value;\n }\n}\n\nclass MyClass\n{\n public static void Solve()\n {\n var input = Console.ReadLine().Split().Select(int.Parse).ToArray();\n Modular n = input[0];\n Modular m = input[1];\n var k = input[2];\n if (input[0] == 1)\n {\n Console.WriteLine((int)Modular.Pow(m, k));\n return;\n }\n var dp = new Modular[k + 1];\n var poly = new Modular[k + 1];\n for (int i = 0; i < k + 1; i++)\n {\n poly[i] = 0;\n }\n poly[1] = 1;\n for (int i = 1; i < k + 1; i++)\n {\n var num = Modular.Pow(n / (n - 1), (int)(m - i)) * Modular.Pow(1 / (n - 1), (int)i);\n for (int j = 0; j < i; j++)\n {\n num *= m - j;\n }\n for (int j = 1; j < i; j++)\n {\n num -= poly[j] * dp[j];\n }\n dp[i] = num;\n if (i == k)\n {\n break;\n }\n poly[i + 1] = 1;\n for (int j = i; j >= 1; j--)\n {\n poly[j] = -i * poly[j] + poly[j - 1];\n }\n }\n Console.WriteLine((int)(dp[k] * Modular.Pow((n - 1) / n, (int)m)));\n }\n\n public static void Main()\n {\n var sw = new StreamWriter(Console.OpenStandardOutput()) { AutoFlush = false };\n Console.SetOut(sw);\n Solve();\n Console.Out.Flush();\n }\n}", "lang": "Mono C#", "bug_code_uid": "20a6c5fd28ac44227ca3438cb03f1de9", "src_uid": "e6b3e559b5fd4e05adf9f1cd1b22126b", "apr_id": "dc2f697f955d83a17fab489b23c16112", "difficulty": 2600, "tags": ["dp", "probabilities", "combinatorics", "number theory", "math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.5571890620405763, "equal_cnt": 11, "replace_cnt": 9, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 11, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing static System.Console;\nusing static System.Convert;\nusing static System.Math;\n//using Debug;\n//using static System.Globalization.CultureInfo;\n//using Edge = Pair;\nusing System.Text;\nclass Program\n{ \n static void Main(string[] args)\n {\n Solve();\n //WriteLine(Solve());\n }\n static void Solve()\n {\n var num = Input.num;\n var th = new bool[num + 1];var res = 1L;var q = 0;\n for(var i = num; i >= 1; i--)\n {\n var dic = Calculation.Factorize(i);\n if (dic.Keys.Any(v => th[v])) continue;\n foreach (var c in dic.Keys)\n th[c] = true;\n res *=i;q++;if (q == 3) break;\n }\n WriteLine(res);\n }\n}\n\npublic class Input\n{\n public static string read => ReadLine().Trim();\n public static int[] ar => read.Split(' ').Select(int.Parse).ToArray();\n public static int num => ToInt32(read);\n public static long[] arL => read.Split(' ').Select(long.Parse).ToArray();\n public static long numL => ToInt64(read);\n public static char[][] gred(int h) \n => Enumerable.Repeat(0, h).Select(_ => read.ToCharArray()).ToArray();\n public static int[][] ar2D(int num)\n => Enumerable.Repeat(0, num).Select(_ => ar).ToArray();\n public static long[][] arL2D(int num)\n => Enumerable.Repeat(0, num).Select(_ => arL).ToArray();\n public static T getValue(string g)\n {\n var t = typeof(T);\n if (t == typeof(int))\n return (T)(object)int.Parse(g);\n if (t == typeof(long))\n return (T)(object)long.Parse(g);\n if (t == typeof(string))\n return (T)(object)g;\n if (t == typeof(char))\n return (T)(object)char.Parse(g);\n if (t == typeof(double))\n return (T)(object)double.Parse(g);\n if (t == typeof(bool))\n return (T)(object)bool.Parse(g);\n return default(T);\n }\n public const long Inf = (long)1e18;\n public const double eps = 1e-6;\n public const string Alfa = \"abcdefghijklmnopqrstuvwxyz\";\n public const int MOD = 1000000007;\n}\n", "lang": "Mono C#", "bug_code_uid": "572efafa465d552a25252d51e22578dd", "src_uid": "25e5afcdf246ee35c9cef2fcbdd4566e", "apr_id": "bf3ec3c060d463c584d4b999c61fd89b", "difficulty": 1600, "tags": ["number theory"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9634760705289672, "equal_cnt": 7, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 5, "fix_ops_cnt": 6, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\n\nnamespace N\n{\n class Program\n {\n static void Main(string[] args)\n {\n long n = Convert.ToInt32(Console.ReadLine());\n if (n > 3)\n {\n if (n % 2 == 1)\n {\n long u = n * (n - 1) * (n - 2);\n Console.WriteLine(u);\n }\n else\n {\n long max = 1;\n for (long i = n - 101; i < n - 3; i+=2)\n {\n \n long u = i * (i + 1) * (i + 2);\n if (u > max)\n {\n max = u;\n }\n long u = i * (i + 3) * (i + 2);\n if (u > max)\n {\n max = u;\n }\n }\n //if (n == 508)\n // max = 130065780;\n Console.WriteLine(max);\n }\n }\n else\n {\n if (n == 3)\n {\n Console.WriteLine(6);\n }\n if (n == 2)\n {\n Console.WriteLine(2);\n }\n if (n == 1)\n {\n Console.WriteLine(1);\n }\n }\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "6ecbaa6abc1e3e8e0a78d47e07d4ba12", "src_uid": "25e5afcdf246ee35c9cef2fcbdd4566e", "apr_id": "82e290a70dd6423da55b229915bfb80e", "difficulty": 1600, "tags": ["number theory"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.9994722955145119, "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.Text;\nusing System.Threading.Tasks;\n\nnamespace ConsoleApplication1\n{\n class examples\n {\n static void Main(string[] args)\n {\n int r, m, a, b, f, g;\n string[] rick = Console.ReadLine().Split();\n string[] morty = Console.ReadLine().Split();\n r = int.Parse(rick[0]);\n a = int.Parse(rick[1]);\n m = int.Parse(morty[0]);\n b = int.Parse(morty[1]);\n for (int i = 0; i < 1000; i++)\n {\n f = a + i * r;\n for (int j = 0; j < 1000; j++)\n {\n g = b + j * m;\n if (g == f)\n {\n Console.Write(f);\n goto A;\n }\n }\n }\n\n Console.Write(-1);\n A:\n }\n }\n}", "lang": "MS C#", "bug_code_uid": "c824c0380ede1142c790e3072356749f", "src_uid": "158cb12d45f4ee3368b94b2b622693e7", "apr_id": "6423e0b37100cb67dc44d0b02a3bbf82", "difficulty": 1200, "tags": ["math", "brute force", "number theory"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.9128682725888779, "equal_cnt": 33, "replace_cnt": 20, "delete_cnt": 8, "insert_cnt": 4, "fix_ops_cnt": 32, "bug_source_code": "#define Online\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.IO;\nusing System.Diagnostics;\nusing System.Threading;\n\n\nnamespace CF\n{\n delegate double F(double x);\n delegate decimal Fdec(decimal x);\n\n class Team : IComparable\n {\n public string name;\n public int goal;\n public int miss;\n public int point;\n public int cnt;\n public int CompareTo(Team y)\n {\n if (this.point > y.point)\n {\n return 1;\n }\n else\n {\n if (this.point == y.point)\n {\n if (this.goal - this.miss > y.goal - y.miss)\n {\n return 1;\n }\n else\n {\n if (this.goal - this.miss == y.goal - y.miss)\n {\n if (this.goal > y.goal)\n {\n return 1;\n }\n else\n {\n if (this.goal == y.goal)\n {\n if (this.name.CompareTo(y.name) > 0)\n return 1;\n else\n return -1;\n }\n else\n {\n return -1;\n }\n }\n\n }\n else\n {\n return -1;\n }\n }\n }\n else\n {\n return -1;\n }\n }\n }\n }\n\n class Program\n {\n\n static void Main(string[] args)\n {\n\n#if FileIO\n StreamReader sr = new StreamReader(\"input.txt\");\n StreamWriter sw = new StreamWriter(\"output.txt\");\n Console.SetIn(sr);\n Console.SetOut(sw);\n#endif\n\n Team[] t = new Team[4];\n for (int i = 0; i < 5; i++)\n {\n string[] input = ReadArray();\n string[] score = input[2].Split(':');\n int x = int.Parse(score[0]);\n int y = int.Parse(score[1]);\n for (int j = 0; j < 4; j++)\n {\n if (t[j] == null)\n {\n t[j] = new Team();\n t[j].name = input[0];\n }\n if (t[j].name.Equals(input[0]))\n {\n if (x > y) t[j].point += 3;\n if (x == y) t[j].point++;\n t[j].goal += x;\n t[j].miss += y;\n t[j].cnt++;\n break;\n }\n\n }\n for (int j = 0; j < 4; j++)\n {\n if (t[j] == null)\n {\n t[j] = new Team();\n t[j].name = input[1];\n }\n if (t[j].name.Equals(input[1]))\n {\n if (y > x) t[j].point += 3;\n if (x == y) t[j].point++;\n t[j].goal += y;\n t[j].miss += x;\n t[j].cnt++;\n break;\n }\n }\n }\n int opp = 0;\n int ans = 0;\n for (int i = 0; i < 4; i++)\n {\n if (t[i].name.Equals(\"BERLAND\"))\n {\n t[i].point += 3;\n t[i].goal++;\n ans++;\n\n }\n if (!t[i].name.Equals(\"BERLAND\") && t[i].cnt == 2)\n {\n t[i].miss++;\n }\n }\n\n Team[] L = new Team[4];\n Team[] R = new Team[4];\n ArrayUtils.Merge_Sort(t, 0, 3, L, R);\n for (int i = 0; i < 4; i++)\n if (!t[i].name.Equals(\"BERLAND\") && t[i].cnt == 2)\n opp = i;\n for (int i = 0; i < 4; i++)\n {\n if (t[i].name.Equals(\"BERLAND\"))\n {\n if (i >= 2)\n {\n Console.WriteLine(\"1:0\");\n return;\n }\n for (int j = i + 1; j < 3; j++)\n {\n if (t[j].point > t[i].point && j <= 2)\n {\n Console.WriteLine(\"IMPOSSIBLE\");\n return;\n }\n else\n {\n while (t[i].CompareTo(t[j]) < 0)\n {\n t[i].goal++;\n ans++;\n t[opp].miss++;\n }\n }\n }\n Console.WriteLine(ans + \":0\");\n }\n }\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 string[] ReadArray()\n {\n return Console.ReadLine().Split(' ');\n }\n\n static int ReadInt()\n {\n return int.Parse(Console.ReadLine());\n }\n }\n\n /* public static class MyMath\n {\n public static long BinPow(long a, long n, long mod)\n {\n long res = 1;\n while (n > 0)\n {\n if ((n & 1) == 1)\n {\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) b = a % (a = b);\n return a;\n }\n\n public static int GCD(int a, int b)\n {\n while (b != 0) 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 public class SegmentTree\n {\n int[] v_min;\n int[] v_max;\n int[] mas;\n public void BuildTree(int[] a)\n {\n int n = a.Length - 1;\n int z = 0;\n while (n >= 2)\n {\n z++;\n n >>= 1;\n }\n n = 1 << (z + 1);\n v_min = new int[n << 1];\n v_max = new int[n << 1];\n mas = new int[n << 1];\n for (int i = n; i < n + a.Length; i++)\n v_min[i] = a[i - n];\n for (int i = n + a.Length; i < v_min.Length; i++)\n v_min[i] = int.MaxValue;\n for (int i = n - 1; i > 0; i--)\n v_min[i] = Math.Min(v_min[(i << 1)], v_min[(i << 1) + 1]);\n\n for (int i = n; i < n + a.Length; i++)\n v_max[i] = a[i - n];\n for (int i = n + a.Length; i < v_max.Length; i++)\n v_max[i] = int.MinValue;\n for (int i = n - 1; i > 0; i--)\n v_max[i] = Math.Max(v_max[(i << 1)], v_max[(i << 1) + 1]);\n\n }\n //nil\n public int RMQ_MIN(int l, int r)\n {\n int ans = int.MaxValue;\n l += v_min.Length >> 1;\n r += v_min.Length >> 1;\n const int o = 1;\n while (l <= r)\n {\n if ((l & 1) == o)\n ans = Math.Min(ans, v_min[l]);\n if (!((r & 1) == 0))\n ans = Math.Min(ans, v_min[r]);\n l = (l + 1) >> 1;\n r = (r - 1) >> 1;\n }\n return ans;\n }\n\n public int RMQ_MAX(int l, int r)\n {\n int ans = int.MinValue;\n l += v_max.Length >> 1;\n r += v_max.Length >> 1;\n const int o = 1;\n while (l <= r)\n {\n if ((l & 1) == o)\n ans = Math.Max(ans, v_max[l]);\n if (!((r & 1) == 0))\n ans = Math.Max(ans, v_max[r]);\n l = (l + 1) >> 1;\n r = (r - 1) >> 1;\n }\n return ans;\n }\n\n public void Put(int l, int r, int op)\n {\n l += mas.Length >> 1;\n r += mas.Length >> 1;\n while (l <= r)\n {\n if (l % 2 != 0)\n mas[l] = op;\n if (r % 2 == 0)\n mas[r] = op;\n l = (l + 1) >> 1;\n r = (r - 1) >> 1;\n }\n }\n\n public int Get(int x)\n {\n x += mas.Length >> 1;\n int ans = int.MinValue;\n while (x > 0)\n {\n ans = Math.Max(mas[x], ans);\n x >>= 1;\n }\n return ans;\n }\n\n public void Update(int i, int x)\n {\n i += v_min.Length >> 1;\n v_min[i] = x;\n v_max[i] = x;\n i >>= 1;\n while (i > 0)\n {\n v_min[i] = Math.Min(v_min[(i << 1)], v_min[(i << 1) + 1]);\n v_max[i] = Math.Max(v_max[(i << 1)], v_max[(i << 1) + 1]);\n i >>= 1;\n }\n }\n }\n\n class Edge\n {\n public int a;\n public int b;\n public int w;\n\n public Edge(int a, int b, int w)\n {\n this.a = a;\n this.b = b;\n this.w = w;\n }\n }\n\n /* class Graph\n {\n public List[] g;\n public int[] color; //0-white, 1-gray, 2-black\n public int[] o; //open\n public int[] c; //close\n public int[] p;\n public int[] d;\n public List e;\n\n public Graph(int n)\n {\n g = new List[n + 1];\n color = new int[n + 1];\n o = new int[n + 1];\n c = new int[n + 1];\n p = new int[n + 1];\n d = new int[n + 1];\n }\n }\n\n static class GraphUtils\n {\n const int white = 0;\n const int gray = 1;\n const int black = 2;\n\n public static void BFS(int s, Graph g)\n {\n Queue q = new Queue();\n q.Enqueue(s);\n while (q.Count != 0)\n {\n int u = q.Dequeue();\n for (int i = 0; i < g.g[u].Count; i++)\n {\n int v = g.g[u][i];\n if (g.color[v] == white)\n {\n g.color[v] = gray;\n g.d[v] = g.d[u] + 1;\n g.p[v] = u;\n q.Enqueue(v);\n }\n }\n g.color[u] = black;\n }\n }\n\n public static void DFS(int u, ref int time, Graph g)\n {\n g.color[u] = gray;\n time++;\n g.o[u] = time;\n for (int i = 0; i < g.g[u].Count; i++)\n {\n int v = g.g[u][i];\n if (g.color[v] == white)\n {\n g.p[v] = u;\n DFS(v, ref time, g);\n }\n }\n g.color[u] = black;\n g.c[u] = time;\n time++;\n }\n\n public static void FordBellman(int u, Graph g)\n {\n int n = g.g.Length;\n for (int i = 0; i <= n; i++)\n {\n g.d[i] = int.MaxValue;\n g.p[i] = 0;\n }\n\n g.d[u] = 0;\n\n for (int i = 0; i < n - 1; i++)\n {\n for (int j = 0; j < g.e.Count; j++)\n {\n if (g.d[g.e[j].a] != int.MaxValue)\n {\n if (g.d[g.e[j].a] + g.e[j].w < g.d[g.e[j].b])\n {\n g.d[g.e[j].b] = g.d[g.e[j].a] + g.e[j].w;\n g.p[g.e[j].b] = g.e[j].a;\n }\n }\n }\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 {\n mid = left + ((right - left) >> 1);\n if (val <= a[mid])\n {\n right = mid;\n }\n else\n {\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 {\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\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 {\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 {\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) 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 {\n if (i > q)\n {\n for (; k <= r; k++, j++)\n A[k] = R[j];\n return;\n }\n if (j > r)\n {\n for (; k <= r; k++, i++)\n A[k] = L[i];\n return;\n }\n if (L[i].CompareTo(R[j]) <= 0)\n {\n A[k] = L[i];\n i++;\n }\n else\n {\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) 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 static void Shake(T[] a)\n {\n Random rnd = new Random(Environment.TickCount);\n T temp;\n int b, c;\n for (int i = 0; i < a.Length; i++)\n {\n b = rnd.Next(0, a.Length);\n c = rnd.Next(0, a.Length);\n temp = a[b];\n a[b] = a[c];\n a[c] = temp;\n }\n }\n }\n}", "lang": "MS C#", "bug_code_uid": "cf14a5fd8d4eaa5ec259f67c5377e272", "src_uid": "5033d51c67b7ae0b1a2d9fd292fdced1", "apr_id": "66a4c01d14ca0695e87f5bcc10ed13e6", "difficulty": 1800, "tags": ["brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9965635738831615, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "using System;\nusing System.Linq;\n\nnamespace ConsoleApplication18\n{\n internal class Program\n {\n public static void Main(string[] args)\n {\n \n if(Console.ReadLine() == 2) Console.WriteLine(2); \n else Console.WriteLine(1); \n }\n }\n}", "lang": "Mono C#", "bug_code_uid": "8c0f080536bf610236b3f8058b9e6ba2", "src_uid": "c30b372a9cc0df4948dca48ef4c5d80d", "apr_id": "92a3d647ca436af71d3edb72c161c089", "difficulty": 800, "tags": ["math", "constructive algorithms"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.35477582846003897, "equal_cnt": 11, "replace_cnt": 2, "delete_cnt": 1, "insert_cnt": 9, "fix_ops_cnt": 12, "bug_source_code": "int n = int.Parse(Console.ReadLine());\n for (int i = n - 1; i > 1; i--)\n {\n if (n % i != 0 && n != 1)\n {\n n -= i;\n }\n }\n Console.WriteLine(n);", "lang": "Mono C#", "bug_code_uid": "49cda6cdd8cfd6c63298de29f7894f43", "src_uid": "c30b372a9cc0df4948dca48ef4c5d80d", "apr_id": "9bf26c696619eb7f89cc0210642cd729", "difficulty": 800, "tags": ["math", "constructive algorithms"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.263058527375708, "equal_cnt": 20, "replace_cnt": 11, "delete_cnt": 8, "insert_cnt": 1, "fix_ops_cnt": 20, "bug_source_code": "using System;\n\n\nnamespace codebusinesstrip\n{\n class Program\n {\n private static void Main(string[] args)\n {\n int k, temp, s2 = 0;\n int[] ai = new int[12];\n k = Convert.ToInt32(Console.ReadLine());\n for (int i = 0; i < 12; i++)\n ai[i] = Convert.ToInt32(Console.ReadLine());\n\n if (k == 0)\n {\n Console.WriteLine(0);2\n\n }\n else\n {\n for (int j = 0; j < 12; j++)\n for (int i = 0; i < 11; i++)\n {\n if (ai[i] > ai[i + 1])\n {\n temp = ai[i];\n ai[i] = ai[i + 1];\n ai[i + 1] = temp;\n }\n }\n\n for (int i = 11; i >= 0; i--)\n {\n if (k > 0)\n {\n k -= ai[i];\n s2++;\n }\n }\n Console.WriteLine(k <= 0 ? s2 : -1);\n\n }\n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "236f2dfb5636474516425d8aecbffdc0", "src_uid": "59dfa7a4988375febc5dccc27aca90a8", "apr_id": "048a838e9e627bcf6b915663850515eb", "difficulty": 900, "tags": ["greedy", "sortings", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9994544462629569, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "using System;\nusing System.IO;\nusing System.Text;\n\nnamespace Almost_Identity_Permutations\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 private static readonly long[,] C = new long[1000,5];\n\n private static void Main(string[] args)\n {\n writer.WriteLine(Solve(args));\n writer.Flush();\n }\n\n private static long Solve(string[] args)\n {\n int n = Next();\n int k = Next();\n\n long ans = 1;\n var m = new[] {0, 1, 1, 2, 9};\n for (int i = 2; i <= k; i++)\n {\n ans += GetC(n, i)*m[i];\n }\n\n return ans;\n }\n\n private static long GetC(int n, int k)\n {\n if (n < k)\n {\n int c = k;\n k = n;\n n = c;\n }\n if (k == 0 || k == n)\n return 1;\n\n if (C[n, k] != 0)\n return C[n, k];\n\n return C[n, k] = GetC(n - 1, k - 1) + GetC(n - 1, k);\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": "4a01ad8e95ce4e69c93eb6e0df504384", "src_uid": "96d839dc2d038f8ae95fc47c217b2e2f", "apr_id": "6e779a297375116b7404051eff6f4830", "difficulty": 1600, "tags": ["dp", "math", "combinatorics"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.8438384741469229, "equal_cnt": 10, "replace_cnt": 5, "delete_cnt": 0, "insert_cnt": 4, "fix_ops_cnt": 9, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\n\nnamespace G.GangUp\n{\n internal static class Program\n {\n public static void Main(string[] args)\n {\n var nmkcd = Console.ReadLine().Split();\n var n = int.Parse(nmkcd[0]);\n var m = int.Parse(nmkcd[1]);\n var k = int.Parse(nmkcd[2]);\n var c = int.Parse(nmkcd[3]);\n var d = int.Parse(nmkcd[4]);\n \n var solver = new Solver(n, m, k, c, d);\n solver.Init();\n\n var memberHomes = Console.ReadLine().Split().GroupBy(int.Parse);\n foreach (var memberHome in memberHomes)\n solver.AddMemberHome(memberHome.Key - 1, memberHome.Count());\n \n for (var i = 0; i < m; i++)\n {\n var xy = Console.ReadLine().Split();\n var x = int.Parse(xy[0]) - 1;\n var y = int.Parse(xy[1]) - 1;\n \n solver.AddEdge(x, y);\n solver.AddEdge(y, x);\n }\n \n for (var i = 0; i < k; i++)\n solver.IncreaseFlow();\n\n Console.WriteLine(solver.TotalCost);\n }\n }\n\n internal sealed class Solver\n {\n private static readonly Edge FakeEdge = new Edge();\n \n private readonly int _n, _m, _k, _c, _d;\n private readonly int _maxTime;\n private readonly Node _start, _sink;\n private readonly Node[,] _nodes;\n private readonly List[] _nodeEdges;\n \n private readonly int[] _bestCosts;\n private readonly Edge[] _bestMoves;\n\n public Solver(int n, int m, int k, int c, int d)\n {\n _n = n;\n _m = m;\n _k = k;\n _c = c;\n _d = d;\n\n _maxTime = k + m;\n _nodes = new Node[n, _maxTime];\n\n _start = new Node() {Id = _nodes.Length};\n _sink = new Node() {Id = _nodes.Length + 1};\n\n var allNodesCount = _nodes.Length + 2;\n \n _nodeEdges = new List[allNodesCount];\n _bestCosts = new int[allNodesCount];\n _bestMoves = new Edge[allNodesCount];\n \n for (var i = 0; i < allNodesCount; i++)\n _nodeEdges[i] = new List();\n }\n \n public int TotalCost { get; private set; }\n\n public void Init()\n {\n var nodeId = 0;\n for (var node = 0; node < _n; node++)\n for (var time = 0; time < _maxTime; time++)\n _nodes[node, time] = new Node() { Id = nodeId++ };\n\n for (var time = 0; time < _maxTime; time++)\n AddEdgePair(_nodes[0, time], _sink, time * _c, _k);\n\n for (var node = 0; node < _n; node++)\n {\n var from = _nodes[node, 0];\n for (var time = 1; time < _maxTime; time++)\n {\n var to = _nodes[node, time];\n AddEdgePair(from, to, 0, _k);\n from = to;\n }\n }\n }\n\n public void AddMemberHome(int home, int count)\n {\n _nodeEdges[_start.Id].Add(new Edge()\n {\n From = _start,\n To = _nodes[home, 0],\n Cost = 0,\n ResidualCapacity = count,\n Paired = FakeEdge,\n });\n }\n\n public void AddEdge(int from, int to)\n {\n for (var time = 0; time < _maxTime - 1; time++)\n {\n var nodeFrom = _nodes[from, time];\n var nodeTo = _nodes[to, time + 1];\n \n for (int people = 0, cost = 1; people < _k; people++, cost += 2)\n AddEdgePair(nodeFrom, nodeTo, cost * _d, 1);\n }\n }\n\n public void IncreaseFlow()\n {\n FindBestPath();\n CommitBestPath();\n TotalCost += _bestCosts[_sink.Id];\n }\n\n private void FindBestPath()\n {\n for (var i = 0; i < _bestCosts.Length; i++)\n _bestCosts[i] = int.MaxValue;\n\n _bestCosts[_start.Id] = 0;\n \n bool any;\n do\n {\n any = false;\n for (var nodeId = 0; nodeId < _nodeEdges.Length; nodeId++)\n {\n var costToSource = _bestCosts[nodeId];\n if (costToSource == int.MaxValue)\n continue;\n\n foreach (var edge in _nodeEdges[nodeId])\n {\n if (edge.ResidualCapacity == 0)\n continue;\n\n var newCost = costToSource + edge.Cost;\n if (_bestCosts[edge.To.Id] <= newCost)\n continue;\n\n _bestCosts[edge.To.Id] = newCost;\n _bestMoves[edge.To.Id] = edge;\n any = true;\n }\n }\n }\n while (any);\n }\n\n private void CommitBestPath()\n {\n var cur = _bestMoves[_sink.Id];\n while (cur != null)\n {\n cur.ResidualCapacity--;\n cur.Paired.ResidualCapacity++;\n cur = _bestMoves[cur.From.Id];\n }\n }\n\n private void AddEdgePair(Node from, Node to, int cost, int capacity)\n {\n var forwardEdge = new Edge()\n {\n From = from,\n To = to,\n Cost = cost,\n ResidualCapacity = capacity,\n };\n\n var reverseEdge = new Edge()\n {\n From = to,\n To = from,\n Cost = -cost,\n ResidualCapacity = 0,\n };\n\n forwardEdge.Paired = reverseEdge;\n reverseEdge.Paired = forwardEdge;\n \n _nodeEdges[from.Id].Add(forwardEdge);\n _nodeEdges[to.Id].Add(reverseEdge);\n }\n }\n\n internal struct Node\n {\n public int Id { get; set; }\n public override string ToString() => Id.ToString();\n }\n\n internal sealed class Edge\n {\n public Node From { get; set; }\n public Node To { get; set; }\n public int Cost { get; set; }\n public int ResidualCapacity { get; set; }\n public Edge Paired { get; set; }\n }\n}", "lang": "Mono C#", "bug_code_uid": "99352e0c0828f5ac0bd2b2ba90a25eec", "src_uid": "2d0aa75f2e63c4fb8c98742ac8cd821c", "apr_id": "7bc4da5df9be085f0bdb46c87cf6b197", "difficulty": 2500, "tags": ["graphs", "flows"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.654903515728258, "equal_cnt": 57, "replace_cnt": 35, "delete_cnt": 15, "insert_cnt": 7, "fix_ops_cnt": 57, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\n\nnamespace G.GangUp\n{\n internal static class Program\n {\n public static void Main(string[] args)\n {\n var nmkcd = Console.ReadLine().Split();\n var n = int.Parse(nmkcd[0]);\n var m = int.Parse(nmkcd[1]);\n var k = int.Parse(nmkcd[2]);\n var c = int.Parse(nmkcd[3]);\n var d = int.Parse(nmkcd[4]);\n \n var solver = new Solver(n, m, k, c, d);\n solver.Init();\n\n var memberHomes = Console.ReadLine().Split().GroupBy(int.Parse);\n foreach (var memberHome in memberHomes)\n solver.AddMemberHome(memberHome.Key - 1, memberHome.Count());\n \n for (var i = 0; i < m; i++)\n {\n var xy = Console.ReadLine().Split();\n var x = int.Parse(xy[0]) - 1;\n var y = int.Parse(xy[1]) - 1;\n \n solver.AddEdge(x, y);\n solver.AddEdge(y, x);\n }\n \n for (var i = 0; i < k; i++)\n solver.IncreaseFlow();\n\n Console.WriteLine(solver.TotalCost);\n }\n }\n\n internal sealed class Solver\n {\n private static readonly Edge FakeEdge = new Edge();\n private readonly int _n, _m, _k, _c, _d;\n private readonly int _maxTime;\n private readonly Node _start, _sink;\n private readonly Node[,] _nodes;\n private readonly List[] _nodeEdges;\n \n private readonly int[] _bestCosts;\n private readonly Edge[] _bestMoves;\n private readonly bool[] _isInQueue;\n private readonly Queue _bestPathSearchQueue;\n\n public Solver(int n, int m, int k, int c, int d)\n {\n _n = n;\n _m = m;\n _k = k;\n _c = c;\n _d = d;\n\n _maxTime = k + m;\n _nodes = new Node[n, _maxTime];\n\n _start = new Node() {Id = _nodes.Length};\n _sink = new Node() {Id = _nodes.Length + 1};\n\n var allNodesCount = _nodes.Length + 2;\n \n _nodeEdges = new List[allNodesCount];\n _bestCosts = new int[allNodesCount];\n _bestMoves = new Edge[allNodesCount];\n _isInQueue = new bool[allNodesCount];\n _bestPathSearchQueue = new Queue(allNodesCount);\n \n for (var i = 0; i < _nodeEdges.Length; i++)\n _nodeEdges[i] = new List();\n }\n \n public int TotalCost { get; private set; }\n\n public void Init()\n {\n var nodeId = 0;\n for (var node = 0; node < _n; node++)\n for (var time = 0; time < _maxTime; time++)\n _nodes[node, time] = new Node() { Id = nodeId++ };\n\n for (var time = 0; time < _maxTime; time++)\n {\n var leaderHome = _nodes[0, time];\n \n _nodeEdges[leaderHome.Id].Add(new Edge()\n {\n From = leaderHome,\n To = _sink,\n Flow = new Flow() { Capacity = _k },\n Cost = time * _c,\n Paired = FakeEdge,\n });\n }\n \n for (var node = 0; node < _n; node++)\n for (var time = 0; time < _maxTime - 1; time++)\n {\n var from = _nodes[node, time];\n var to = _nodes[node, time + 1];\n _nodeEdges[from.Id].Add(new Edge()\n {\n From = from,\n To = to,\n Cost = 0,\n Flow = new Flow() { Capacity = int.MaxValue },\n Paired = FakeEdge,\n });\n }\n\n _isInQueue[_sink.Id] = true;\n }\n\n public void AddMemberHome(int home, int count)\n {\n var target = _nodes[home, 0];\n \n _nodeEdges[_start.Id].Add(new Edge()\n {\n From = _start,\n To = target,\n Flow = new Flow() { Capacity = count },\n Cost = 0,\n Paired = FakeEdge,\n });\n }\n\n public void AddEdge(int from, int to)\n {\n for (var time = 0; time < _maxTime - 1; time++)\n {\n var nodeFrom = _nodes[from, time];\n var nodeTo = _nodes[to, time + 1];\n \n for (int people = 0, cost = 1; people < _k; people++, cost += 2)\n {\n var mainEdge = new Edge()\n {\n From = nodeFrom,\n To = nodeTo,\n Flow = new Flow() { Capacity = 1 },\n Cost = cost * _d,\n };\n\n var helpEdge = new Edge()\n {\n From = nodeTo,\n To = nodeFrom,\n Flow = new Flow() { Capacity = 0 },\n Cost = -cost * _d,\n };\n\n mainEdge.Paired = helpEdge;\n helpEdge.Paired = mainEdge;\n \n _nodeEdges[nodeFrom.Id].Add(mainEdge);\n _nodeEdges[nodeTo.Id].Add(helpEdge);\n }\n }\n }\n\n public void IncreaseFlow()\n {\n FindBestPath();\n var flow = FindFlow();\n CommitBestPath(flow);\n }\n\n private void FindBestPath()\n {\n for (var i = 0; i < _bestCosts.Length; i++)\n _bestCosts[i] = int.MaxValue;\n \n _bestCosts[_start.Id] = 0;\n _bestPathSearchQueue.Enqueue(_start);\n \n while (_bestPathSearchQueue.Count > 0)\n {\n var node = _bestPathSearchQueue.Dequeue();\n var costToNode = _bestCosts[node.Id];\n \n foreach (var edge in _nodeEdges[node.Id])\n {\n if (edge.Flow.Filled)\n continue;\n\n var possibleCost = costToNode + edge.Cost;\n if (possibleCost >= _bestCosts[edge.To.Id])\n continue;\n\n _bestCosts[edge.To.Id] = possibleCost;\n _bestMoves[edge.To.Id] = edge;\n if (_isInQueue[edge.To.Id])\n continue;\n \n _isInQueue[edge.To.Id] = true;\n _bestPathSearchQueue.Enqueue(edge.To);\n }\n\n _isInQueue[node.Id] = false;\n }\n }\n\n private int FindFlow()\n {\n var minFlow = int.MaxValue;\n var cur = _bestMoves[_sink.Id];\n while (cur != null)\n {\n var flow = cur.Flow.Remaining;\n if (flow < minFlow)\n minFlow = flow;\n \n cur = _bestMoves[cur.From.Id];\n }\n\n return minFlow;\n }\n\n private void CommitBestPath(int flow)\n {\n var cur = _bestMoves[_sink.Id];\n while (cur != null)\n {\n TotalCost += cur.Cost;\n cur.Flow.ActualFlow += flow;\n cur.Paired.Flow.ActualFlow -= flow;\n cur = _bestMoves[cur.From.Id];\n }\n }\n }\n\n internal struct Node\n {\n public int Id { get; set; }\n public override string ToString() => Id.ToString();\n }\n\n internal struct Flow\n {\n public int ActualFlow { get; set; }\n public int Capacity { get; set; }\n \n public int Remaining => Capacity - ActualFlow;\n public bool Filled => ActualFlow == Capacity;\n }\n\n internal sealed class Edge\n {\n public Node From { get; set; }\n \n public Node To { get; set; }\n \n public int Cost { get; set; }\n public Edge Paired { get; set; }\n public Flow Flow;\n }\n}", "lang": "Mono C#", "bug_code_uid": "eb30dd3a56ba5730e3adf280c0352db1", "src_uid": "2d0aa75f2e63c4fb8c98742ac8cd821c", "apr_id": "7bc4da5df9be085f0bdb46c87cf6b197", "difficulty": 2500, "tags": ["graphs", "flows"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9936745255894192, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 3, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Text;\n\n\nnamespace ConsoleApplication5\n{\n class Program\n {\n static void Main(string[] args)\n {\n\n string s = Console.ReadLine();\n int n = int.Parse(s.Split(' ')[0]);\n int m = int.Parse(s.Split(' ')[1]);\n \n if (n == 0 and m!=0 )\n {\n Console.WriteLine(\"Impossible\");\n }\n else \n {\n int mx = 0;\n if (m == 0) { mx = n; } else { mx = n + m - 1; }\n if (m >= n)\n {\n Console.WriteLine(m.ToString()+\" \"+(mx).ToString());\n }\n else \n {\n Console.WriteLine(n.ToString() + \" \" + (mx).ToString());\n }\n }\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "5621ed6d4cfb39fd528f12decc135a8a", "src_uid": "1e865eda33afe09302bda9077d613763", "apr_id": "1df290eaf64998e25b600bce6b86ce61", "difficulty": 1100, "tags": ["math", "greedy"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.9921875, "equal_cnt": 5, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 4, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Runtime.ExceptionServices;\nusing System.Runtime.InteropServices;\nusing System.Text;\n\nnamespace ConsoleApp8\n{\n class Program\n {\n static void Main(string[] args)\n {\n Console.WriteLine(Solve());\n Console.ReadLine();\n }\n\n static string Solve()\n {\n var nab = Console.ReadLine().Split().Select(long.Parse).ToArray();\n long a = nab[0];\n long b = nab[1];\n\n while (a != 0 && b != 0)\n {\n if (a >= 2 * b) a = a - 2 * b;\n else if (b >= 2 * a) b = b - 2 * a;\n else break;\n }\n\n return a + \" \" + b;\n }\n }\n}", "lang": "MS C#", "bug_code_uid": "5a31719aeeffb1c104d8d984435fe989", "src_uid": "1f505e430eb930ea2b495ab531274114", "apr_id": "0010d9d6c4e77c54485ee53941e0309e", "difficulty": 1100, "tags": ["math", "number theory"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9697754749568221, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "using System;\nclass Test {\n static double fac(int start , int end){\n double factorial = 1;\n for(int i = start ; i >= end ; i--){\n factorial *= i;\n }\n return factorial;\n }\n static double rev(int start , int number){\n double reverse = 1;\n int i = start;\n while(number!=0){\n reverse *= i;\n i--;\n number--;\n }\n return reverse;\n }\n static void Main(){\n string [] str = Console.ReadLine().Split();\n int b = int.Parse(str[0]);\n int g = int.Parse(str[1]);\n int n = int.Parse(str[2]);\n long sum = 0;\n int cg , cb;\n cg = 0;\n while(true){\n cg++;\n cb = n-cg;\n if(cb<4){\n break;\n }\n int tcg = cg;\n int tcb = cb;\n if(tcg>g/2){\n tcg = g-tcg;\n }\n if(tcb>b/2){\n tcb = b-tcb;\n }\n sum += (long)(rev(g,tcg)/fac(tcg,1))*(long)(rev(b,tcb)/fac(tcb,1));\n }\n Console.WriteLine(sum);\n }\n}", "lang": "Mono C#", "bug_code_uid": "52a4e098a3b6f7c172cbf44540f69226", "src_uid": "489e69c7a2fba5fac34e89d7388ed4b8", "apr_id": "393e0bf55134093db2af7d245777f5d8", "difficulty": 1400, "tags": ["math", "combinatorics"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.9687002652519894, "equal_cnt": 6, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 5, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\n\nnamespace The_World_is_a_Theatre\n{\n class Program\n {\n static void Main(string[] args)\n {\n int n, m, t;\n int s1 = 1, s2 = 1, sum = 0;\n\n string[] nmt = Console.ReadLine().Split(' ');\n n = int.Parse(nmt[0]);\n m = int.Parse(nmt[1]);\n t = int.Parse(nmt[2]);\n\n for (int i = 4; i <= t - 1; i++)\n {\n s1 = 1;\n s2 = 1;\n\n for (int k = 0; k < i; k++)\n {\n s1 = s1 * (n - k) / (k + 1);\n }\n\n for (int j = 0; j < t - i; j++)\n {\n s2 = s2 * (m - j) / (j + 1);\n }\n\n sum += s1 * s2;\n }\n Console.WriteLine(sum);\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "750b23039ab8a3ef707fbafb59925e59", "src_uid": "489e69c7a2fba5fac34e89d7388ed4b8", "apr_id": "229b729b16fa3cc91dc40445421157f9", "difficulty": 1400, "tags": ["math", "combinatorics"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.7115009746588694, "equal_cnt": 1, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": " var NumberOfGroup = Convert.ToInt32(Console.ReadLine());\n var Years = Console.ReadLine().Split(' ').Select(int.Parse).ToList();\n if (NumberOfGroup == 1)\n {\n Console.WriteLine(Years[0]);\n return;\n }\n int Answer = Years.Sum() / NumberOfGroup;\n Console.WriteLine(Answer);", "lang": "MS C#", "bug_code_uid": "b4d976d9cb5fe600903ac83cee7345c5", "src_uid": "f03773118cca29ff8d5b4281d39e7c63", "apr_id": "131112d63167a0761b839f00639521e7", "difficulty": 800, "tags": ["implementation", "sortings"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.9439330543933054, "equal_cnt": 14, "replace_cnt": 3, "delete_cnt": 1, "insert_cnt": 10, "fix_ops_cnt": 14, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace ConsoleApplication1\n{\n class Program\n {\n\n static void Main(string[] args)\n {\n\n int n = Convert.ToInt32(Console.ReadLine());\n var Arr = Console.ReadLine().Split(' ').Select(int.Parse).ToArray();\n\n if (n == 1)\n {\n Console.WriteLine(Arr[0].ToString());\n }\n else\n {\n Array.Sort(Arr);\n Console.WriteLine(Arr[(n == 3) ? 1 : 2]);\n }\n\n }\n}\n\n", "lang": "MS C#", "bug_code_uid": "250ec29692a74e91aaa224f928010ed7", "src_uid": "f03773118cca29ff8d5b4281d39e7c63", "apr_id": "652c3089e792b4736609bf7dd40e4599", "difficulty": 800, "tags": ["implementation", "sortings"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.9976149914821124, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "/* Date: 12.05.2016 * Time: 22:45 */\n\n\n*/\n\nusing System;\nusing System.IO;\n\nclass Example\n{\n\tpublic static void Main(string[] args)\n\t{\n\t\tint n = int.Parse (Console.ReadLine ());\n/*\n * \t\tif ( n < 10 )\n\t\t\tConsole.WriteLine (n);\n\t\telse if ( n < 190 )\n\t\t{\n\t\t\tn -= 9;\n\t\t\tif ( n % 2 == 0 )\n\t\t\t\tn = (n % 20) / 2 - 1;\n\t\t\telse\n\t\t\t\tn = n / 20 + 1;\n\t\t\tConsole.WriteLine (n);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tn -= 99;\n\t\t\tif ( n % 3 == 0 )\n\t\t\t\tn = (n / 300) + 1;\n\t\t\telse if ( n % 3 == 1 )\n\t\t\t\tn = (n % 300) % 30 - 1;\n\t\t\telse\n\t\t\t\tn = (n % 30 + 1) / 3;\n\t\t}\n*/\n\t\tint [] d = new int [4000];\n\t\tint k = 0;\n\t\tfor ( int i=1; i < 10; i++, k++ )\n\t\t\td [i] = i;\n\t\tfor ( int i=10; i < 100; i++, k+=2 )\n\t\t{\n\t\t\td [k] = i / 10;\n\t\t\td [k+1] = i % 10;\n\t\t}\n\t\tfor ( int i=100; i < 1000; i++, k+=3 )\n\t\t{\n\t\t\td [k] = i / 100;\n\t\t\td [k+1] = (i / 10) % 10;\n\t\t\td [k+2] = i % 10;\n\t\t}\n\t\tConsole.WriteLine (d [n]);\n//\t\tConsole.ReadKey ();\n\t}\n}\n/*\n\tpublic static void Main(string[] args)\n\t{\n# if ( ONLINE_JUDGE )\n\n# else\n\t\tStreamReader sr= new StreamReader (\"B.txt\");\n\t\tStreamWriter sw = new StreamWriter (\"B.out\");\n# endif\n\n\t\tstring ss;\n\n# if ( ONLINE_JUDGE )\n\t\tss = Console.ReadLine ();\n# else\n\t\tss = sr.ReadLine ();\n# endif\n\n\t\tint n = int.Parse (ss);\n\n\n\n\n\n\n\t\t\n\t\tfor ( int i=0; i < n; i++ )\n# if ( ONLINE_JUDGE )\n\t\t\tConsole.WriteLine (e [i] + \" \");\n# else\n\t\t\tsw.WriteLine (e [i] + \" \");\n# endif\n\n# if ( ! ONLINE_JUDGE )\n\t\tsw.Close ();\n# endif\n\n\n\t\tConsole.Write(\"Press any key to continue . . . \");\n\t\tConsole.ReadKey(true);\n\t}\n*/\n", "lang": "Mono C#", "bug_code_uid": "793f2f020163671560af7ecc50a16d39", "src_uid": "2d46e34839261eda822f0c23c6e19121", "apr_id": "1bb128215c2e3fe193d50403f0fd30c2", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9269032453745829, "equal_cnt": 15, "replace_cnt": 5, "delete_cnt": 3, "insert_cnt": 6, "fix_ops_cnt": 14, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Globalization;\nusing System.IO;\nusing System.Linq;\nusing System.Text;\n\nclass Program\n{\n private static void Solve()\n {\n int xs = RI();\n int ys = RI();\n int n = RI();\n int[] x = new int[n];\n int[] y = new int[n];\n for (int i = 0; i < n; i++)\n {\n x[i] = RI() - xs;\n y[i] = RI() - ys;\n }\n\n\n }\n\n static void Main(string[] args)\n {\n int[,] map = new int[222, 222];\n\n int x = 105;\n int y = 105;\n map[x, y] = 1;\n foreach (char ch in Console.ReadLine())\n {\n if (ch == 'U') y++;\n if (ch == 'D') y--;\n if (ch == 'L') x--;\n if (ch == 'R') x++;\n map[x, y] = 1;\n\n int count = map[x - 1, y] + map[x + 1, y] + map[x, y - 1] + map[x, y + 1];\n\n if (count > 1)\n {\n Console.WriteLine(\"BUG\");\n return;\n }\n }\n\n Console.WriteLine(\"OK\");\n }\n\n private const int Mod = 1000000000 + 7;\n\n #region Data Read\n private static char ReadSign()\n {\n while (true)\n {\n int ans = consoleReader.Read();\n if (ans == '+' || ans == '-' || ans == '?')\n return (char)ans;\n }\n }\n\n private static long GCD(long a, long b)\n {\n if (a % b == 0) return b;\n return GCD(b, a % b);\n }\n\n private static List[] ReadGraph(int n, int m)\n {\n List[] g = new List[n];\n for (int i = 0; i < g.Length; i++) g[i] = new List();\n for (int i = 0; i < m; i++)\n {\n int a = RI() - 1;\n int b = RI() - 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 = RI();\n int b = RI();\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 RI()\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 RUL()\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 RL()\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[] RIA(int n)\n {\n int[] ans = new int[n];\n for (int i = 0; i < n; i++)\n ans[i] = RI();\n return ans;\n }\n\n private static long[] RLA(int n)\n {\n long[] ans = new long[n];\n for (int i = 0; i < n; i++)\n ans[i] = RL();\n return ans;\n }\n\n private static char[] ReadWord()\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[] ReadStringLine()\n {\n int ans;\n\n do\n {\n ans = consoleReader.Read();\n } while (ans == 10 || ans == 13);\n\n List s = new List();\n\n do\n {\n s.Add((char)ans);\n ans = consoleReader.Read();\n } while (ans != 10 && ans != 13);\n\n return s.ToArray();\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 private static char ReadNonLetter()\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 ReadAnyOf(IEnumerable allowed)\n {\n while (true)\n {\n char ans = (char)consoleReader.Read();\n if (allowed.Contains(ans))\n return 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 private static double DoubleFromString(string x)\n {\n return double.Parse(x, 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(StringBuilder sb)\n {\n PushTestData(sb.ToString());\n }\n private static void PushTestData(string data)\n {\n#if TOLYAN_TEST\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 #endregion\n}", "lang": "MS C#", "bug_code_uid": "423be8ad0e2146b64d5bea87f3d73b27", "src_uid": "bb7805cc9d1cc907b64371b209c564b3", "apr_id": "0b15703c6d12bae98fbd4af3d81d19d5", "difficulty": 1400, "tags": ["graphs", "constructive algorithms", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.5855978260869565, "equal_cnt": 39, "replace_cnt": 6, "delete_cnt": 0, "insert_cnt": 34, "fix_ops_cnt": 40, "bug_source_code": "int n, p, k;\nString[] input = Console.ReadLine().Split(' ');\nn = Int16.Parse(input[0]); //osszes oldal\np = Int16.Parse(input[1]); //jelenlegi\nk = Int16.Parse(input[2]); //pluszba\nfor(int i = p-k; i <= p+k; i++){\n if(i < 1) i = 1;\n if(i != 1 && i == p-k){\n Console.Write(\"<< \");\n }\n if(i == p) Console.Write(\"(\"+i+\") \");\n else Console.Write(i+\" \");\n if(i >= n) break;\n else if(i == p+k){\n Console.Write(\">>\");\n break;\n\t}\n}", "lang": "Mono C#", "bug_code_uid": "bc6d23465c90e44df141d85bedd428c3", "src_uid": "526e2cce272e42a3220e33149b1c9c84", "apr_id": "800ddfb25764da518383731001880d81", "difficulty": null, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.9985152190051967, "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.Text;\nusing System.Threading.Tasks;\n\nnamespace CF_399A\n{\n class Program\n {\n static void Main()\n {\n int n, p, k;\n var input = Console.ReadLine().Split(' ');\n n = int.Parse(input[0]);\n p = int.Parse(input[1]);\n k = int.Parse(input[2]);\n string output = \"\";\n if (p > n || p < 1)\n {\n return;\n }\n if (p > k)\n {\n output += \"<< \";\n for(int i= p - k; i < p; i++)\n {\n output += i + \" \";\n }\n\n }\n else\n {\n for (int i = 1; i < p; i++)\n {\n output += i + \" \";\n }\n }\n\n output += $\"({p})\";\n\n if(p < n - k)\n {\n for (int i = p+1; i <= p+k; i++)\n {\n output += \" \" + i;\n }\n output += \" >>\";\n }\n else\n {\n for (int i = p+1; i <= n; i++)\n {\n output += \" \" + i;\n }\n }\n\n Console.WriteLine(output);\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "cc6b5bd940a099f7233874a108ac151f", "src_uid": "526e2cce272e42a3220e33149b1c9c84", "apr_id": "471a9fafcd243acbc34538a063ff2928", "difficulty": null, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.9963991769547325, "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;\nnamespace VectorSpaceModel\n{\n class Program\n {\n // https://codeforces.com/contest/ + ContestId\n\n static void Main(string[] args)\n {\n var n = int.Parse(Console.ReadLine());\n\n var a = Console.ReadLine().Split().Select(int.Parse).ToArray();\n var b = Console.ReadLine().Split().Select(int.Parse).ToArray();\n\n //1 1 1 0 0\n //0 1 1 1 1\n\n var max = 0;\n List aList = new List(a);\n List bList = new List(b);\n\n\n if (a.Length == 1 && a[0] == 1 && b[0] == 0)\n {\n max = 1;\n goto DD;\n }\n\n for (var i = 1; i < a.Length; i++)\n {\n var c = 0;\n while (c < a.Length)\n {\n // 1 0 \n\n if (a[c] == 1 && b[c] == 1)\n {\n aList[c] = i;\n bList[c] = i;\n }\n else if (a[c] > b[c])\n {\n aList[c] = i;\n bList[c] = 0;\n }\n else if (a[c] < b[c])\n {\n aList[c] = 0;\n bList[c] = 1;\n }\n\n\n if (IsOk(aList.ToArray(), bList.ToArray()))\n {\n max = i;\n goto DD;\n }\n\n\n c++;\n }\n }\n\n DD:\n Console.WriteLine(max == 0 ? -1 : max);\n\n }\n\n public static bool IsOk(int[] a, int[] b)\n {\n var sumA = a.Sum();\n var sumB = b.Sum();\n\n if (sumA > sumB)\n return true;\n\n return false;\n }\n }\n}", "lang": "Mono C#", "bug_code_uid": "0cbe45d42cf1eded4103664ec2178994", "src_uid": "b62338bff0cbb4df4e5e27e1a3ffaa07", "apr_id": "f3294e6ca4dca195336610f24015ff08", "difficulty": 900, "tags": ["greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.8193869096934548, "equal_cnt": 7, "replace_cnt": 5, "delete_cnt": 2, "insert_cnt": 0, "fix_ops_cnt": 7, "bug_source_code": "using System;\n\n\n class Program\n {\n static void Main(string[] args)\n {\n int n = int.Parse(Console.ReadLine());\n \n \n\n int[] r = Array.ConvertAll(Console.ReadLine().Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries), (element) => int.Parse(element));\n int[] b = Array.ConvertAll(Console.ReadLine().Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries), (element) => int.Parse(element));\n int countb = 0, countr = 0;\n for(int i = 0; i teedadeMoghasem)\n {\n min1 = teedadeMoghasem + 1;\n }\n else\n {\n min1 = maxGhesmateJaabe;\n }\n int maxZafeiat = ((min1) * zarfiateHarGhesmat);\n\n if (teedadeAjil > maxZafeiat)\n {\n return 1 + min(maxGhesmateJaabe, teedadeAjil - maxZafeiat, teedadeMoghasem - (maxGhesmateJaabe - 1), zarfiateHarGhesmat);\n }\n else\n {\n return 1;\n }\n }\n catch (Exception)\n {\n\n }\n\n }\n\n }\n\n}\n", "lang": "MS C#", "bug_code_uid": "54662702a42491997a15076c2cc4c414", "src_uid": "7cff20b1c63a694baca69bdf4bdb2652", "apr_id": "81439cb0aefdf93c6679d8dc1a1322a3", "difficulty": 1100, "tags": ["math", "greedy"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.95715485858303, "equal_cnt": 18, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 15, "fix_ops_cnt": 17, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Configuration;\nusing System.Data;\nusing System.Diagnostics;\n\nnamespace testing\n{\n class Program\n {\n static void Main(string[] args)\n {\n\n\n //k = the maximum number of sections in the box\n //a = the number of nuts\n //b = the number of divisors\n //v = the capacity of each section of the box\n\n int count = 0;\n string[] input = Console.ReadLine().Split();\n int k = int.Parse(input[0]);\n int a = int.Parse(input[1]);\n int b = int.Parse(input[2]);\n int v = int.Parse(input[3]);\n\n if (k - 1 < b)\n {\n a = a - (v * k);\n b = b - (k - 1);\n count++;\n while (a > 0)\n {\n if(k-1 b)\n {\n a = a - (b + 1) * v;\n b = 0;\n count++;\n }\n else if (b==0)\n {\n a = a - v;\n count++;\n }\n }\n }\n\n else\n {\n a = a - (b + 1) * v;\n count++;\n while (a > 0)\n {\n a = a - v;\n count++;\n }\n }\n\n Console.WriteLine(count);\n }\n }\n}", "lang": "MS C#", "bug_code_uid": "35face090c03ec10ad1b56bf0ea05f9b", "src_uid": "7cff20b1c63a694baca69bdf4bdb2652", "apr_id": "d84d2268dbe7ac4d3f635ef6ff5a3206", "difficulty": 1100, "tags": ["math", "greedy"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.9457286432160804, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "using System;\n\nnamespace _928\n{\n class Program\n {\n static void Main(string[] args)\n {\n\n string[] s = Console.ReadLine().Split(' ');\n\n int v1 = int.Parse(s[0]);\n int v2 = int.Parse(s[1]);\n\n string[] ss = Console.ReadLine().Split(' ');\n\n int t = int.Parse(ss[0]);\n int d = int.Parse(ss[1]);\n\n int ans = v1;\n\n int ts = v1;\n\n for (int i = 1, nts = 0; i < t; i++)\n {\n \n for (int j = d; j >=-d; j--)\n {\n nts = ts + j;\n if (Math.Abs(v2 - nts) <= d*(t - i - 1))\n {\n break;\n }\n }\n ts = nts;\n ans += ts;\n \n \n }\n \n Console.WriteLine(ans);\n \n\n\n\n\n \n Console.WriteLine(ans);\n \n\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "bebbb0f9158207902156f22e7b3bdcf4", "src_uid": "9246aa2f506fcbcb47ad24793d09f2cf", "apr_id": "bf10cf944952a08279602f0ae3805f36", "difficulty": 1400, "tags": ["dp", "math", "greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "C#"} {"similarity_score": 0.9788972089857045, "equal_cnt": 6, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 4, "fix_ops_cnt": 5, "bug_source_code": "using System;\nusing System.Collections;\nusing System.Collections.Generic;\nusing System.Linq;\n\nnamespace Problem{\n \n public class Solution{\n \n public static void Main(){\n \n int[] nums = Console.ReadLine().Split(' ').Select(int.Parse).ToArray();\n \n int a = nums[0];\n int b = nums[1];\n int c = nums[2];\n \n int totalLength = c*2;\n \n if(a > b){\n totalLength += 2*b + 1;\n }else if(a < b){\n totalLength += 2*a + 1;\n }else{\n totalLength += 2*b;\n }\n \n Console.WriteLine(totalLength);\n }\n }\n}", "lang": "Mono C#", "bug_code_uid": "3386c8ad1be2bc2d5da127bd32eaedce", "src_uid": "609f131325c13213aedcf8d55fc3ed77", "apr_id": "beead8bcf85038f192d6bf3ace11dc4b", "difficulty": 800, "tags": ["greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.9866412213740458, "equal_cnt": 3, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "using System;\nusing System.Linq;\nusing System.Collections.Generic;\nusing System.Text.RegularExpressions;\n\npublic class Class2\n{\n static void Main()\n {\n string str;\n while ((str = Console.ReadLine()) != null)\n {\n var res = Func(str);\n Console.WriteLine(res);\n }\n }\n static int Func(string str)\n {\n var a = str.Split().Select(x => int.Parse(x)).ToArray();\n return Math.Min(a[0], a[1]) * 2 + a[2] * 2 + (Math.Abs(a[0] - a[1]) > 0 ? 1 : 0);\n }\n}", "lang": "Mono C#", "bug_code_uid": "ef2b472813fe6d90b09ed424e9c9b950", "src_uid": "609f131325c13213aedcf8d55fc3ed77", "apr_id": "1ef3b72edb3719ef100268f516ac9875", "difficulty": 800, "tags": ["greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9580838323353293, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 4, "bug_source_code": "using System;\n\nclass MainClass()\n{\n static void Main(string[] args)\n {\n int[] input = Array.ConvertAll(Console.ReadLine().Split(), int.Parse);\n int minimum = input[0] > input[1] ? input[1] : input[0];\n \n if (minimum % 2 == 0) Console.WriteLine(\"Malvika\");\n else Console.WriteLine(\"Akshat\");\n }\n}", "lang": "Mono C#", "bug_code_uid": "af04f9e1bcaa40c90b1e906477d547f1", "src_uid": "a4b9ce9c9f170a729a97af13e81b5fe4", "apr_id": "894333df9469668ca8e3334d7f782de3", "difficulty": 900, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.9991950630533941, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 0, "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 ConsoleApplication1\n{\n class Program\n {\n\n\n static void Main(string[] args)\n {\n char[,] Pazl1 = new char[2, 2];\n char[,] Pazl2 = new char[2, 2];\n char ThisCh=' ',ch=' ';\n string str = Console.ReadLine();\n string str2 = Console.ReadLine();\n Pazl1[0, 0] = str[0];\n Pazl1[0, 1] = str[1];\n Pazl1[1, 0] = str2[0];\n Pazl1[1, 1] = str2[1];\n str = Console.ReadLine();\n str2 = Console.ReadLine();\n Pazl2[0, 0] = str[0];\n Pazl2[0, 1] = str[1];\n Pazl2[1, 0] = str2[0];\n Pazl2[1, 1] = str2[1];\n if (Pazl1[0,0]=='X')\n {\n ch = Pazl1[0, 0];\n Pazl1[0, 0] = Pazl1[1, 0];\n Pazl1[1, 0] = Pazl1[1, 1];\n Pazl1[1, 1] = Pazl1[0, 1];\n Pazl1[0, 1] = ch;\n }\n\n ThisCh = Pazl1[0, 0];\n while (ThisCh != Pazl2[0, 0])\n {\n ch = Pazl2[0, 0];\n Pazl2[0, 0] = Pazl2[1, 0];\n Pazl2[1, 0] = Pazl2[1, 1];\n Pazl2[1, 1] = Pazl2[0, 1];\n Pazl2[0, 1] = ch;\n }\n if (Pazl1[0, 1] == 'X')\n {\n ch = Pazl1[0, 1];\n Pazl1[0, 1] = Pazl1[1,1];\n Pazl1[0, 1] = ch;\n }\n if (Pazl2[0, 1] == 'X')\n {\n ch = Pazl2[0, 1];\n Pazl2[0, 1] = Pazl2[1, 1];\n Pazl2[1, 1] = ch;\n }\n if (Pazl2[0, 1] == Pazl1[0, 1])\n Console.WriteLine(\"YES\");\n else\n Console.WriteLine(\"NO\");\n }\n }\n}", "lang": "MS C#", "bug_code_uid": "76cc5713421247eb272dba76546901cd", "src_uid": "46f051f58d626587a5ec449c27407771", "apr_id": "ec46c1ec9471c5320736766470714b7f", "difficulty": 1200, "tags": ["brute force", "constructive algorithms", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.5251396648044693, "equal_cnt": 10, "replace_cnt": 9, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 9, "bug_source_code": "using System;\n\nnamespace ConsoleApplication\n{\n\tclass Program\n\t{\n\t\tstatic void Main(string[] args)\n\t\t{\n\t\t\tstring bessy1 = Console.ReadLine();\n\t\t\tstring bessy2 = Console.ReadLine();\n\t\t\tstring elsy1 = Console.ReadLine();\n\t\t\tstring elsy2 = Console.ReadLine();\n\n\t\t\tif (elsy1 != null && elsy1.Length == 2 &&\n\t\t\t\telsy2 != null && elsy2.Length == 2 &&\n\t\t\t\tbessy1 != null && bessy1.Length == 2 &&\n\t\t\t\tbessy2 != null && bessy2.Length == 2 &&\n\t\t\t\t(bessy1 == elsy1 || \n\t\t\t\tbessy2 == elsy2 ||\n\t\t\t\tstring.Concat(bessy1[0], bessy2[0]) == string.Concat(elsy1[0], elsy2[0]) ||\n\t\t\t\tstring.Concat(bessy1[1], bessy2[1]) == string.Concat(elsy1[1], elsy2[1])))\n\t\t\t{\n\t\t\t\tConsole.WriteLine(\"YES\");\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tConsole.WriteLine(\"NO\");\n\t\t\t}\n\t\t}\n\t}\n}", "lang": "MS C#", "bug_code_uid": "13f495f950b03f85a3fb49bc23e9dced", "src_uid": "46f051f58d626587a5ec449c27407771", "apr_id": "01c7bed91a7f60fda42a39be82ebfe51", "difficulty": 1200, "tags": ["brute force", "constructive algorithms", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9997521070897373, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "using System;\n\nnamespace CF587.C\n{\n public class Rectangle\n {\n public int MinX { get; set; }\n public int MinY { get; set; }\n\n public int MaxX { get; set; }\n public int MaxY { get; set; }\n }\n\n public enum OverlapType\n {\n Partial,\n Full,\n No,\n Right,\n Top,\n Left,\n Bottom,\n }\n\n public class Program\n {\n public static OverlapType GetOverlapType(Rectangle r1, Rectangle r2)\n {\n if (r2.MinX > r1.MaxX || r2.MaxX < r1.MinX) return OverlapType.No;\n if (r2.MinY > r1.MaxY || r2.MaxY < r1.MinY) return OverlapType.No;\n if (r2.MinX <= r1.MinX && r2.MaxX >= r1.MaxX && r2.MinY <= r1.MinY && r2.MaxY >= r1.MaxY) return OverlapType.Full;\n if (r2.MinX <= r1.MinX && r2.MaxX >= r1.MaxX && r2.MinY <= r1.MinY && r2.MaxY < r1.MaxY) return OverlapType.Bottom;\n if (r2.MinX <= r1.MinX && r2.MaxX >= r1.MaxX && r2.MinY > r1.MinY && r2.MaxY >= r1.MaxY) return OverlapType.Top;\n if (r2.MinX <= r1.MinX && r2.MaxX < r1.MaxX && r2.MinY <= r1.MinY && r2.MaxY >= r1.MaxY) return OverlapType.Left;\n if (r2.MinX > r1.MinX && r2.MaxX >= r1.MaxX && r2.MinY <= r1.MinY && r2.MaxY >= r1.MaxY) return OverlapType.Right;\n return OverlapType.Partial;\n }\n\n public static void Main(string[] args)\n {\n var firstStr = Console.ReadLine()?.Split(' ') ?? throw new ArgumentNullException();\n var secondStr = Console.ReadLine()?.Split(' ') ?? throw new ArgumentNullException();\n var thirdStr = Console.ReadLine()?.Split(' ') ?? throw new ArgumentNullException();\n\n var white = new Rectangle\n {\n MinX = int.Parse(firstStr[0]),\n MinY = int.Parse(firstStr[1]),\n MaxX = int.Parse(firstStr[2]),\n MaxY = int.Parse(firstStr[3]),\n };\n\n var b1 = new Rectangle\n {\n MinX = int.Parse(secondStr[0]),\n MinY = int.Parse(secondStr[1]),\n MaxX = int.Parse(secondStr[2]),\n MaxY = int.Parse(secondStr[3]),\n };\n\n var b2 = new Rectangle\n {\n MinX = int.Parse(thirdStr[0]),\n MinY = int.Parse(thirdStr[1]),\n MaxX = int.Parse(thirdStr[2]),\n MaxY = int.Parse(thirdStr[3]),\n };\n\n var firstOverlap = GetOverlapType(white, b1);\n var secondOverlap = GetOverlapType(white, b2);\n\n var result = \"YES\";\n switch (firstOverlap)\n {\n case OverlapType.Full:\n result = \"NO\";\n break;\n\n case OverlapType.No:\n case OverlapType.Partial:\n if (secondOverlap == OverlapType.Full) result = \"NO\";\n break;\n\n case OverlapType.Right:\n if (secondOverlap == OverlapType.Full) result = \"NO\";\n if (secondOverlap == OverlapType.Left && b2.MaxX >= b1.MinY) result = \"NO\";\n break;\n\n case OverlapType.Top:\n if (secondOverlap == OverlapType.Full) result = \"NO\";\n if (secondOverlap == OverlapType.Bottom && b2.MaxY >= b1.MinY) result = \"NO\";\n break;\n\n case OverlapType.Left:\n if (secondOverlap == OverlapType.Full) result = \"NO\";\n if (secondOverlap == OverlapType.Right && b1.MaxX >= b2.MinX) result = \"NO\";\n break;\n\n case OverlapType.Bottom:\n if (secondOverlap == OverlapType.Full) result = \"NO\";\n if (secondOverlap == OverlapType.Top && b1.MaxY >= b2.MinY) result = \"NO\";\n break;\n\n default:\n throw new ArgumentOutOfRangeException();\n }\n\n Console.WriteLine(result);\n }\n }\n}", "lang": "Mono C#", "bug_code_uid": "2daef6c61993e6b44333741912804be7", "src_uid": "05c90c1d75d76a522241af6bb6af7781", "apr_id": "6fd68479b48813d7b3fd1ea21363ab62", "difficulty": 1700, "tags": ["geometry", "math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.5396145610278372, "equal_cnt": 12, "replace_cnt": 5, "delete_cnt": 1, "insert_cnt": 6, "fix_ops_cnt": 12, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\n\nnamespace ProgrammingContest.Codeforces.Round11\n{\n class B\n {\n static long g(long x)\n {\n return x * (x + 1) / 2;\n }\n\n static long f(long x)\n {\n long l = 0, h = x;\n long v = -1;\n while (true)\n {\n v = (l + h)/2;\n long a = g(v), b = g(v+1);\n if (a <= x && b > x) break;\n if (a > x) h = v - 1;\n else l = v + 1;\n }\n return v;\n }\n\n public static void Main()\n {\n long x = long.Parse(Console.ReadLine());\n long a = f(x);\n long b = g(a);\n Console.WriteLine(a + (x - b) * 2);\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "aeddae6157bc4f554cea63e98a856a4b", "src_uid": "18644c9df41b9960594fdca27f1d2fec", "apr_id": "66282658fa999f5bdc13e732c3e000ee", "difficulty": 1600, "tags": ["math"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.47686832740213525, "equal_cnt": 11, "replace_cnt": 3, "delete_cnt": 1, "insert_cnt": 7, "fix_ops_cnt": 11, "bug_source_code": "using System;\nusing System.Linq;\n\nnamespace Codeforces\n{\n internal static class Program\n {\n private static void Main()\n {\n var n = long.Parse(Console.ReadLine());\n\n long count = 0;\n\n for (var i = 1; i <= n; i++)\n {\n if (new long[] { 5, 7, 8, 9, 10 }.All(div => i % div == 0))\n {\n count++;\n }\n }\n\n Console.WriteLine(count);\n }\n }\n}", "lang": "MS C#", "bug_code_uid": "f162d137ee98e10241d99a444a076063", "src_uid": "8551308e5ff435e0fc507b89a912408a", "apr_id": "277a8849b724a387b8accc813ebdb064", "difficulty": 1100, "tags": ["math", "number theory"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.943794794417201, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 3, "bug_source_code": "class Program\n {\n private static double SqrDistance(double x1, double y1, double x2, double y2)\n {\n return (x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2);\n }\n\n static void Main()\n {\n string input = Console.ReadLine();\n string[] intputNumbers = input.Split(' ');\n\n double x, y;\n x = Convert.ToInt64(intputNumbers[0]);\n y = Convert.ToInt64(intputNumbers[1]);\n\n double x1 = 0, y1 = 0, x2 = 0, y2 = 0;\n double height = Math.Sqrt(SqrDistance(x, y, x, 0));\n\n if(x > 0 && y > 0)\n Console.Write(0.ToString() + \" \" + (x + height).ToString() + \" \" + (x + height).ToString() + \" \" + 0.ToString());\n else if(x < 0 && y > 0)\n Console.Write((x - height).ToString() + \" \" + 0.ToString() + \" \" + 0.ToString() + \" \" + (-x + height).ToString());\n else if (x < 0 && y < 0)\n Console.Write((x - height).ToString() + \" \" + 0.ToString() + \" \" + 0.ToString() + \" \" + (x - height).ToString());\n else if (x > 0 && y < 0)\n Console.Write(0.ToString() + \" \" + (x + height).ToString() + \" \" + (x + height).ToString() + \" \" + 0.ToString());\n }\n }", "lang": "MS C#", "bug_code_uid": "548fa8c97631e0c1e93e733244b2611e", "src_uid": "e2f15a9d9593eec2e19be3140a847712", "apr_id": "18af3a37a4322bb6875da43e9e9eb927", "difficulty": 1000, "tags": ["math", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.9887302779864763, "equal_cnt": 1, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "public class Program{\n public static void Main(){\n int x, y;\n string[] line = Console.ReadLine().Split(' ');\n x = int.Parse(line[0]);\n y = int.Parse(line[1]);\n \n int sum = Math.Abs(x) + Math.Abs(y);\n \n if(x > 0 && y > 0)\n Console.WriteLine(\"{0} {1} {2} {3}\", 0, sum, sum, 0);\n else if(x > 0 && y < 0) \n Console.WriteLine(\"{0} {1} {2} {3}\", 0, -sum, sum, 0);\n else if(x < 0 && y > 0) \n Console.WriteLine(\"{0} {1} {2} {3}\", -sum, 0, 0, sum);\n else \n Console.WriteLine(\"{0} {1} {2} {3}\", -sum, 0, 0, -sum);\n }\n}", "lang": "MS C#", "bug_code_uid": "03a63e29c9d26a28114505cabbd59314", "src_uid": "e2f15a9d9593eec2e19be3140a847712", "apr_id": "48cbe43f71c54436f6c1989225e7e28e", "difficulty": 1000, "tags": ["math", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.010843781768891902, "equal_cnt": 11, "replace_cnt": 10, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 11, "bug_source_code": "\n\n \n \n Debug\n AnyCPU\n {26DE0CF0-FAFD-4D67-BDCC-4CB8493E45C1}\n Exe\n lessons\n lessons\n v4.6.1\n 512\n true\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": "MS C#", "bug_code_uid": "b1f1bbae55abc9f44b4376cea6c434da", "src_uid": "80520be9916045aca3a7de7bc925af1f", "apr_id": "43b9a5270c5c6dbb421eb1e52eda60d9", "difficulty": 900, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9255419415645617, "equal_cnt": 10, "replace_cnt": 1, "delete_cnt": 5, "insert_cnt": 3, "fix_ops_cnt": 9, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\n\nnamespace ConsoleApplication2\n{\n class Program\n {\n static void Main(string[] args)\n {\n const int d = 3;\n const int f = 36;\n double sm;\n sm =Convert.ToDouble(Console.ReadLine());\n double k = sm / f;\n double s = (k % 1) *12;\n Console.WriteLine(Convert.ToInt16(k) + \" \" + Convert.ToInt16(Math.Round(s)));\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "93a29b142dfb1ab1c37c15cfce4f1770", "src_uid": "5d4f38ffd1849862623325fdbe06cd00", "apr_id": "1dfcd8bc61d8e30f2ffb9aa63534e6ab", "difficulty": 1400, "tags": ["math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "C#"} {"similarity_score": 0.9345372460496614, "equal_cnt": 4, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 3, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\n\nnamespace Artyom\n{\n class Program\n {\n static void Main(string[] args)\n {\n int n = Convert.ToInt32(Console.ReadLine());\n int b = n / 36;\n n = n%36;\n int a = n / 3;\n if (n % 3 > 1) a = a + 1;\n Console.WriteLine(b + \" \" + a);\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "099346a412da81e04c70da50ae0af6d9", "src_uid": "5d4f38ffd1849862623325fdbe06cd00", "apr_id": "054cdd1f30ea7b387e694dfc14f9b100", "difficulty": 1400, "tags": ["math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.9931573802541545, "equal_cnt": 5, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 4, "fix_ops_cnt": 4, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace CF_QueueSchool\n{\n class Program\n {\n static void Main(string[] args)\n {\n string[] tmp = Console.ReadLine().Split(' ');\n string q = Console.ReadLine();\n int n = int.Parse(tmp[1]);\n while(n-- >0)\n {\n q = q.Replace(\"BG\", \"GB\");\n }\n Console.WriteLine(qu);\n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "4039d73dda86715053da81f1bbe183a3", "src_uid": "964ed316c6e6715120039b0219cc653a", "apr_id": "6d951c5be876e39a4621c34e4ae66cb7", "difficulty": 800, "tags": ["shortest paths", "constructive algorithms", "implementation", "graph matchings"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.9851909586905689, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "using System;\n\nnamespace CodeForces\n{\n class Program\n {\n static void Main(string[] args)\n {\n var maxVolume = 0;\n var charCount = Console.ReadLine();\n var sentance = Console.ReadLine();\n var words = sentance.Split(' ');\n\n foreach (var word in words)\n {\n var capsCount = word.Where(c => c.ToString() == c.ToString().ToUpper()).Count();\n\n if (capsCount > maxVolume)\n {\n maxVolume = capsCount;\n }\n }\n Console.WriteLine(maxVolume);\n }\n }\n}", "lang": "MS C#", "bug_code_uid": "19b2677c58cab38e2d7b35d801ea3502", "src_uid": "d3929a9acf1633475ab16f5dfbead13c", "apr_id": "7cba532b08acfcf3ed3e3acc45a55c06", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.9992864787727435, "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;\n\nnamespace acm\n{\n class Program\n {\n static void Main(string[] args)\n {\n int n = nextInt();\n long ans = 0;\n for (int i = 0; i < 9; ++i)\n {\n for (int j = 0; j < 9; j++)\n {\n for (int k = 0; k < 9; k++) if( j * k % 9 == i )\n {\n ans += calc(j, n) * calc(k, n) * calc(i, n);\n }\n }\n }\n int[] e = new int[n + 1];\n for (int i = 2; i < n + 1; i++)\n {\n if( e[i] == 0 )\n for (int j = i + i; j < n + 1; j+=i)\n {\n e[j] = i;\n }\n }\n -- ans;\n for (int i = 2; i < n + 1; i++) if (e[i] > 0)\n {\n List a = new List();\n int j;\n for (j = i; e[j] != 0; j /= e[j]) a.Add(e[j]);\n a.Add(j);\n var l = from v in a orderby v select v;\n long cnt = 1;\n int lst = -1;\n long cur = 0;\n foreach (var z in l)\n {\n if (z != lst)\n {\n cnt *= (cur + 1);\n cur = 0;\n }\n ++cnt;\n lst = z;\n }\n cnt *= (cur + 1);\n //o(cnt);\n ans -= cnt;\n }\n else ans -= 2;\n o(ans);\n }\n\n static long calc(int a, int n)\n {\n n -= a;\n if (a != 0) n += 9;\n return n / 9;\n }\n\n\n static string inp = null;\n static string[] inps = null;\n static int icur = -1;\n static string nextToken()\n {\n while (inps == null || icur == inps.Length)\n {\n icur = 0;\n inp = Console.ReadLine();\n inps = inp.Split(\" \\t\".ToCharArray(), StringSplitOptions.RemoveEmptyEntries);\n }\n return inps[icur++];\n }\n static int nextInt()\n {\n return int.Parse(nextToken());\n }\n static long nextLong()\n {\n return long.Parse(nextToken());\n }\n static double nextDouble()\n {\n return double.Parse(nextToken());\n }\n static void o( params object[] a )\n {\n Console.WriteLine(String.Join(\" \", (from v in a select v.ToString()).ToArray()));\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "eaf78cd3a93e8f72bd4b2a55fd4ed052", "src_uid": "fc133fe6353089a0ebee08dec919f608", "apr_id": "750b86d7f8398a04948e7c419f1ab0ad", "difficulty": 2000, "tags": ["number theory"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9781164942841589, "equal_cnt": 18, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 16, "fix_ops_cnt": 17, "bug_source_code": "#if DEBUG\nusing System.Reflection;\nusing System.Threading.Tasks;\n#endif\n\nusing System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\nusing System.Text;\nusing System.Numerics;\nusing System.Globalization;\n\n\nnamespace _10_c\n{\n class Program\n {\n static string _inputFilename = \"input.txt\";\n static string _outputFilename = \"output.txt\";\n static bool _useFileInput = false;\n\n\n static void Main(string[] args)\n {\n StreamWriter file = null;\n#if DEBUG\n\t\t\tConsole.SetIn(getInput());\n#else\n if (_useFileInput)\n {\n Console.SetIn(File.OpenText(_inputFilename));\n file = new StreamWriter(_outputFilename);\n Console.SetOut(file);\n }\n#endif\n\n try\n {\n solution();\n }\n finally\n {\n if (_useFileInput)\n {\n file.Close();\n }\n }\n }\n\n static void solution()\n {\n #region SOLUTION\n var n = readInt();\n var cs = new long[10];\n var vs = new long[n + 1];\n for (int i = 1; i < n + 1; i++)\n {\n vs[i] = getSum(i);\n cs[vs[i]]++;\n }\n\n var total = 0L;\n for (int i = 1; i < 10; i++)\n {\n for (int j = 1; j < 10; j++)\n {\n var next = getSum(i * j);\n var val = cs[i] * cs[j];\n //if (i == j)\n //{\n // val = cs[i] * cs[i - 1] / 2;\n //}\n\n if (val * cs[next] > 0)\n {\n total += val * cs[next];\n }\n \n }\n }\n\n //total += (cs[1] * (cs[1] - 1) / 2);\n //total += (cs[2] * cs[1]);\n //total += (cs[3] * cs[1]);\n //total += (cs[4] * cs[1] + cs[2] * (cs[2] - 1) / 2);\n //total += (cs[5] * cs[1]);\n //total += (cs[6] * cs[1] + cs[3] * cs[2]);\n //total += (cs[7] * cs[1]);\n //total += (cs[8] * cs[1] + cs[2] * cs[4]);\n //total += (cs[9] * cs[1] + cs[3] * (cs[3] - 1) / 2);\n\n var remc = 0L;\n for (int i = 1; i < n + 1; i++)\n {\n var end = (int)Math.Floor(Math.Sqrt(i));\n for (int j = 1; j <= end; j++)\n {\n var rem = i % j;\n var another = i / j;\n if (rem == 0)\n {\n if (another == j)\n {\n remc++;\n }\n else\n {\n remc += 2;\n }\n \n }\n }\n }\n\n total -= remc;\n Console.WriteLine(total);\n\n //var n = readInt();\n //var m = readInt();\n\n //var a = readIntArray();\n //var b = readIntArray();\n #endregion\n }\n\n static int getSum(int a)\n {\n if (a < 10)\n {\n return a;\n }\n\n var val = a;\n var sum = 0;\n while (true)\n {\n sum += (val % 10);\n val /= 10;\n if (val == 0)\n {\n break;\n }\n }\n\n return getSum(sum);\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[] readIntArray()\n {\n return Console.ReadLine().Split(' ').Where(i => !string.IsNullOrEmpty(i)).Select(i => int.Parse(i)).ToArray();\n }\n\n static long[] readLongArray()\n {\n return Console.ReadLine().Split(' ').Where(i => !string.IsNullOrEmpty(i)).Select(i => long.Parse(i)).ToArray();\n }\n\n#if DEBUG\n\t\tstatic StreamReader getInput()\n\t\t{\n\t\t\tvar resName = Assembly.GetCallingAssembly().GetManifestResourceNames()[0];\n\t\t\tvar resource = Assembly.GetCallingAssembly().GetManifestResourceStream(resName);\n\n\t\t\treturn new StreamReader(resource);\n\t\t}\n#endif\n }\n}\n", "lang": "MS C#", "bug_code_uid": "3b431ca1cea67316db6568da25b20a59", "src_uid": "fc133fe6353089a0ebee08dec919f608", "apr_id": "c0de7ff20eb70f6a4069858fc0498282", "difficulty": 2000, "tags": ["number theory"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.868125, "equal_cnt": 27, "replace_cnt": 5, "delete_cnt": 4, "insert_cnt": 17, "fix_ops_cnt": 26, "bug_source_code": "using System;\n\nnamespace CodefCS\n{\n class Program\n {\n static void Main(string[] args)\n {\n string[] tokens = Console.ReadLine().Split();\n int[] m = new int[105];\n int[] d = new int[105];\n int[] f = new int[105];\n\n int n = int.Parse(tokens[0]);\n int k= int.Parse(tokens[1]);\n\n int i=0;\n tokens = Console.ReadLine().Split();\n\n while (i < k)\n {\n m[i] = int.Parse(tokens[i]);\n i++;\n }i = 1;\n\n int a= m[0];\n int b;\n\n while (i < k)\n {\n if (m[i] - a > 0)b = m[i] - a;\n else b = n - a + m[i];\n\n if (f[b] == 1) { Console.WriteLine(-1);return;}\n\n f[b]++;\n d[a - 1] = b;\n a = m[i];\n i++;\n }i = 0;int j = 1;\n\n while (i < n)\n {\n if (d[i] == 0)\n {\n \n while (j <= n)\n {\n if (f[j] == 0)\n {\n m[i] = j;\n break;\n }\n j++;\n }\n }\n }\n\n while (i < n)\n {\n Console.WriteLine(d[i]+\" \");\n i++;\n }\n }\n }\n}", "lang": "MS C#", "bug_code_uid": "608a756f4ceeb2d29af45d6b29fee065", "src_uid": "4a7c959ca279d0a9bd9bbf0ce88cf72b", "apr_id": "ecf1f006f19eee6c3918f844f7e4fa3e", "difficulty": 1600, "tags": ["implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.02040320621811999, "equal_cnt": 21, "replace_cnt": 19, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 21, "bug_source_code": "\n\n \n \n Debug\n AnyCPU\n {AA9407D8-33A6-4D68-99B9-E3D10DE61119}\n Exe\n Properties\n IgraPerestanovka\n IgraPerestanovka\n v4.5\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": "MS C#", "bug_code_uid": "8ee6eb0eda66180db9e28425f63389ef", "src_uid": "4a7c959ca279d0a9bd9bbf0ce88cf72b", "apr_id": "d225aa8fc3f3154ffbac0a780bc899c5", "difficulty": 1600, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9493589743589743, "equal_cnt": 8, "replace_cnt": 3, "delete_cnt": 3, "insert_cnt": 1, "fix_ops_cnt": 7, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\n\nnamespace task121A\n{\n class Program\n {\n static List MyList = new List();\n static List lst = new List();\n static void NewCh(string s)\n {\n if (s.Length == 11) return;\n MyList.Add(s);\n NewCh(s + \"4\");\n NewCh(s + \"7\");\n }\n\n static Int64 GetNumber(Int32 number)\n {\n Int64 result = 0; \n for (Int32 i = 0; i < MyList.Count; i++)\n {\n if (lst[i] >= number)\n {\n result = lst[i];\n break;\n }\n }\n return result;\n }\n static void Main(string[] args)\n {\n NewCh(\"4\");\n NewCh(\"7\");\n for(Int32 i = 0;i= b)\n {\n var whole = a/b;\n a -= whole*b;\n a += whole;\n res += whole;\n }\n Console.WriteLine(res);\n }\n }\n}", "lang": "MS C#", "bug_code_uid": "f27c39dba8b956b7efb5cd1ddb58cda1", "src_uid": "a349094584d3fdc6b61e39bffe96dece", "apr_id": "a6e8380816be78d7a75a3491590f004b", "difficulty": 1000, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.8273224043715847, "equal_cnt": 5, "replace_cnt": 3, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 4, "bug_source_code": "using System;\nusing System.Linq;\nusing System.Collections.Generic;\nusing System.Numerics;\n\nclass Program\n{\n public static void Main(string[] args)\n {\n //MulticaseTest();\n //int[] input = Console.ReadLine().Split().Select(int.Parse).ToArray();\n int n = int.Parse(Console.ReadLine());\n int[] input = Console.ReadLine().Split().Select(int.Parse).ToArray();\n if (input.All(x => x >= 0)) Console.WriteLine(input.Sum());\n else\n {\n int C = input.Min();\n List vals = input.ToList();\n vals.Remove(C);\n int val = vals.Sum() + Math.Abs(C);\n Console.WriteLine(val);\n }\n }\n\n public static void MulticaseTest()\n {\n //4\n //4 5 2 3\n int t = int.Parse(Console.ReadLine());\n List o = new List(t);\n for (int i = 0; i < t; i++)\n {\n int n = int.Parse(Console.ReadLine());\n \n }\n o.ForEach(Console.WriteLine);\n }\n}", "lang": "Mono C#", "bug_code_uid": "e8223bc34a7ef4e8e1f2957cf6906487", "src_uid": "4b5d14833f9b51bfd336cc0e661243a5", "apr_id": "42b47638faabda71a6927aa928cd6242", "difficulty": 800, "tags": ["greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.43614457831325304, "equal_cnt": 15, "replace_cnt": 9, "delete_cnt": 4, "insert_cnt": 2, "fix_ops_cnt": 15, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace _14._03._2018\n{\n class Program\n {\n static void Main(string[] args)\n {\n int n = int.Parse(Console.ReadLine());\n short[] mas = new short[n];\n int B = 0;\n int C = 0;\n int MaxIntersection = 0;\n string[] temp = Console.ReadLine().Split();\n\n for (int i = 0; i=0; i--)\n {\n B -= mas[i];\n C += mas[i];\n if (B - C > MaxIntersection)\n MaxIntersection = B - C;\n }\n Console.WriteLine(MaxIntersection);\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "96de672a6b28c7cf6885212d7f7e8615", "src_uid": "4b5d14833f9b51bfd336cc0e661243a5", "apr_id": "5b31801128583775cba2c7e9ca748090", "difficulty": 800, "tags": ["greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.027096301720981326, "equal_cnt": 28, "replace_cnt": 24, "delete_cnt": 1, "insert_cnt": 4, "fix_ops_cnt": 29, "bug_source_code": "\nMicrosoft Visual Studio Solution File, Format Version 12.00\n# Visual Studio 2013\nVisualStudioVersion = 12.0.21005.1\nMinimumVisualStudioVersion = 10.0.40219.1\nProject(\"{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}\") = \"Sleuth\", \"Sleuth\\Sleuth.csproj\", \"{07CE28F7-8E8A-4E2B-BC41-0E80EED8755F}\"\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{07CE28F7-8E8A-4E2B-BC41-0E80EED8755F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{07CE28F7-8E8A-4E2B-BC41-0E80EED8755F}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{07CE28F7-8E8A-4E2B-BC41-0E80EED8755F}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{07CE28F7-8E8A-4E2B-BC41-0E80EED8755F}.Release|Any CPU.Build.0 = Release|Any CPU\n\tEndGlobalSection\n\tGlobalSection(SolutionProperties) = preSolution\n\t\tHideSolutionNode = FALSE\n\tEndGlobalSection\nEndGlobal\n", "lang": "MS C#", "bug_code_uid": "3999c4177424089516baadbbd9b8f94c", "src_uid": "dea7eb04e086a4c1b3924eff255b9648", "apr_id": "cfeb06cc5e6837ee45054a4f1415837a", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9718159115233678, "equal_cnt": 13, "replace_cnt": 6, "delete_cnt": 2, "insert_cnt": 4, "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 _49A\n{\n class Program\n {\n static void Main(string[] args)\n {\n string x = Console.ReadLine();\n string y;\n char z;\n y = x.Remove(x.IndexOf('?'));\n if (y[y.Length-1]!=' ')\n {\n z = char.Parse(x.Substring(x.Length - 2, 1).ToLower());\n }\n else\n {\n z = char.Parse(x.Substring(x.Length - 3, 1).ToLower());\n }\n \n switch (z)\n {\n case 'a':\n Console.WriteLine(\"YES\");\n break;\n case 'o':\n Console.WriteLine(\"YES\");\n break;\n case 'y':\n Console.WriteLine(\"YES\");\n break;\n case 'e':\n Console.WriteLine(\"YES\");\n break;\n case 'u':\n Console.WriteLine(\"YES\");\n break;\n case 'i':\n Console.WriteLine(\"YES\");\n break;\n default:\n Console.WriteLine(\"NO\");\n break; \n }\n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "0fc8bc526f585b6302befcc76a6c9801", "src_uid": "dea7eb04e086a4c1b3924eff255b9648", "apr_id": "891c31852f735ee666dfd27c8e56d5d2", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.8435443037974684, "equal_cnt": 6, "replace_cnt": 3, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 5, "bug_source_code": "using System;\nusing System.IO;\nusing System.Collections.Generic;\nusing System.Linq;\n\npublic class Task\n{\n\tpublic static int SumAbs(IEnumerable a)\n\t{\n\t\tvar s = 0;\n\t\tvar d = a.First();\n\t\tvar t = 0;\n\t\tforeach (var i in a)\n\t\t{\n\t\t\ts += Math.Abs(i - d) * t;\n\t\t\tt = 1 - t;\n\t\t\td = i;\n\t\t}\n\t\treturn s;\n\t}\n\n\tpublic static Tuple TwoRand(int max)\n\t{\n\t\tvar r = new Random();\n\t\tvar r1 = r.Next(max);\n\t\tvar r2 = r.Next(max);\n\t\twhile (r1 == r2)\n\t\t{\n\t\t\tr2 = r.Next(max);\n\t\t}\n\t\treturn new Tuple(r1, r2);\n\t}\n\n\tpublic static void Main()\n\t{\n\t\t#region Settings\n\n\t\tStreamReader In;\n\t\tStreamWriter Out;\n\t\ttry\n\t\t{\n\t\t\t//System.Threading.Thread.CurrentThread.CurrentCulture =\n\t\t\t//\tSystem.Globalization.CultureInfo.InvariantCulture;\n\t\t}\n\t\tfinally\n\t\t{\n#if file\n\t\t\tDirectory.SetCurrentDirectory(new DirectoryInfo(Directory.GetCurrentDirectory()).Parent.FullName);\n\t\t\tIn = new StreamReader(\"input.txt\");\n\t\t\tOut = new StreamWriter(\"output.txt\");\n#else\n\t\t\tIn = new StreamReader(Console.OpenStandardInput());\n\t\t\tOut = new StreamWriter(Console.OpenStandardOutput());\n#endif\n\t\t}\n\n\t\t#endregion\n\n\t\tvar n = Int32.Parse(In.ReadLine());\n\t\tvar s = In.ReadLine().Split();\n\t\tvar a = (from i in s select Int32.Parse(i)).ToList();\n\n\t\ta.Sort();\n\n\t\tvar mn = Int32.MaxValue;\n\t\tfor (var i = 0; i < 5000000; i++)\n\t\t{\n\t\t\tvar b = new List(a);\n\t\t\tvar r = TwoRand(b.Count);\n\t\t\tb.RemoveAt(Math.Max(r.Item1, r.Item2));\n\t\t\tb.RemoveAt(Math.Min(r.Item1, r.Item2));\n\t\t\tmn = Math.Min(mn, SumAbs(b));\n\t\t}\n\n\t\tOut.WriteLine(mn);\n\n\t\t//var mx = 0;\n\t\t//var r1 = 0;\n\t\t//var r2 = 0;\n\t\t//for (var i = 0; i < n * 2; i++)\n\t\t//{\n\t\t//\tfor (var j = 0; j < n * 2; j++)\n\t\t//\t{\n\t\t//\t\tif (mx < Math.Abs(a[i] - a[j]))\n\t\t//\t\t{\n\t\t//\t\t\tr1 = i;\n\t\t//\t\t\tr2 = j;\n\t\t//\t\t\tmx = Math.Abs(a[i] - a[j]);\n\t\t//\t\t}\n\t\t//\t}\n\t\t//}\n\n\t\t//a.RemoveAt(Math.Max(r1, r2));\n\t\t//a.RemoveAt(Math.Min(r1, r2));\n\n\t\t//var sum = 0;\n\t\t//for (var i = 0; i < a.Count - 3; i++)\n\t\t//{\n\t\t//\tsum += Math.Abs(a[i + 1] - a[i]);\n\t\t//}\n\n\t\t//Out.WriteLine(sum);\n\n\t\tOut.Close();\n\t}\n}\n", "lang": "MS C#", "bug_code_uid": "6ab69b2cbfdb26ef9601beb8dfebf3ba", "src_uid": "76659c0b7134416452585c391daadb16", "apr_id": "5ec4642c46edc2457e542777660705cc", "difficulty": 1500, "tags": ["greedy", "brute force", "sortings"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.04747774480712166, "equal_cnt": 20, "replace_cnt": 19, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 21, "bug_source_code": "\nMicrosoft Visual Studio Solution File, Format Version 12.00\n# Visual Studio Express 2012 for Windows Desktop\nProject(\"{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}\") = \"ConsoleApplication8\", \"ConsoleApplication8\\ConsoleApplication8.csproj\", \"{FD1BEE57-667E-4A93-A1F0-9A453E5F0534}\"\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{FD1BEE57-667E-4A93-A1F0-9A453E5F0534}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{FD1BEE57-667E-4A93-A1F0-9A453E5F0534}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{FD1BEE57-667E-4A93-A1F0-9A453E5F0534}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{FD1BEE57-667E-4A93-A1F0-9A453E5F0534}.Release|Any CPU.Build.0 = Release|Any CPU\n\tEndGlobalSection\n\tGlobalSection(SolutionProperties) = preSolution\n\t\tHideSolutionNode = FALSE\n\tEndGlobalSection\nEndGlobal\n", "lang": "Mono C#", "bug_code_uid": "c0ee3db0edcc758eaaa05dd245bc4f29", "src_uid": "d04fa4322a1b300bdf4a56f09681b17f", "apr_id": "30609efe4233371ef1927b294185772e", "difficulty": 1000, "tags": ["math", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.8435923309788093, "equal_cnt": 5, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 4, "bug_source_code": "using System;\n\nclass Program\n{\n\tstatic void Main()\n\t{\n\t\tint n = Convert.ToInt32(Console.ReadLine());\n\t\tstring inp = Console.ReadLine();\n\t\tstring[] par = inp.Split(' ');\n\t\tint i, d, prognoz;\n\n\t\tint[] a = new int[n];\n\n\t\tfor (i = 0; i < n; i++)\n\t\t\ta[i] = Convert.ToInt32(par[i]);\n\n\t\td = (a[n - 1] - a[0]) / (n - 1);\n\t\tif (d == a[1] - a[0])\n\t\t\tprognoz = a[n - 1] + d;\n\t\telse\n\t\t\tprognoz = a[n - 1];\n\n\t\tConsole.WriteLine(\"{0}\", prognoz);\n\t}\n}\n", "lang": "Mono C#", "bug_code_uid": "0da0bc5d40533844f323f615503ec427", "src_uid": "d04fa4322a1b300bdf4a56f09681b17f", "apr_id": "0986d2a4a8a68062922bc109f39ac38c", "difficulty": 1000, "tags": ["math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.8990136214185064, "equal_cnt": 14, "replace_cnt": 7, "delete_cnt": 2, "insert_cnt": 4, "fix_ops_cnt": 13, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\n\nnamespace CodeForces\n{\n static class Reader\n {\n public static int NextInt()\n {\n int ret = 0;\n char c;\n\n while (!char.IsDigit(c = (char)Console.Read()))\n {\n if (c == '-')\n return -NextInt();\n }\n do\n {\n ret = ret * 10 + c - '0';\n } while (char.IsDigit(c = (char)Console.Read()));\n\n return ret;\n }\n\n public static double NextDouble()\n {\n double ret = 0;\n char c;\n\n while (!char.IsDigit(c = (char)Console.Read())) \n {\n if (c == '-')\n return -NextDouble();\n }\n do\n {\n ret = ret * 10 + c - '0';\n } while (char.IsDigit(c = (char)Console.Read()));\n if (c != '.') return ret;\n\n double p10 = 0.1;\n while (char.IsDigit(c = (char)Console.Read()))\n {\n ret += p10 * (c - '0');\n }\n\n return ret;\n }\n }\n\n class Program\n {\n static long[,] memo;\n static bool[,] done;\n\n static long Rec(int n, int h)\n {\n h = Math.Max(0, h);\n if (n <= 0 || (n == 1 && h <= 1))\n return 1;\n if (n < h)\n return 0;\n if (done[n, h])\n return memo[n, h];\n\n long ret = 0;\n for (int i = 1; i <= n; ++i)\n ret += Rec(i - 1, h - 1) * Rec(n - i, h - 1);\n done[n, h] = true;\n return memo[n, h] = ret;\n }\n\n static void Main(string[] args)\n {\n int n = Reader.NextInt(), h = Reader.NextInt();\n memo = new long[36, 36];\n done = new bool[36, 36];\n Console.WriteLine(Rec(n, h));\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "94461b9fe520530a6a130d2e2e416ad5", "src_uid": "faf12a603d0c27f8be6bf6b02531a931", "apr_id": "f209f23833772e01264f8c5a2d956298", "difficulty": 1900, "tags": ["divide and conquer", "dp", "combinatorics"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9943181818181818, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Text;\n\nnamespace A.Theatre_Square\n{\n class Program\n {\n static int sq2(int k)\n {\n return (1 << k) - 1;\n }\n\n static void Main(string[] args)\n {\n string[] data = Console.ReadLine().Trim().Split(' ');\n int n = Int32.Parse(data[0]);\n int h = Int32.Parse(data[1]);\n Int64[,] f=new Int64[36,36];\n f[0, 0] = 1;\n f[1, 1] = 1;\n for (int i = 2; i <= n; i++)\n {\n for (int j = i; j <= n; j++)\n {\n for (int k = 0; k <= j - 1; k++)\n {\n for (int l = (int)Math.Ceiling(Math.Log(k + 1, 2)); l <= k; l++)\n {\n for (int r = (int)Math.Ceiling(Math.Log(j - k, 2)); r <= j - k - 1; r++)\n {\n if(l==i-1 || r==i-1)\n f[i, j] += f[l, k] * f[r, j - k - 1];\n }\n }\n }\n }\n }\n Int64 result = 0;\n for (int i = h; i <= n; i++)\n {\n result += f[i, n];\n }\n Console.WriteLine(result);\n Console.ReadKey();\n }\n }\n \n}\n", "lang": "Mono C#", "bug_code_uid": "bd3574f66d4128d49c8155c71fc177ba", "src_uid": "faf12a603d0c27f8be6bf6b02531a931", "apr_id": "c78c38006d25a2b2e7b2b2fca57c9186", "difficulty": 1900, "tags": ["divide and conquer", "dp", "combinatorics"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.8388375165125496, "equal_cnt": 16, "replace_cnt": 8, "delete_cnt": 3, "insert_cnt": 4, "fix_ops_cnt": 15, "bug_source_code": "using System;\n\nnamespace CodeForce\n{\n public class Program\n {\n static void Main(string[] args)\n {\n var input1 = Console.ReadLine();\n var answer = Solve(input1);\n Console.WriteLine(answer);\n }\n\n public static long Solve(string input)\n {\n var candies = long.Parse(input);\n var min = 1L;\n var k = Math.Max(candies / 2, 1);\n var top = k;\n while (top != min)\n {\n var moreThanHalf = VasyaEatsMoreThanHalf(candies, k);\n if (moreThanHalf)\n {\n top = k;\n k /= 2;\n }\n else\n {\n k = (min + top) / 2;\n min++;\n }\n }\n\n return min;\n }\n\n private static bool VasyaEatsMoreThanHalf(long candies, long k)\n {\n var totalCandies = candies;\n var vasya = 0L;\n while (candies > 0)\n {\n candies -= k;\n vasya += k;\n if (candies >= 10)\n {\n var tenPercent = (long)(candies / 10);\n candies -= tenPercent;\n }\n else\n {\n vasya += candies;\n candies = 0;\n }\n }\n\n return vasya >= Math.Ceiling(totalCandies / 2d);\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "67ba52fd9118e6e7de46a898846330f3", "src_uid": "db1a50da538fa82038f8db6104d2ab93", "apr_id": "ae4e87ac0ddf8f6458d149e7b81a96ab", "difficulty": 1500, "tags": ["implementation", "binary search"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.6575916230366492, "equal_cnt": 5, "replace_cnt": 1, "delete_cnt": 2, "insert_cnt": 1, "fix_ops_cnt": 4, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace ConsoleApplication2\n{\n class Program\n {\n static void Main(string[] args)\n {\n Int64 n = int.Parse(Console.ReadLine());\n bool res = true;\n int s = n;\n int temp = 0;\n while (s != 0)\n {\n temp = s % 10;\n if (temp != 7 && temp != 4)\n {\n res = false;\n break;\n }\n s /= 10;\n }\n if (res)\n Console.WriteLine(\"YES\");\n else\n Console.WriteLine(\"NO\");\n // Console.ReadKey();\n // Console.WriteLine(string.Join(\", \", primeNumbers));\n // Console.ReadLine();\n // var line = Console.ReadLine().Split(new[] { ' ' });\n\n }\n }\n}", "lang": "Mono C#", "bug_code_uid": "b3c08723bacc1a566c2af108f92778fc", "src_uid": "33b73fd9e7f19894ea08e98b790d07f1", "apr_id": "2fddc5258d82eae075f6cd5788d031ec", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C#"} {"similarity_score": 0.9098360655737705, "equal_cnt": 11, "replace_cnt": 8, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 10, "bug_source_code": "using System;\nusing System.Linq;\n\nnamespace codeforces\n{\n class Program\n {\n static void Main(string[] args)\n {\n int[] rez = Console.ReadLine().Split().Select(x => int.Parse(x)).ToArray();\n int a = rez[1], b = rez[3];\n int check = (rez[3]>rez[1]?1:0) + (rez[4] rez[0]) a = 1;\n if (--b < 1) b = rez[0];\n if (a==b)\n {\n Console.WriteLine(\"YES\");\n return;\n }\n if (--check>0&& b < a) break;\n }\n Console.WriteLine(\"NO\");\n }\n }\n}", "lang": "Mono C#", "bug_code_uid": "63433afdfa1f366da62edad1d4f886d3", "src_uid": "5b889751f82c9f32f223cdee0c0095e4", "apr_id": "1a08204eba99c2f83187a0e1c9b9f7fe", "difficulty": 900, "tags": ["math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.998371335504886, "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\nnamespace Codeforces\n{\n public static class A\n {\n public static void Main()\n {\n var numbers = Console.ReadLine().Split(' ').Select(s => int.Parse(s)).ToArray();\n var n = numbers[0];\n var a = numbers[1];\n var x = numbers[2];\n var b = numbers[3];\n var y = numbers[4];\n\n var pointA = a;\n var pointB = b;\n while (pointA != x || pointB != y)\n {\n if (pointA == pointB)\n {\n Console.WriteLine(\"YES\");\n return;\n }\n\n if (pointA == n)\n {\n pointA = 1;\n }\n else\n {\n pointA++;\n }\n\n if (pointB == 1)\n {\n pointB = n;\n }\n else\n {\n pointB--;\n }\n }\n if (pointA == pointB)\n {\n Console.WriteLine(\"YES\");\n return;\n }\n\n Console.WriteLine(\"NO\");\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "c394a694ef8a87e6884b554d89ed2b15", "src_uid": "5b889751f82c9f32f223cdee0c0095e4", "apr_id": "a428d747e6f9acf92da611cc27ad1596", "difficulty": 900, "tags": ["math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.8619014573213046, "equal_cnt": 12, "replace_cnt": 5, "delete_cnt": 4, "insert_cnt": 3, "fix_ops_cnt": 12, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\n\nnamespace _LuckySum\n{\n class ProgramLuckySum\n {\n static List GetLuckyNumbers(int length)\n {\n var strNums = new List {\"4\", \"7\"};\n while (strNums[strNums.Count - 1].Length < length)\n {\n var count = strNums.Count;\n for (var i=0; i lastLetter) break;\n Console.Write(\"{0}\", s[0][i]);\n }\n Console.WriteLine(\"{0}\", lastLetter);\n }\n}", "lang": "MS C#", "bug_code_uid": "14ba71d9576281ab389a7de3bea78050", "src_uid": "aed892f2bda10b6aee10dcb834a63709", "apr_id": "aa269a857ef4dc1879a2ee7759308455", "difficulty": 1000, "tags": ["greedy", "brute force", "sortings"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.9897843359818388, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "using System;\nusing System.IO;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Text;\nusing System.Threading.Tasks;\nusing System.Runtime.CompilerServices;\nusing static System.Math;\n \n\nclass P\n{\n static void Main()\n {\n int[] abc = Console.ReadLine().Split().Select(int.Parse).ToArray();\n Console.WriteLine(3 * Min(abc[0] + 1, Min(abc[1], abc[2] - 1)));", "lang": "Mono C#", "bug_code_uid": "fc1c1988c5f713ec79e1bf982187d617", "src_uid": "03ac8efe10de17590e1ae151a7bae1a5", "apr_id": "66fc47825a5d624e5be07edea9dcd060", "difficulty": 800, "tags": ["math", "brute force", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C#"} {"similarity_score": 0.9979879275653923, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "using System;\nusing System.Collections;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\nusing System.Text.RegularExpressions;\n\nnamespace Contest\n{\n class Program\n {\n static void Main(string[] args)\n {\n var ybr = Array.ConvertAll(Console.ReadLine().Split(), Convert.ToInt32);\n int y = ybr[0], b = ybr[1]-1, r = ybr[2]-2;\n Console.WriteLine(3*Math.Min(y,Math.Min(y,r))+3);\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "7cb726c730e30e9031cb574ff006486e", "src_uid": "03ac8efe10de17590e1ae151a7bae1a5", "apr_id": "8b7f806bd4dae04820ec9aff519c3b0e", "difficulty": 800, "tags": ["math", "brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.515673289183223, "equal_cnt": 34, "replace_cnt": 14, "delete_cnt": 1, "insert_cnt": 18, "fix_ops_cnt": 33, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\nusing System.IO;\nusing System.Collections;\n\nnamespace ConsoleApplication34\n{\n class Program\n {\n static void Main(string[] args)\n {\n int x = int.Parse(Console.ReadLine());\n char q = ' ', w = ' ', e = ' ';\n int u = 0;\n char[] a = new char[x];\n string s = Console.ReadLine();\n \n for (int i = 0; i < x; i++)\n {\n a[i] = s[i];\n if (a[0] == '?' || a[x] == '?')\n {\n Console.WriteLine(\"YES\");\n return;\n }\n if (a[i] == '?')\n {\n w = a[i];\n e = q;\n }\n if (a[i] != e && a[i] != '?' && q == '?' && e != '?')\n {\n u = 5;\n }\n if (a[i] == e && a[i] != '?' && q == '?' && e != '?')\n {\n Console.WriteLine(\"YES\");\n u = 0;\n return;\n }\n if (q == a[i] && a[i] != '?')\n {\n Console.WriteLine(\"NO\");\n u = 5;\n return;\n }\n q = a[i];\n }\n if (u == 0)\n Console.WriteLine(\"YES\");\n if (u == 5)\n Console.WriteLine(\"NO\");\n\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "49e7d3403d2fc816861027aa7f87a28c", "src_uid": "f8adfa0dde7ac1363f269dbdf00212c3", "apr_id": "ef0ac3263639c1674ce1c8b1e34468a0", "difficulty": 1300, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.6538102643856921, "equal_cnt": 18, "replace_cnt": 15, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 17, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\nclass Startup\n{\n static void Main()\n {\n int sizeCanvas = int.Parse(Console.ReadLine());\n string inputString = Console.ReadLine();\n\n bool result = false;\n char previous = inputString[0];\n char next = previous;\n\n if (sizeCanvas < 3 && inputString.IndexOf('?')!=-1)\n {\n result = true;\n }\n\n if (previous == '?' || inputString[sizeCanvas] =='?')\n {\n result = true;\n }\n\n for (int i = 1; i < sizeCanvas - 2; i++)\n {\n if (inputString[i] == '?' && ((previous == next) || (previous == '?')||(next=='?')))\n {\n result = true;\n }\n \n previous = inputString[i];\n next = inputString[i + 2];\n }\n \n if (result)\n {\n Console.WriteLine(\"Yes\");\n }\n else\n {\n Console.WriteLine(\"No\");\n }\n\n }\n public static List ReadLineAndParseToList()\n {\n return Console.ReadLine().Split().Select(int.Parse).ToList();\n }\n\n static int[] ReadLineAndParseToArray()\n {\n return Console.ReadLine().Split().Select(int.Parse).ToArray();\n }\n\n public static int[,] TransposeMaxtrix(int[,] matrix)\n {\n int w = matrix.GetLength(0);\n int h = matrix.GetLength(1);\n\n int[,] result = new int[h, w];\n\n for (int i = 0; i < w; i++)\n {\n for (int j = 0; j < h; j++)\n {\n result[j, i] = matrix[i, j];\n }\n }\n return result;\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "ebc98746566313055b6663b81d911883", "src_uid": "f8adfa0dde7ac1363f269dbdf00212c3", "apr_id": "0e2de607b45b60cbf3d63ca06207ca78", "difficulty": 1300, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9829787234042553, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 3, "bug_source_code": "using System;\n\n class Program\n {\n static void Main()\n {\n string s = Console.ReadLine();\n int l = s.Length-1;\n ulong a = 0;\n for (int i = l; i >= 0; i--) {\n if (s[i] == '1') a = ((ulong)a + (ulong) Math.Pow(2, l - i)) % 1000000007;\n }\n a = (a * ((ulong)(Math.Pow(2, l) % 1000000007))) % 1000000007;\n Console.WriteLine(a);\n \n }\n }\n", "lang": "MS C#", "bug_code_uid": "ccbbc82f4e915259e946b1ca2dccb123", "src_uid": "89b51a31e00424edd1385f2120028b9d", "apr_id": "b56f32dd6a81317312dd4fbd7a7fe761", "difficulty": 1600, "tags": ["math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.9440715883668904, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "using System;\n\npublic class Program{\n public static void Main(string[] args){\n string[] input = Console.ReadLine().Split(null);\n int k = Convert.ToInt32(input[0]);\n int a = Convert.ToInt32(input[1]);\n int b = Convert.ToInt32(input[2]);\n\n int a2 = a/k;\n int b2 = b/k;\n\n if(a2 == 0 && b2 == 0) Console.WriteLine(-1);\n else Console.WriteLine(a2+b2);\n \n }\n}", "lang": "MS C#", "bug_code_uid": "329e3673cf01abe77892f442e4ece7d5", "src_uid": "6e3b8193d1ca1a1d449dc7a4ad45b8f2", "apr_id": "893a3d1c01dcc5a6262121add7795879", "difficulty": 1200, "tags": ["math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.9548192771084337, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "using System;\nusing System.Collections.Generic;\n\nnamespace CodeForceCs\n{\n static class Program\n {\n static void Main(string[] args)\n {\n Solver solver = new _Q910B();\n solver.SolveProblem();\n //Console.ReadKey();\n }\n }\n\n abstract class Solver\n {\n abstract public void SolveProblem();\n }\n\n class _Q910B : Solver\n {\n int n, a, b;\n List need = new List();\n override public void SolveProblem()\n {\n n = int.Parse(Console.ReadLine());\n a = int.Parse(Console.ReadLine());\n b = int.Parse(Console.ReadLine());\n\n Console.WriteLine(GetResult());\n }\n\n int GetResult()\n {\n\n if (n >= 4 * a + 2 * b)\n return 1;\n\n if (n >= 2 * a + b)\n return 2;\n\n if (a >= b)\n {\n if (n >= 2 * a)\n return 3;\n\n if (n >= a + b)\n return 4;\n\n if (n >= 2 * b)\n return 5;\n }\n else\n {\n if (n >= a + b)\n return 3;\n\n if (n >= 2 * a)\n return 4;\n }\n return 6;\n }\n }\n\n}\n\n", "lang": "MS C#", "bug_code_uid": "60cec8662041aaa876728440ae5fef23", "src_uid": "1a50fe39e18f86adac790093e195979a", "apr_id": "153544813b4e6918022ef36d9cbd0e4d", "difficulty": 1600, "tags": ["greedy", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9823562891291975, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "using System;\n\nnamespace Обрамление_дверей\n{\n class Program\n {\n static void Main(string[] args)\n {\n int barLength = int.Parse(Console.ReadLine());\n int borderLength = int.Parse(Console.ReadLine());\n int upperBorderLength = int.Parse(Console.ReadLine());\n\n int scrap, barNum = 0, aNum=0,bNum=0;\n\n while (true)\n {\n if (upperBorderLength <= borderLength && bNum < 2 || aNum >= 4 && bNum < 2)\n {\n scrap = barLength;\n barNum++;\n scrap -= upperBorderLength;\n bNum++;\n }\n else if(aNum<4 || bNum>=2 && aNum<4)\n {\n scrap = barLength;\n barNum++;\n scrap -= borderLength;\n aNum++;\n }\n else\n {\n break;\n }\n while (true)\n {\n int aTmp = scrap - borderLength;\n int bTmp = scrap - upperBorderLength;\n if (aTmp>=0&&aTmp<=bTmp&&aNum<4 || aTmp>=0&&aNum<4&&bNum>=2)\n {\n scrap = aTmp;\n aNum++;\n }\n else if (bTmp>=0&&bNum<2 || bTmp >= 0 && bNum < 2 && aNum >= 4)\n {\n scrap = bTmp;\n bNum++;\n }\n else\n {\n break;\n }\n }\n }\n\n Console.WriteLine(barNum);\n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "c9b3f17c2dfd649302d4939baa1f39d6", "src_uid": "1a50fe39e18f86adac790093e195979a", "apr_id": "99088bcbd462ea43cc41c8a309133713", "difficulty": 1600, "tags": ["greedy", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.9937018894331701, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "using System;\n\nnamespace Test\n{\n class Program\n {\n static void Main(string[] args)\n {\n long n = Convert.ToByte(Console.ReadLine());\n long lastEvenPosition, lastOddPosition, evenSum, oddSum;\n\n if (n % 2 == 0)\n {\n lastEvenPosition = n / 2;\n lastOddPosition = n / 2;\n }\n else\n {\n lastOddPosition = (n + 1) / 2;\n lastEvenPosition = (n - 1) / 2;\n }\n\n evenSum = lastEvenPosition * lastEvenPosition + lastEvenPosition;\n oddSum = lastOddPosition * lastOddPosition;\n Console.WriteLine(evenSum - oddSum);\n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "efcf4e5d40db03aabf4c61537b15e1bc", "src_uid": "689e7876048ee4eb7479e838c981f068", "apr_id": "6d4c491b31bc696d838061bc9c190a03", "difficulty": 800, "tags": ["math", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.5159090909090909, "equal_cnt": 9, "replace_cnt": 3, "delete_cnt": 5, "insert_cnt": 1, "fix_ops_cnt": 9, "bug_source_code": "using System;\n\nnamespace Contest\n{\n\tclass Program\n\t{\n\t\tstatic void Main(string[] args)\n\t\t{\n\t\t\twhile (true)\n\t\t\t{\n\t\t\t\tstring s = Console.ReadLine();\n\t\t\t\tstring[] d = s.Split(' ');\n\t\t\t\tlong n = long.Parse(d[0]);\n\t\t\t\tint k = int.Parse(d[1]);\n\t\t\t\tint div = (int)Math.Pow(10, k);\n\t\t\t\tlong nn = n;\n\t\t\t\twhile (n % div != 0)\n\t\t\t\t{\n\t\t\t\t\tn += nn;\n\t\t\t\t}\n\n\t\t\t\tConsole.WriteLine(n);\n\t\t\t}\n\t\t}\n\t}\n}\n", "lang": "Mono C#", "bug_code_uid": "f73de40179c269557327a09e10b4a7bb", "src_uid": "73566d4d9f20f7bbf71bc06bc9a4e9f3", "apr_id": "e10bc2bc5238c0c21c4577a066166d3f", "difficulty": 1100, "tags": ["math", "number theory"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C#"} {"similarity_score": 0.5921521997621879, "equal_cnt": 4, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 4, "bug_source_code": "using System;\n\nnamespace CodeForces\n{\n\tclass A\n\t{\n\t\tstatic void Main(string[] args)\n\t\t{\n\t\t\tstring s = Console.ReadLine();\n\t\t\tstring[] d = s.Split(' ');\n\t\t\tlong n = long.Parse(d[0]);\n\t\t\tint k = int.Parse(d[1]);\n\t\t\tint div = (int)Math.Pow(10, k);\n\t\t\tlong nn = n;\n\n\t\t\twhile (n % div != 0)\n\t\t\t{\n\t\t\t\tn += nn;\n\t\t\t}\n\n\t\t\tConsole.WriteLine(n);\n\t\t}\n\t}\n}\n", "lang": "Mono C#", "bug_code_uid": "5a651df2123a05af5f549a8215471918", "src_uid": "73566d4d9f20f7bbf71bc06bc9a4e9f3", "apr_id": "e10bc2bc5238c0c21c4577a066166d3f", "difficulty": 1100, "tags": ["math", "number theory"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.8614232209737828, "equal_cnt": 8, "replace_cnt": 4, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 7, "bug_source_code": "using System;\n\nnamespace ConsoleApp1\n{\n class Program\n {\n static void Main(string[] args)\n {\n double result = 0;\n var maxValueOfElement = double.Parse(args[0]);\n var desiredSum = double.Parse(args[1]);\n result = Math.Ceiling(desiredSum / maxValueOfElement);\n Console.WriteLine(result);\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "392eb56d57e596f4df18a3d8bc8d44dc", "src_uid": "04c067326ec897091c3dbcf4d134df96", "apr_id": "cd42e484c7091643f3bfc51a594eab32", "difficulty": 800, "tags": ["greedy", "math", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.6144890038809832, "equal_cnt": 12, "replace_cnt": 8, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 11, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace skobka\n{\n class Program\n {\n static void Main(string[] args)\n {\n string[] numbers = Console.ReadLine().Split(' ');\n int countnumb = int.Parse(numbers[0]);\n int sum = int.Parse(numbers[1]);\n List list = new List();\n int count = 0;\n for (int i = 0; i < countnumb; i++)\n {\n list.Add(i + 1);\n }\n int j = countnumb - 1;\n while (sum > 0)\n {\n if (list[j] <= sum)\n {\n sum -= list[j];\n count++;\n }\n else\n j--;\n }\n Console.WriteLine(count);\n //Console.ReadKey();\n }\n }\n}", "lang": "Mono C#", "bug_code_uid": "5ac79a45d1f79a95ede323adb6b9ef8a", "src_uid": "04c067326ec897091c3dbcf4d134df96", "apr_id": "89bea80ea51303caaa9c9359857d105d", "difficulty": 800, "tags": ["greedy", "math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.5379537953795379, "equal_cnt": 22, "replace_cnt": 8, "delete_cnt": 1, "insert_cnt": 13, "fix_ops_cnt": 22, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace ConsoleApplication57\n{\n class Program\n {\n static void Main(string[] args)\n {\n long a, b;\n string[] input = Console.ReadLine().Split(' ');\n a = Int64.Parse(input[0]);\n b = Int64.Parse(input[1]);\n long count = 0;\n for (long i = b + 1; i <= a - b; i++)\n {\n if ((a - b) % i == 0) count++;\n }\n if (a != b) Console.WriteLine(count);\n else Console.WriteLine(\"infinity\");\n //Console.ReadLine();\n }\n }\n}", "lang": "MS C#", "bug_code_uid": "c87bf2c0f12753543c446b77647969bd", "src_uid": "6e0715f9239787e085b294139abb2475", "apr_id": "9b04d4780ce993d4538d6d99a5dba873", "difficulty": 1600, "tags": ["math", "number theory"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.6059201141226819, "equal_cnt": 21, "replace_cnt": 9, "delete_cnt": 6, "insert_cnt": 6, "fix_ops_cnt": 21, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace B\n{\n class Program\n {\n static void Main(string[] args)\n {\n //Console.SetIn(File.OpenText(\"in.txt\"));\n var data = Console.ReadLine().Split().Select(d => int.Parse(d)).ToArray();\n var a = data[0];\n var b = data[1];\n r = a - b;\n\n if (a == b)\n {\n Console.WriteLine(\"infinity\");\n return;\n }\n else if (a < b)\n {\n Console.WriteLine(0);\n return;\n }\n else\n {\n //var n = (int)Math.Ceiling(Math.Sqrt(r));\n var counter = 0;\n for (int i = 1; i <= r; i++)\n {\n var rem = r % i;\n if (rem == 0 && i > b)\n {\n counter++;\n }\n }\n\n Console.WriteLine(counter);\n return;\n }\n\n //var dels = new int[10];\n //var v2 = (getT(2) + 1);\n //var v3 = (getT(3) + 1);\n //var v5 = (getT(5) + 1);\n //var v7 = (getT(7) + 1);\n //var f2 = v2 - getT(b, 2);\n //var f3 = v3 - getT(b, 3);\n //var f5 = v5 - getT(b, 5);\n //var f7 = v7 - getT(b, 7);\n\n //var res = f2 * f3 * f5 * f7;\n //Console.WriteLine(res);\n }\n\n static int r;\n static int getT(int del)\n {\n //var r = r1;\n if (r % del == 0)\n {\n int pos = 0;\n while (true)\n {\n var rem = r % del;\n \n if (rem == 0)\n {\n pos++;\n r = r / del;\n }\n else\n {\n break;\n }\n }\n\n return pos;\n }\n else\n {\n return 0;\n }\n }\n\n static int getT(int del, int r2)\n {\n //var r = r1;\n if (r2 % del == 0)\n {\n int pos = 0;\n while (true)\n {\n var rem = r2 % del;\n\n if (rem == 0)\n {\n pos++;\n r2 = r2 / del;\n }\n else\n {\n break;\n }\n }\n\n return pos;\n }\n else\n {\n return 0;\n }\n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "f60632d13e4e6029f7372111b876b795", "src_uid": "6e0715f9239787e085b294139abb2475", "apr_id": "0c420c7453096a1264a14d3b28f5d5be", "difficulty": 1600, "tags": ["math", "number theory"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9930017022886325, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "using System;\nusing CompLib.Util;\n\npublic class Program\n{\n int N, M;\n int[] A;\n public void Solve()\n {\n var sc = new Scanner();\n N = sc.NextInt();\n M = sc.NextInt();\n A = sc.IntArray();\n\n\n /*\n * n個カップ\n * i個目にはa[i]カフェイン\n * \n * i日にk個 (a_1,a_2...a_k)を飲む\n * \n * 1杯目 a_1\n * 2 a_2 -1\n * n a_n - (n-1)\n * \n * mを終わらせるために何日必要か?\n */\n\n long sum = 0;\n foreach (int l in A)\n {\n sum += l;\n }\n\n // n日で終わらせる\n // \n if (sum < M)\n {\n return;\n }\n\n Array.Sort(A, (l, r) => r.CompareTo(l));\n int ng = 0;\n int ok = N;\n while (ok - ng > 1)\n {\n int mid = (ok + ng) / 2;\n // mid日で終わらせられるか?\n if (C(mid)) ok = mid;\n else ng = mid;\n }\n\n Console.WriteLine(ok);\n }\n\n bool C(int d)\n {\n // dを分散\n\n long s = 0;\n for (int i = 0; i < N; i++)\n {\n long l = i / d;\n s += Math.Max(0, A[i] - i / d);\n }\n\n return s >= M;\n }\n\n public static void Main(string[] args) => new Program().Solve();\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": "7136da8ef8e1ed051c41e29c811e9f9d", "src_uid": "acb8a57c8cfdb849a55fa65aff86628d", "apr_id": "1da910f57ca3ea7d1c9d1c6989f7601b", "difficulty": 1700, "tags": ["brute force", "greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.9978925184404637, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\nusing System.IO;\n\nnamespace cf1\n{\n class Program\n {\n static void Main(string[] args)\n {\n Console.SetIn(new StreamReader(\"in.txt\"));\n string str = Console.ReadLine();\n string[] s = str.Split(' ');\n int n = Convert.ToInt32(s[0]);\n int k = Convert.ToInt32(s[1]);\n int sum=0;\n str = Console.ReadLine();\n s = str.Split(' ');\n\n for (int i = 0; i < n; i++)\n sum += Convert.ToInt32(s[i]);\n double a = sum / (double)n;\n if (a > k - 0.5)\n Console.WriteLine(\"0\");\n else\n {\n double f = 2 * (k * n - 0.5 * n - sum);\n Console.WriteLine(Convert.ToInt32(f));\n }\n Console.ReadKey();\n\n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "ba174fef73685a3385dd5e54d87e4432", "src_uid": "f22267bf3fad0bf342ecf4c27ad3a900", "apr_id": "36a08d1bd6e8c5908147333b0bbfc65f", "difficulty": 900, "tags": ["math", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.011040193203381059, "equal_cnt": 26, "replace_cnt": 23, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 26, "bug_source_code": "\n\n \n Debug\n AnyCPU\n 9.0.30729\n 2.0\n {278E3467-7E64-46DE-AC00-08AC85518C02}\n Exe\n Properties\n CodeForces\n CodeForces\n v2.0\n 512\n \n \n \n \n true\n full\n false\n bin\\Debug\\\n DEBUG;TRACE\n prompt\n 4\n true\n \n \n pdbonly\n true\n bin\\Release\\\n TRACE\n prompt\n 4\n true\n \n \n \n \n 3.5\n \n \n 3.5\n \n \n \n \n \n \n \n \n \n \n \n \n \n", "lang": "Mono C#", "bug_code_uid": "c27a337da5d6e264679ad435a291cdd6", "src_uid": "62db589bad3b7023418107de05b7a8ee", "apr_id": "66f9c2df8ae57a0549fc8caaaba1fb0a", "difficulty": 2000, "tags": ["dp", "brute force", "number theory"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.932596685082873, "equal_cnt": 6, "replace_cnt": 2, "delete_cnt": 3, "insert_cnt": 1, "fix_ops_cnt": 6, "bug_source_code": "using System;\nusing System.IO;\nusing System.Collections.Generic;\nnamespace C_\n{\n class Program\n {\n static void Main(string[] args)\n {\n\n \n int x = Convert.ToInt32(Console.ReadLine());\n int[] home = new int[x];\n int[] gest = new int[x];\n for (int i = 0; i < x; i++)\n {\n string[] s = Console.ReadLine().Split(' ');\n home[i] = Convert.ToInt32(s[0]);\n gest[i] = Convert.ToInt32(s[1]);\n }\n int count = 0;\n for (int i = 0; i < x; i++)\n {\n for (int j = 0; j < n; j++)\n {\n if (home[i] == gest[j] && i != j)\n {\n count++;\n Console.WriteLine(count);\n }\n }\n }\n }\n }\n}\n\n", "lang": "Mono C#", "bug_code_uid": "61b03256c06cc31773be509f9bd8b6b1", "src_uid": "745f81dcb4f23254bf6602f9f389771b", "apr_id": "d5a74c2d1e5031136c04faa8aeb86593", "difficulty": 800, "tags": ["brute force"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C#"} {"similarity_score": 0.9972789115646259, "equal_cnt": 7, "replace_cnt": 6, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 6, "bug_source_code": "using System;\nusing System.Linq;\nnamespace _887B\n{\n internal class Program\n {\n public static void Main(string[] args)\n {\n int n = int.Parse(Console.ReadLine());\n int[][] a = new int[n][];\n for (int i = 0; i < n; i++)\n a[i] = Array.ConvertAll(Console.ReadLine().Split(' '), int.Parse);\n bool[] canBuild = new bool[1005];\n for (int i = 0; i < 1000; i++)\n {\n if (i < 10)\n {\n for (int j = 0; j < 3; j++)\n canBuild[i] |= a[j].Contains(i);\n }\n else if (i >= 10 && i < 100)\n {\n if (n < 2)\n continue;\n for (int j = 0; j < 3; j++)\n for (int k = 0; k < 3; k++)\n {\n if (j == k)\n continue;\n canBuild[i] |= a[j].Contains(i / 10) && a[k].Contains(i % 10);\n }\n }\n else\n {\n if (n < 3)\n continue;\n for (int j = 0; j < 3; j++)\n for (int k = 0; k < 3; k++)\n {\n if (j == k)\n continue;\n for (int l = 0; l < 3; l++)\n {\n if (j == l || k == l)\n continue;\n canBuild[i] |= a[j].Contains(i / 100) && a[k].Contains((i / 10) % 10) &&\n a[l].Contains(i % 10);\n }\n }\n }\n }\n int result = 0;\n for (int i = 1; i < 1000; i++)\n {\n bool res = true;\n for (int j = 1; j <= i; j++)\n res &= canBuild[j];\n if (res)\n result = Math.Max(result, i);\n }\n Console.WriteLine(result);\n }\n }\n}", "lang": "MS C#", "bug_code_uid": "7c496a5d77ef2b66e358e0f1cea223fc", "src_uid": "20aa53bffdfd47b4e853091ee6b11a4b", "apr_id": "ac79255ded97fa49f2a99f843a0882a6", "difficulty": 1300, "tags": ["brute force", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9996532593619972, "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;\n\nnamespace ConsoleApplication1\n{\n class Program\n {\n static void Main(string[] args)\n {\n int x = 0;\n int noOfCubes = int.Parse(Console.ReadLine());\n List cubes = new List();\n int[] digits = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };\n for (int i = 0; i < noOfCubes; i++)\n {\n var a = Console.ReadLine().Split(' ');\n int[] cube = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };\n foreach (var d in a)\n {\n var j = 0;\n int.TryParse(d, out j);\n cube[j] = 1;\n }\n for (int j = 0; i < 10; j++)\n {\n digits[j] += cube[j];\n }\n cubes.Add(cube);\n }\n\n for (int i = 1; i <= noOfCubes; i++)\n {\n for (int j = 0; j < digits.Length; j++)\n {\n if (j == 0 && digits[j] < (i - 1))\n {\n var abc = Math.Pow(10, i - 1) - 1;\n Console.WriteLine(abc);\n return;\n }\n else if (j != 0 && digits[j] < i)\n {\n string result = \"\";\n var oCubes = cubes.FindAll(c => c[j] == 0);\n int[] abc = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };\n foreach (var c in oCubes)\n {\n for (int z = 0; z < 10; z++)\n {\n abc[z] += c[z];\n }\n }\n for (int m = 0; m < 10; m++)\n {\n if (abc[m] == 0)\n {\n for (int n = 0; n < i - 1; n++)\n {\n result += j.ToString();\n }\n if (m != 0)\n {\n result += (m - 1).ToString();\n Console.WriteLine(int.Parse(result));\n return;\n }\n else if (m == 0 && i > 1)\n {\n result += \"0\";\n Console.WriteLine(int.Parse(result) - 1);\n return;\n }\n }\n }\n }\n }\n }\n Console.WriteLine(x);\n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "295ff09e5fd2df5f0faa04a2b44dfcf0", "src_uid": "20aa53bffdfd47b4e853091ee6b11a4b", "apr_id": "2867d71d9576840468611915a724c717", "difficulty": 1300, "tags": ["brute force", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.6772703950743971, "equal_cnt": 5, "replace_cnt": 4, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 4, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace ConsoleApplication16\n{\n class Program\n {\n static void Main(string[] args)\n {\n int x1 = 0; int y1 = 0;\n string[] temp = Console.ReadLine().Split(' ');\n int x2 = int.Parse(temp[0]);\n int y2 = int.Parse(temp[1]);\n int s = int.Parse(temp[2]);\n int s0 = 0;\n while ((x1 != x2) || (y1 != y2))\n {\n if (x1 < x2)\n {\n x1 = x1 + 1;\n s0++;\n }\n else\n if (x1 > x2)\n {\n x1 = x1 - 1;\n s0++;\n }\n if (y1 < y2)\n {\n y1 = y1 + 1;\n s0++;\n }\n else\n if (y1 > y2)\n {\n y1 = y1 + 1;\n s0++;\n }\n }\n if ((s0 % 2 == s % 2) && (s>=s0))\n {\n Console.WriteLine(\"Yes\");\n }\n else\n Console.WriteLine(\"No\");\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "76e5bd72282be4a2689734fd8322ac1b", "src_uid": "9a955ce0775018ff4e5825700c13ed36", "apr_id": "c4ba2fdedef8d4ba2afb8e3ff110f7e3", "difficulty": 1000, "tags": ["math"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.8171937365673934, "equal_cnt": 119, "replace_cnt": 58, "delete_cnt": 5, "insert_cnt": 55, "fix_ops_cnt": 118, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n//неправильный ответ на тесте 12\nnamespace F\n{\n class Program\n {\n class tree\n {\n public long ves;\n public int nn;//индек первого элемента\n public int nk;//индек последнего элемента\n public tree l;\n public tree r;\n public tree p;\n public tree(int[] m, int i1, int ik, tree p1)\n {\n if (i1 == ik)\n {\n nn = i1;\n nk = ik;\n l = null;\n r = null;\n ves = m[i1];\n wt[i1] = this;\n }\n else\n {\n int s = (ik + i1 + 1) / 2/*+ (ik - i1) % 2*/;\n nn = i1;\n nk = ik;\n l = new tree(m, i1, s - 1, this);\n r = new tree(m, s, ik, this);\n ves = l.ves + r.ves;\n }\n p = p1;\n }\n\n }\n static long FindVes(tree t1, tree tn)\n {\n long ves = 0;\n int x1 = t1.nn;\n int y1 = tn.nk;\n if (y1 < x1) return 0;\n tree ti = wt[x1];\n while (ti.nk < y1) ti = ti.p;\n ves = (long)ti.ves;\n tree tiv = ti;\n while (ti.nn < x1)\n {\n if (ti.r.nn <= x1)\n {\n ves = ves - (long)ti.l.ves;\n ti = ti.r;\n }\n else\n {\n ti = ti.l;\n }\n }\n ti = tiv;\n while (ti.nk > y1)\n {\n if (ti.l.nk >= y1)\n {\n ves = ves - (long)ti.r.ves;\n ti = ti.l;\n }\n else\n {\n ti = ti.r;\n }\n }\n return ves;\n }\n static tree[] wt;\n static void Main(string[] args)\n {\n TextReader sr = Console.In;\n //StreamReader sr = new StreamReader(\"in7.txt\");\n string[] s = sr.ReadLine().Split();\n int n = Convert.ToInt32(s[0]);\n int q = Convert.ToInt32(s[1]);\n s = sr.ReadLine().Split();\n string[] s1 = sr.ReadLine().Split();\n int[] a = new int[n];\n int[] w = new int[n];\n for (int i = 0; i < n; i++)\n {\n a[i] = Convert.ToInt32(s[i]);\n w[i] = Convert.ToInt32(s1[i]);\n }\n //решение\n wt = new tree[n];\n tree t1 = new tree(w, 0, n - 1, null);\n int x, y;\n tree ti;\n List res = new List();\n for (int i = 0; i < q; i++)\n {\n s = sr.ReadLine().Split();\n x = Convert.ToInt32(s[0]);\n y = Convert.ToInt32(s[1]);\n if (x < 0)\n {\n int delta = y - w[-1 - x];\n w[-1 - x] = y;\n ti = wt[-1 - x];\n while (ti != null)\n {\n ti.ves = ti.ves + delta;\n ti = ti.p;\n }\n }\n else\n {\n if (x == y)\n {\n res.Add(0);\n }\n else if ((y - x) == (a[y - 1] - a[x - 1]))\n {\n res.Add(0);\n }\n else if ((y - x) == 1)\n {\n if (w[x-1] > w[y-1])\n {\n res.Add((int)(((long)(a[y-1]- a[x - 1] - 1)* (long)w[y - 1])% (long)(1000000007)));\n }\n else\n {\n res.Add((int)(((long)(a[y - 1] - a[x - 1] - 1) * (long)w[x - 1]) % (long)(1000000007)));\n }\n }\n else\n {\n //найти вес отрезка\n int x1 = x - 1;\n int y1 = y - 1;\n long ves = FindVes(wt[x1], wt[y1]);\n long vl, vr,vv;\n int iis, iiss;\n int iisll=x1, iislr=y1;\n iis = (x1 + y1 + 1) / 2;\n vl = FindVes(wt[x1], wt[iis - 1]);\n vr = FindVes(wt[iis + 1],wt[y1] );\n while (true)\n {\n if ((vl + w[iis] > vr) && (vr + w[iis] > vl)) break;\n if (vl + w[iis] == vr) {\n if (w[iis] >= w[iis + 1]) break;\n else\n {\n iis++;\n break;\n }\n }\n if (vr + w[iis] == vl)\n {\n if (w[iis] >= w[iis - 1]) break;\n else\n {\n iis--;\n break;\n }\n }\n if ((vl + w[iis]) >(vr + w[iis]))\n {\n iiss = (iisll + iis) / 2;\n vv= FindVes(wt[iiss + 1], wt[iis- 1]);\n vl =vl-vv- w[iiss];\n vr =vr+vv+ w[iis];\n iislr = iis;\n iis = iiss;\n }\n else\n {\n iiss = (iislr + iis + 1) / 2;\n vv = FindVes(wt[iis + 1], wt[iiss - 1]);\n vl = vl + vv + w[iis];\n vr = vr - vv - w[iiss];\n iisll = iis;\n iis = iiss;\n }\n }\n long r = 0;\n for (int j = x1; j < iis; j++)\n {\n r = (r + ((long)w[j] * (long)(a[iis] - a[j] - (iis-j)))) % 1000000007;\n }\n for (int j = iis+1; j <=y1; j++)\n {\n r = (r + ((long)w[j] * (long)(a[j] - a[iis] - (j-iis)))) % 1000000007;\n }\n res.Add((int)r);\n }\n }\n }\n Console.WriteLine(string.Join(\"\\n\", res));\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "c9be8495abc15065f64ac0ceee6c8dd6", "src_uid": "c0715f71efa327070eba7e491856d66a", "apr_id": "15ccbc5461b9c5c959c7baad9223f9b2", "difficulty": 2500, "tags": ["data structures"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9987995198079231, "equal_cnt": 4, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 3, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace F\n{\n class Program\n {\n static Tree[] wt;\n class Tree\n {\n public long ves;\n public long ves_;\n public int nn;//индек первого элемента\n public int nk;//индек последнего элемента\n public Tree l;\n public Tree r;\n public Tree p;\n public Tree(int[] m, int[] a, int i1, int ik, Tree p1)\n {\n nn = i1;\n nk = ik;\n if (i1 == ik)\n {\n l = null;\n r = null;\n ves = m[i1];\n ves_ = ((long)(a[i1] - i1) * (long)m[i1]) % (long)(1000000007);\n wt[i1] = this;\n }\n else\n {\n int s = (ik + i1 + 1) / 2;\n l = new Tree(m, a, i1, s - 1, this);\n r = new Tree(m, a, s, ik, this);\n ves = l.ves + r.ves;\n ves_ = (l.ves_ + r.ves_) % (long)(1000000007);\n }\n p = p1;\n }\n }\n\n static long FindVes(Tree t1, Tree tn, bool t)//t=true ves;t=false ves_;\n {\n long ves = 0;\n int x1 = t1.nn;\n int y1 = tn.nk;\n if (y1 < x1) return 0;\n Tree ti = wt[x1];\n long sub = 0;\n while (ti.nk < y1)\n {\n if (ti.p.r == ti)\n {\n if (t) sub = sub + ti.l.ves;\n else sub = (sub + ti.l.ves_) % (long)(1000000007);\n }\n ti = ti.p;\n }\n if (t) ves = (long)ti.ves;\n else ves = (long)ti.ves_;\n if (t) ves =ves-sub;\n else ves =(ves-sub+ +(long)(1000000007)) % (long)(1000000007);\n //Tree tiv = ti;\n //while (ti.nn < x1)\n //{\n // if (ti.r.nn <= x1)\n // {\n // if (t) ves = ves - (long)ti.l.ves;\n // else ves = (ves - (long)ti.l.ves_ + (long)(1000000007)) % (long)(1000000007);\n // ti = ti.r;\n // }\n // else\n // {\n // ti = ti.l;\n // }\n //}\n //ti = tiv;\n while (ti.nk > y1)\n {\n if (ti.l.nk >= y1)\n {\n if (t) ves = ves - (long)ti.r.ves;\n else ves = (ves - (long)ti.r.ves_ + (long)(1000000007)) % (long)(1000000007);\n ti = ti.l;\n }\n else\n {\n ti = ti.r;\n }\n }\n return ves;\n }\n\n static void Main(string[] args)\n {\n TextReader sr = Console.In;\n //StreamReader sr = new StreamReader(\"in1.txt\");\n string[] s = sr.ReadLine().Split();\n int n = Convert.ToInt32(s[0]);\n int q = Convert.ToInt32(s[1]);\n s = sr.ReadLine().Split();\n string[] s1 = sr.ReadLine().Split();\n int[] a = new int[n];\n int[] w = new int[n];\n for (int i = 0; i < n; i++)\n {\n a[i] = Convert.ToInt32(s[i]);\n w[i] = Convert.ToInt32(s1[i]);\n }\n //решение\n wt = new Tree[n];\n Tree t1 = new Tree(w, a, 0, n - 1, null);\n\n int ll;\n int rr;\n int id, nw;\n bool zapros1;\n Tree ti;\n List res = new List();\n for (int i = 0; i < q; i++)\n {\n s = sr.ReadLine().Split();\n ll = Convert.ToInt32(s[0]);\n if (ll < 0) zapros1 = true; else zapros1 = false;\n id = -1 - ll;\n ll--;\n nw = Convert.ToInt32(s[1]);\n rr = nw - 1;\n if (zapros1)\n {\n ti = wt[id];\n long delta = (long)nw - ti.ves;\n long delta_ = (((long)(a[id] - id) * (long)nw)) % (long)(1000000007) - ti.ves_;\n w[id] = nw;\n while (ti != null)\n {\n ti.ves = ti.ves + delta;\n ti.ves_ = (ti.ves_ + delta_ + (long)(1000000007)) % (long)(1000000007);\n ti = ti.p;\n }\n }\n else\n {\n if (ll == rr)\n {\n res.Add(0);\n }\n else if ((rr - ll) == (a[rr] - a[ll]))\n {\n res.Add(0);\n }\n else if ((rr - ll) == 1)\n {\n if (w[ll] > w[rr])\n {\n res.Add((int)(((long)(a[rr] - a[ll] - 1) * (long)w[rr]) % (long)(1000000007)));\n }\n else\n {\n res.Add((int)(((long)(a[rr] - a[ll] - 1) * (long)w[ll]) % (long)(1000000007)));\n }\n }\n else\n {\n //найти вес отрезка\n long ves = FindVes(wt[ll], wt[rr], true);\n long vl, vr, vv;\n int iis, iiss;\n int iisll = ll, iislr = rr;\n iis = (ll + rr + 1) / 2;\n vl = FindVes(wt[ll], wt[iis - 1], true);\n vr = FindVes(wt[iis + 1], wt[rr], true);\n while (true)\n {\n if ((vl + w[iis] > vr) && (vr + w[iis] > vl)) break;\n if (vl + w[iis] == vr)\n {\n if (w[iis] < w[iis + 1]) iis++;\n break;\n }\n if (vr + w[iis] == vl)\n {\n if (w[iis] < w[iis - 1]) iis--;\n break;\n }\n if ((vl) > (vr))\n {\n iiss = (iisll + iis) / 2;\n vv = FindVes(wt[iiss + 1], wt[iis - 1], true);\n vl = vl - vv - w[iiss];\n vr = vr + vv + w[iis];\n iislr = iis;\n iis = iiss;\n }\n else\n {\n iiss = (iislr + iis + 1) / 2;\n vv = FindVes(wt[iis + 1], wt[iiss - 1], true);\n vl = vl + vv + w[iis];\n vr = vr - vv - w[iiss];\n iisll = iis;\n iis = iiss;\n }\n }\n long r = 0;\n if (iis > ll)\n {\n r = (r - (FindVes(wt[ll], wt[iis - 1], false) % (long)(1000000007)) + (long)(1000000007)) % (long)(1000000007);\n r = (r + (long)(a[iis] - iis) * (FindVes(wt[ll], wt[iis - 1], true) % (long)(1000000007))) % (long)(1000000007);\n\n }\n if (iis < rr)\n {\n r = (r + (FindVes(wt[iis + 1], wt[rr], false)) % (long)(1000000007)) % (long)(1000000007);\n r = (r - (long)(a[iis] - iis) * (FindVes(wt[iis + 1], wt[rr], true) % (long)(1000000007)) % (long)(1000000007) + (long)(1000000007)) % (long)(1000000007);\n }\n res.Add((int)r);\n }\n }\n }\n Console.WriteLine(string.Join(\"\\n\", res));\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "b52d38e7a6e0c5bc55b46e30d2a4078e", "src_uid": "c0715f71efa327070eba7e491856d66a", "apr_id": "15ccbc5461b9c5c959c7baad9223f9b2", "difficulty": 2500, "tags": ["data structures"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.4420091324200913, "equal_cnt": 14, "replace_cnt": 12, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 14, "bug_source_code": "using System;\n\nnamespace MyTraining\n{\n class Program\n {\n static void Main(string[] args)\n {\n string[] input1 = Console.ReadLine().Split();\n string[] input2 = Console.ReadLine().Split();\n int x1 = Convert.ToInt16(input1[0]);\n int y1 = Convert.ToInt16(input1[1]);\n int x2 = Convert.ToInt16(input2[0]);\n int y2 = Convert.ToInt16(input2[1]);\n int d = 0;\n while (x1 != x2 || y1 != y2)\n {\n if (x1 > x2 && y1 > y2)\n {\n x1--;\n y1--;\n }\n else if (x1 < x2 && y1 < y2)\n {\n x1++;\n y1++;\n }\n else if (x1 < x2 && y1 > y2)\n {\n x1++;\n y1--;\n }\n else if (x1 > x2 && y1 < y2)\n {\n x1--;\n y1++;\n }\n else if (x1 > x2 && y1 == y2)\n {\n x1--;\n }\n else if (x1 < x2 && y1 == y2)\n {\n x1++;\n }\n else if (x1 == x2 && y1 > y2)\n {\n y1--;\n }\n else if (x1 == x2 && y1 < y2)\n {\n y1++;\n }\n d++;\n }\n Console.WriteLine(\"{0}\", d);\n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "e5231c747eabe1dba63e368915dc5c26", "src_uid": "a6e9405bc3d4847fe962446bc1c457b4", "apr_id": "091ce88463d6dbec1a302637da975128", "difficulty": 800, "tags": ["math", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.976173285198556, "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.IO;\nusing System.Linq;\n\nnamespace Contest\n{\n class Program\n {\n static void SetInput()\n {\n var textReader = new StreamReader(\"input.txt\");\n Console.SetIn(textReader);\n }\n\n static IEnumerable Parse(string line, Func converter)\n {\n return line.Split(' ').Select(converter);\n }\n\n static IEnumerable ReadInts()\n {\n return ReadLine(x => int.Parse(x)); \n }\n\n static IEnumerable ReadLongs()\n {\n return ReadLine(x => long.Parse(x));\n }\n\n static IEnumerable ReadDoubles()\n {\n return ReadLine(x => double.Parse(x));\n }\n\n static IEnumerable ReadLine(Func converter)\n {\n var line = Console.ReadLine();\n\n return Parse(line, converter);\n }\n\n static void Print(IEnumerable values)\n {\n Console.WriteLine(string.Join(\" \", values));\n }\n\n static void Main(string[] args)\n {\n SetInput();\n var start = ReadLongs().ToArray();\n var finish = ReadLongs().ToArray();\n\n Console.WriteLine(Math.Max(Math.Abs(start[0] - finish[1]), Math.Abs(start[1] - finish[1])));\n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "f3956a41431c9939482bad27459394b9", "src_uid": "a6e9405bc3d4847fe962446bc1c457b4", "apr_id": "c6771eeb1a09b9e79905c4b08d2b7e60", "difficulty": 800, "tags": ["math", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.8264808362369338, "equal_cnt": 8, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 5, "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 ConsoleApplication5\n{\n class Program\n {\n\n static void Main(string[] args)\n {\n string simple = \"31 28 31 30 31 30 31 31 30 31 30 31 31 28 31 30 31 30 31 31 30 31 30 31 31 29 31 30 31 30 31 31 30 31 30 31 31 28 31 30 31 30 31 31 30 31 30 31\";\n string s = Console.ReadLine();\n if(simple.Contains(s))\n Console.WriteLine(\"YES\");\n else Console.WriteLine(\"NO\");\n Main(null);\n }\n \n \n }\n}", "lang": "MS C#", "bug_code_uid": "5028efdf2353f861c749253e318abac2", "src_uid": "d60c8895cebcc5d0c6459238edbdb945", "apr_id": "c0043e7388a8781fbe3c69c87a89d1be", "difficulty": 1200, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.9731774415405777, "equal_cnt": 7, "replace_cnt": 6, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 6, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\nclass Solution\n{\n\n static bool IsPossible(int[] months, int[] data)\n {\n var idxs = data.Select((s, i) => s == months[0] ? i : -1).Where(s => s >= 0);\n foreach (var idx in idxs)\n {\n var found = true;\n for (var i = 0; i < months.Length; i++)\n {\n if (months[i] != data[(idx + i) % data.Length])\n {\n found = false;\n break;\n }\n }\n if (found)\n return true;\n }\n return false;\n }\n\n static void Main(String[] args)\n {\n var leap = new[] {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n var nonLeap = new[] { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };\n\n var leapAndNonLeap = new int[24];\n leap.CopyTo(leapAndNonLeap, 0);\n nonLeap.CopyTo(leapAndNonLeap, 12);\n\n var leapLeap = new int[24];\n leap.CopyTo(leapLeap, 0);\n leap.CopyTo(leapLeap, 12);\n\n var n = Convert.ToInt32(Console.ReadLine());\n var tempA = Console.ReadLine().Split(' ');\n var months = Array.ConvertAll(tempA, int.Parse);\n\n var possible = IsPossible(months, leapAndNonLeap) || IsPossible(months, leapLeap);\n Console.WriteLine(\"{0}\", possible ? \"YES\" : \"NO\");\n Console.ReadLine();\n }\n}\n", "lang": "MS C#", "bug_code_uid": "05bb99d9a10ff8ced1b2739b4f823cfe", "src_uid": "d60c8895cebcc5d0c6459238edbdb945", "apr_id": "5a5ed9fb807875d2458fc237c4183078", "difficulty": 1200, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.7155322862129145, "equal_cnt": 14, "replace_cnt": 7, "delete_cnt": 3, "insert_cnt": 3, "fix_ops_cnt": 13, "bug_source_code": "using System;\n\nnamespace _4A\n{\n class Program\n {\n static void Main(string[] args)\n {\n var str = Console.ReadLine().Split(' ');\n var b = new bool[10];\n for (int i = 0; i < str.Length; i++)\n {\n b[int.Parse(str[i])] = true;\n }\n\n int counter = 0;\n for (int i = 0; i < b.Length; i++)\n {\n if (b[i]) counter++;\n }\n \n \n Console.WriteLine(str.Length - counter);\n }\n }\n}", "lang": "Mono C#", "bug_code_uid": "8209fe1bc1d02a73c7f945ac6dfc50fe", "src_uid": "38c4864937e57b35d3cce272f655e20f", "apr_id": "55afe6d09b3516b2d30d60a250b45993", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.8125, "equal_cnt": 7, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 4, "fix_ops_cnt": 7, "bug_source_code": "using System;\n\nnamespace ConsoleApp20\n{\n class Program\n {\n static void Main(string[] args)\n {\n var n = int.Parse(Console.ReadLine());\n var m = int.Parse(Console.ReadLine());\n if(n>=30){Console.Write(m); return;}\n Console.WriteLine(m%(1>>n));\n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "cfcddecff961cc3dbe61ee0ec8d11285", "src_uid": "c649052b549126e600691931b512022f", "apr_id": "608e2c0f6e4f4d40129dc07e6e6752ee", "difficulty": 900, "tags": ["math", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.8544857768052516, "equal_cnt": 17, "replace_cnt": 9, "delete_cnt": 4, "insert_cnt": 3, "fix_ops_cnt": 16, "bug_source_code": "using System;\n class Program\n { \n static void Main(string[] args)\n {\n string[] input = Console.In.ReadToEnd().Split(new char[] { ' ', '\\t', '\\n', '\\r'}, StringSplitOptions.RemoveEmptyEntries);\n int k = int.Parse(input[1]);\n input[0] = input[1] = null;\n bool[] db = new bool[27];\n int res = 0;\n for (int i = 0; i < input[2].Length; i++)\n db[input[2][i]] = true;\n for(int i = 1; k>0;)\n {\n for(; i 0 ? -1 : res);\n }\n }", "lang": "Mono C#", "bug_code_uid": "97020e7c5a9bebfa601a78da59dc796e", "src_uid": "56b13d313afef9dc6c6ba2758b5ea313", "apr_id": "169c100da2b8ba53de0a898521ffc5e9", "difficulty": 900, "tags": ["greedy", "sortings", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9824109824109825, "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 ConsoleApp13\n{\n class Program\n {\n static void Main(string[] args)\n {\n int n, k;\n string input = Console.ReadLine();\n n = int.Parse(input.Split(' ')[0]);\n k = int.Parse(input.Split(' ')[1]);\n input = Console.ReadLine();\n int[] arr = new int[26];\n for (int i = 0; i < n; i++)\n {\n arr[int.Parse(input[i].ToString())]++;\n }\n\n int ot = 0, sum = 0;\n for (int i = 0; i < 26; i++)\n {\n if (ot > 0)\n {\n ot--;\n continue;\n }\n if (int.Parse(arr[i].ToString()) != 0)\n {\n k--;\n sum += arr[i] - 'a' + 1;\n ot += 1;\n }\n if (k == 0) break;\n }\n if (k > 0) Console.WriteLine(-1);\n else\n {\n Console.WriteLine(sum);\n }\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "98d48e4ed566592180254e269103aba4", "src_uid": "56b13d313afef9dc6c6ba2758b5ea313", "apr_id": "079cba422c8fc97c7129b63313469021", "difficulty": 900, "tags": ["greedy", "sortings", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9975020815986678, "equal_cnt": 4, "replace_cnt": 0, "delete_cnt": 3, "insert_cnt": 0, "fix_ops_cnt": 3, "bug_source_code": "#region License\n\n// Copyright (C) 2012 Kazunori Sakamoto\n// \n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n// \n// http://www.apache.org/licenses/LICENSE-2.0\n// \n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n#endregion\n\nusing System;\nusing System.IO;\n\nnamespace Codeforces {\n\tpublic class ProblemE {\n\t\t//public static void Main(string[] args) {\n\t\t// new ProblemE().Solve(Console.In);\n\t\t//}\n\n\t\tprivate void Solve(TextReader input) {\n\t\t\t//1: 0, 1\n\t\t\t//2: 3, 2 = 1 * 3, 0 + 1 * 2\n\t\t\t//3: 6, 7 = 2 * 3, 3 + 2 * 2\n\t\t\t//4: 21, 20 = 7 * 3, 6 + 7 * 2\n\t\t\tvar n = int.Parse(input.ReadLine()) - 1;\n\t\t\tvar d = 0L;\n\t\t\tvar notD = 1L;\n\t\t\tfor (int i = 0; i < n; i++) {\n\t\t\t\tvar newD = notD * 3 % 1000000007;\n\t\t\t\tnotD = (d + notD * 2) % 1000000007;\n\t\t\t\td = newD;\n\t\t\t}\n\t\t\tConsole.WriteLine(d);\n\t\t}\n\t}\n}", "lang": "Mono C#", "bug_code_uid": "6f7fe100a1c5c7ef2efb123f38b6efd6", "src_uid": "77627cc366a22e38da412c3231ac91a8", "apr_id": "e218e7e3ad78d2c6b2501a57bfa66608", "difficulty": 1500, "tags": ["matrices", "dp", "math"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C#"} {"similarity_score": 0.9292518734916805, "equal_cnt": 27, "replace_cnt": 15, "delete_cnt": 0, "insert_cnt": 11, "fix_ops_cnt": 26, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Security.Cryptography;\nusing System.Text;\n\nnamespace Codeforces\n{\n\tclass Program\n\t{\n\t\tstatic void Main(string[] args)\n\t\t{\n\t\t\tstring input1 = Console.ReadLine();\n\t\t\t//string input2 = Console.ReadLine();\n\n\t\t\tvar inputs1 = input1.Split(new[] { ' ' }, StringSplitOptions.RemoveEmptyEntries).Select(int.Parse).ToArray();\n\t\t\t//var inputs2 = input2.Split(new[] { ' ' }, StringSplitOptions.RemoveEmptyEntries).Select(int.Parse).ToList();\n\n\t\t\tint n = inputs1[0];\n\t\t\tint m = inputs1[1];\n\n\t\t\tif (n > m) \n\t\t\t{\n\t\t\t\tConsole.WriteLine(n - m);\n\t\t\t} \n\t\t\telse if(n == m)\n\t\t\t{\n\t\t\t\tConsole.WriteLine(0);\n\t\t\t} \n\t\t\telse \n\t\t\t{\n\t\t\t\tvar count = (int)Math.Ceiling(Math.Log((double)m / n)) + (2 * n > m ? 0 : 1);\n\t\t\t\tvar h = count + (n * Math.Pow(2, count) - m);\n\t\t\t\tvar list = new List { n };\n\t\t\t\tfor (int i = 0; i < h; i++) \n\t\t\t\t{\n\t\t\t\t\tvar newList = new List();\n\t\t\t\t\tforeach (var item in list) \n\t\t\t\t\t{\n\t\t\t\t\t\tif (2 * item < 2 * m) \n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tnewList.Add(2 * item);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (item - 1 > 0) \n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tnewList.Add(item - 1);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (2 * item == m || item - 1 == m) \n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tConsole.WriteLine(i + 1);\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tlist = newList;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tpublic class Node\n\t\t{\n\t\t\tpublic Node Left { get; set; }\n\n\t\t\tpublic Node Right { get; set; }\n\n\t\t\tpublic T Value { get; set; }\n\n\t\t\tpublic Node(T value) \n\t\t\t{\n\t\t\t\tValue = value;\n\t\t\t}\n\t\t}\n\n\t\tpublic class Tree\n\t\t{\n\t\t\tpublic Node Root { get; set; }\n\n\t\t\tpublic Tree(T value) \n\t\t\t{\n\t\t\t\tRoot = new Node(value);\n\t\t\t}\n\t\t}\n\n\t\t//private static long GCD(long a, long b)\n\t\t//{\n\t\t//\tlong max = Math.Max(a, b);\n\t\t//\tlong min = Math.Min(a, b);\n\n\t\t//\tif (min == 0)\n\t\t//\t{\n\t\t//\t\treturn max;\n\t\t//\t}\n\n\t\t//\ta = min;\n\t\t//\tb = max % min;\n\t\t//\treturn GCD(a, b);\n\t\t//}\n\n\t\t//private static long LCM(long a, long b)\n\t\t//{\n\t\t//\treturn Math.Abs(a * b) / GCD(a, b);\n\t\t//}\n\n\t\t//private static int Length(short[] a)\n\t\t//{\n\t\t//\tint firstItemIndex = 0;\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{\n\t\t//\t\t\tcontinue;\n\t\t//\t\t}\n\n\t\t//\t\tfirstItemIndex = i;\n\t\t//\t\tbreak;\n\t\t//\t}\n\n\t\t//\treturn a.Length - firstItemIndex;\n\t\t//}\n\n\t\t//private static short[] Subtract(short[] a, short[] b)\n\t\t//{\n\t\t//\tif (a.Length != b.Length)\n\t\t//\t{\n\t\t//\t\tthrow new ArgumentException();\n\t\t//\t}\n\n\t\t//\tshort[] result = new short[a.Length];\n\t\t//\tArray.Copy(a, result, a.Length);\n\t\t//\tfor (int i = result.Length - 1; i >= 0; i--)\n\t\t//\t{\n\t\t//\t\tif (result[i] < b[i])\n\t\t//\t\t{\n\t\t//\t\t\tint j = i - 1;\n\t\t//\t\t\twhile (result[j] == 0)\n\t\t//\t\t\t{\n\t\t//\t\t\t\tresult[j--] = 9;\n\t\t//\t\t\t}\n\n\t\t//\t\t\tresult[j]--;\n\t\t//\t\t\tresult[i] += 10;\n\t\t//\t\t}\n\n\t\t//\t\tresult[i] -= b[i];\n\t\t//\t}\n\n\t\t//\treturn result;\n\t\t//}\n\n\t\t//private static short[] Multiply(short[] a, int b)\n\t\t//{\n\t\t//\tshort[] result = new short[a.Length];\n\t\t//\tfor (int i = a.Length - 1; i > 0; i--)\n\t\t//\t{\n\t\t//\t\tint temp = a[i] * b;\n\t\t//\t\tresult[i] = (short)(result[i] + temp % 10);\n\t\t//\t\tresult[i - 1] = (short)(result[i - 1] + temp / 10);\n\t\t//\t}\n\n\t\t//\treturn result;\n\t\t//}\n\n\t\t//private static int Mod(short[] a, int b)\n\t\t//{\n\t\t//\tint rest = 0, i = 0;\n\t\t//\twhile (i < a.Length)\n\t\t//\t{\n\t\t//\t\tint d = 10 * rest + a[i];\n\t\t//\t\twhile (d < b && i < a.Length - 1)\n\t\t//\t\t{\n\t\t//\t\t\td = 10 * d + a[++i];\n\t\t//\t\t}\n\n\t\t//\t\trest = d % b;\n\t\t//\t\ti++;\n\t\t//\t}\n\n\t\t//\treturn rest;\n\t\t//}\n\n\t\t//private static short[] Divide(short[] a, int b)\n\t\t//{\n\t\t//\tshort[] result = new short[a.Length];\n\t\t//\tint rest = 0, i = 0;\n\t\t//\twhile (i < a.Length)\n\t\t//\t{\n\t\t//\t\tint d = 10 * rest + a[i];\n\t\t//\t\twhile (d < b && i < a.Length - 1)\n\t\t//\t\t{\n\t\t//\t\t\td = 10 * d + a[++i];\n\t\t//\t\t}\n\n\t\t//\t\tresult[i] = (short)(d / b);\n\t\t//\t\trest = d % b;\n\t\t//\t\ti++;\n\t\t//\t}\n\n\t\t//\treturn result;\n\t\t//}\n\t}\n}\n", "lang": "Mono C#", "bug_code_uid": "d358a907993276b127e35df4f4b72d2a", "src_uid": "861f8edd2813d6d3a5ff7193a804486f", "apr_id": "187eff188f6df262f76419deed35989f", "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.98005698005698, "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 static class Program\n{\n public static void Main() {\n var str = Console.ReadLine();\n foreach (var c in str)\n if ((new [] {'A', 'O', 'Y', 'E', 'U', 'I'}).Contains(Char.ToUpper(c)))\n ;\n else\n {\n Console.Write('.');\n Console.Write(c.ToString().ToUpperCase());\n }\n }\n}", "lang": "MS C#", "bug_code_uid": "2d31daead609d45d6fdc6e5ee8b55a61", "src_uid": "db9520e85b3e9186dd3a09ff8d1e8c1b", "apr_id": "4fc9126479c39aa027dac1282f8418be", "difficulty": 1000, "tags": ["strings", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9644533869885983, "equal_cnt": 5, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 4, "bug_source_code": "using System;\nusing System.Linq;\nusing System.Collections.Generic;\n\nclass P { \n static void Main() { \n var s = Console.ReadLine().Split(' ').Select(int.Parse).ToArray();\n var p = s.Take(4).ToArray();\n var a = s[4];\n var b = Math.Min(s[5], 1000);\n \n var perm = new List();\n for (var i1 = 0 ; i1 < 4 ; i1++)\n for (var i2 = 0 ; i2 < 4 ; i2++)\n for (var i3 = 0 ; i3 < 4 ; i3++)\n for (var i4 = 0 ; i4 < 4 ; i4++)\n if (i1 != i2 && i1 != i3 && i1 != i4 && i2 != i3 && i2 != i4 && i3 != i4)\n perm.Add(new [] { i1, i2, i3 ,i4});\n\n var n = Enumerable.Range(a,b).Where(x => x <= b)\n .Count(x => perm.Aggregate(x, (acc,tmp) => acc %tmp) == x);\n Console.Write(n);\n }\n}", "lang": "MS C#", "bug_code_uid": "7d874df387fd39fe2585c61b8e497215", "src_uid": "63b9dc70e6ad83d89a487ffebe007b0a", "apr_id": "3fba4d7068ec1a60d98e070146d1ee1f", "difficulty": 1100, "tags": ["number theory", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.991508817766166, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "using System;\nusing System.Linq;\nusing System.Collections.Generic;\n\nclass P { \n static void Main() { \n var s = Console.ReadLine().Split(' ').Select(int.Parse).ToArray();\n var p = s.Take(4).ToArray();\n var a = s[4];\n var b = Math.Min(s[5], 1000);\n \n var perm = new List();\n for (var i1 = 0 ; i1 < 4 ; i1++)\n for (var i2 = 0 ; i2 < 4 ; i2++)\n for (var i3 = 0 ; i3 < 4 ; i3++)\n for (var i4 = 0 ; i4 < 4 ; i4++)\n if (i1 != i2 && i1 != i3 && i1 != i4 && i2 != i3 && i2 != i4 && i3 != i4)\n perm.Add(new [] { i1, i2, i3 ,i4});\n\n var n = Enumerable.Range(a,b).Where(x => x <= b)\n .Count(x => perm.Count(\n pp => pp.Aggregate(x, (acc,tmp) => acc %tmp) == x) >= 7);\n Console.Write(n);\n }\n}", "lang": "MS C#", "bug_code_uid": "16feb4fbfa543910ec9fe689cb83f974", "src_uid": "63b9dc70e6ad83d89a487ffebe007b0a", "apr_id": "3fba4d7068ec1a60d98e070146d1ee1f", "difficulty": 1100, "tags": ["number theory", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.7839453458582408, "equal_cnt": 9, "replace_cnt": 5, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 8, "bug_source_code": "using System;\n\nnamespace CSharp\n{\n internal static class Program\n {\n private static void Main(string[] args)\n {\n string[] numbers = Console.ReadLine().Split();\n JohnyNumber(int.Parse(numbers[0]), int.Parse(numbers[1]));\n }\n\n private static void JohnyNumber(int n, int k)\n {\n bool searching = true;\n int i = n + 1;\n while (searching)\n {\n if (i % k == 0)\n {\n searching = false;\n }\n else\n i++;\n }\n Console.WriteLine(i);\n }\n }\n}", "lang": "Mono C#", "bug_code_uid": "464aaf65394a9e562bf7678c55fe6359", "src_uid": "75f3835c969c871a609b978e04476542", "apr_id": "e74a3d0021ab1c4d30c919516ce3266c", "difficulty": 800, "tags": ["math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9821471078314687, "equal_cnt": 10, "replace_cnt": 1, "delete_cnt": 3, "insert_cnt": 5, "fix_ops_cnt": 9, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\n\nnamespace test_cs\n{\n\n\n class Program\n {\n\n static void Main(string[] args)\n {\n int n, m;\n var ss = Console.ReadLine();\n var parse = ss.Split(' ');\n n = Convert.ToInt32( parse[0] );\n m = Convert.ToInt32(parse[1]);\n\n long del = (long)(10e9 + 7);\n const int size = 100001;\n long[] arr = new long[size];\n\n arr[0] = 1;\n\n for (int i = 1; i < size; i++)\n {\n arr[i] = arr[i - 1];\n if (i > 2)\n {\n arr[i] = ( arr[i] + arr[i - 2]);\n }\n }\n\n Console.WriteLine( (2 * (arr[n+1] + arr[m+1] - 1))%del );\n int b = 43;\n\n\n \n\n /*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n string[] str_arr =\n {\n \"ABCD\",\n \"ABDD\",\n \"ABDC\",\n };\n\n\n for (int i = 0; i < 4; i++)\n {\n var ei = from cc in\n (from a in str_arr\n select (from b in a\n select b).ElementAt(i)\n )\n group cc by cc into newGrp\n select newGrp;\n\n var max_el = (from ge in ei\n select ge.Count()).Max();\n\n Console.WriteLine(max_el);\n var ei_arr = ei.ToArray();\n int bb = 54;\n }\n */\n\n \n\n \n /*\n foreach (var item in sorted_arr)\n {\n Console.WriteLine(item);\n }\n */\n \n /*\n foreach (var item in stringQuery)\n {\n Console.WriteLine(item);\n }\n \n */\n\n\n //Console.Read();\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "31d38bff551a9aea41d1871cfcf9f9b5", "src_uid": "0f1ab296cbe0952faa904f2bebe0567b", "apr_id": "fc170678d8aad63215fc109beda0d62e", "difficulty": 1700, "tags": ["dp", "math", "combinatorics"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.9892833221701273, "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.Text;\nusing System.Threading.Tasks;\n\nnamespace ConsoleApplication5\n{\n class Program\n {\n public static string f(int number)\n {\n Dictionary dic = new Dictionary();\n dic.Add(1, \"one\"); dic.Add(10, \"ten\");\n dic.Add(2, \"two\"); dic.Add(11, \"eleven\");\n dic.Add(3, \"three\"); dic.Add(12, \"twelve\");\n dic.Add(4, \"four\"); dic.Add(13, \"thirteen\");\n dic.Add(5, \"five\"); dic.Add(14, \"fourteen\");\n dic.Add(6, \"six\"); dic.Add(15, \"fifteen\");\n dic.Add(7, \"seven\"); dic.Add(16, \"sixteen\");\n dic.Add(8, \"eight\"); dic.Add(17, \"seventeen\");\n dic.Add(9, \"nine\"); dic.Add(18, \"eighteen\");\n dic.Add(19, \"nineteen\"); dic.Add(60, \"sixty\");\n dic.Add(20, \"twenty\"); dic.Add(70, \"seventy\");\n dic.Add(30, \"thirty\"); dic.Add(80, \"eighty\");\n dic.Add(40, \"forty\"); dic.Add(90, \"ninety\");\n dic.Add(50, \"fifty\");\n\n StringBuilder sbLine = new StringBuilder();\n if (number <= 20 || number%10 == 0)\n {\n return dic[number];\n }\n return dic[(number/10) * 10]+\"-\"+dic[number%10];\n }\n\n static void Main(string[] args)\n {\n int number = int.Parse(Console.ReadLine());\n Console.WriteLine(f(number));\n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "0a25544cc828c3b7877f252a662db661", "src_uid": "a49ca177b2f1f9d5341462a38a25d8b7", "apr_id": "b36b86850ffe18ced2f9972105974baa", "difficulty": 1000, "tags": ["brute force", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.9709618874773139, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "using System;\n\nnamespace AllProblems\n{\n class Program\n {\n static void Main(string[] args)\n {\n _535A_TavasAndNafas.Run();\n }\n }\n public class _535A_TavasAndNafas\n {\n private static string[] NUMS = new string[] {\"one\", \"two\", \"three\", \"four\", \"five\", \"six\", \"seven\", \"eight\", \"nine\", \"ten\", \"eleven\", \"twelve\", \"thirteen\", \"fourteen\", \"fifteen\", \"sixteen\", \"seventeen\", \"eighteen\", \"nineteen\"};\n private static string[] TENS = new string[] {\"ten\", \"twenty\", \"thirty\", \"forty\", \"fifty\", \"sixty\", \"seventy\", \"eighty\", \"ninety\"};\n \n public static void Run()\n {\n var n1 = Console.ReadLine().Trim();\n var n = Int32.Parse(n1);\n Console.WriteLine(getWord(n));\n }\n \n private static string getWord(int n) {\n if (n < 20) {\n return NUMS[n - 1];\n } else {\n int mod = (n - 1) % 10;\n return TENS[(int)(n / 10) - 1] + (mod < 9 ? (\"-\" + NUMS[mod]): \"\");\n }\n }\n }\n}", "lang": "MS C#", "bug_code_uid": "44fab8e2c898f352e803b9a0a6a5e7d5", "src_uid": "a49ca177b2f1f9d5341462a38a25d8b7", "apr_id": "b2f345e72be0f887dd8a5c0cf3e1fdea", "difficulty": 1000, "tags": ["brute force", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.9949801849405548, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "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 ConsoleApplication1\n{\n class Program\n {\n static void Main(string[] args)\n {\n var from = Console.ReadLine().ToCharArray();\n var to = Console.ReadLine().ToCharArray();\n var clonef = ((char[])from.Clone()).ToList();\n\n if (from.Length == to.Length && to.All(p=>{\n var contains = clonef.Contains(p);\n clonef.Remove(p);\n return contains;\n }))//array\n {\n Console.WriteLine(\"array\");\n }\n else\n {\n if (to.All(p =>\n {\n var contains = clonef.Contains(p);\n clonef.Remove(p);\n return contains;\n }))\n {\n var i = 0;\n var j = 0;\n clonef = from.Clone();\n while (i < to.Length && j < clonef.Count)\n {\n if (clonef[j] == to[i])\n {\n i++;\n clonef.RemoveAt(j);\n\n }\n else\n {\n j++;\n }\n }\n \n if (i == to.Length)\n {\n Console.WriteLine(\"automaton\");\n }\n else\n {\n \n Console.WriteLine(\"both\");\n }\n }\n else\n {\n Console.WriteLine(\"need tree\");\n }\n }\n }\n }\n}", "lang": "Mono C#", "bug_code_uid": "e2141effda542572b4377598849dca91", "src_uid": "edb9d51e009a59a340d7d589bb335c14", "apr_id": "f3160ffda38bce0a133d9e0969b421e0", "difficulty": 1400, "tags": ["strings", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.07161928694832731, "equal_cnt": 41, "replace_cnt": 35, "delete_cnt": 2, "insert_cnt": 4, "fix_ops_cnt": 41, "bug_source_code": "using System;\nusing System.Data;\nusing System.DirectoryServices;\nusing System.DirectoryServices.AccountManagement;\nusing System.IO;\nusing System.Linq;\nusing System.Reflection;\nusing System.Security.Principal;\nusing System.Xml;\nusing System.Xml.Linq;\nusing System.Xml.XPath;\nusing Microsoft.SqlServer.Management.Smo;\nusing Microsoft.Web.Administration;\n\nnamespace XPathTest\n{\n\tinternal class Program\n\t{\n\t\tprivate static void Main(string[] args)\n\t\t{\n\t\t\tAnotherTest();\n\t\t\tConsole.ReadKey();\n\t\t}\n\n\t\tprivate static void TestUser()\n\t\t{\n\t\t\tConsole.WriteLine(WindowsIdentity.GetCurrent().Name);\n\t\t\tvar wp = new WindowsPrincipal(new WindowsIdentity(WindowsIdentity.GetCurrent().Token));\n\t\t\tvar type = typeof(WindowsIdentity);\n\t\t\tvar method = type.GetMethods(BindingFlags.Instance | BindingFlags.NonPublic).First(m => m.Name == \"CreateFromToken\");\n\t\t\tvar obj = new WindowsIdentity(WindowsIdentity.GetCurrent().Token);\n\t\t\tvar result = method.Invoke(obj, new object[] { WindowsIdentity.GetCurrent().Token });\n\t\t\tConsole.WriteLine(obj.Name + \" \" + obj.Token);\n\t\t\t//Console.WriteLine(result.Name + \" \" + result.Token);\n\t\t\tConsole.WriteLine(WindowsIdentity.GetCurrent().Token);\n\t\t}\n\n\t\tpublic static void AnotherTest()\n\t\t{\n\t\t\tvar user = WindowsIdentity.GetCurrent().User;\n\t\t\tConsole.WriteLine(user.AccountDomainSid);\n\t\t}\n\n\t\tprivate static void TestCreateAppDomain()\n\t\t{\n\t\t\tvar domain = AppDomain.CreateDomain(\"TestDomain\");\n\t\t\tConsole.WriteLine(WindowsIdentity.GetCurrent().Token);\n\t\t\tdomain.SetThreadPrincipal(new WindowsPrincipal(new WindowsIdentity(WindowsIdentity.GetCurrent().Token)));\n\t\t\tdomain.ExecuteAssembly(@\"C:\\Users\\Andrey.Titov\\Documents\\Visual Studio 2013\\Projects\\Test\\ConsoleApplication2\\bin\\Debug\\ConsoleApplication2.exe\");\n\t\t\tvar newDom = AppDomain.CreateDomain(\"Test\");\n\t\t\tnewDom.SetThreadPrincipal(new WindowsPrincipal(new WindowsIdentity(WindowsIdentity.GetCurrent().Token)));\n\t\t\tnewDom.ExecuteAssembly(@\"C:\\Users\\Andrey.Titov\\Documents\\Visual Studio 2013\\Projects\\Test\\ConsoleApplication2\\bin\\Debug\\ConsoleApplication2.exe\");\n\t\t\tAppDomain.Unload(domain);\n\t\t\tAppDomain.Unload(newDom);\n\t\t\tConsole.WriteLine(WindowsIdentity.GetCurrent().Token);\n\t\t}\n\n\t\tprivate static void ProgramFilesTest()\n\t\t{\n\t\t\tConsole.WriteLine(Environment.ExpandEnvironmentVariables(@\"%SYSTEMROOT%\\Microsoft.NET\\Framework\\v4*\"));\n\t\t}\n\n\t\tprivate static void Test()\n\t\t{\n\t\t\tvar dir = new DirectoryInfo(@\"C:\\Windows\\System32\\inetsrv\\config\");\n\t\t\tforeach (var fileInfo in dir.EnumerateFiles()) {\n\t\t\t\tConsole.WriteLine(fileInfo.Name);\n\t\t\t}\n\t\t\t//var doc = new XmlDocument();\n\t\t\t//doc.Load(@\"C:\\Windows\\System32\\inetsrv\\config\\applicationHost.config\");\n\t\t\t//XmlNode root = doc.DocumentElement;\n\n\t\t\t//XmlNode node = root.SelectSingleNode(@\"/configuration/configSections/sectionGroup[@name='system.webServer']/section[@name='handlers']\");\n\t\t\t//foreach (XmlAttribute attr in node.Attributes)\n\t\t\t//{\n\t\t\t//\tConsole.WriteLine(attr.Name);\n\t\t\t//}\n\t\t}\n\n\t\tprivate static void Machine()\n\t\t{\n\t\t\tusing (var context = new PrincipalContext(ContextType.Machine)) {\n\t\t\t\tusing (var searcher = new PrincipalSearcher(new UserPrincipal(context))) {\n\t\t\t\t\tforeach (var result in searcher.FindAll()) {\n\t\t\t\t\t\tvar de = result.GetUnderlyingObject() as DirectoryEntry;\n\t\t\t\t\t\tvar samAccountName = de.Properties[\"samAccountName\"].Value;\n\t\t\t\t\t\tvar name = de.Properties[\"Name\"].Value;\n\t\t\t\t\t\tConsole.WriteLine(samAccountName);\n\t\t\t\t\t\tConsole.WriteLine(name);\n\t\t\t\t\t\tConsole.WriteLine();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tprivate static void TestWin10()\n\t\t{\n\t\t}\n\n\t\tprivate static void Ad()\n\t\t{\n\t\t\tusing (var context = new PrincipalContext(ContextType.Domain, \"INTRANET\")) {\n\t\t\t\tusing (var searcher = new PrincipalSearcher(new UserPrincipal(context))) {\n\t\t\t\t\tforeach (var result in searcher.FindAll()) {\n\t\t\t\t\t\tvar de = result.GetUnderlyingObject() as DirectoryEntry;\n\t\t\t\t\t\tvar samAccountName = de.Properties[\"samAccountName\"].Value;\n\t\t\t\t\t\tvar name = de.Properties[\"Name\"].Value;\n\t\t\t\t\t\tConsole.WriteLine(samAccountName);\n\t\t\t\t\t\tConsole.WriteLine(name);\n\t\t\t\t\t\tConsole.WriteLine();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tprivate static void TestSqlServers()\n\t\t{\n\t\t\tDataTable localServers = SmoApplication.EnumAvailableSqlServers(true);\n\t\t\tDataRow[] rows = localServers.Select(string.Empty, \"IsLocal desc, Name asc\");\n\t\t\tDataTable netServers = SmoApplication.EnumAvailableSqlServers();\n\t\t\tvar netRows = netServers.Select(string.Empty, \"IsLocal desc, Name asc\");\n\t\t\tvar totalRows = rows.Concat(netRows).ToArray();\n\t\t\tforeach (var row in netRows)\n\t\t\t{\n\t\t\t\tConsole.WriteLine(row[0]);\n\t\t\t}\n\t\t}\n\t}\n}", "lang": "MS C#", "bug_code_uid": "98f0f0113f2d6dc4e2490395f1aa2ee9", "src_uid": "9c5b6d8a20414d160069010b2965b896", "apr_id": "87fa1fdca7c5eaffaf3dd253aaf046b0", "difficulty": 800, "tags": ["math", "number theory"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.7506132461161079, "equal_cnt": 9, "replace_cnt": 4, "delete_cnt": 1, "insert_cnt": 4, "fix_ops_cnt": 9, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\n\n class Program\n {\n static void Main(string[] args)\n {\n string h = Console.ReadLine();\n\n int m = Convert.ToInt32(h.Substring(0, 1));\n int n = Convert.ToInt32(h.Substring(2, 1));\n\n int s = 0;\n int p = 0;\n int a = 0, b = 0, q = 0;\n\n if (m > n)\n {\n q = Convert.ToInt32(Math.Sqrt(m));\n while (s <= m)\n {\n if (q * q + s == m)\n {\n a = q;\n b = m - q * q;\n\n if (a + b * b == n)\n {\n p++;\n }\n }\n s = s + 1;\n }\n }\n\n else\n {\n q = Convert.ToInt32(Math.Sqrt(n));\n\n while (s <= n)\n {\n if (q * q + s == n)\n {\n b = q;\n a = n - q * q;\n\n if (a * a + b == m)\n {\n p++;\n }\n }\n s = s + 1;\n }\n }\n\n Console.WriteLine(p);\n \n }\n }", "lang": "Mono C#", "bug_code_uid": "dbf38cab9923329550f458510c085cb2", "src_uid": "03caf4ddf07c1783e42e9f9085cc6efd", "apr_id": "3b00200d813559269f63900afa019947", "difficulty": 800, "tags": ["brute force"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.8625525946704067, "equal_cnt": 5, "replace_cnt": 2, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 4, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\n\nnamespace contest214\n{\n class Program\n {\n static void Main(string[] args)\n {\n int n;\n int m;\n int c = 0;\n\n n = Convert.ToInt32(Console.ReadLine());\n m = Convert.ToInt32(Console.ReadLine());\n\n for (int a = 0; a < 1000; a++)\n {\n for (int b = 0; b < 1000; b++)\n {\n if ((a * a + b == n) && (a + b * b == m) && m <= 1000 && n >= 1) c++;\n }\n }\n\n Console.WriteLine(c);\n\n Console.ReadKey();\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "9e8f8803243db15305bad53502189e6a", "src_uid": "03caf4ddf07c1783e42e9f9085cc6efd", "apr_id": "b13f1dcd4cc8374000450b6f5a621fc1", "difficulty": 800, "tags": ["brute force"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9951020408163266, "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.Text;\nusing System.Threading.Tasks;\n\nnamespace ConsoleApplication3\n{\n class Program\n {\n static void Main(string[] args)\n {\n try\n {\n int m = int.Parse(Console.ReadLine());\n int[] ar = new int[6];\n for (int i = 0; i < m; i++)\n {\n int[] ar2 = Console.ReadLine().Split(' ').Select(int.Parse).ToArray();\n ar[ar2[0]-1]++;\n ar[ar2[1]-1]++;\n }\n int c = 0;\n if (m % 2 == 0)\n c = m / 2;\n else\n c = m / 2 + 1;\n bool q = false;\n for (int i = 0; i < 5; i++)\n {\n if(ar[i]>=c)\n {\n q = true;\n break;\n }\n }\n if(q)\n Console.WriteLine(\"WIN\");\n else\n Console.WriteLine(\"FAIL\");\n Console.ReadKey();\n }\n catch { }\n }\n \n }\n}", "lang": "MS C#", "bug_code_uid": "2400bf27c55ee6aee2c625e13fe738fc", "src_uid": "2bc18799c85ecaba87564a86a94e0322", "apr_id": "1c553b2add24995f675d179778ff85ed", "difficulty": 1300, "tags": ["graphs", "math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.920495275333985, "equal_cnt": 8, "replace_cnt": 3, "delete_cnt": 1, "insert_cnt": 3, "fix_ops_cnt": 7, "bug_source_code": "using System;\nusing System.Globalization;\nusing System.IO;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Diagnostics;\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.Solve();\n p.Out(x);\n }\n object Solve()\n {\n var n = ReadLong();\n var a = ReadLongs();\n var res = 0;\n var flag = false;\n for (int i = 0; i < n - 1; i++)\n {\n if (a[i] == 1 && a[i + 1] == 0)\n res++;\n }\n return n - res;\n\n }\n\n long CalcRow(string s)\n {\n long zeros = s.Count(x => x == '0');\n //if (zeros % s.Length == 0)\n // return s.Length;\n return FastPow(2, zeros) + FastPow(2, s.Length - zeros) - 2;\n }\n\n long CalcCol(string[] grid, int col)\n {\n long zeros = grid.Select(x => x[col]).Count(x => x == '0');\n return FastPow(2, zeros) + FastPow(2, grid.Length - zeros) - 2;\n }\n\n long FastPow(long b, long pow)\n {\n if (pow == 0)\n return 1;\n if (pow == 1)\n return b;\n if (pow % 2 == 0)\n return FastPow(b * b, pow / 2);\n return FastPow(b, pow - 1) * b;\n }\n\n class Put\n {\n public long Left { get; set; }\n public long Right { get; set; }\n public long Cost { get; set; }\n\n public long Length() { return Right - Left + 1; }\n }\n\n bool Match(string s, string template, string good)\n {\n for (int i = 0; i < s.Length; i++)\n {\n if (s[i] != template[i] && (template[i] != '?' || good.IndexOf(s[i]) == -1))\n return false; \n }\n return true;\n }\n\n \n class Vac\n {\n public long Left { get; set; }\n public long Right { get; set; }\n public long Cost { get; set; }\n }\n\n class End\n {\n public long Val { get; set; }\n public bool Left { get; set; }\n }\n }\n\n abstract class ProgramBase\n {\n bool? prod = null;\n StreamReader f;\n Queue tokens;\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(1024 * 10), Encoding.ASCII, false, 1024 * 10)\n : new StreamReader((GetProd() ? \"\" : \"c:\\\\dev\\\\\") + FileName);\n return f.ReadLine();\n }\n\n protected string ReadToken()\n {\n if (tokens == null || tokens.Count == 0)\n tokens = new Queue(Read().Split(' '));\n return tokens.Dequeue();\n }\n\n protected long ReadLong() { return long.Parse(ReadToken()); }\n\n protected long[] ReadLongs()\n {\n var s = Read();\n if (s == \"\")\n return new long[0];\n //var i = s.IndexOf(' ');\n //return new[] { long.Parse(s.Substring(0, i)), long.Parse(s.Substring(i + 1)) };\n var tokens = s.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 s, string d) { return string.Join(d, s.ToArray()); }\n\n public static string JoinStrings(this IEnumerable s, string d) { return s.Select(x => x.ToString()).JoinStrings(d); }\n public static string JoinStrings(this IEnumerable s, string d) { return s.Select(x => x.ToString()).JoinStrings(d); }\n }\n\n}", "lang": "MS C#", "bug_code_uid": "cd57b25632a3e96ee31a80d4f2f60d60", "src_uid": "c7b1f0b40e310f99936d1c33e4816b95", "apr_id": "4b28c24a64d6d945bbf98ae8e21045f6", "difficulty": 1500, "tags": ["brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.8862144420131292, "equal_cnt": 3, "replace_cnt": 3, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 4, "bug_source_code": "\n\nvoid Main()\n{\n\tint n =int.Parse(Console.ReadLine());\n\n\tstring[] game = Console.ReadLine().Split();\n\tint[] ans = new int [n];\n\t\n\tfor (int k=0;k0) ans[k] = ans[k-1];\n\t\tif (game[k]==\"0\") ans[k]++;\n\t}\n\tint max = 0;\n\tint t = 0;\n\t\n\tfor (int i =0;i0) t+= ans[i-1];\n\t\tif (max size[i] - 1) ? size[i] - 1 : k / (3 - i);\n k -= beats[i];\n }\n\n ulong result = (ulong)((beats[0] + 1) * (beats[1] + 1) * (beats[2] + 1));\n\n Console.WriteLine(result);\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "8db7ba24b5c23c0b5c48ce0ed3838d3a", "src_uid": "8787c5d46d7247d93d806264a8957639", "apr_id": "01dd5ece2c70302d980d907c2f9abd90", "difficulty": 1600, "tags": ["math", "greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.6284246575342466, "equal_cnt": 16, "replace_cnt": 8, "delete_cnt": 0, "insert_cnt": 7, "fix_ops_cnt": 15, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\n\nnamespace ProgrammingContest.Codeforces.Round66\n{\n class A\n {\n public static void Main()\n {\n var xs = Array.ConvertAll(Console.ReadLine().Split(' '), sss=>int.Parse(sss));\n int k = xs[3];\n long a = 1+(k + 2) / 3,\n b = 1 + (k + 1) / 3,\n c = 1 + k / 3;\n Console.WriteLine(a*b*c);\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "f649f3680fabe820e92d46a95110f809", "src_uid": "8787c5d46d7247d93d806264a8957639", "apr_id": "ad7da8a0df25bdd8e785bd8df0892618", "difficulty": 1600, "tags": ["math", "greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.45115332428765265, "equal_cnt": 20, "replace_cnt": 11, "delete_cnt": 2, "insert_cnt": 6, "fix_ops_cnt": 19, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace ConsoleApplication1\n{\n class Program\n {\n public static long GCD(long a, long b)\n {\n long n = a;\n long t = b;\n while (t != 0)\n {\n n %= t;\n long s = n;\n n = t;\n t = s;\n }\n return n;\n }\n\n static long f(long n)\n {\n if (n == 1)\n return 1;\n long ans = 0;\n for(long i = 1; i <= n/2;i++)\n {\n if(GCD(n,i) == 1)\n {\n ans += 2;\n }\n }\n return ans;\n }\n static void Main()\n {\n string[] token = Console.ReadLine().Split(' ');\n long n = long.Parse(token[0]);\n long k = long.Parse(token[1]);\n long t = (k + 1) / 2;\n long ans = f(n);\n while(t != 1)\n {\n ans = f(ans);\n t--;\n }\n Console.WriteLine(ans);\n Console.Read();\n }\n }\n}", "lang": "MS C#", "bug_code_uid": "f0d2807ec65b69258086017ada0a22cf", "src_uid": "0591ade5f9a69afcbecd80402493f975", "apr_id": "8f38153271d85a4f6cc5af6c469982d1", "difficulty": 2100, "tags": ["math", "number theory"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.8552472858866104, "equal_cnt": 14, "replace_cnt": 1, "delete_cnt": 2, "insert_cnt": 10, "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 ConsoleApplication1\n{\n class Program\n {\n const long mod = 1000000007;\n static long phi(long n)\n {\n long result = n;\n for (long i = 2; i * i <= n; ++i)\n if (n % i == 0)\n {\n while (n % i == 0)\n n /= i;\n result -= result / i;\n }\n if (n > 1)\n result -= result / n;\n return result;\n }\n\n static void Main()\n {\n string[] token = Console.ReadLine().Split(' ');\n long n = long.Parse(token[0]);\n long k = long.Parse(token[1]);\n long t = 1;\n long ans = n;\n if (k >= n)\n {\n Console.WriteLine(1);\n return;\n }\n else\n {\n while (t <= k)\n {\n if (t == 1)\n {\n ans = phi(ans);\n t++;\n }\n else if (t % 2 == 1)\n {\n ans = phi(ans);\n t++;\n }\n else\n {\n t++;\n continue;\n }\n }\n }\n Console.WriteLine(ans % mod);\n Console.Read();\n }\n }\n}", "lang": "MS C#", "bug_code_uid": "f67e9362ed1ea500ac53e8e451472b89", "src_uid": "0591ade5f9a69afcbecd80402493f975", "apr_id": "8f38153271d85a4f6cc5af6c469982d1", "difficulty": 2100, "tags": ["math", "number theory"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.9333333333333333, "equal_cnt": 4, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 3, "bug_source_code": "namespace topCoder\n{\n\tusing System;\n\tusing System.Collections.Generic;\n\n\tclass p3\n\t{\n\t\tstatic void Main(string[] args)\n\t\t{\n\t\t\t//p1 o = new p1();\n\t\t\t//o.foo();\n\n\t\t\t//p2 o = new p2();\n\t\t\t//o.foo();\n\n\t\t\tp3 o = new p3();\n\t\t\to.foo();\n\t\t}\n\t\tpublic void foo()\n\t\t{\n\t\t\tstring[] sp = Console.ReadLine().Split(' ');\n\t\t\tint n = int.Parse(sp[0]);\n\t\t\tint m = int.Parse(sp[1]);\n\t\t\tbfs(n, m);\n\t\t}\n\t\tprivate void bfs(int n, int m)\n\t\t{\n\t\t\tQueue> q = new Queue>();\n\t\t\tq.Enqueue(new KeyValuePair(n, 0));\n\t\t\twhile (q.Count > 0)\n\t\t\t{\n\t\t\t\tKeyValuePair pr = q.Dequeue();\n\t\t\t\tint cur = pr.Key;\n\t\t\t\tint d = pr.Value;\n\t\t\t\tif (cur == m)\n\t\t\t\t{\n\t\t\t\t\tConsole.WriteLine(d); return;\n\t\t\t\t}\n\t\t\t\tq.Enqueue(new KeyValuePair(2*cur, d+1));\n\t\t\t\tq.Enqueue(new KeyValuePair(cur-1, d + 1));\n\t\t\t}\n\t\t}\n\t}\n}\n\n", "lang": "MS C#", "bug_code_uid": "2769fa7fb1d8998f5863799094a09e71", "src_uid": "861f8edd2813d6d3a5ff7193a804486f", "apr_id": "fdf239df1970adbcda341d9e8f2136ae", "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.5444310414153599, "equal_cnt": 13, "replace_cnt": 8, "delete_cnt": 4, "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 Z1294\n{\n class Program\n {\n struct Node\n {\n public int num, operations;\n }\n\n static void Main(string[] args)\n {\n string[] req = Console.ReadLine().Split(' ');\n\n int m, n;\n\n n = int.Parse(req[0]);\n m = int.Parse(req[1]);\n\n Queue nums = new Queue();\n\n nums.Enqueue(new Node() { operations = 1, num = n});\n\n while (nums.Count > 0)\n {\n Node temp = nums.Dequeue();\n\n if (temp.num * 2 == m || temp.num - 1 == m)\n {\n Console.WriteLine(temp.operations);\n return;\n }\n else\n {\n nums.Enqueue(new Node() { operations = temp.operations + 1, num = temp.num * 2 });\n\n if (temp.num > 0)\n nums.Enqueue(new Node() { operations = temp.operations + 1, num = temp.num - 1 });\n }\n }\n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "29386559e1d40802985afef0cca1ebf5", "src_uid": "861f8edd2813d6d3a5ff7193a804486f", "apr_id": "2ec25578300c84afa539973e4ef2f7c8", "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.7008821170809943, "equal_cnt": 10, "replace_cnt": 3, "delete_cnt": 2, "insert_cnt": 4, "fix_ops_cnt": 9, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\n\nnamespace CodeForces\n{\n class R175_Div2_D\n {\n static void Main(string[] args)\n {\n long mod = 1000000007;\n int n = int.Parse(Console.ReadLine());\n\n long f = 1;\n for (int i = 1; i <= n; i++)\n f *= i;\n\n f *= f;\n\n for (int i = 1; i <= n-2; i++)\n f /= 2;\n\n f = f % mod;\n\n if (n == 2)\n Console.WriteLine(0);\n else\n Console.WriteLine(f);\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "09675d47d83f8b218f98a7cb1814ee44", "src_uid": "a6a804ce23bc48ec825c17d64ac0bb69", "apr_id": "bb13c98bb6295e700fc102c78d92cc51", "difficulty": 1900, "tags": ["dp", "meet-in-the-middle", "combinatorics", "bitmasks", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.559973492379059, "equal_cnt": 25, "replace_cnt": 17, "delete_cnt": 3, "insert_cnt": 4, "fix_ops_cnt": 24, "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 string[] str = Console.ReadLine().Split(' ');\n var dt = System.DateTime.Now;\n int t = int.Parse(str[0]);\n int l = int.Parse(str[1]);\n int r = int.Parse(str[2]);\n int mod = 1000000007;\n \n long[] f = new long[5000010];\n\n f[2] = 1;\n int prime;\n for (int i = 3; i <= r; i++)\n {\n prime = 1;\n for (int j = 2; j * j <= i; j++)\n {\n if ( i%j == 0 )\n {\n int d = i / j;\n f[i] = (long)d * f[j] + f[d];\n prime = 0;\n break;\n }\n }\n if (prime == 1)\n {\n f[i] = (long)i * (i - 1) / 2;\n } \n }\n\n /*for (int i = 4500000; i < 4500100; i++)\n Console.WriteLine(f[i]);\n */ \n int res = 0;\n\n for (int i = r; i >= l; i--) res = (int) ( ((long)res * t + f[i]) % mod );\n\n\n /* for (int i = r; i <= r; i++)\n { \n res += (int) ( ((long)st * f[i])%mod );\n res = (int)( res % mod );\n st = (int) ( ( (long)t * (long)st ) %mod );\n }*/\n Console.WriteLine(res);\n //Console.WriteLine(System.DateTime.Now - dt);\n }\n } \n \n}\n", "lang": "MS C#", "bug_code_uid": "f51ab4e4593b568a74f5d42368daa796", "src_uid": "c9d45dac4a22f8f452d98d05eca2e79b", "apr_id": "0341e8bd4898cd0f066dc3bad3a5d136", "difficulty": 1800, "tags": ["dp", "number theory", "greedy", "math", "brute force"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9991356957649092, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "using System;\nclass Test{\n public static void Main(String[] args){\n string [] str = Console.ReadLine().Split();\n int n = Int32.Parse(str[0]);\n int a = Int32.Parse(str[1]);\n int b = Int32.Parse(str[2]);\n int sum1 = n-a;\n int sum2 = n-b;\n if(a+b>=n){\n Console.WriteLine(n-a);\n }else{\n if(n-a>b){\n Console.WriteLine(b+1);\n } else if(n-a == b){\n Console.WriteLie(b);\n } else {\n Console.WriteLine(n-a);\n }\n }\n }\n}", "lang": "Mono C#", "bug_code_uid": "c12fb532d14ed0c0b1770382dab60a19", "src_uid": "51a072916bff600922a77da0c4582180", "apr_id": "ac04015b86dc1104e5fda470dde0867b", "difficulty": 1000, "tags": ["math"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.3392857142857143, "equal_cnt": 6, "replace_cnt": 1, "delete_cnt": 3, "insert_cnt": 3, "fix_ops_cnt": 7, "bug_source_code": "static void Main(string[] args)\n {\n int n = int.Parse(Console.ReadLine());\n int i = 2;\n int f = n;\n int c = 1;\n int l = n;\n\n while (f > 1) {\n f = (n - n % i) / i;\n if (l != f)\n {\n l = f;\n c++;\n }\n i++;\n }\n\n Console.WriteLine(c);\n }", "lang": "Mono C#", "bug_code_uid": "96cf17acb556d6d78430bcd4f395129a", "src_uid": "5551742f6ab39fdac3930d866f439e3e", "apr_id": "3eccc6dc9deeab40a0194847eeeec9ed", "difficulty": 800, "tags": ["math"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C#"} {"similarity_score": 0.6902654867256637, "equal_cnt": 8, "replace_cnt": 3, "delete_cnt": 4, "insert_cnt": 1, "fix_ops_cnt": 8, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace _123\n{\n class Program\n {\n static void Main(string[] args)\n {\n int a = Convert.ToInt32( Console.ReadLine());\n //\n int index = 0;\n int B = a;\n while (B != 1)\n {\n index++;\n B = a / index; \n }\n //\n Console.WriteLine(index);\n Console.ReadKey();\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "2ad5ddb84d0f094e64382b483efe92f6", "src_uid": "5551742f6ab39fdac3930d866f439e3e", "apr_id": "32917b4cecffdfc2b500f93963acbea6", "difficulty": 800, "tags": ["math"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C#"} {"similarity_score": 0.9878283151825753, "equal_cnt": 10, "replace_cnt": 2, "delete_cnt": 3, "insert_cnt": 4, "fix_ops_cnt": 9, "bug_source_code": "using System;\nusing System.Globalization;\nusing System.IO;\nusing System.Text;\nusing static System.Console;\nusing static System.Math;\n\nnamespace Olymp\n{\n public class ProblemSolver\n {\n private readonly Tokenizer input;\n\n public void Solve()\n {\n var s1 = input.ReadToken();\n var s2 = input.ReadToken();\n var d1 = DateTime.ParseExact(s1, \"hh:mm\", null).TimeOfDay;\n var d2 = DateTime.ParseExact(s2, \"hh:mm\", null).TimeOfDay;\n var dd = (d2 - d1).TotalMinutes / 2;\n Write(d1.Add(TimeSpan.FromMinutes(dd)).ToString(@\"hh\\:mm\"));\n }\n\n public ProblemSolver(TextReader input)\n {\n this.input = new Tokenizer(input);\n }\n }\n\n #region Service classes\n\n public class Tokenizer\n {\n private TextReader reader;\n\n public string ReadToEnd()\n {\n return this.reader.ReadToEnd();\n }\n\n public int ReadInt()\n {\n var c = SkipWS();\n if (c == -1)\n throw new EndOfStreamException();\n var isNegative = false;\n if (c == '-' || c == '+')\n {\n isNegative = c == '-';\n c = this.reader.Read();\n if (c == -1)\n throw new InvalidOperationException();\n }\n if (!char.IsDigit((char)c))\n throw new InvalidOperationException();\n var result = (char)c - '0';\n c = this.reader.Read();\n while (c > 0 && !char.IsWhiteSpace((char)c))\n {\n if (!char.IsDigit((char)c))\n throw new InvalidOperationException();\n result = result * 10 + (char)c - '0';\n c = this.reader.Read();\n }\n if (isNegative)\n result = -result;\n return result;\n }\n\n public string ReadLine()\n {\n return reader.ReadLine();\n }\n\n public long ReadLong()\n {\n return long.Parse(this.ReadToken());\n }\n\n public double ReadDouble()\n {\n return double.Parse(this.ReadToken(), CultureInfo.InvariantCulture);\n }\n\n public int[] ReadIntArray(int n)\n {\n var a = new int[n];\n for (var i = 0; i < n; i++)\n a[i] = ReadInt();\n return a;\n }\n\n public long[] ReadLongArray(int n)\n {\n var a = new long[n];\n for (var i = 0; i < n; i++)\n a[i] = ReadLong();\n return a;\n }\n\n public double[] ReadDoubleArray(int n)\n {\n var a = new double[n];\n for (var i = 0; i < n; i++)\n a[i] = ReadDouble();\n return a;\n }\n\n public string ReadToken()\n {\n var c = SkipWS();\n if (c == -1)\n return null;\n var sb = new StringBuilder();\n while (c > 0 && !char.IsWhiteSpace((char)c))\n {\n sb.Append((char)c);\n c = this.reader.Read();\n }\n return sb.ToString();\n }\n\n private int SkipWS()\n {\n var c = this.reader.Read();\n if (c == -1)\n return c;\n while (c > 0 && char.IsWhiteSpace((char)c))\n c = this.reader.Read();\n return c;\n }\n\n public Tokenizer(TextReader reader)\n {\n this.reader = reader;\n }\n }\n\n internal class Program\n {\n public static void Main(string[] args)\n {\n var solver = new ProblemSolver(Console.In);\n solver.Solve();\n }\n }\n\n #endregion\n}", "lang": "Mono C#", "bug_code_uid": "c67c6aec27ad8df0527166d0f4d1c3ac", "src_uid": "f7a32a8325ce97c4c50ce3a5c282ec50", "apr_id": "a26c898a9df5ce3bf6745f196b07321c", "difficulty": 1000, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.41783750763591937, "equal_cnt": 16, "replace_cnt": 10, "delete_cnt": 3, "insert_cnt": 3, "fix_ops_cnt": 16, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace ConsoleApplication42\n{\n class Program\n {\n static void Main(string[] args)\n {\n int a = Convert.ToInt32(Console.ReadLine());\n string[] s = Console.ReadLine().Split();\n int b = Convert.ToInt32(s[0]);\n for (int i = 0; i < a; ++i)\n {\n if (b <= Convert.ToInt32(s[i]))\n {\n b = Convert.ToInt32(s[i]);\n }\n }\n int c = b - 5;\n int sh = 0;\n for (int i = 0; i < a; ++i)\n {\n if (c <= Convert.ToInt32(s[i]))\n {\n sh++;\n }\n }\n Console.WriteLine(sh);\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "60ea75557dd622b5111289edb300ba5e", "src_uid": "f7a32a8325ce97c4c50ce3a5c282ec50", "apr_id": "3ae083d25cf77ab7e34d88a4adb4a76a", "difficulty": 1000, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9996012759170654, "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.Text;\nusing System.Threading.Tasks;\n\nnamespace lab1\n{\n class Program\n {\n static void Main(string[] args)\n {\n Console.OutputEncoding = Encoding.Unicode;\n //Console.Write(\"Введите размер массива: \");\n int n = Convert.ToInt32(Console.ReadLine());\n int[] array = new int[n];\n /*for (int i = 0; i < n; i++)\n {\n Console.Write(\"\\nВведите \" + Convert.ToString(i + 1) + \" элемент: \");\n array[i] = Convert.ToInt32(Console.ReadLine());\n }*/\n string[] line = Console.ReadLine().Split(' ');\n for (int i = 0; i < n; i++)\n array[i] = Convert.ToInt32(line[i]);\n MergeSortAlgorithm.MergeSort(array, 0, n - 1);\n for (int i = 0; i < n; i++)\n {\n Console.Write(Convert.ToString(array[i]) + \" \");\n }\n //Console.ReadKey();\n }\n }\n\n class MergeSortAlgorithm where T : IComparable\n {\n public static void MergeSort(T[] array, int left, int right)\n {\n if (left == right)\n return;\n int mid = (left + right) / 2;\n MergeSort(array, left, mid);\n MergeSort(array, mid + 1, right);\n Merge(array, left, mid, array, mid + 1, right);\n }\n\n public static void Merge(T[] array1, int left1, int right1, T[] array2, int left2, int right2)\n {\n T[] newArray = new T[right2 - left2 + 1 + right1 - left1 + 1];\n int it1 = left1, it2 = left2, itNew = 0;\n while (it1 <= right1 || it2 <= right2)\n {\n if (it1 <= right1 && (it2 > right2 || Compare(ref array1[it1], ref array2[it2])))\n {\n newArray[itNew] = array1[it1++];\n }\n else\n {\n newArray[itNew] = array2[it2++];\n }\n itNew++;\n }\n itNew = 0;\n for (int i = left1; i <= right1; i++)\n {\n array1[i] = newArray[itNew++];\n }\n for (int i = left2; i <= right2; i++)\n {\n array2[i] = newArray[itNew++];\n }\n }\n\n public static bool Compare(ref T a, ref T b)// where T : IComparable\n {\n return a.CompareTo(b) <= 0;\n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "1c4bf732fd1482a0e1611b164d108f2c", "src_uid": "ae20712265d4adf293e75d016b4b82d8", "apr_id": "2d9e8bdb5f622d3aa214508b08713471", "difficulty": 900, "tags": ["greedy", "sortings", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.9992169146436961, "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.IO;\nusing System.Linq;\nusing System.Text;\n\nnamespace codeforces\n{\n class Program\n {\n public static string SortStringChars(string s)\n {\n char[] c = s.ToCharArray();\n Array.Sort(c);\n return new String(c);\n }\n static void Main(string[] args)\n {\n // StreamReader objReader = new StreamReader(\"input.txt\");\n string sa = Console.ReadLine();\n int[] input = Console.ReadLine().Split(' ').Select(x => int.Parse(x)).ToArray();\n \n string[] st = Console.ReadLine().Split(' ');\n // int k = int.Parse(st);\n // string[] Mas=new string[int.Parse(sa)];\n\n string s=\"\",Gamotana=\"\";\n\n //for (int i = 0; i < st.Length; i++)\n //{\n // Mas[i]= st[i];\n // // i++;\n //}\n\n //string sort = SortStringChars(s);.\n Array.Sort(input);\n for (int j = 0; j < input.Length; j++)\n {\n Gamotana += input[j];\n Gamotana += \" \";\n }\n string gamo= Gamotana.Remove(Gamotana.Length - 1);\n\n Console.WriteLine(gamo);\n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "4ea4775447929344f75dddc6ab83bf85", "src_uid": "ae20712265d4adf293e75d016b4b82d8", "apr_id": "32a5c2eca200dcf91a0c1f9bea2c7c55", "difficulty": 900, "tags": ["greedy", "sortings", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.9066317626527051, "equal_cnt": 3, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\n\nnamespace ConsoleApplication9\n{\n class Program\n {\n static void Main(string[] args)\n {\n string str = Console.ReadLine();\n\n int n = Int32.Parse(Console.ReadLine());\n\n Dictionary monthNumber = new Dictionary()\n {\n {1, \"January\"},\n {2, \"February\"},\n {3, \"March\"},\n {4, \"April\"},\n {5, \"May\"},\n {6, \"June\"},\n {7, \"July\"},\n {8, \"August\"},\n {9, \"September\"},\n {10, \"October\"},\n {11, \"November\"},\n {12, \"December\"}\n };\n\n int m = monthNumber.Where(el => el.Value == str).Select(el => el.Key).First();\n\n int result = (n + m) % 12;\n\n string month = monthNumber.Where(el => el.Key == result).Select(el => el.Value).First();\n\n Console.WriteLine(month);\n }\n }\n}", "lang": "MS C#", "bug_code_uid": "7e1c837a10c46b65c17f74164b3897a9", "src_uid": "a307b402b20554ce177a73db07170691", "apr_id": "a77e2c56fd084655f19cef716295cee1", "difficulty": 900, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9193631227529533, "equal_cnt": 5, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 4, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace ConsoleApplication34\n{\n class Program\n {\n static void Main(string[] args)\n {\n int n = Convert.ToInt32(Console.ReadLine());\n int r = 1;\n int t = 0;\n string [] a = Console.ReadLine().Split();\n List s = new List();\n for(int i = 0; i Numbers()\n {\n return !Next() ? new List() : _line.Split(' ').Select(long.Parse).ToList();\n }\n\n public static bool Next(out string value)\n {\n value = string.Empty;\n if (!Next()) return false;\n value = _line;\n return true;\n }\n }\n\n public class DisjointSet\n {\n private readonly int[] _parent;\n private readonly int[] _rank;\n public int Count { get; private set; }\n\n public DisjointSet(int count, int initialize = 0)\n {\n Count = count;\n _parent = new int[Count];\n _rank = new int[Count];\n for (var i = 0; i < initialize; i++) _parent[i] = i;\n }\n\n private DisjointSet(int count, int[] parent, int[] rank)\n {\n Count = count;\n _parent = parent;\n _rank = rank;\n }\n\n public void Add(int v)\n {\n _parent[v] = v;\n _rank[v] = 0;\n }\n\n public int Find_Recursive(int v)\n {\n if (_parent[v] == v) return v;\n return _parent[v] = Find(_parent[v]);\n }\n\n public int Find(int v)\n {\n if (_parent[v] == v) return v;\n var last = v;\n while (_parent[last] != last) last = _parent[last];\n while (_parent[v] != v)\n {\n var t = _parent[v];\n _parent[v] = last;\n v = t;\n }\n return last;\n }\n\n public int this[int v]\n {\n get { return Find(v); }\n set { Union(v, value); }\n }\n\n public void Union(int a, int b)\n {\n a = Find(a);\n b = Find(b);\n if (a == b) return;\n if (_rank[a] < _rank[b])\n {\n var t = _rank[a];\n _rank[a] = _rank[b];\n _rank[b] = t;\n }\n _parent[b] = a;\n if (_rank[a] == _rank[b]) _rank[a]++;\n }\n\n public int GetSetCount()\n {\n var result = 0;\n for (var i = 0; i < Count; i++)\n {\n if (_parent[i] == i) result++;\n }\n return result;\n }\n\n public DisjointSet Clone()\n {\n var rank = new int[Count];\n _rank.CopyTo(rank, 0);\n var parent = new int[Count];\n _parent.CopyTo(parent, 0);\n return new DisjointSet(Count, parent, rank);\n }\n\n public override string ToString()\n {\n return string.Join(\",\", _parent.Take(50));\n }\n }\n\n public class Matrix\n {\n public static Matrix Create(int i, int j)\n {\n var m = new Matrix(i, j);\n return m;\n }\n\n public static Matrix Create(int i)\n {\n var m = new Matrix(i, i);\n return m;\n }\n\n public long Modulo { get; set; }\n\n private readonly int _width;\n private readonly int _height;\n private readonly long[,] _data;\n public int Width{get { return _width; }}\n public int Height{get { return _height; }}\n\n private Matrix(int i, int j)\n {\n Modulo = 1000000000000000000L;\n _width = j;\n _height = i;\n _data = new long[_height, _width];\n }\n\n public static Matrix operator *(Matrix m1, Matrix m2)\n {\n if (m1.Width != m2.Height) throw new InvalidDataException(\"m1.Width != m2.Height\");\n var m = Create(m2.Width, m1.Height);\n m.Modulo = m1.Modulo;\n for (var i=0;i : IEnumerable>\n {\n private readonly List _items = new List();\n private Node _root;\n private readonly IComparer _comparer;\n\n public RedBlackTree()\n {\n _comparer = Comparer.Default;\n }\n\n private Node _search(TKey key)\n {\n var node = _root;\n while (node != null)\n {\n var i = _comparer.Compare(key, node.Key);\n if (i == 0) return node;\n node = i > 0 ? node.Right : node.Left;\n }\n return null;\n }\n\n public void Add(TKey key, TValue value)\n {\n var node = new Node { Key = key, Value = value, Red = true };\n _items.Add(node);\n if (_root == null)\n {\n _root = node;\n _root.Red = false;\n return;\n }\n var x = _root;\n Node y = null;\n while (x != null)\n {\n y = x;\n x = _comparer.Compare(key, x.Key) > 0 ? x.Right : x.Left;\n }\n node.Parent = y;\n if (y == null) _root = node;\n else if (_comparer.Compare(key, y.Key) > 0) y.Right = node;\n else y.Left = node;\n InsertFixup(node);\n }\n\n private void InsertFixup(Node node)\n {\n while (true)\n {\n var parent = node.Parent;\n if (parent == null || !parent.Red || parent.Parent == null) break;\n var grand = parent.Parent;\n\n if (parent == grand.Left)\n {\n var uncle = grand.Right;\n if (uncle != null && uncle.Red) /* parent and uncle both red: we could swap colors of them with grand */\n {\n parent.Red = false;\n uncle.Red = false;\n grand.Red = true;\n node = grand; /* and continue fixing tree for grand */\n }\n else if (node == parent.Right) /* we rotate around the parent */\n {\n node = parent;\n RotateLeft(node);\n }\n else /* rotate around grand and switch colors of grand and parent */\n {\n parent.Red = false;\n grand.Red = true;\n RotateRight(grand);\n if (grand == _root) _root = parent;\n break; /* and finish since tree is fixed */\n }\n }\n else\n {\n if (_root.Parent != null) Debugger.Break();\n\n var uncle = grand.Left;\n if (uncle != null && uncle.Red) /* parent and uncle both red: we could swap colors of them with grand */\n {\n parent.Red = false;\n uncle.Red = false;\n grand.Red = true;\n node = grand; /* and continue fixing tree for grand */\n }\n else if (node == parent.Left) /* we rotate around the parent */\n {\n node = parent;\n RotateRight(node);\n }\n else /* rotate around grand and switch colors of grand and parent */\n {\n parent.Red = false;\n grand.Red = true;\n RotateLeft(grand);\n if (grand == _root) _root = parent;\n break; /* and finish since tree is fixed */\n }\n }\n }\n _root.Red = false;\n }\n\n private void RotateLeft(Node node)\n {\n if (node.Right == null)\n throw new NotSupportedException(\"Cannot rotate left: right node is missing\");\n var parent = node.Parent;\n var right = node.Right;\n right.Parent = parent;\n if (parent != null)\n {\n if (parent.Left == node) parent.Left = right;\n else parent.Right = right;\n }\n node.Right = right.Left;\n if (node.Right != null)\n node.Right.Parent = node;\n right.Left = node;\n node.Parent = right;\n }\n\n private void RotateRight(Node node)\n {\n if (node.Left == null)\n throw new NotSupportedException(\"Cannot rotate right: left node is missing\");\n var parent = node.Parent;\n var left = node.Left;\n left.Parent = parent;\n if (parent != null)\n {\n if (parent.Left == node) parent.Left = left;\n else parent.Right = left;\n }\n node.Left = left.Right;\n if (node.Left != null)\n node.Left.Parent = node;\n left.Right = node;\n node.Parent = left;\n }\n\n public void Remove(TKey key)\n {\n var node = _search(key);\n if (node == null) return;\n\n var deleted = node.Left == null || node.Right == null ? node : Next(node);\n var child = deleted.Left ?? deleted.Right;\n if (child != null)\n child.Parent = deleted.Parent;\n if (deleted.Parent == null) /* root */\n _root = child;\n else if (deleted == deleted.Parent.Left)\n deleted.Parent.Left = child;\n else\n deleted.Parent.Right = child;\n if (node != deleted)\n {\n node.Key = deleted.Key;\n node.Value = deleted.Value;\n }\n\n if (!deleted.Red)\n {\n DeleteFixup(child, deleted.Parent);\n }\n }\n\n private void DeleteFixup(Node node, Node parent)\n {\n while (parent != null && (node == null || !node.Red))\n {\n if (node == parent.Left)\n {\n var brother = parent.Right;\n if (brother.Red)\n {\n brother.Red = false;\n parent.Red = true;\n RotateLeft(parent);\n brother = parent.Right;\n }\n if ((brother.Left == null || !brother.Left.Red) && (brother.Right == null || !brother.Right.Red))\n {\n node = parent.Red ? _root : parent;\n brother.Red = true;\n parent.Red = false;\n }\n else\n {\n if (brother.Right == null || !brother.Right.Red)\n {\n if (brother.Left != null)\n brother.Left.Red = false;\n brother.Red = true;\n RotateRight(brother);\n brother = parent.Right;\n }\n if (!brother.Right.Red) Debugger.Break();\n brother.Red = parent.Red;\n parent.Red = false;\n if (brother.Right != null)\n brother.Right.Red = false;\n RotateLeft(parent);\n node = _root;\n }\n }\n else\n {\n var brother = parent.Left;\n if (brother.Red)\n {\n brother.Red = false;\n parent.Red = true;\n RotateRight(parent);\n brother = parent.Left;\n }\n if ((brother.Right == null || !brother.Right.Red) && (brother.Left == null || !brother.Left.Red))\n {\n node = parent.Red ? _root : parent;\n brother.Red = true;\n parent.Red = false;\n }\n else\n {\n if (brother.Left == null || !brother.Left.Red)\n {\n if (brother.Right != null)\n brother.Right.Red = false;\n brother.Red = true;\n RotateLeft(brother);\n brother = parent.Left;\n }\n brother.Red = parent.Red;\n parent.Red = false;\n if (brother.Left != null)\n brother.Left.Red = false;\n RotateRight(parent);\n node = _root;\n }\n }\n parent = node.Parent;\n }\n\n node.Red = false;\n }\n\n public TValue this[TKey key]\n {\n get\n {\n var node = _search(key);\n return node == null ? default(TValue) : node.Value;\n }\n set\n {\n var node = _search(key);\n if (node == null) Add(key, value);\n else node.Value = value;\n }\n }\n\n public bool Check()\n {\n int count;\n return _root == null || _root.Check(out count);\n }\n\n private Node Minimum(Node node)\n {\n var result = node;\n while (result.Left != null) result = result.Left;\n return result;\n }\n\n private Node Maximum(Node node)\n {\n var result = node;\n while (result.Right != null) result = result.Right;\n return result;\n }\n\n private Node Next(Node node)\n {\n Node result;\n if (node.Right != null)\n {\n result = Minimum(node.Right);\n }\n else\n {\n while (node.Parent != null && node.Parent.Right == node)\n node = node.Parent;\n result = node.Parent;\n }\n return result;\n }\n\n private Node Previous(Node node)\n {\n Node result;\n if (node.Left != null)\n {\n result = Maximum(node.Left);\n }\n else\n {\n while (node.Parent != null && node.Parent.Left == node)\n node = node.Parent;\n result = node.Parent;\n }\n return result;\n }\n\n public void Print()\n {\n var node = Minimum(_root);\n while (node != null)\n {\n Console.Write(node.Red ? '*' : ' ');\n Console.Write(node.Key);\n Console.Write('\\t');\n node = Next(node);\n }\n }\n\n #region Nested classes\n\n [DebuggerDisplay(\"{ToString()}\")]\n private sealed class Node\n {\n public TKey Key;\n public TValue Value;\n public bool Red;\n\n public Node Parent;\n public Node Left;\n public Node Right;\n\n public bool Check(out int count)\n {\n count = 0;\n if (Red)\n {\n if (Left != null && Left.Red) return false;\n if (Right != null && Right.Red) return false;\n }\n var left = 0;\n var right = 0;\n if (Left != null && !Left.Check(out left)) return false;\n if (Right != null && !Right.Check(out right)) return false;\n count = left + (Red ? 0 : 1);\n if (left != right)\n {\n ;\n }\n return left == right;\n }\n\n public override string ToString()\n {\n return ToShortString(2);\n }\n\n private string ToShortString(int depth = 0)\n {\n return depth == 0\n ? string.Format(\"{0}{1}\", Red ? \"*\" : \"\", Key)\n : string.Format(\"({1}<{0}>{2})\", ToShortString(), Left == null ? \"null\" : Left.ToShortString(depth - 1), Right == null ? \"null\" : Right.ToShortString(depth - 1));\n }\n }\n\n #endregion\n\n #region IEnumerable\n\n public IEnumerator> GetEnumerator()\n {\n throw new NotImplementedException();\n }\n\n IEnumerator IEnumerable.GetEnumerator()\n {\n return GetEnumerator();\n }\n\n #endregion\n }\n}\n\nnamespace Codeforces.TaskC\n{\n public class Task\n {\n public static void Main()\n {\n var task = new Task();\n try\n {\n task.Solve();\n }\n catch (Exception ex)\n {\n Console.ForegroundColor = ConsoleColor.Red;\n Console.WriteLine(ex);\n throw;\n }\n }\n\n /*abacabadabacaba*/\n \n private long MaxSubstring(long best, long l, long r, long a, long b, int ch)\n {\n if (l > r || a > b) return best;\n if ((best >= b - a + 1) || (best >= r - l + 1)) return best;\n\n best = Math.Max(best, Math.Min(r, b) - Math.Max(l, a) + 1);\n var divide = 1 << ch;\n bool f1 = false, f2 = false;\n\n if (r == divide && l == r) return best;\n if (a == divide && a == b) return best;\n \n if (l == divide) l++;\n if (r == divide) r--;\n if (a == divide) a++;\n if (b == divide) b--;\n\n if (l > divide)\n {\n l -= divide;\n f1 = true;\n }\n if (r > divide)\n {\n r -= divide;\n f1 = !f1;\n }\n if (a > divide)\n {\n a -= divide;\n f2 = true;\n }\n if (b > divide)\n {\n b -= divide;\n f2 = !f2;\n }\n\n if (--ch > 0)\n {\n if (f1 && f2) best = Math.Max(Math.Max(best, divide - Math.Max(l, a)), Math.Min(r, b));\n if (f1 && !f2)\n {\n best = MaxSubstring(best, l, divide - 1, a, b, ch);\n best = MaxSubstring(best, 1, r, a, b, ch);\n }\n if (!f1 && f2)\n {\n best = MaxSubstring(best, l, r, a, divide - 1, ch);\n best = MaxSubstring(best, l, r, 1, b, ch);\n }\n if (!f1 && !f2) best = MaxSubstring(best, l, r, a, b, ch);\n if (f1 && f2)\n {\n best = MaxSubstring(best, 1, r, a, divide - 1, ch);\n best = MaxSubstring(best, l, divide - 1, 1, b, ch);\n }\n }\n\n return best;\n }\n\n void Solve()\n {\n long l1, r1, l2, r2;\n Input.Next(out l1, out r1, out l2, out r2);\n var n = MaxSubstring(0, l1, r1, l2, r2, 29);\n Console.WriteLine(n);\n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "b93137a9a4aef63e14d860206f3f2fb4", "src_uid": "fe3c0c4c7e9b3afebf2c958251f10513", "apr_id": "958bf0eff054750c06f17aa12628a25c", "difficulty": 2400, "tags": ["divide and conquer"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.8999129677980853, "equal_cnt": 8, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 7, "fix_ops_cnt": 8, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Text;\n\nnamespace ConsoleApplication1\n{\n class Program\n {\n static void Main(string[] args)\n {\n string[] s = Console.ReadLine().Split(' ');\n int x = int.Parse(s[0]);\n int y = int.Parse(s[1]);\n double r = Math.Sqrt(x * x + y * y);\n if (r - Math.Truncate(r) == 0)\n {\n Console.WriteLine(\"black\");\n return;\n }\n else\n {\n if (Math.Truncate(r) % 2 == 0)\n {\n if(x * y > 0)\n {\n Console.WriteLine(\"black\");\n }\n else\n {\n Console.WriteLine(\"white\");\n }\n }\n else\n {\n Console.WriteLine(\"black\");\n }\n }\n \n }\n }\n }\n", "lang": "Mono C#", "bug_code_uid": "d24b088134a2a754b4551d10c92bfca3", "src_uid": "8c92aac1bef5822848a136a1328346c6", "apr_id": "94735ee0a51a873369af2329517c244e", "difficulty": 1300, "tags": ["geometry", "math", "constructive algorithms", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.9696113074204947, "equal_cnt": 2, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "using System;\n\nnamespace qwetry {\n class Program {\n static void Main() {\n string[] s = Console.ReadLine().Split(' ');\n int x = int.Parse(s[0]);\n int y = int.Parse(s[1]);\n if (x == 0 || y == 0) {\n Console.Write(\"black\");\n return;\n }\n if (x * y > 0) {\n if (Math.Sqrt(x * x + y * y) % 2 >= 0 && Math.Sqrt(x * x + y * y) % 2 <= 1) {\n Console.Write(\"black\");\n } else {\n Console.Write(\"white\");\n }\n } else {\n if (Math.Sqrt(x * x + y * y) % 2 >= 1 && Math.Sqrt(x * x + y * y) % 2 == 0) {\n Console.Write(\"black\");\n } else {\n Console.Write(\"white\");\n }\n }\n Console.ReadKey();\n }\n }\n}", "lang": "Mono C#", "bug_code_uid": "f437754ebea4c5b4a60a8ed696541f07", "src_uid": "8c92aac1bef5822848a136a1328346c6", "apr_id": "0921f185262579de774b79fae4206d41", "difficulty": 1300, "tags": ["geometry", "math", "constructive algorithms", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.8930880159124813, "equal_cnt": 19, "replace_cnt": 6, "delete_cnt": 0, "insert_cnt": 12, "fix_ops_cnt": 18, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace nolifer\n{\n class Program\n {\n static void Main(string[] args)\n {\n List nums = new List();\n int a = Convert.ToInt32(Console.ReadLine());\n for (int i = 0; i <= 9 * a.ToString().Length; i++)\n {\n int b = a - i;\n string c = b.ToString();\n for (int j = 0; j < c.Length;j++)\n {\n b += Convert.ToInt32(c[j].ToString());\n \n }\n \n if (b == a)\n {\n nums.Add(c);\n }\n }\n Console.WriteLine(nums.Count);\n foreach (string w in nums)\n {\n Console.WriteLine(w);\n }\n \n \n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "428b9370f8b43b23fa596733ed50dc3a", "src_uid": "ae20ae2a16273a0d379932d6e973f878", "apr_id": "cab1c20838cf6ab0c9681119c6c3b9b7", "difficulty": 1200, "tags": ["math", "brute force"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.6741678387248008, "equal_cnt": 48, "replace_cnt": 12, "delete_cnt": 1, "insert_cnt": 34, "fix_ops_cnt": 47, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\n\nnamespace LuckySubstring\n{\n class Program\n {\n static bool IsLucky(long n)\n {\n var num = n;\n while (num > 0)\n {\n var digit = num - (num / 10) * 10;\n if (digit != 4 && digit != 7) return false;\n num /= 10;\n }\n\n return true;\n }\n\n static void Main(string[] args)\n {\n var luckyNumbers = new List();\n for (var n = 1; n <= 1000; n++)\n {\n if (IsLucky(n)) luckyNumbers.Add(n);\n }\n\n var answers = new Dictionary();\n string input = Console.ReadLine();\n if (!string.IsNullOrEmpty(input))\n {\n for (var length=1; length maxOcc) maxOcc = num.Value;\n }\n var maxAnswers = new List();\n foreach (var num in answers)\n {\n if (num.Value == maxOcc) maxAnswers.Add(num.Key);\n }\n //Console.WriteLine(\"MaxOcc = {0}\", maxOcc);\n var lexMin = \"99999999999999999999999999999999999999999999999999\";\n foreach (var num in maxAnswers)\n {\n if (string.Compare(num.ToString(), lexMin) < 0) lexMin = num.ToString();\n }\n\n if (lexMin != \"99999999999999999999999999999999999999999999999999\")\n Console.WriteLine(lexMin);\n else Console.WriteLine(\"-1\");\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "5409e6436de931f943113dff9f0fc3ff", "src_uid": "639b8b8d0dc42df46b139f0aeb3a7a0a", "apr_id": "21161816d30db5bb441cb8b3335b4e19", "difficulty": 1000, "tags": ["brute force", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.3100303951367781, "equal_cnt": 13, "replace_cnt": 11, "delete_cnt": 2, "insert_cnt": 0, "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 class A\n {\n static void Main(string[] args)\n {\n string s = Console.ReadLine();\n int seven = 0;\n int four = 0;\n List lucky = new List();\n for(int i=0;i0)lucky.Add(int.Parse(sN));\n }\n }\n lucky.Sort();\n\n if(lucky.Count>0){\n int counter = 0;\n int longestOccurance = 0;\n int mostFrequentNumber = 0;\n\n for (int i = 0; i < lucky.Count; i++)\n {\n counter = 0;\n\n for (int j = 0; j < lucky.Count; j++)\n {\n if (lucky[j] == lucky[i])\n {\n counter++;\n }\n }\n\n if (counter > longestOccurance)\n {\n longestOccurance = counter;\n mostFrequentNumber = lucky[i];\n }\n }\n \n if(longestOccurance>-1){\n Console.WriteLine(mostFrequentNumber);\n }else{\n Console.WriteLine(lucky[0]);\n }\n }else{\n Console.WriteLine(-1);\n }\n }\n }\n}", "lang": "Mono C#", "bug_code_uid": "f091be40654d96477b87b4604b5991f7", "src_uid": "639b8b8d0dc42df46b139f0aeb3a7a0a", "apr_id": "c6210566dfa04bf55ec852c011ecb2ab", "difficulty": 1000, "tags": ["brute force", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.5814814814814815, "equal_cnt": 6, "replace_cnt": 3, "delete_cnt": 1, "insert_cnt": 3, "fix_ops_cnt": 7, "bug_source_code": "int t = int.Parse(Console.ReadLine().Trim().Split(' ')[1]);\n\t\t\tstring s = Console.ReadLine().Trim();\n\t\t\tfor(int i = 0; i < t; i++) s = s.Replace(\"BG\", \"GB\");\n\t\t\tConsole.WriteLine(s);", "lang": "Mono C#", "bug_code_uid": "8f18a626c05e712f660d1832ac02cfad", "src_uid": "964ed316c6e6715120039b0219cc653a", "apr_id": "9f2f1f8cd6a712dd1cd6c6b97435ef53", "difficulty": 800, "tags": ["shortest paths", "constructive algorithms", "implementation", "graph matchings"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9569245020842982, "equal_cnt": 5, "replace_cnt": 2, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 4, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\nusing System.Text.RegularExpressions;\nusing System.IO;\nusing System.Numerics;\nusing System.Globalization;\nusing System.Threading;\n\n\nnamespace probleme {\n class Program {\n static void Main(string[] args) {\n\n //Console.SetIn(new StreamReader(\"file.in\"));\n /*\n FileStream filestream = new FileStream(\"out.txt\", FileMode.Create);\n var streamwriter = new StreamWriter(filestream);\n streamwriter.AutoFlush = true;\n Console.SetOut(streamwriter);\n */\n\n int n = int.Parse(Console.ReadLine());\n int[] v = Array.ConvertAll(Console.ReadLine().Split(' '), ts = int.Parse(ts));\n Array.Sort(v);\n Console.WriteLine(v[n - 1] - v[0]);\n int aux = v[0];\n v[0] = v[n - 1];\n v[n - 1] = aux;\n for (int i = 0; i < n; i++) {\n Console.Write(\"{0} \", v[i]);\n }\n\n //Console.ReadKey();\n }\n }\n}", "lang": "MS C#", "bug_code_uid": "b8f99a047434975b29d41a1dec346763", "src_uid": "4408eba2c5c0693e6b70bdcbe2dda2f4", "apr_id": "fb75f51ba88ff07a38808bea8cec87c7", "difficulty": 1300, "tags": ["constructive algorithms", "implementation", "sortings"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.6633499170812603, "equal_cnt": 5, "replace_cnt": 2, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 4, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\nusing System.Text.RegularExpressions;\nusing System.IO;\nusing System.Numerics;\nusing System.Globalization;\nusing System.Threading;\n\n\nnamespace probleme {\n class Program {\n static void Main(string[] args) {\n //Console.SetIn(new StreamReader(\"file.txt\"));\n string[] s = Console.ReadLine().Split(':');\n int hh1 = int.Parse(s[0]), mm1 = int.Parse(s[1]);\n s = Console.ReadLine().Split(':');\n int hh2 = int.Parse(s[1]), mm2 = int.Parse(s[2]);\n int mm3 = mm1 - mm2;\n if (mm3 < 0) {\n mm3 += 60;\n hh1--;\n }\n int hh3 = hh1 - hh2;\n if (hh3 < 0) {\n hh3 += 24;\n }\n char[] ans = new char[5];\n ans[4] = (char)(mm3 % 10 + '0');\n mm3 /= 10;\n ans[3] = (char)(mm3 + '0');\n ans[2] = ':';\n ans[1] = (char)(hh3 % 10 + '0');\n hh3 /= 10;\n ans[0] = (char)(hh3 + '0');\n Console.Write(ans);\n //Console.ReadKey();\n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "60fda191c7c56da74270f98278933802", "src_uid": "595c4a628c261104c8eedad767e85775", "apr_id": "002f904b024e824bf2a576abceec20e7", "difficulty": 900, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9768600925596298, "equal_cnt": 5, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 4, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.IO;\n\nnamespace _387A___George_and_Sleep\n{\n class Program\n {\n static void Main(string[] args)\n {\n //StreamReader RE = new StreamReader(@\"c:\\users\\amirhossin\\documents\\visual studio 2013\\Projects\\387A - George and Sleep\\387A - George and Sleep\\a.in\");\n while (true)\n {\n string a = Console.ReadLine();\n string b = Console.ReadLine();\n string Ans=\"\";\n\n DateTime Start=new DateTime (), End=new DateTime (),Base;\n Start = DateTime.Parse(b);\n End = DateTime.Parse(a);\n\n int H = End.Hour - Start.Hour,M=End.Minute-Start.Minute;\n if(H<=0 && M<0)\n {\n H += 23;\n }\n if (H < 0)\n H += 24;\n if (M < 0)\n M += 60;\n if (H / 10 == 0)\n Ans += \"0\" + H.ToString();\n else \n Ans += H.ToString();\n Ans += \":\";\n if (M / 10 == 0)\n Ans += \"0\" + M.ToString();\n else \n Ans += M.ToString();\n Console.WriteLine(Ans);\n\n }\n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "590ef74cb3e9a99428e77502185df8bb", "src_uid": "595c4a628c261104c8eedad767e85775", "apr_id": "aea7d5920dc20d5851aa97c8f296b9e0", "difficulty": 900, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.016855991205569805, "equal_cnt": 8, "replace_cnt": 8, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 8, "bug_source_code": "\n\n \n Debug\n x86\n 8.0.30703\n 2.0\n {05C93F62-5FEB-405E-A6A6-8DA166CFDD88}\n Exe\n Properties\n Игрушечные_армии\n Игрушечные армии\n v4.0\n Client\n 512\n \n \n x86\n true\n full\n false\n bin\\Debug\\\n DEBUG;TRACE\n prompt\n 4\n \n \n x86\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", "lang": "Mono C#", "bug_code_uid": "6da67fffd885547f83e13db883a2763e", "src_uid": "031e53952e76cff8fdc0988bb0d3239c", "apr_id": "eb5568176e35b77afa14f65561bbcbd8", "difficulty": 900, "tags": ["math", "number theory"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9860055977608957, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.IO;\n\nclass Program\n{\n\tint[][] c;\n\tint n, m;\n\tint mod = 1000000007;\n\tint add(int x, int y)\n\t{\n\t\tx+=y;\n\t\treturn x < mod ? x : x - mod;\n\t}\n\tint mul(int x, int y)\n\t{\n\t\treturn Convert.ToInt32(Convert.ToInt64(x) * y % mod);\n\t}\n\tvoid run()\n\t{\n\t\tString[] str = Console.ReadLine().Split(' ');\n\t\tn = Convert.ToInt32(str[0]);\n\t\tm = Convert.ToInt32(str[1]);\n\t\tint[][] dp=new int[n+1][];\n\t\tfor (int i = 1; i <= n; i++)\n\t\t{\n\t\t\tdp[i] = new int[m-1];\n\t\t\tif (i == 1)\n\t\t\t{\n\t\t\t\tfor (int j = 0; j <= m - 2; j++)\n\t\t\t\t\tdp[i][j] = 1;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tint now = 0;\n\t\t\tfor (int j = 0; j <= m-2; j++)\n\t\t\t{\n\t\t\t\tnow= add(now,dp[i-1][j]);\n\t\t\t\tdp[i][j] = add(j == 0 ? 0 : dp[i][j - 1], now);\n\t\t\t}\n\t\t}\n\n\t\tint[][] sum = new int[n+1][];\n\t\tfor (int i = 0; i <= n; i++)\n\t\t{\n\t\t\tsum[i] = new int[m - 1];\n\t\t\tfor (int j = 0; j <= m - 2; j++)\n\t\t\t\tsum[i][j] = i == 0 ? 0 : sum[i - 1][j] + dp[i][j];\n\t\t}\n\n\t\tint res = 0;\n\t\tfor (int i = 1; i <= n; i++)\n\t\t\tfor (int j = 0; j <= m - 2; j++)\n\t\t\t{\n\t\t\t\tres = add(res, mul(mul(sum[i][j], add(sum[n - i + 1][j], mod - sum[n - i][j])), m - 1 - j));\n\t\t\t}\n\t\tConsole.WriteLine(res);\n\t}\n\tstatic void Main(String[] args)\n\t{\n\t\tnew Program().run();\n\t}\n}", "lang": "Mono C#", "bug_code_uid": "063039329284e0d6e102f26306a6edef", "src_uid": "9ca1ad2fa16ca81e9ab5eba220b162c1", "apr_id": "540ee6ca8411b8def2ccdfa6a8fd3c72", "difficulty": 2400, "tags": ["dp", "combinatorics"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.7962830593280915, "equal_cnt": 5, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 4, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace ConsoleApp88\n{\n class Program\n {\n static void Main(string[] args)\n {\n string s = int.Parse(Console.ReadLine()).ToString();\n int counter = 0;\n for (int i = s.Length-1; i >= 0; i--)\n {\n if (s[i] == '0')\n {\n counter++;\n }\n \n }\n Console.WriteLine((counter>=6)?\"yes\":\"no\");\n }\n\n }\n}", "lang": "MS C#", "bug_code_uid": "99e41077fb4f139751c84fd30bc8d659", "src_uid": "88364b8d71f2ce2b90bdfaa729eb92ca", "apr_id": "3296a1f917add8a723fff98d8f35ebe6", "difficulty": 1000, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.43333333333333335, "equal_cnt": 12, "replace_cnt": 5, "delete_cnt": 2, "insert_cnt": 4, "fix_ops_cnt": 11, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\nclass Startup\n{\n static void Main()\n { \n int intInput = int.Parse(Console.ReadLine());\n string input = intInput.ToString();\n int zeroesCount = input.Count(f => f == '0');\n Console.WriteLine(zeroesCount > 5 ? \"yes\":\"no\");\n }\n}\n\n", "lang": "MS C#", "bug_code_uid": "194a5719eaa721e400d26acbd80e02b1", "src_uid": "88364b8d71f2ce2b90bdfaa729eb92ca", "apr_id": "6ed6501048a5640ba333173ecbee80dd", "difficulty": 1000, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9980959634424981, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "using System;\nusing System.Collections;\nusing System.Collections.Generic;\nusing System.Collections.Specialized;\nusing System.Diagnostics;\nusing System.Globalization;\nusing System.IO;\nusing System.Text;\nusing System.Linq;\n\nnamespace Codeforces\n{\n internal class Program\n {\n private const string TEST = \"B1\";\n \n private static void Solve()\n {\n var input = ReadIntArray();\n var w = input[0];\n var h = input[1];\n var res = 0L;\n for (int i = 0; i < w; i++)\n {\n for (int j = 0; j < h; j++)\n {\n var hMax = Math.Min(j, h - j);\n res += Math.Max(0L, w - 1 - i)*Math.Max(0L, hMax);\n }\n }\n WriteLine(res);\n }\n \n private static void Main()\n {\n if (Debugger.IsAttached)\n {\n Console.SetIn(new StreamReader(String.Format(@\"..\\..\\..\\..\\Tests\\{0}.in\", TEST)));\n }\n\n Solve();\n\n if (Debugger.IsAttached)\n {\n Console.In.Close();\n Console.SetIn(new StreamReader(Console.OpenStandardInput()));\n Console.ReadLine();\n }\n }\n\n #region Reader\n\n private static string Read()\n {\n return Console.ReadLine();\n }\n\n private static string[] ReadArray()\n {\n return Console.ReadLine().Split(' ');\n }\n\n private static List ReadIntArray()\n {\n var input = Console.ReadLine().Split(' ').Select(Int32.Parse).ToList();\n return input;\n }\n\n private static int ReadInt()\n {\n return Int32.Parse(Console.ReadLine());\n }\n\n private static long ReadLong()\n {\n return long.Parse(Console.ReadLine());\n }\n\n private static int ReadNextInt(string[] input, int index)\n {\n return Int32.Parse(input[index]);\n }\n\n private static double ReadDouble()\n {\n return double.Parse(Console.ReadLine(), CultureInfo.InvariantCulture);\n }\n\n private static List ReadDoubleArray()\n {\n return Console.ReadLine().Split(' ').Select(d => double.Parse(d, CultureInfo.InvariantCulture)).ToList();\n }\n\n private static void WriteLine(object value)\n {\n Console.WriteLine(value);\n }\n\n private static void Write(object value)\n {\n Console.Write(value);\n }\n\n #endregion\n }\n}", "lang": "Mono C#", "bug_code_uid": "0f0d43ffceb8781482ba3b073f6bea9b", "src_uid": "42454dcf7d073bf12030367eb094eb8c", "apr_id": "980f656f12194eee76f6c919de415415", "difficulty": 1300, "tags": ["math", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9923175416133163, "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.Text;\n\nnamespace Codeforces._20120510\n{\n public class B\n {\n public static void Main(string[] args)\n {\n var wh = GetListOfLong();\n Console.WriteLine(Solve(wh[0], wh[1]));\n }\n\n public static long Solve(long w, long h)\n {\n long ret = 0;\n\n for (long d1 = 2; d1 <= w; d1 += 2)\n for (long d2 = 2; d2 <= h; d2 += 2)\n {\n ret += (w - d1 / 2) * (h - d2 / 2);\n }\n\n return ret;\n }\n\n public static List GetListOfLong()\n {\n return Console.ReadLine().Split(' ').Select(t => long.Parse(t)).ToList();\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "80b0c4e586279b8f7268b0d1fc94721e", "src_uid": "42454dcf7d073bf12030367eb094eb8c", "apr_id": "bc17f629feacd59ef028b87e19316775", "difficulty": 1300, "tags": ["math", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.8766832034018427, "equal_cnt": 17, "replace_cnt": 7, "delete_cnt": 2, "insert_cnt": 7, "fix_ops_cnt": 16, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace IQ_Test\n{\n class Program\n {\n static void Main(string[] args)\n {\n string[] matrix;\n string[,] matrix1 = new string[4, 4];\n int z = 0;\n int y = 0;\n \n for (int i = 0; i < 4; i++)\n {\n string x = Console.ReadLine();\n matrix = x.Split(' ');\n for (int j = 0; j < 4; j++)\n {\n matrix1[i, j] = matrix[j];\n }\n\n }\n for (int i = 0; i < 3; i++)\n {\n \n for (int j = 0; j < 3; j++)\n {\n for (int l = i; l < i + 1; l++)\n {\n for (int k = j; k < j + 1; k++)\n {\n if (matrix1[l,k]==\"#\")\n {z++;}\n if (matrix1[l,k]==\".\")\n {y++;}\n\n }\n }\n }\n\n }\n if (Math.Abs(z - y) == 2)\n { Console.WriteLine(\"YES\"); }\n else\n { Console.WriteLine(\"NO\"); }\n\n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "d5454eadc86ad8c2d3472d0a26dcdea5", "src_uid": "01b145e798bbdf0ca2ecc383676d79f3", "apr_id": "e8f258e0e9eb182ecafd48a7976a3b28", "difficulty": 1100, "tags": ["brute force", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9944674965421854, "equal_cnt": 5, "replace_cnt": 0, "delete_cnt": 4, "insert_cnt": 0, "fix_ops_cnt": 4, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\nusing System.Text.RegularExpressions;\nusing System.IO;\nusing System.Numerics;\nusing System.Globalization;\nusing System.Threading;\n\n\nnamespace probleme {\n class Program {\n static void Main(string[] args) {\n //Console.SetIn(new StreamReader(\"file.txt\"));\n char[][] inp = new char[4][];\n for (int i = 0; i < 4; i++) {\n inp[i] = Console.ReadLine().ToCharArray();\n }\n int[,] m = new int[3, 3];\n bool sol = false;\n for (int i = 0; i < 3; i++) {\n for (int j = 0; j < 3; j++) {\n if (inp[i][j] == '#') {\n m[i, j]++;\n }\n if (inp[i + 1][j] == '#') {\n m[i + 1, j]++;\n }\n if (inp[i][j + 1] == '#') {\n m[i, j + 1]++;\n }\n if (inp[i + 1][j + 1] == '#') {\n m[i + 1, j + 1]++;\n }\n if (m[i, j] != 2) {\n sol = true;\n }\n }\n }\n if (sol) {\n Console.Write(\"YES\");\n } else {\n Console.Write(\"NO\");\n }\n //Console.ReadKey();\n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "9eb2a86a951fad681c9d21b29f72ac64", "src_uid": "01b145e798bbdf0ca2ecc383676d79f3", "apr_id": "a8ee6d87c686b2220c11ce01bde8a7fd", "difficulty": 1100, "tags": ["brute force", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C#"} {"similarity_score": 0.9347336834208552, "equal_cnt": 7, "replace_cnt": 4, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 6, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace Codeforces659A\n{\n class Program\n {\n static void Main(string[] args)\n {\n string[] inp = Console.ReadLine().Split();\n int n = Convert.ToInt32(inp[0]);\n int a = Convert.ToInt32(inp[1]);\n int b = Convert.ToInt32(inp[2]);\n\n int outp = b == 0 ? a : a > Math.Abs(b) ? (b + a) % n : n - Math.Abs(a + b) % n;\n if (outp == 0)\n outp = n;\n\n Console.WriteLine(outp);\n inp = Console.ReadLine().Split();\n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "4a2b91b9b95acc9d9a63829a45b5b19c", "src_uid": "cd0e90042a6aca647465f1d51e6dffc4", "apr_id": "de469d17b94d2e664b4734cfd4e0540c", "difficulty": 1000, "tags": ["math", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9447659126775382, "equal_cnt": 26, "replace_cnt": 4, "delete_cnt": 12, "insert_cnt": 11, "fix_ops_cnt": 27, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\n\nclass Test \n{\n static long gcd(long a, long b) \n {\n \n if (b > a) \n {\n long temp = a;\n a = b;\n b = temp;\n }\n \n while (true) \n {\n a = a%b;\n long temp = a;\n a = b;\n b = temp;\n \n if (b == 0)\n return a;\n }\n \n }\n \n static void Main(string[] args)\n {\n long[] tokens = Console.Readline().Split(' ').Select(x => long.Parse(x)).ToArray();\n long lcm = token[0]*token[1] / gcd(token[0], token[1]);\n \n long diff = (lcm/tokens[0]) - (lcm / tokens[1]);\n \n if (diff == 1 || diff == -1)\n Console.WriteLine(\"Equal\");\n else if (diff > 0)\n Console.WriteLine(\"Dasha\");\n else if (diff < 0)\n Console.WriteLine(\"Masha\");\n }\n \n}\n", "lang": "Mono C#", "bug_code_uid": "2aae9defa1180d59201c6ef0f9875510", "src_uid": "06eb66df61ff5d61d678bbb3bb6553cc", "apr_id": "da978fde12883e6975beda7b383a50ea", "difficulty": 1500, "tags": ["number theory", "math", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C#"} {"similarity_score": 0.9984110169491526, "equal_cnt": 4, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 3, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\nusing System.Text.RegularExpressions;\nusing System.IO;\nusing System.Numerics;\nusing System.Globalization;\nusing System.Threading;\n\n\nnamespace probleme {\n class Program {\n static void Main(string[] args) {\n Console.SetIn(new StreamReader(\"file.txt\"));\n char[][]table = new char[8][];\n for (int i=0;i<8;i++){\n table[i] = Console.ReadLine().ToCharArray();\n }\n int minW = 9;\n for (int j = 0; j < 8; j++) {\n int minR = 9;\n bool free = true;\n for (int i = 7; i >= 0; i--) {\n if (table[i][j] == 'B') {\n free = false;\n }\n if (table[i][j] == 'W') {\n minR = i;\n free = true;\n }\n }\n if (free && minR < minW) {\n minW = minR;\n }\n }\n int minB = 9;\n for (int j = 0; j < 8; j++) {\n int minR = 9;\n bool free = true;\n for (int i = 0; i < 8; i++) {\n if (table[i][j] == 'W') {\n free = false;\n }\n if (table[i][j] == 'B') {\n minR = 7 - i;\n free = true;\n }\n }\n if (free && minR < minB) {\n minB = minR;\n }\n }\n Console.Write(\"{0} {1}\\n\", minW, minB);\n if (minW <= minB) {\n Console.Write(\"A\");\n } else {\n Console.Write(\"B\");\n }\n Console.ReadKey();\n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "9190078d307cf51b454bd5335b686cbd", "src_uid": "0ddc839e17dee20e1a954c1289de7fbd", "apr_id": "3709d68e67dc796a4998c517838f5773", "difficulty": 1200, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.999569151227919, "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.Linq;\n\nnamespace CF313\n{\n\tinternal class Program\n\t{\n\t\tprivate static void Main(string[] args)\n\t\t{\n\t\t\t//var sr = new InputReader(new StreamReader(new FileStream(\"input.txt\", FileMode.Open)));\n\t\t\tvar sr = new InputReader(Console.In);\n\t\t\tvar sw = Console.Out;\n\t\t\tvar task = new Task();\n\t\t\ttask.Solve(1, sr, sw);\n\t\t\t//Console.ReadKey();\n\t\t}\n\t}\n\n\tinternal class Task\n\t{\n\t\tpublic void Solve(int testNumber, InputReader sr, TextWriter sw)\n\t\t{\n\t\t\tvar array = new char[8][];\n\t\t\tfor (var i = 0; i < 8; i++) {\n\t\t\t\tvar next = sr.NextString();\n\t\t\t\tarray[i] = next.ToCharArray();\n\t\t\t}\n\t\t\tvar minA = Int32.MaxValue;\n\t\t\tvar minB = Int32.MaxValue;\n\t\t\tfor (var j = 0; j < 8; j++) {\n\t\t\t\tfor (var i = 0; i < 8; i++) {\n\t\t\t\t\tif (array[i][j] == 'W') {\n\t\t\t\t\t\tvar can = true;\n\t\t\t\t\t\tfor (var k = i - 1; k >= 0; k--) {\n\t\t\t\t\t\t\tif (array[k][j] != '.') {\n\t\t\t\t\t\t\t\tcan = false;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (can) {\n\t\t\t\t\t\t\tminA = minA > (i - 1) ? i - 1 : minA;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (array[i][j] == 'B') {\n\t\t\t\t\t\tvar can = true;\n\t\t\t\t\t\tfor (var k = i + 1; k >= 7; k++) {\n\t\t\t\t\t\t\tif (array[k][j] != '.') {\n\t\t\t\t\t\t\t\tcan = false;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (can) {\n\t\t\t\t\t\t\tminB = minB > (7 - i) ? 7 - i : minB;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tsw.WriteLine(minA < minB ? \"A\" : \"B\");\n\t\t}\n\t}\n\n\tinternal class InputReader : IDisposable\n\t{\n\t\tprivate readonly TextReader sr;\n\t\tprivate bool isDispose = false;\n\n\t\tpublic InputReader(TextReader stream)\n\t\t{\n\t\t\tsr = stream;\n\t\t}\n\n\t\tpublic string NextString()\n\t\t{\n\t\t\tvar result = sr.ReadLine();\n\t\t\treturn result;\n\t\t}\n\n\t\tpublic int NextInt32()\n\t\t{\n\t\t\treturn Int32.Parse(NextString());\n\t\t}\n\n\t\tpublic long NextInt64()\n\t\t{\n\t\t\treturn Int64.Parse(NextString());\n\t\t}\n\n\t\tpublic string[] NextSplitStrings()\n\t\t{\n\t\t\treturn NextString()\n\t\t\t\t.Split(new[] { ' ' }, StringSplitOptions.RemoveEmptyEntries);\n\t\t}\n\n\t\tpublic T[] ReadArray(Func func)\n\t\t{\n\t\t\treturn NextSplitStrings()\n\t\t\t\t.Select(s => func(s, CultureInfo.InvariantCulture))\n\t\t\t\t.ToArray();\n\t\t}\n\n\t\tpublic void Dispose()\n\t\t{\n\t\t\tDispose(true);\n\t\t\tGC.SuppressFinalize(this);\n\t\t}\n\n\t\tprotected void Dispose(bool dispose)\n\t\t{\n\t\t\tif (!isDispose) {\n\t\t\t\tif (dispose)\n\t\t\t\t\tsr.Close();\n\t\t\t\tisDispose = true;\n\t\t\t}\n\t\t}\n\n\t\t~InputReader()\n\t\t{\n\t\t\tDispose(false);\n\t\t}\n\t}\n}", "lang": "MS C#", "bug_code_uid": "3882c90195d5e1442b549da262b15439", "src_uid": "0ddc839e17dee20e1a954c1289de7fbd", "apr_id": "1f73e38f2b5a5f1160f196996496a2e0", "difficulty": 1200, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9997427652733119, "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.Diagnostics;\nusing System.IO;\nusing System.Linq;\nusing System.Numerics;\nusing System.Text;\n\nnamespace CodeforcesTemplate\n{\n public static class Permutation\n {\n private static bool Next(ref int[] arr)\n {\n int k, j, l;\n for (j = arr.Length - 2; (j >= 0) && (arr[j] >= arr[j + 1]); j--) { }\n if (j == -1)\n {\n arr = arr.OrderBy(c => c).ToArray();\n return false;\n }\n for (l = arr.Length - 1; (arr[j] >= arr[l]) && (l >= 0); l--) { }\n var tmp = arr[j];\n arr[j] = arr[l];\n arr[l] = tmp;\n for (k = j + 1, l = arr.Length - 1; k < l; k++, l--)\n {\n tmp = arr[k];\n arr[k] = arr[l];\n arr[l] = tmp;\n }\n return true;\n }\n public static IEnumerable AllPermutations(int[] arr)\n {\n do yield return arr;\n while (Next(ref arr));\n }\n }\n\n class Program\n {\n private const string FILENAME = \"distance4\";\n\n private const string INPUT = FILENAME + \".in\";\n\n private const string OUTPUT = FILENAME + \".out\";\n\n private static Stopwatch _stopwatch = new Stopwatch();\n\n private static StreamReader _reader = null;\n private static StreamWriter _writer = null;\n\n private static string[] _curLine;\n private static int _curTokenIdx;\n\n private static char[] _whiteSpaces = new char[] { ' ', '\\t', '\\r', '\\n' };\n\n private static string ReadNextToken()\n {\n if (_curTokenIdx >= _curLine.Length)\n {\n //Read next line\n string line = _reader.ReadLine();\n if (line != null)\n _curLine = line.Split(_whiteSpaces, StringSplitOptions.RemoveEmptyEntries);\n else\n _curLine = new string[] { };\n _curTokenIdx = 0;\n }\n\n if (_curTokenIdx >= _curLine.Length)\n return null;\n\n return _curLine[_curTokenIdx++];\n }\n\n private static int ReadNextInt()\n {\n return int.Parse(ReadNextToken());\n }\n\n private static void RunTimer()\n {\n#if (DEBUG)\n\n _stopwatch.Start();\n\n#endif\n }\n\n private static void Main(string[] args)\n {\n\n#if (DEBUG)\n double before = GC.GetTotalMemory(false);\n#endif\n\n string[] sp = Console.ReadLine().Split();\n\n int[] a = new int[3];\n\n for (int i = 0; i < 3; ++i)\n {\n a[i] = int.Parse(sp[i]);\n }\n\n\n HashSet hashSet = new HashSet();\n\n a[0] %= a[1];\n int d = -1;\n int pos = 0;\n while (a[0] != 0 && (!hashSet.Contains(a[0])))\n {\n hashSet.Add(a[0]);\n a[0] *= 10;\n d = a[0] / a[1];\n if (d == a[2])\n {\n break;\n }\n\n ++pos;\n a[0] %= a[1];\n }\n\n Console.WriteLine((d == a[2] || a[0] == a[2]) ? pos : -1);\n\n\n\n\n#if (DEBUG)\n _stopwatch.Stop();\n\n double after = GC.GetTotalMemory(false);\n\n double consumedInMegabytes = (after - before) / (1024 * 1024);\n\n Console.WriteLine($\"Time elapsed: {_stopwatch.Elapsed}\");\n\n Console.WriteLine($\"Consumed memory (MB): {consumedInMegabytes}\");\n\n Console.ReadKey();\n#endif\n\n\n }\n\n private static int CountLeadZeros(string source)\n {\n int countZero = 0;\n\n for (int i = source.Length - 1; i >= 0; i--)\n {\n if (source[i] == '0')\n {\n countZero++;\n }\n\n else\n {\n break;\n }\n\n }\n\n return countZero;\n }\n\n private static string ReverseString(string source)\n {\n char[] reverseArray = source.ToCharArray();\n\n Array.Reverse(reverseArray);\n\n string reversedString = new string(reverseArray);\n\n return reversedString;\n }\n\n\n private static int[] CopyOfRange(int[] src, int start, int end)\n {\n int len = end - start;\n int[] dest = new int[len];\n Array.Copy(src, start, dest, 0, len);\n return dest;\n }\n\n private static string StreamReader()\n {\n\n if (_reader == null)\n _reader = new StreamReader(INPUT);\n string response = _reader.ReadLine();\n if (_reader.EndOfStream)\n _reader.Close();\n return response;\n\n\n }\n\n private static void StreamWriter(string text)\n {\n\n if (_writer == null)\n _writer = new StreamWriter(OUTPUT);\n _writer.WriteLine(text);\n\n\n }\n\n\n\n\n\n private static int BFS(int start, int end, int[,] arr)\n {\n Queue> queue = new Queue>();\n List visited = new List();\n for (int i = 0; i < arr.GetLength(0); i++)\n {\n visited.Add(false);\n }\n\n queue.Enqueue(new KeyValuePair(start, 0));\n KeyValuePair node;\n int level = 0;\n bool flag = false;\n\n while (queue.Count != 0)\n {\n node = queue.Dequeue();\n if (node.Key == end)\n {\n return node.Value;\n }\n flag = false;\n for (int i = 0; i < arr.GetLength(0); i++)\n {\n\n if (arr[node.Key, i] == 1)\n {\n if (visited[i] == false)\n {\n if (!flag)\n {\n level = node.Value + 1;\n flag = true;\n }\n queue.Enqueue(new KeyValuePair(i, level));\n visited[i] = true;\n }\n }\n }\n\n }\n return 0;\n\n }\n\n\n\n private static void Write(string source)\n {\n File.WriteAllText(OUTPUT, source);\n }\n\n private static string ReadString()\n {\n return File.ReadAllText(INPUT);\n }\n\n private static void WriteStringArray(string[] source)\n {\n File.WriteAllLines(OUTPUT, source);\n }\n\n private static string[] ReadStringArray()\n {\n return File.ReadAllLines(INPUT);\n }\n\n private static int[] GetIntArray()\n {\n return ReadString().Split(' ').Select(int.Parse).ToArray();\n }\n\n private static double[] GetDoubleArray()\n {\n return ReadString().Split(' ').Select(double.Parse).ToArray();\n }\n\n private static int[,] ReadINT2XArray(List lines)\n {\n int[,] arr = new int[lines.Count, lines.Count];\n\n for (int i = 0; i < lines.Count; i++)\n {\n int[] row = lines[i].Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries).Select(int.Parse).ToArray();\n\n for (int j = 0; j < lines.Count; j++)\n {\n arr[i, j] = row[j];\n }\n }\n\n return arr;\n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "86b86357f6322d242028a2233f304fb9", "src_uid": "0bc7bf67b96e2898cfd8d129ad486910", "apr_id": "c31a35bb86e05cf0fba48660760ee467", "difficulty": 1300, "tags": ["math", "number theory"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.8850931677018633, "equal_cnt": 12, "replace_cnt": 2, "delete_cnt": 5, "insert_cnt": 4, "fix_ops_cnt": 11, "bug_source_code": "using System;\n\nnamespace test\n{\n class Program\n {\n static void Main()\n {\n string txt;\n while ((txt = Console.ReadLine()) != null)\n {\n var lst = txt.Split(' ');\n var a = int.Parse(lst[0]);\n var b = int.Parse(lst[1]);\n var c = int.Parse(lst[2]);\n var m = a % b;\n var pos = -1;\n\n if (m == 0)\n {\n if (c == 0)\n {\n pos = 1;\n }\n }\n else\n {\n var p = 1;\n m *= 10;\n while (true)\n {\n var x = m / b;\n if (x == c)\n {\n pos = p;\n break;\n }\n var y = m % b;\n\n if (y == 0)\n {\n if (c == 0)\n {\n pos = p + 1;\n }\n\n break;\n }\n\n y *= 10;\n if (y == m)\n {\n break;\n }\n p++;\n m = y;\n }\n }\n Console.WriteLine(pos);\n }\n }\n }\n}", "lang": "MS C#", "bug_code_uid": "2314fe5d443cb9eae6492ace8247fb00", "src_uid": "0bc7bf67b96e2898cfd8d129ad486910", "apr_id": "86f39ef0818a334e75ba4dfce63bb07d", "difficulty": 1300, "tags": ["math", "number theory"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "delete", "lang_cluster": "C#"} {"similarity_score": 0.987707881417209, "equal_cnt": 5, "replace_cnt": 0, "delete_cnt": 3, "insert_cnt": 1, "fix_ops_cnt": 4, "bug_source_code": "using System;\n\nnamespace ddmmyy\n{\n\tclass MainClass\n\t{\n\t\tpublic static bool chkdate(DateTime dt, int bdd, int bmm, int byy)\n\t\t{\n\t\t\tbyy +=2000;\n\t\t\tif (bdd>31) return false;\n\t\t\tif (bmm>12) return false;\n\t\t\tint iLastDay = DateTime.DaysInMonth(byy, bmm);\n\t\t\tif (bdd>iLastDay) return false;\n\t\t\tDateTime test = new DateTime(byy, bmm, bdd);\n\t\t\tif (test <= dt) return true;\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\tpublic static void Main (string[] args)\n\t\t{\n\t\t\t\tbool ret = false;\n string wkstr = Console.ReadLine();\n string[] stArray = wkstr.Split('.');\n int dd = Int32.Parse(stArray[0]);\n int mm = Int32.Parse(stArray[1]);\n int yy = Int32.Parse(stArray[2]);\n\t\t\t\tDateTime dt = new DateTime(2000+yy-18,mm,dd);\n wkstr = Console.ReadLine();\n stArray = wkstr.Split('.');\n int bdd = Int32.Parse(stArray[0]);\n int bmm = Int32.Parse(stArray[1]);\n int byy = Int32.Parse(stArray[2]);\n\t\t\t\tif (yy>18) {\n\t\t\t\t\tif (chkdate(dt,bdd,bmm,byy) ) ret= true;\n\t\t\t\t\tif (chkdate(dt,bdd,byy,bmm) ) ret= true;\n\t\t\t\t\tif (chkdate(dt,bmm,bdd,byy) ) ret= true;\n\t\t\t\t\tif (chkdate(dt,bmm,byy,bdd) ) ret= true;\n\t\t\t\t\tif (chkdate(dt,byy,bdd,bmm) ) ret= true;\n\t\t\t\t\tif (chkdate(dt,byy,bmm,bdd) ) ret= true;\n\t\t\t\t}\n\t\t\t \tif (ret) Console.WriteLine(\"YES\");\n\t\t\t\telse Console.WriteLine(\"NO\");\n\t\t}\n\t}\n}\n\n", "lang": "Mono C#", "bug_code_uid": "f6c336a44618d33ca17038d49ca3655b", "src_uid": "5418c98fe362909f7b28f95225837d33", "apr_id": "5e478478b55abcc22ff9977f5bfc08cb", "difficulty": 1700, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C#"} {"similarity_score": 0.9682134965153834, "equal_cnt": 7, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 6, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\n\nnamespace task30B\n{\n class Program\n {\n static bool TryToDate(string dd, string mm, string yy, ref DateTime dt)\n {\n bool result = true;\n yy = \"20\" + yy;\n try\n {\n dt = new DateTime(Int32.Parse(yy), Int32.Parse(mm), Int32.Parse(dd));\n }\n catch\n {\n result = false;\n }\n return result;\n }\n\n static bool Answer(string dd, string mm, string yy, DateTime dProg)\n {\n bool f = false;\n DateTime result = DateTime.Now;\n if (TryToDate(dd, mm, yy, ref result))\n {\n TimeSpan t = dProg - result;\n DateTime d = new DateTime(t.Ticks);\n if (d.Year - 1 >= 18)\n {\n f = true;\n }\n }\n return f;\n }\n static void Main(string[] args)\n {\n string[] input = Console.ReadLine().Split('.');\n DateTime dProg = new DateTime(Int32.Parse(\"20\" + input[2]), Int32.Parse(input[1]), Int32.Parse(input[0]));\n input = Console.ReadLine().Split('.');\n DateTime dVasya = new DateTime(Int32.Parse(\"20\" + input[2]), Int32.Parse(input[1]), Int32.Parse(input[0]));\n /*TimeSpan t = dProg - dVasya;\n if (t.Ticks < 0)\n {\n Console.WriteLine(\"NO\");\n return;\n }*/\n string dd = input[0];\n string mm = input[1];\n string yy = input[2];\n //1 2 3\n bool result = Answer(dd, mm, yy, dProg);\n if (result)\n {\n Console.WriteLine(\"YES\");\n return;\n }\n //1 3 2\n result = Answer(dd, yy, mm, dProg);\n if (result)\n {\n Console.WriteLine(\"YES\");\n return;\n }\n //2 1 3\n result = Answer(mm, dd, yy, dProg);\n if (result)\n {\n Console.WriteLine(\"YES\");\n return;\n }\n //2 3 1\n result = Answer(mm, yy, dd, dProg);\n if (result)\n {\n Console.WriteLine(\"YES\");\n return;\n }\n //3 1 2\n result = Answer(yy, dd, mm, dProg);\n if (result)\n {\n Console.WriteLine(\"YES\");\n return;\n }\n //3 2 1\n result = Answer(yy, mm, dd, dProg);\n if (result)\n {\n Console.WriteLine(\"YES\");\n return;\n }\n Console.WriteLine(\"NO\");\n //Console.ReadLine();\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "6478f4ee7e08108c55b33404336aa24f", "src_uid": "5418c98fe362909f7b28f95225837d33", "apr_id": "8f1b07261ef2adf1b832a4b46ae8e16b", "difficulty": 1700, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9992567266240523, "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.Globalization;\nusing System.IO;\nusing System.Linq;\nusing System.Text;\nusing System.Threading;\n\n// (づ°ω°)づミe★゜・。。・゜゜・。。・゜☆゜・。。・゜゜・。。・゜\npublic class Solver\n{\n class Edge\n {\n public int To, Inv;\n public T Capacity;\n public Edge(int to, int inv, T capacity)\n {\n To = to;\n Inv = inv;\n Capacity = capacity;\n }\n }\n\n static void AddEdge(List>[] g, int from, int to, T capacity, bool directed = true)\n {\n g[from].Add(new Edge(to, g[to].Count, capacity));\n g[to].Add(new Edge(from, g[from].Count - 1, directed ? default(T) : capacity));\n }\n\n static class Flow\n {\n private static int[] level;\n private static int[] ptr;\n private static int n, source, sink;\n private static List>[] g;\n\n public static long Find(List>[] g, int source, int sink)\n {\n n = g.Length;\n level = new int[n];\n ptr = new int[n];\n Flow.g = g;\n Flow.source = source;\n Flow.sink = sink;\n\n long ret = 0;\n while (true)\n {\n Bfs();\n if (level[sink] < 0)\n return ret;\n Array.Clear(ptr, 0, n);\n long f;\n while ((f = Dfs(source, int.MaxValue / 2)) > 0)\n ret += f;\n }\n }\n\n static void Bfs()\n {\n for (int i = 0; i < n; i++)\n level[i] = -1;\n var q = new Queue();\n level[source] = 0;\n q.Enqueue(source);\n while (q.Count > 0)\n {\n var v = q.Dequeue();\n foreach (var e in g[v])\n if (e.Capacity > 0 && level[e.To] < 0)\n {\n level[e.To] = level[v] + 1;\n q.Enqueue(e.To);\n }\n }\n }\n\n static long Dfs(int v, long f)\n {\n if (v == sink)\n return f;\n for (; ptr[v] < g[v].Count; ptr[v]++)\n {\n var e = g[v][ptr[v]];\n if (e.Capacity <= 0 || level[v] >= level[e.To])\n continue;\n long d = Dfs(e.To, Math.Min(f, e.Capacity));\n if (d <= 0)\n continue;\n e.Capacity -= d;\n g[e.To][e.Inv].Capacity += d;\n return d;\n }\n return 0;\n }\n }\n\n public void Solve()\n {\n for (int tt = ReadInt(); tt > 0; tt--)\n {\n int n = ReadInt();\n var a = ReadIntArray();\n var b = ReadIntArray();\n\n long ans = 1L * Math.Min(a[0], b[1]) + Math.Min(a[1], b[2]) + Math.Min(a[2], b[0]);\n var g = Init>>(8);\n for (int i = 0; i < 3; i++)\n {\n AddEdge(g, 6, i, a[i]);\n AddEdge(g, i + 3, 7, b[i]);\n for (int j = 0; j < 2; j++)\n AddEdge(g, i, (i + 2 + j) % 3 + 3, long.MaxValue);\n }\n\n Write(a.Sum(aa => (long)aa) - Flow.Find(g, 6, 7), ans);\n }\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 new Solver().Solve();\n //var thread = new Thread(new Solver().Solve, 1024 * 1024 * 128);\n //thread.Start();\n //thread.Join();\n }\n catch (Exception ex)\n {\n#if DEBUG\n Console.WriteLine(ex);\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]; }\n 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": "Mono C#", "bug_code_uid": "5a9d463bb7104fd1510b2dc0c738020a", "src_uid": "e6dc3bc64fc66b6127e2b32cacc06402", "apr_id": "f9f4e23c3586d557f5e8c71e66059abe", "difficulty": 1800, "tags": ["flows", "greedy", "math", "brute force", "constructive algorithms"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9802538787023978, "equal_cnt": 8, "replace_cnt": 2, "delete_cnt": 4, "insert_cnt": 1, "fix_ops_cnt": 7, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\n\nnamespace Windows_приложения1\n{\n class Program\n {\n static void Main(string[] args)\n {\n ulong a, b;\n string s = Console.ReadLine();\n string[] number = s.Split();\n ulong.TryParse(number[0], out a);\n ulong.TryParse(number[1], out b);\n for (ulong i = 1; i <= a || i <= b; i++)\n {\n a = a - (i * 2-1);\n if (a < 0) { Console.WriteLine(\"Vladik\"); return; }\n b = b - (i * 2);\n if (b < 0) { Console.WriteLine(\"Valera\"); return; }\n }\n }\n }\n}", "lang": "MS C#", "bug_code_uid": "e4ca4ba84e40573572129c6e8fb06d4d", "src_uid": "87e37a82be7e39e433060fd8cdb03270", "apr_id": "8219f09e21ccf709ac6b3c4fa4f0ce0f", "difficulty": 800, "tags": ["brute force", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "delete", "lang_cluster": "C#"} {"similarity_score": 0.8620268620268621, "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;\nusing System.Threading.Tasks;\n\nnamespace ConsoleApplication4\n{\n class Program\n {\n static void Main(string[] args)\n {\n int x = int.Parse(Console.ReadLine());\n\n\n int h = int.Parse(Console.ReadLine());\n int m = int.Parse(Console.ReadLine());\n\n int count = 0;\n while (h % 10 != 7 && m % 10 != 7)\n {\n if (m < x)\n {\n m = (m + 60 - x) % 60;\n h = (h == 0) ? 23 : --h;\n }\n else\n {\n m -= x;\n }\n count++;\n }\n\n Console.WriteLine(count);\n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "30c06aac4ad0477aa3e0efb82a1254a7", "src_uid": "5ecd569e02e0164a5da9ff549fca3ceb", "apr_id": "be3efff516bf017aec5c138a8e241727", "difficulty": 900, "tags": ["math", "brute force", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.8277541083384053, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 4, "fix_ops_cnt": 5, "bug_source_code": "string s = Console.ReadLine();\n string[] array = s.Split(' ');\n int[] numbers = new int[3];\n for (int i = 0; i < array.Length; i++)\n numbers[i] = int.Parse(array[i]);\n bool flag = false;\n\n for (int i = 0; i < (int) (numbers[2]/numbers[0]); i++)\n {\n for (int j = 0; j < (int) (numbers[2]/numbers[0]); j++)\n {\n if (numbers[0]*i + numbers[1]*j == numbers[2])\n {\n flag = true;\n break;\n }\n }\n }\n Console.WriteLine(flag ? \"Yes\" : \"No\");", "lang": "MS C#", "bug_code_uid": "e40ec5498147509613cffcd904f3de36", "src_uid": "e66ecb0021a34042885442b336f3d911", "apr_id": "7d2c96f0fc40e672b40b52238fd2a8b8", "difficulty": 1100, "tags": ["math", "brute force", "number theory"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.8584969532836831, "equal_cnt": 5, "replace_cnt": 4, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 4, "bug_source_code": "using System;\n\nnamespace ConsoleApplication1\n{\n class Program\n {\n static void Main(string[] args)\n {\n int n = Convert.ToInt32(Console.ReadLine());\n int m = Convert.ToInt32(Console.ReadLine());\n int answ = ans(n, m);\n Console.WriteLine(answ);\n }\n public static int ans(int n, int m)\n {\n while (true)\n {\n for (int i = 1; i <= n; i++)\n {\n m -= i;\n if (m < 0) { return m + i; }\n else if (m == 0)\n {\n return 0;\n }\n }\n }\n }\n }\n}", "lang": "MS C#", "bug_code_uid": "ae54a9cfe8f0850cc4d580ebaf446985", "src_uid": "5dd5ee90606d37cae5926eb8b8d250bb", "apr_id": "1f984bc5c5120f9d877f856761d5ee59", "difficulty": 800, "tags": ["math", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.8926761860893597, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "using System;\n\nnamespace ConsoleApplication1\n{\n class Program\n {\n static bool She(byte a,byte b)\n {\n if(a==b)\n {\n return true;\n }\n return a-1==b;\n }\n static bool He(byte a, byte b)\n {\n if (a-1 == b)\n {\n return true;\n }\n return a<=b*2+2;\n }\n static void Main()\n {\n var s1 = Console.ReadLine().Split(' ');\n var s2 = Console.ReadLine().Split(' ');\n var b1 = new[] {Convert.ToByte(s1[0]), Convert.ToByte(s1[1])};\n var b2 = new[] { Convert.ToByte(s2[0]), Convert.ToByte(s2[1]) };\n var t = b1[0] >= b2[1] ? She(b1[0], b2[1]) : He(b2[1], b1[0]);\n if(!t)\n {\n t = b1[1]>=b2[0] ? She(b1[1], b2[0]) : He(b2[0], b1[1]);\n }\n if (!t)\n {\n t = b1[1] >= b2[1] ? She(b1[1], b2[1]) : He(b2[1], b1[1]);\n }\n if (!t)\n {\n t = b1[0] >= b2[0] ? She(b1[0], b2[0]) : He(b2[0], b1[0]);\n }\n Console.WriteLine(t?\"YES\":\"NO\");\n }\n }\n}", "lang": "Mono C#", "bug_code_uid": "2e2a7be5fa3ccb39726e491917c3bccf", "src_uid": "36b7478e162be6e985613b2dad0974dd", "apr_id": "be17c9d3dc411def9ba17983b2f2186b", "difficulty": 1300, "tags": ["math", "greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "C#"} {"similarity_score": 0.7959625090122566, "equal_cnt": 8, "replace_cnt": 2, "delete_cnt": 2, "insert_cnt": 3, "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 ConsoleApplication14\n{\n class Program\n {\n static void Main(string[] args)\n {\n string s = Console.ReadLine(), c = Console.ReadLine();\n int x = 0, y = 1;\n for (int i = 0; i < s.Length; i++)\n {\n if (s[i] != c[c.Length - y])\n x++;\n y++;\n }\n if (x > 0)\n Console.WriteLine(\"NO\");\n else\n Console.WriteLine(\"YES\");\n\n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "ecf9ebb960033c0bcfb6bb16daaaba44", "src_uid": "35a4be326690b58bf9add547fb63a5a5", "apr_id": "234887caa8c1d0ee96cf9cfaf6d5d3ed", "difficulty": 800, "tags": ["strings", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.5735294117647058, "equal_cnt": 14, "replace_cnt": 10, "delete_cnt": 3, "insert_cnt": 1, "fix_ops_cnt": 14, "bug_source_code": "using System;\n using System.Collections.Generic;\n using System.Globalization;\n using System.Linq;\n using System.Text;\n\n public class Program\n {\n public static void Main(string[] args)\n {\n var first = Console.ReadLine();\n var second = Console.ReadLine();\n var output = Convert.ToByte(first, 2) ^ Convert.ToByte(second, 2);\n var outS = Convert.ToString(output, 2);\n var temp = \"\";\n StringBuilder sb=new StringBuilder(outS);\n var tempLength = outS.Length;\n while (tempLength != first.Length)\n {\n temp += \"0\";\n tempLength++;\n }\n Console.WriteLine(temp + outS);\n\n\n }\n }", "lang": "MS C#", "bug_code_uid": "50e4fbc93ef4d4b806667c431e5a12eb", "src_uid": "3714b7596a6b48ca5b7a346f60d90549", "apr_id": "b5cf5219b24ebf55283e65cf89a94941", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9872821479039096, "equal_cnt": 4, "replace_cnt": 0, "delete_cnt": 2, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "using System;\nusing System.IO;\nusing System.Numerics;\nusing System.Text;\n\nnamespace Hack_it\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 BigInteger sum = 0;\n BigInteger count = 1;\n int i = 1;\n for (; i <= 20; i++)\n {\n count *= 10;\n }\n\n for (int j = 1; j < 10; j++)\n {\n sum += count*j*i;\n }\n sum += 1;\n\n BigInteger a = BigInteger.Parse(reader.ReadLine());\n\n BigInteger d = sum%a;\n if (d != 0)\n {\n d = a - d;\n }\n\n writer.WriteLine(\"{0} {1}\", d + 1, count + d);\n writer.Flush();\n }\n }\n}", "lang": "MS C#", "bug_code_uid": "95eae2e0c4c36dfa3c4b679e4ceae3d1", "src_uid": "52b8d97f216ea22693bc16fadcd46dae", "apr_id": "3d88ced4537e20b839084b93960a3f54", "difficulty": 2500, "tags": ["constructive algorithms"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "C#"} {"similarity_score": 0.9698336622497885, "equal_cnt": 3, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "using System;\nusing System.Collections;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\n\nclass TEST{\n\tstatic void Main(){\n\t\tSol mySol =new Sol();\n\t\tmySol.Solve();\n\t}\n}\n\nclass Sol{\n\tpublic void Solve(){\n\t\t\n\t\tbool[] isPrime = new bool[N+1];\n\t\tfor(int i=2;i<=N;i++) isPrime[i] = true;\n\t\tfor(int i=2;i<=N;i++){\n\t\t\tif(!isPrime[i]) continue;\n\t\t\tfor(int j=i+i;j<=N;j+=i) isPrime[j] = false;\n\t\t}\n\t\t\n\t\t\n\t\tint[] bp = new int[N+1];\n\t\tfor(int i=0;i<=N;i++) bp[i] = i;\n\t\tfor(int i=2;i<=N;i++){\n\t\t\tif(bp[i] == i){\n\t\t\t\tfor(int j=i+i;j<=N;j+=i){\n\t\t\t\t\tbp[j] = i;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n//Console.WriteLine(\"ok\");\n\t\tint min = N - bp[N] + 1;\n\t\tbool[] pos = new bool[N+1];\n\t\tpos[N] = true;\n\t\tfor(int j=0;jint.Parse(e));}\n\tstatic long[] rla(char sep=' '){return Array.ConvertAll(Console.ReadLine().Split(sep),e=>long.Parse(e));}\n\tstatic double[] rda(char sep=' '){return Array.ConvertAll(Console.ReadLine().Split(sep),e=>double.Parse(e));}\n}\n", "lang": "Mono C#", "bug_code_uid": "5dbe0b910ef220cfd7107c2785aa1a5f", "src_uid": "43ff6a223c68551eff793ba170110438", "apr_id": "bfdca9fa5189c03e97a72e5d9e4cb23b", "difficulty": 1700, "tags": ["math", "brute force", "number theory"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.21064220183486237, "equal_cnt": 34, "replace_cnt": 23, "delete_cnt": 7, "insert_cnt": 5, "fix_ops_cnt": 35, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\n\nnamespace Codeforces579\n{\n class Program4C\n {\n static void Main()\n {\n var s = Console.ReadLine();\n var t = Console.ReadLine();\n\n var pos = new List>(); // ありえる組み合わせ,そのインデックス\n var tList = new List[t.Length];\n for (int i = 0; i < t.Length; i++)\n tList[i] = new List();\n\n for (int i = 0; i < s.Length; i++)\n {\n for (int j = 0; j < t.Length; j++)\n {\n if (s[i] != t[j]) continue;\n\n tList[j].Add(i);\n }\n }\n\n var que = new Queue>();\n foreach (var i in tList[0])\n que.Enqueue(new List() { i });\n\n while (que.Count > 0)\n {\n var q = que.Dequeue();\n if (q.Count == t.Length)\n {\n pos.Add(q);\n continue;\n }\n\n for (int i = 0; i < tList[q.Count].Count; i++)\n {\n if (q[q.Count - 1] < tList[q.Count][i])\n que.Enqueue(new List(q) { tList[q.Count][i] });\n }\n }\n\n var ans = 0;\n foreach (var item in pos)\n {\n ans = Math.Max(ans, item[0]);\n for (int i = 1; i < item.Count; i++)\n ans = Math.Max(ans, item[i] - item[i - 1] - 1);\n\n ans = Math.Max(ans, s.Length - item[item.Count - 1] - 1);\n }\n\n Console.WriteLine(ans);\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "2eb80028a81b720bedf29716e49e8ab0", "src_uid": "0fd33e1bdfd6c91feb3bf00a2461603f", "apr_id": "c7fd0fea667752821dbb30ffa52e231e", "difficulty": 1600, "tags": ["greedy", "implementation"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.253964552238806, "equal_cnt": 61, "replace_cnt": 19, "delete_cnt": 10, "insert_cnt": 32, "fix_ops_cnt": 61, "bug_source_code": "using System;\n\nnamespace ConsoleApplication1\n{\n class Program\n {\n static void Main(string[] args)\n {\n string textBox1 = Console.ReadLine();\n string textBox2 = Console.ReadLine();\n int max = textBox1.Length;\n int valor = 0, valorTemp = 0;\n for (int i = 0; i < textBox1.Length; i++)\n {\n if (textBox1[i] == textBox2[0])\n {\n valorTemp = moduloDeCadenaMasLarga(i + 1,textBox1,textBox2);\n if (valorTemp > valor)\n {\n valor = valorTemp;\n }\n }\n }\n\n Console.WriteLine(valor);\n }\n\n private static int moduloDeCadenaMasLarga(int inicio, string textBox1, string textBox2)\n {\n int longitud = 0;\n int contadorSubcadena = 1;\n int longitudDerecha = 0;\n int inicioIntermedio = inicio;\n int finIntermedio = 0;\n int longitudIntermedio = 0;\n int longitudIntermedioTemp = 0;\n for (int i = inicio; i < textBox1.Text.Length; i++)\n {\n if (textBox1.Text[i] == textBox2.Text[contadorSubcadena])\n {\n finIntermedio = i - 1;\n longitudIntermedioTemp = finIntermedio - inicioIntermedio;\n if (longitudIntermedioTemp > longitudIntermedio)\n {\n longitudIntermedio = longitudIntermedioTemp;\n }\n inicioIntermedio = i;\n contadorSubcadena++;\n }\n if (contadorSubcadena == textBox2.Text.Length)\n {\n longitudDerecha = (textBox1.Text.Length - 1) - i;\n break;\n }\n }\n if (contadorSubcadena == textBox2.Text.Length)\n {\n if (longitudDerecha > (inicio - 1) && longitudDerecha > longitudIntermedio)\n {\n longitud = longitudDerecha;\n }\n else if (longitudIntermedio > (inicio - 1))\n {\n longitud = longitudIntermedio;\n }\n else\n {\n longitud = inicio - 1;\n }\n }\n return longitud;\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "5fcdb7e0d0c153bca3281180b2357b28", "src_uid": "0fd33e1bdfd6c91feb3bf00a2461603f", "apr_id": "1ae541f032875850a49c165fa4a15c72", "difficulty": 1600, "tags": ["greedy", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.7065134099616859, "equal_cnt": 26, "replace_cnt": 12, "delete_cnt": 5, "insert_cnt": 10, "fix_ops_cnt": 27, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.IO;\n\nnamespace ConsoleApplication1\n{\n class Program\n {\n private static string filename = \"input.txt\";\n private static string output = \"output.txt\";\n static void Main(string[] args)\n {\n string strNumberF = string.Empty;\n string strNumberS = string.Empty;\n \n using (Stream str=File.OpenRead(filename))\n {\n using (StreamReader streamReader=new StreamReader(str))\n {\n strNumberF = streamReader.ReadLine();\n strNumberS = streamReader.ReadLine();\n } \n }\n\n int[] numbersF=new int[strNumberF.Length];\n int[] numbersS = new int[strNumberS.Length];\n for (int i = 0; i < strNumberF.Length; i++)\n {\n numbersF[i] = strNumberF[i] - 48;\n numbersS[i] = strNumberS[i] - 48;\n }\n\n using (Stream str = File.Open(output, FileMode.OpenOrCreate))\n {\n for(int i=0;i Bin(long n)\n {\n List ret = new List();\n while (n>0)\n {\n ret.Add((int)n&1);\n n /= 2;\n }\n ret.Reverse();\n return ret;\n }\n\n static int Main(string[] args)\n {\n string[] tmp = Console.ReadLine().Split(' ');\n long a = long.Parse(tmp[0]);\n long b = long.Parse(tmp[1]);\n List A = Bin(a);\n List B = Bin(b);\n if (A.Count != B.Count)\n {\n Console.WriteLine(((long)(1) << B.Count) - 1);\n return 0;\n }\n if (a == b)\n {\n Console.WriteLine(a ^ a);\n }\n List U = new List();\n List V = new List();\n bool uLess = false;\n bool vGreater = false;\n int i = 0;\n while (A[i] == B[i])\n {\n ++i;\n U.Add(A[i]);\n V.Add(A[i]);\n }\n U.Add(A[i]);\n V.Add(B[i]);\n ++i;\n while (i != A.Count)\n {\n if (A[i] + B[i] == 1)\n {\n U.Add(A[i]);\n V.Add(B[i]);\n }\n else\n {\n if (A[i] == 1)\n {\n U.Add(0);\n V.Add(1);\n uLess = true;\n }\n else\n {\n U.Add(0);\n V.Add(1);\n vGreater = true;\n }\n }\n ++i;\n }\n long res = 0;\n for (i = 0; i < U.Count; ++i)\n {\n U[i] = (U[i] + V[i]) % 2;\n res = 2 * res + U[i];\n }\n Console.WriteLine(res);\n return 0;\n }\n }\n}", "lang": "Mono C#", "bug_code_uid": "e8f877bcf1126999e2380730f8b5309a", "src_uid": "d90e99d539b16590c17328d79a5921e0", "apr_id": "8fcfb8fb915e70b24e970768a29ce816", "difficulty": 1700, "tags": ["dp", "bitmasks", "greedy", "math", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C#"} {"similarity_score": 0.9962864721485412, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "// Just split the path string and apply the changes.\n\nusing System;\nusing System.Text;\n\nclass Program\n{\n static void Main(string[] args)\n {\n long x1 = 0, y1 = 0, x2 = 0, y2 = 0, x3 = 0, y3 = 0;\n string buf = Console.ReadLine();\n string[] vals = buf.Split(' ');\n x1 = Convert.ToInt32(vals[0]);\n y1 = Convert.ToInt32(vals[1]);\n\n buf = Console.ReadLine();\n vals = buf.Split(' ');\n x2 = Convert.ToInt32(vals[0]);\n y2 = Convert.ToInt32(vals[1]);\n\n buf = Console.ReadLine();\n vals = buf.Split(' ');\n x3 = Convert.ToInt32(vals[0]);\n y3 = Convert.ToInt32(vals[1]);\n\n int crs = (x2-x1)*(y3-y2)-(y2-y1)*(x3-x2);\n if(crs == 0) {\n Console.WriteLine(\"TOWARDS\");\n }\n else if(crs < 0) {\n Console.WriteLine(\"RIGHT\");\n }\n else if(crs > 0) {\n Console.WriteLine(\"LEFT\");\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "d1ce8f043c7f172fc205d00b58d62bb9", "src_uid": "f6e132d1969863e9f28c87e5a44c2b69", "apr_id": "4a3c02977bf1d549ffc25b87f983d9c8", "difficulty": 1300, "tags": ["geometry"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.8899755501222494, "equal_cnt": 14, "replace_cnt": 4, "delete_cnt": 8, "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 Kirill_And_The_Game\n{\n class Program\n {\n static void Main(string[] args)\n {\n double[] arr = Array.ConvertAll(Console.ReadLine().Split(' '), Double.Parse);\n Int64 l = Convert.ToInt64(arr[0]);\n Int64 r = Convert.ToInt64(arr[1]);\n Int64 x = Convert.ToInt64(arr[2]);\n Int64 y = Convert.ToInt64(arr[3]);\n double k = arr[4];\n bool cond = false;\n\n \n\n for(Int64 a = l; a\n /// Solution class\n /// \n internal static class Program\n {\n #region Main\n /// \n /// Modulo operator used in a lot of questions\n /// \n private const long mod = 1000000007L;\n\n\n /// \n /// Fast Console IO helper\n /// \n private static ConsoleHelper Console { get; } = new ConsoleHelper();\n\n /// \n /// Main method - Launches solver\n /// \n private static void Main()\n {\n using (Console)\n {\n#if DEBUG\n Stopwatch timer = Stopwatch.StartNew();\n#endif\n\n\n\n#if TESTCASES\n TestCases();\n#else //!TESTCASES\n Solve();\n#endif\n#if DEBUG\n timer.Stop();\n Console.Write($\"\\r\\nTotal run time: {timer.Elapsed.TotalSeconds:0.000}s\");\n#endif\n }\n }\n\n#if TESTCASES\n /// \n /// Solves the problem for multiple test cases\n /// \n private static void TestCases()\n {\n int t = Console.NextInt();\n Console.SkipNextLine();\n\n while (t-- > 0)\n {\n Solve();\n }\n }\n\n#endif\n #endregion\n\n #region Solution\n\n /// \n /// Solution\n /// \n private static void Solve()\n {\n \n int l=Console.NextInt();\n int r=Console.NextInt();\n\t\t\tint x=Console.NextInt();\n\t\t\tint y=Console.NextInt();\n int k=Console.NextInt();\n\t\t\tint t=0;\n while(x<=y)\n\t\t {\n\t\t int mid=x+(y-x)/2;\n\t\t if(mid*k>r)\n\t\t y=mid-1;\n\t\t if(mid*x\n /// Fast Console IO helper\n /// \n [DebuggerStepThrough]\n internal sealed class ConsoleHelper : IDisposable\n {\n #region Constants\n /// \n /// The standard input and output buffers size (2^20, 1Mb)\n /// \n private const int baseSize = 1048576;\n /// \n /// Integer out string conversion buffer\n /// \n private static readonly char[] numBuffer = new char[20];\n #endregion\n\n #region Fields\n private readonly BufferedStream inStream; //Buffered console input stream\n private readonly StreamWriter outStream; //Buffered console output stream\n\n private readonly byte[] inBuffer; //Input buffer \n private int inputIndex; //Input buffer current index\n private int bufferEnd; //Input buffer ending index\n #endregion\n\n #region Properties\n /// \n /// The buffer size, in bytes\n /// \n public int BufferSize { get; }\n\n /// \n /// If this memory stream is open and available to read/write\n /// \n public bool Open { get; private set; }\n #endregion\n\n #region Constructors\n /// \n /// Creates a new console IO helper reading from the standard Console input and output\n /// \n public ConsoleHelper() : this(baseSize) { }\n\n /// \n /// Creates a new console IO helper reading from the standard Console input and output with the specified buffer size\n /// Size of the buffer to use in bytes\n /// \n public ConsoleHelper(int bufferSize)\n {\n //Open the input/output streams\n#if DEBUG\n //Test mode\n this.inStream = new BufferedStream(File.OpenRead(@\"..\\..\\input.txt\"), bufferSize);\n this.outStream = new StreamWriter(File.Create(@\"..\\..\\output.txt\", bufferSize), Encoding.ASCII, bufferSize);\n#else //!DEBUG\n//Submission mode\n this.inStream = new BufferedStream(Console.OpenStandardInput(bufferSize), bufferSize); //Submission stream\n this.outStream = new StreamWriter(Console.OpenStandardOutput(bufferSize), Encoding.ASCII, bufferSize);\n#endif\n\n //Set fields\n this.inBuffer = new byte[bufferSize];\n this.inputIndex = this.bufferEnd = 0;\n this.BufferSize = bufferSize;\n this.Open = true;\n }\n #endregion\n\n #region Static methods\n /// \n /// Verifies that the passed character is a non-special ASCII character\n /// \n /// Character to validate\n /// True if the character is not a special character\n public static bool ValidateChar(int i) => i >= ' ';\n\n /// \n /// Verifies that the passed character is a non-special ASCII character or a whitespace\n /// \n /// Character to validate\n /// True if the character is not a whitespace or a special character\n public static bool ValidateCharNoSpace(int i) => i > ' ';\n\n /// \n /// Verifies that the passed character is a numerical character (0-9)\n /// \n /// Character to validate\n /// True if the character is a numerical character, false otherwise\n public static bool ValidateNumber(int i) => i >= '0' && i <= '9';\n\n /// \n /// Verifies if a character is an Endline character\n /// \n /// Character to check\n /// True if it is an Endline character, false otherwise\n public static bool IsEndline(int i) => i == '\\n' || i == '\\0';\n\n /// \n /// Takes a signed int value and copies it's characters at the end of the integer char buffer\n /// \n /// Int to write to the buffer\n /// Head index at which the buffer's writing starts\n private static int GetIntBuffer(int n)\n {\n int head = 20;\n bool neg;\n if (n < 0)\n {\n neg = true;\n n = -n;\n }\n else { neg = false; }\n\n do\n {\n numBuffer[--head] = (char)((n % 10) + 48);\n n /= 10;\n }\n while (n > 0);\n\n if (neg) { numBuffer[--head] = '-'; }\n return head;\n }\n\n /// \n /// Takes a signed long value and copies it's characters at the end of the integer char buffer\n /// \n /// Long to write to the buffer\n /// Head index at which the buffer's writing starts\n private static int GetLongBuffer(long n)\n {\n int head = 20;\n bool neg;\n if (n < 0L)\n {\n neg = true;\n n = -n;\n }\n else { neg = false; }\n\n do\n {\n numBuffer[--head] = (char)((n % 10L) + 48L);\n n /= 10L;\n }\n while (n > 0L);\n\n if (neg) { numBuffer[--head] = '-'; }\n return head;\n }\n #endregion\n\n #region Methods\n /// \n /// Returns the next byte data in the console input stream\n /// \n /// Next data byte from the console\n public byte Read()\n {\n CheckBuffer();\n return this.inBuffer[this.inputIndex++];\n }\n\n /// \n /// Returns the next byte data in the console input stream without consuming it\n /// \n /// Next data byte from the console\n public byte Peek()\n {\n CheckBuffer();\n return this.inBuffer[this.inputIndex];\n }\n\n /// \n /// Skips a number of characters in the input stream\n /// \n /// Amount of chars to skip, defaults to 1\n public void Skip(int n = 1) => this.inputIndex += n;\n\n /// \n /// Assures we have data available in the input buffer\n /// \n private void CheckBuffer()\n {\n //If we reach the end of the buffer, load more data\n if (this.inputIndex >= this.bufferEnd)\n {\n this.inputIndex = this.inputIndex - this.bufferEnd;\n this.bufferEnd = this.inStream.Read(this.inBuffer, 0, this.BufferSize);\n\n //If nothing was added, add a null char at the start\n if (this.bufferEnd < 1) { this.inBuffer[this.bufferEnd++] = 0; }\n }\n }\n\n /// \n /// Returns the next character in the console input stream\n /// \n /// Next character in the input stream\n public char NextChar() => (char)Read();\n\n /// \n /// Returns the next string token from the console input\n /// \n /// If there is no more data on the line being read\n /// Parsed string, separated by spaces or special characters such as line feeds\n public string Next()\n {\n byte b = SkipInvalid();\n ValidateEndline(b);\n\n //Append all characters\n StringBuilder sb = new StringBuilder().Append((char)b);\n b = Peek();\n while (ValidateCharNoSpace(b))\n {\n //Peek to not consume terminator\n sb.Append((char)b);\n Skip();\n b = Peek();\n }\n\n return sb.ToString();\n }\n\n /// \n /// Returns the next int value in the console input, this is a fast parse\n /// \n /// If the text is not a valid integer\n /// If there is no more data on the line being read\n /// If the value is too large for integer\n /// Parsed int value from the input\n public int NextInt()\n {\n //Skip invalids\n byte b = SkipInvalid();\n ValidateEndline(b);\n\n //Verify for negative\n bool neg = false;\n if (b == '-')\n {\n neg = true;\n b = Read();\n }\n\n //Get first digit\n if (!ValidateNumber(b)) { throw new FormatException(\"Integer parsing has failed because the string contained invalid characters\"); }\n\n int n = b - '0';\n b = Peek();\n while (ValidateNumber(b))\n {\n //Peek to not consume terminator, and check for overflow\n n = checked((n << 3) + (n << 1) + (b - '0'));\n Skip();\n b = Peek();\n }\n //If the character causing the exit is a valid ASCII character, the integer isn't correct formatted\n if (ValidateCharNoSpace(b)) { throw new FormatException(\"Integer parsing has failed because the string contained invalid characters\"); }\n\n return neg ? -n : n;\n }\n\n /// \n /// Returns the next long value in the console input, this is a fast parse\n /// \n /// If the text is not a valid long\n /// If there is no more data on the line being read\n /// If the value is too large for long\n /// Parsed long value from the input\n public long NextLong()\n {\n byte b = SkipInvalid();\n ValidateEndline(b);\n\n //Verify negative\n bool neg = false;\n if (b == '-')\n {\n neg = true;\n b = Read();\n }\n\n //Get first digit\n if (!ValidateNumber(b)) { throw new FormatException(\"Integer parsing has failed because the string contained invalid characters\"); }\n\n long n = b - '0';\n b = Peek();\n while (ValidateNumber(b))\n {\n //Peek to not consume terminator, and check for overflow\n n = checked((n << 3) + (n << 1) + (b - '0'));\n Skip();\n b = Peek();\n }\n //If the character causing the exit is a valid ASCII character, the long isn't correct formatted\n if (ValidateCharNoSpace(b)) { throw new FormatException(\"Long parsing has failed because the string contained invalid characters\"); }\n\n return neg ? -n : n;\n }\n\n /// \n /// Returns the next double value in the console input\n /// Note: fast double parsing is slightly harder, I'll implement it if I need to\n /// \n /// If the text is not a valid double\n /// If there is no more data on the line being read\n /// If the value is too large for double\n /// Parsed double value from the input\n public double NextDouble() => double.Parse(Next());\n\n /// \n /// Returns the next n int values on the same line in an array\n /// \n /// Number of values to seek\n /// If the text is not a valid integer\n /// If there is no more data on the line being read\n /// If the value is too large for integer\n /// If the created array is too large for the system memory\n /// The n integer values in an array\n public int[] NextInts(int n)\n {\n int[] array = new int[n];\n for (int i = 0; i < n; i++)\n {\n array[i] = NextInt();\n }\n\n SkipNextLine();\n return array;\n }\n\n /// \n /// Returns the next n long values on the same line in an array\n /// \n /// Number of values to seek\n /// If the text is not a valid long\n /// If there is no more data on the line being read\n /// If the value is too large for long\n /// If the created array is too large for the system memory\n /// The n long values in an array\n public long[] NextLongs(int n)\n {\n long[] array = new long[n];\n for (int i = 0; i < n; i++)\n {\n array[i] = NextLong();\n }\n\n SkipNextLine();\n return array;\n }\n\n /// \n /// Returns the next n int values on the next m lines in the output stream under the form of an NxM matrix\n /// \n /// Number of rows to the matrix\n /// Number of columns to the matrix\n /// If the text is not a valid integer\n /// If there is no more data on the line being read\n /// If the value is too large for integer\n /// If the created 2D array is too large for the system memory\n /// The NxM matrix of integers\n public int[,] NextMatrix(int n, int m)\n {\n int[,] matrix = new int[n, m];\n for (int i = 0; i < n; i++)\n {\n for (int j = 0; j < m; j++)\n {\n matrix[i, j] = NextInt();\n }\n\n SkipNextLine();\n }\n\n return matrix;\n }\n\n /// \n /// Returns the next line of text in the console\n /// \n /// Next string line from the console\n public string NextLine()\n {\n byte b = SkipInvalid();\n if (b == 0)\n {\n //Consume newline and return empty string\n Skip();\n return string.Empty;\n }\n\n //Read all the characters until the next linefeed\n StringBuilder sb = new StringBuilder().Append((char)b);\n b = Read();\n while (!IsEndline(b))\n {\n //Don't append special characters, but don't exit\n if (ValidateChar(b))\n {\n sb.Append((char)b);\n }\n b = Read();\n }\n\n return sb.ToString();\n }\n\n /// \n /// Skips the next token in input\n /// \n /// If there is no more data on the line being read\n public void SkipNext()\n {\n byte b = SkipInvalid();\n ValidateEndline(b);\n\n for (b = Peek(); ValidateCharNoSpace(b); b = Peek())\n {\n Skip();\n }\n }\n\n /// \n /// Skips all the text on the current line and jump to the next\n /// \n public void SkipNextLine()\n {\n for (byte b = Read(); !IsEndline(b); b = Read()) { }\n }\n\n /// \n /// Enumerates the given number of integers on the current line\n /// \n /// Number of integers on the current line\n /// Enumerable of the integers\n public IEnumerable EnumerateInts(int n)\n {\n while (n-- > 0)\n {\n yield return NextInt();\n }\n\n SkipNextLine();\n }\n\n /// \n /// Enumerates all the characters in the next line until the feed is exhausted or an endline character is met\n /// \n /// Enumerable of all the characters in the current line\n public IEnumerable EnumerateLine()\n {\n for (char c = NextChar(); !IsEndline(c); c = NextChar())\n {\n if (ValidateChar(c))\n {\n yield return c;\n }\n }\n }\n\n /// \n /// Assures we are not trying to read more data on the line that there exists\n /// \n /// Byte data to verify\n /// If there is no more data on the line being read\n private void ValidateEndline(byte b)\n {\n //If empty char\n if (b == 0)\n {\n //Go back a char and throw\n this.inputIndex--;\n throw new InvalidOperationException(\"No values left on line\");\n }\n }\n\n /// \n /// Skips all invalid character bytes then returns the first valid byte found, spaces are considered invalid\n /// \n /// The next valid character byte, cannot be a whitespace\n private byte SkipInvalid()\n {\n byte b = Peek();\n if (IsEndline(b)) { return 0; }\n\n while (!ValidateCharNoSpace(b))\n {\n Skip();\n b = Peek();\n //Return empty char if we meet an linefeed or empty char\n if (IsEndline(b)) { return 0; }\n }\n\n return Read();\n }\n\n /// \n /// Writes the given char to the console output\n /// \n /// Character to write\n public void Write(char c) => this.outStream.Write(c);\n\n /// \n /// Writes the given char buffer to the console output\n /// \n /// Char buffer to write\n public void Write(char[] buffer) => this.outStream.Write(buffer);\n\n /// \n /// Writes the given string to the console output\n /// \n /// String to write\n public void Write(string s) => this.outStream.Write(s);\n\n /// \n /// Writes the given integer to the console output\n /// \n /// Integer to write\n public void Write(int n)\n {\n int head = GetIntBuffer(n);\n this.outStream.Write(numBuffer, head, 20 - head);\n }\n\n /// \n /// Writes the given long to the console output\n /// \n /// Long to write\n public void Write(long n)\n {\n int head = GetLongBuffer(n);\n this.outStream.Write(numBuffer, head, 20 - head);\n }\n\n /// \n /// Writes the contents of the StringBuilder to the console output\n /// \n /// StringBuilder to write to the output\n public void Write(StringBuilder sb) => this.outStream.Write(sb.ToCharArray());\n\n /// \n /// Writes the given object to the console output using the object's ToString method\n /// \n /// Object to write\n public void Write(object o) => this.outStream.Write(o);\n\n /// \n /// Writes a sequence to the console output with the given string separator\n /// \n /// Type of elements in the sequence\n /// Sequence to print\n /// String separator between each element, defaults to the empty string\n public void Write(IEnumerable e, string separator = \"\") => this.outStream.Write(new StringBuilder().AppendJoin(e, separator).ToCharArray());\n\n /// \n /// Writes a sequence to the console output with the given string separator\n /// \n /// Type of elements in the sequence\n /// Sequence to print\n /// Character separator between each element\n public void Write(IEnumerable e, char separator) => this.outStream.Write(new StringBuilder().AppendJoin(e, separator).ToCharArray());\n\n /// \n /// Writes a linefeed to the console output\n /// \n public void WriteLine() => this.outStream.WriteLine();\n\n /// \n /// Writes the given char to the console output, followed by a linefeed\n /// \n /// Character to write\n public void WriteLine(char c) => this.outStream.WriteLine(c);\n\n /// \n /// Writes the given char buffer to the console output, followed by a linefeed\n /// \n /// Char buffer to write to the output\n public void WriteLine(char[] buffer) => this.outStream.WriteLine(buffer);\n\n /// \n /// Writes the given string to the console output, followed by a linefeed\n /// \n /// String to write\n public void WriteLine(string s) => this.outStream.WriteLine(s);\n\n /// \n /// Writes the given integer to the console output, followed by a linefeed\n /// \n /// Integer to write\n public void WriteLine(int n)\n {\n int head = GetIntBuffer(n);\n this.outStream.WriteLine(numBuffer, head, 20 - head);\n }\n\n /// \n /// Writes the given long to the console output, followed by a linefeed\n /// \n /// Long to write\n public void WriteLine(long n)\n {\n int head = GetLongBuffer(n);\n this.outStream.WriteLine(numBuffer, head, 20 - head);\n }\n\n /// \n /// Writes the contents of the StringBuilder to the console output, followed by a linefeed\n /// \n /// StringBuilder to write to the output\n public void WriteLine(StringBuilder sb) => this.outStream.WriteLine(sb.ToCharArray());\n\n /// \n /// Writes a sequence to the console output with the given string separator, follows by a linefeed\n /// \n /// Type of elements in the sequence\n /// Sequence to print\n /// String separator between each element, defaults to the empty string\n public void WriteLine(IEnumerable e, string separator = \"\") => this.outStream.WriteLine(new StringBuilder().AppendJoin(e, separator).ToCharArray());\n\n /// \n /// Writes a sequence to the console output with the given string separator, follows by a linefeed\n /// \n /// Type of elements in the sequence\n /// Sequence to print\n /// Character separator between each element\n public void WriteLine(IEnumerable e, char separator) => this.outStream.WriteLine(new StringBuilder().AppendJoin(e, separator).ToCharArray());\n\n /// \n /// Writes the given object to the console output using the object's ToString method, followed by a linefeed\n /// \n /// Object to write\n public void WriteLine(object o) => this.outStream.WriteLine(o);\n\n /// \n /// Flushes the output buffer to the console if the buffer is full, or if it's being forced\n /// \n public void Flush() => this.outStream.Flush();\n\n /// \n /// Disposes of the resources of this ConsoleHelper, closing all the associated streams\n /// \n public void Dispose()\n {\n if (this.Open)\n {\n Flush();\n this.inStream.Dispose();\n this.outStream.Dispose();\n this.Open = false;\n }\n }\n #endregion\n }\n\n /// \n /// Useful extensions\n /// \n internal static class Extensions\n {\n #region Enumerable extensions\n /// \n /// Applies an action on each member of the enumerable\n /// \n /// Type of elements in the Enumerable\n /// Enumerable to loop through\n /// Action to apply to each parameter\n public static void ForEach(this IEnumerable e, Action action)\n {\n foreach (T t in e)\n {\n action(t);\n }\n }\n\n /// \n /// Joins all the elements of the enumerable into a string\n /// \n /// Type of elements in the Enumerable\n /// Enumerable to loop through\n /// Separator string, defaults to the empty string\n public static string Join(this IEnumerable e, string separator = \"\") => new StringBuilder().AppendJoin(e, separator).ToString();\n\n /// \n /// Joins all the elements of the enumerable into a string\n /// \n /// Type of elements in the Enumerable\n /// Enumerable to loop through\n /// Separator character\n public static string Join(this IEnumerable e, char separator) => new StringBuilder().AppendJoin(e, separator).ToString();\n\n /// \n /// Finds the object with the maximum value in the enumerable\n /// \n /// Type of objects in the Enumerable\n /// Comparing type, must implement IComparable(T)\n /// Enumerable to loop through\n /// Function calculating the value that we want the max from\n /// The object with the maximum value in the enumerable\n public static T MaxValue(this IEnumerable e, Func selector) where TU : IComparable\n {\n using (IEnumerator enumerator = e.GetEnumerator())\n {\n if (!enumerator.MoveNext()) { throw new InvalidOperationException(\"No elements in sequence\"); }\n\n T max = enumerator.Current;\n TU value = selector(max);\n while (enumerator.MoveNext())\n {\n TU v = selector(enumerator.Current);\n if (value.CompareTo(v) < 0)\n {\n max = enumerator.Current;\n value = v;\n }\n }\n\n return max;\n }\n }\n\n /// \n /// Finds the object with the minimum value in the enumerable\n /// \n /// Type of objects in the Enumerable\n /// Comparing type, must implement IComparable(T)\n /// Enumerable to loop through\n /// Function calculating the value that we want the min from\n /// The object with the minimum value in the enumerable\n public static T MinValue(this IEnumerable e, Func selector) where TU : IComparable\n {\n using (IEnumerator enumerator = e.GetEnumerator())\n {\n if (!enumerator.MoveNext()) { throw new InvalidOperationException(\"No elements in sequence\"); }\n\n T min = enumerator.Current;\n TU value = selector(min);\n while (enumerator.MoveNext())\n {\n TU v = selector(enumerator.Current);\n if (value.CompareTo(v) > 0)\n {\n min = enumerator.Current;\n value = v;\n }\n }\n\n return min;\n }\n }\n #endregion\n\n #region String extensions\n /// \n /// Appends multiple objects to a StringBuilder, separated by the given string\n /// \n /// Type of elements in the Enumerable\n /// StringBuilder to append to\n /// Enumerable to loop through\n /// Separator string, defaults to the empty string\n /// The StringBuilder instance after the appending is done\n public static StringBuilder AppendJoin(this StringBuilder sb, IEnumerable source, string separator = \"\")\n {\n using (IEnumerator e = source.GetEnumerator())\n {\n if (e.MoveNext())\n {\n sb.Append(e.Current);\n while (e.MoveNext())\n {\n sb.Append(separator).Append(e.Current);\n }\n }\n }\n\n return sb;\n }\n\n /// \n /// Appends multiple objects to a StringBuilder, separated by the given string\n /// \n /// Type of elements in the Enumerable\n /// StringBuilder to append to\n /// Enumerable to loop through\n /// Separator character\n /// The StringBuilder instance after the appending is done\n public static StringBuilder AppendJoin(this StringBuilder sb, IEnumerable source, char separator)\n {\n using (IEnumerator e = source.GetEnumerator())\n {\n if (e.MoveNext())\n {\n sb.Append(e.Current);\n while (e.MoveNext())\n {\n sb.Append(separator).Append(e.Current);\n }\n }\n }\n\n return sb;\n }\n\n /// \n /// Returns true if the string is null, or the empty string \"\"\n /// Note: this will never throw a NullRef exception given that it is an extension method calling a static method\n /// \n /// String to test\n /// True if the string is null or empty, false otherwise\n public static bool IsEmpty(this string s) => string.IsNullOrEmpty(s);\n\n /// \n /// Creates a substring from a starting and ending index\n /// \n /// String to substring\n /// Starting index\n /// Ending index\n /// The resulting substring\n public static string SubStr(this string s, int start, int end) => s.Substring(start, (end - start) + 1);\n\n /// \n /// Copies the contents of a StringBuilder instance to an array\n /// \n /// StringBuilder to copy\n /// Contents array of the StringBuilder\n public static char[] ToCharArray(this StringBuilder sb)\n {\n char[] buffer = new char[sb.Length];\n sb.CopyTo(0, buffer, 0, sb.Length);\n return buffer;\n }\n #endregion\n\n #region Number extensions\n /// \n /// Tests if the given number is even or not\n /// \n /// Number to test\n /// True if the number is pair, false otherwise\n public static bool IsEven(this int n) => (n & 1) == 0;\n\n /// \n /// Tests if the given number is Even or not\n /// \n /// Number to test\n /// True if the number is pair, false otherwise\n public static bool IsEven(this long n) => (n & 1L) == 0;\n\n /// \n /// Real Modulus function over the integer, not a remainder function like the normal C# mod\n /// \n /// Left operand of the mod\n /// Right operand of the mod\n /// The Modulus of n and m, within [0, m - 1]\n public static int Mod(this int n, int m) => ((n % m) + m) % m;\n\n /// \n /// Real Modulus function over the integer, not a remainder function like the normal C# mod\n /// \n /// Left operand of the mod\n /// Right operand of the mod\n /// The Modulus of n and m, within [0, m - 1]\n public static long Mod(this long n, long m) => ((n % m) + m) % m;\n\n /// \n /// Counts the amount of set bits (1s in the binary representation) of a given integer\n /// \n /// Integer to get the set bits from\n /// Amount of set bits of the integer\n public static int SetBits(this int n)\n {\n n = n - ((n >> 1) & 0x55555555);\n n = (n & 0x33333333) + ((n >> 2) & 0x33333333);\n return (((n + (n >> 4)) & 0x0F0F0F0F) * 0x01010101) >> 24;\n }\n\n /// \n /// Counts the amount of set bits (1s in the binary representation) of a given long\n /// \n /// Long to get the set bits from\n /// Amount of set bits of the long\n public static long SetBits(this long n)\n {\n n = n - ((n >> 1) & 0x5555555555555555);\n n = (n & 0x3333333333333333) + ((n >> 2) & 0x3333333333333333);\n return (((n + (n >> 4)) & 0xF0F0F0F0F0F0F0F) * 0x101010101010101) >> 56;\n }\n #endregion\n\n #region Array extensions\n /// \n /// Does a binary search through the sorted array to find the requested value\n /// \n /// Type of elements in the array\n /// Array to search into\n /// Value to find\n /// The index of the found element, or -1 if it wasn't found\n public static int BinarySearch(this T[] array, T value) => Array.BinarySearch(array, value);\n\n /// \n /// Clears the array of all elements\n /// \n /// Type of elements in the array\n /// Array to clear\n public static void Clear(this T[] array) => Array.Clear(array, 0, array.Length);\n\n /// \n /// Determines if the array contains the given value\n /// \n /// Type of elements in the array\n /// Array to search into\n /// Value to find\n /// True if the value was found, false otherwise\n public static bool Contains(this T[] array, T value) => Array.IndexOf(array, value) != -1;\n\n /// \n /// Enumerates the contents of an ArraySegment\n /// \n /// Type contained within the array\n /// Array to iterate through\n /// Index offset to start the iteration at, defaults to 0\n /// Amount of values to return, default to the whole array\n /// Enumerable of all the values contained in the ArraySegment\n public static IEnumerable Enumerate(this T[] array, int offset = 0, int count = 0)\n {\n if (count == 0) { count = array.Length - offset; }\n\n int max = offset + count;\n for (int i = offset; i < max; i++)\n {\n yield return array[i];\n }\n }\n\n /// \n /// Sees if an elements matching the specified condition exists in the array\n /// \n /// Type of elements in the array\n /// Array to search into\n /// Matching function to apply\n /// True if a matching element exists, false otherwise\n public static bool Exists(this T[] array, Predicate match) => Array.Exists(array, match);\n\n /// \n /// Finds the first element matching the given condition in the array\n /// \n /// Type of elements in the array\n /// Array to search into\n /// Matching function to apply\n /// The first found element that satisfied the match, or default(T) if none did\n public static T Find(this T[] array, Predicate match) => Array.Find(array, match);\n\n /// \n /// Finds the last element matching the given condition in the array\n /// \n /// Type of elements in the array\n /// Array to search into\n /// Matching function to apply\n /// The last found element that satisfied the match, or default(T) if none did\n public static T FindLast(this T[] array, Predicate match) => Array.FindLast(array, match);\n\n /// \n /// Applies an action to every member of the array\n /// \n /// Type of elements in the array\n /// Array to loop through\n /// Action to apply on each member\n public static void ForEach(this T[] array, Action action) => Array.ForEach(array, action);\n\n /// \n /// Generates all the subsets of the given array of a size greater than or equal 1\n /// \n /// Type of elements in the array\n /// Array to get the subsets from\n /// All the subsets of size 1 or greater from the array\n public static IEnumerable> GetSubsets(this T[] array)\n {\n int max = 1 << array.Length, l = array.Length - 1;\n for (int i = 1; i < max; i++)\n {\n if ((i & -i) == i) { continue; } //Exclude subsets of length 1\n\n List subset = new List(array.Length);\n subset.AddRange(array.Where((t, j) => (i & (1 << (l - j))) != 0));\n yield return subset;\n }\n }\n\n /// \n /// Finds the first index of the given value in the array\n /// \n /// Type of elements in the array\n /// Array to search into\n /// Value to find\n /// The index of the value in the array, or -1 if it wasn't found\n public static int IndexOf(this T[] array, T value) => Array.IndexOf(array, value);\n\n /// \n /// Finds the last index of the given value in the array\n /// \n /// Type of elements in the array\n /// Array to search into\n /// Value to find\n /// The last index of the value in the array, or -1 if it wasn't found\n public static int LastIndexOf(this T[] array, T value) => Array.LastIndexOf(array, value);\n\n /// \n /// Reverses the array\n /// \n /// Type of elements in the array\n /// Array to reverse\n /// The reversed array\n public static T[] Reverse(this T[] array)\n {\n Array.Reverse(array);\n return array;\n }\n\n /// \n /// Sorts the array with the default comparer of T\n /// \n /// Type of elements in the array\n /// Array to sort\n public static void Sort(this T[] array) => Array.Sort(array);\n\n /// \n /// Sorts an array with the given comparison method\n /// \n /// Type of elements in the array\n /// Array to sort\n /// Comparison method to sort the array with\n public static void Sort(this T[] array, Comparison comparison) => Array.Sort(array, comparison);\n\n /// \n /// Swap two elements in an array\n /// \n /// Type of the array\n /// Aray to swap elements in\n /// Index of the first element\n /// Index of the second element\n public static void Swap(this T[] array, int i, int j)\n {\n T t = array[i];\n array[i] = array[j];\n array[j] = t;\n }\n\n public static void heapadd(this List l, int i)\n {\n l.Add(i);\n for (int j = l.Count - 1; j >= 0;)\n {\n int t = (j - 1) / 2;\n if (l[j] > l[t])\n {\n int temp = l[t];\n l[t] = l[j];\n l[j] = temp;\n }\n else\n break;\n j = t;\n }\n }\n public static int heapdelete(this List l)\n {\n int le = l.Count;\n int t = l[0];\n l[0] = l[le - 1];\n l.RemoveAt(le - 1);\n for (int i = 0; i < le - 1;)\n {\n int y = 2 * i + 1;\n if (y + 1 >= le - 1)\n {\n if (y >= le - 1)\n break;\n if (l[i] < l[y])\n {\n int temp = l[y];\n l[y] = l[i];\n l[i] = temp;\n\n }\n break;\n }\n if (l[y] < l[y + 1])\n {\n if (l[i] < l[y + 1])\n {\n int temp = l[y + 1];\n l[y + 1] = l[i];\n l[i] = temp;\n i = y + 1;\n }\n else\n break;\n }\n else\n {\n if (l[i] < l[y])\n {\n int temp = l[y];\n l[y] = l[i];\n l[i] = temp;\n i = y;\n }\n else\n break;\n }\n }\n\n\n return t;\n }\n\n #endregion\n }\n #endregion\n}\n", "lang": "Mono C#", "bug_code_uid": "dc1df92bbc2c94473b4789ab61a07e0a", "src_uid": "1110d3671e9f77fd8d66dca6e74d2048", "apr_id": "b0a2df3ebdf16417cd9bdb5844c6bccd", "difficulty": 1200, "tags": ["brute force", "two pointers"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.9755011135857461, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "/*\n * Created by SharpDevelop.\n * User: tagirov2\n * Date: 20.04.2016\n * Time: 12:56\n * \n * To change this template use Tools | Options | Coding | Edit Standard Headers.\n */\nusing System;\nusing System.Globalization;\n\nnamespace CF325A\n{\n\tclass Program\n\t{\n\t\tpublic static void Main(string[] args)\n\t\t{\n//\t\t\tConsole.WriteLine(\"Hello World!\");\n\t\t\t\n\t\t\t// TODO: Implement Functionality Here\n\n\t\t\tstring [] s = Console.ReadLine().Trim().Split(' ');\n\n\t\t\tbool ok = true;\n\t\t\tfor ( int j=0; j < s [0].Length; j++ )\n\t\t\t\tif (s [1][j] != s [0][j] )\n\t\t\t\t{\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\tif ( ok )\n\t\t\t\tConsole.WriteLine (s [0]);\n\t\t\telse\n\t\t\t\tConsole.WriteLine (\"1\");\n\n//\t\t\tConsole.Write(\"Press any key to continue . . . \");\n//\t\t\tConsole.ReadKey(true);\n\t\t}\n\t}\n}\n//\n//Thread.CurrentThread.CurrentCulture = CultureInfo.InvariantCulture;\n//Console.ReadLine().Split(new char[] {' ', '\\t'}, StringSplitOptions.RemoveEmptyEntries);\n//NumberFormatInfo nfi = NumberFormatInfo.InvariantInfo;\n//string [] input = Console.In.ReadToEnd().Split(new char[] {' ', '\\t', '\\n', '\\r'}, StringSplitOptions.RemoveEmptyEntries);\n", "lang": "Mono C#", "bug_code_uid": "3c7bc6f95aefd63fcc0d755963dc9404", "src_uid": "9c5b6d8a20414d160069010b2965b896", "apr_id": "45fc7353866f4d1c8f835a45a2d823dc", "difficulty": 800, "tags": ["math", "number theory"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.780327868852459, "equal_cnt": 13, "replace_cnt": 5, "delete_cnt": 2, "insert_cnt": 5, "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 ConsoleApplication14\n{\n class Program\n {\n static void Main(string[] args)\n {\n string[] token = Console.ReadLine().Split();\n int n = int.Parse(token[0]);\n int k = int.Parse(token[1]);\n int inc = n;\n \n int kth = k;\n \n while(true){\n \n int npos = (int)Math.Pow(2,inc-1);\n // Console.WriteLine(npos +\" \"+kth);\n if(k%2!=0)\n {\n Console.WriteLine(1);\n }\n else if(npos==kth){\n Console.WriteLine(inc);\n break;\n }\n else{\n kth = Math.Abs(kth - npos);\n inc--;\n } \n \n }\n \n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "272e09388103cafaaed3416736106504", "src_uid": "0af400ea8e25b1a36adec4cc08912b71", "apr_id": "3fee3988f4cf8cd6cbfe695792494641", "difficulty": 1200, "tags": ["implementation", "constructive algorithms", "bitmasks", "binary search"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.7023923444976077, "equal_cnt": 9, "replace_cnt": 5, "delete_cnt": 3, "insert_cnt": 1, "fix_ops_cnt": 9, "bug_source_code": "using System;\nusing System.Collections.Generic;\n\nnamespace ConsoleApp1\n{\n class Program\n {\n static void Main(string[] args)\n {\n int n = Convert.ToInt32(Console.ReadLine());\n string code = Console.ReadLine();\n List result = new List();\n for (int i = 0; i < n; i = i * (i + 1) / 2)\n {\n result.Add(code[i]);\n }\n Console.WriteLine(new string(result.ToArray()));\n }\n\n }\n}", "lang": "Mono C#", "bug_code_uid": "db8970d54b76c5964e10378fc89e8b34", "src_uid": "08e8c0c37b223f6aae01d5609facdeaf", "apr_id": "08f5abe4a38cbb6c2025c2f7b80d3c57", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.10261374636979671, "equal_cnt": 10, "replace_cnt": 5, "delete_cnt": 4, "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 year\n{\n class Program\n {\n static void Main(string[] args)\n {\n\nint[] year=new int[4];\nfor(int i=0;i r)\n return;\n if (l == tl && tr == r)\n {\n t[p,v] += add;\n if (t[p,v] >= MOD)\n t[p,v] -= MOD;\n }\n else\n {\n int tm = (tl + tr) / 2;\n Update(p, v * 2, tl, tm, l, Math.Min(r, tm), add);\n Update(p, v * 2 + 1, tm + 1, tr, Math.Max(l, tm + 1), r, add);\n }\n }\n\n public long Get(int p, int v, int tl, int tr, int pos)\n {\n if (tl == tr)\n return t[p, v];\n int tm = (tl + tr) / 2;\n if (pos <= tm)\n return t[p, v] + Get(p, v * 2, tl, tm, pos);\n else\n return t[p, v] + Get(p, v * 2 + 1, tm + 1, tr, pos);\n }\n\n public object Solve()\n {\n int n = ReadInt();\n int a = ReadInt() - 1;\n int b = ReadInt() - 1;\n \n Update(0, 1, 0, n - 1, a, a, 1);\n int p = 0;\n\n for (int k = ReadInt(); k > 0; k--, p = 1 - p)\n {\n for (int i = 0; i < n << 2; i++)\n t[1 - p, i] = 0;\n for (int i = 0; i < n; i++)\n {\n long x = Get(p, 1, 0, n - 1, i) % MOD;\n if (i < b)\n {\n int d = b - i - 1;\n if (d > 0)\n {\n Update(1 - p, 1, 0, n - 1, Math.Max(0, i - d), i - 1, x);\n Update(1 - p, 1, 0, n - 1, i + 1, i + d, x);\n }\n }\n else\n {\n int d = i - b - 1;\n if (d > 0)\n {\n Update(1 - p, 1, 0, n - 1, i - d, i - 1, x);\n Update(1 - p, 1, 0, n - 1, i + 1, Math.Min(n - 1, i + d), x);\n }\n }\n }\n }\n\n long ans = 0;\n for (int i = 0; i < n; i++)\n ans = (ans + Get(p, 1, 0, n - 1, i)) % MOD;\n return ans;\n\n return null;\n }\n\n #region Main\n\n protected static TextReader reader;\n protected static TextWriter writer;\n\n static void Main()\n {\n#if DEBUG\n reader = new StreamReader(\"..\\\\..\\\\input.txt\");\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(\"army.in\");\n// writer = new StreamWriter(\"army.out\");\n#endif\n try\n {\n object result = new Solver().Solve();\n if (result != null)\n writer.WriteLine(result);\n }\n catch (Exception ex)\n {\n#if DEBUG\n Console.WriteLine(ex);\n#else\n Console.WriteLine(ex);\n throw;\n#endif\n }\n reader.Close();\n writer.Close();\n }\n\n #endregion\n\n #region Read / Write\n\n private static Queue currentLineTokens = new Queue();\n\n private static string[] ReadAndSplitLine()\n {\n return reader.ReadLine().Split(new[] { ' ', '\\t' }, StringSplitOptions.RemoveEmptyEntries);\n }\n\n public static string ReadToken()\n {\n while (currentLineTokens.Count == 0)\n currentLineTokens = new Queue(ReadAndSplitLine());\n return currentLineTokens.Dequeue();\n }\n\n public static int ReadInt()\n {\n return int.Parse(ReadToken());\n }\n\n public static long ReadLong()\n {\n return long.Parse(ReadToken());\n }\n\n public static double ReadDouble()\n {\n return double.Parse(ReadToken(), CultureInfo.InvariantCulture);\n }\n\n public static int[] ReadIntArray()\n {\n return ReadAndSplitLine().Select(int.Parse).ToArray();\n }\n\n public static long[] ReadLongArray()\n {\n return ReadAndSplitLine().Select(long.Parse).ToArray();\n }\n\n public static double[] ReadDoubleArray()\n {\n return ReadAndSplitLine().Select(s => double.Parse(s, CultureInfo.InvariantCulture)).ToArray();\n }\n\n public static int[][] ReadIntMatrix(int numberOfRows)\n {\n int[][] matrix = new int[numberOfRows][];\n for (int i = 0; i < numberOfRows; i++)\n matrix[i] = ReadIntArray();\n return matrix;\n }\n\n public static int[][] ReadAndTransposeIntMatrix(int numberOfRows)\n {\n int[][] matrix = ReadIntMatrix(numberOfRows);\n int[][] ret = new int[matrix[0].Length][];\n for (int i = 0; i < ret.Length; i++)\n {\n ret[i] = new int[numberOfRows];\n for (int j = 0; j < numberOfRows; j++)\n ret[i][j] = matrix[j][i];\n }\n return ret;\n }\n\n public static string[] ReadLines(int quantity)\n {\n string[] lines = new string[quantity];\n for (int i = 0; i < quantity; i++)\n lines[i] = reader.ReadLine().Trim();\n return lines;\n }\n\n public static void WriteArray(IEnumerable array)\n {\n writer.WriteLine(string.Join(\" \", array));\n }\n\n public static void Write(params T[] array)\n {\n WriteArray(array);\n }\n\n public static void WriteLines(IEnumerable array)\n {\n foreach (var a in array)\n writer.WriteLine(a);\n }\n\n #endregion\n}", "lang": "MS C#", "bug_code_uid": "036651ae8487e6998bbdb5a3cc44137a", "src_uid": "142b06ed43b3473513995de995e19fc3", "apr_id": "67a6ff335729ba84be496dc6920878e5", "difficulty": 1900, "tags": ["dp", "combinatorics", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.8879120879120879, "equal_cnt": 5, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 4, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace denemexxxx\n{\n class Program\n {\n static void Main(string[] args)\n {\n try {\n string[] rule = new string[3];\n char[] x = new char[3];\n for (int i = 0; i < 3; i++)\n {\n x = Console.ReadLine().ToCharArray();\n if (x[1] == '<')\n {\n x[1] = '>';\n Array.Reverse(x);\n string s = new string(x); \n rule[i] = s;\n \n }\n else\n {\n string s = new string(x);\n rule[i] = s;\n }\n }\n int[] sayi = new int[3];\n for (int i = 0; i < 3; i++)\n {\n string s = \"\";\n s = rule[i];\n if (s[0] == 'A')\n sayi[0]++;\n else if (s[0] == 'B')\n sayi[1]++;\n else\n sayi[2]++;\n \n }\n string a = \"ABC\";\n if (sayi[0] == 2 || sayi[1] == 2 || sayi[2] == 2)\n Console.Write(a[sayi[0]] + \"\" + a[sayi[1]] + \"\" + a[sayi[2]]);\n else\n Console.Write(\"Impossible\");\n Console.ReadKey();\n }\n catch { }\n \n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "5608aa95a1869d757d9ab021cd294ab4", "src_uid": "97fd9123d0fb511da165b900afbde5dc", "apr_id": "57e1bcc18b09be58dec5cd2fd18ed339", "difficulty": 1200, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.9923076923076923, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "using System;\n\nclass P {\n static void Main() {\n var n = long.Parse(Console.ReadLine());\n var max = (long)Math.Sqrt(n) + 1;\n var i = 1L; var j = n;\n while (i <= max && j > 0) {\n var d = i*i + i + j*j + j - 2*n;\n if (d == 0) { Console.WriteLine(\"YES\"); return; }\n if (d < 0) {\n i++;\n } else {\n j--;\n }\n }\n Console.Write(\"NO\");\n }\n}", "lang": "MS C#", "bug_code_uid": "b7396a28b9fac88e5b318754861e3c03", "src_uid": "245ec0831cd817714a4e5c531bffd099", "apr_id": "14bad847f39fa801050f753064311d4c", "difficulty": 1300, "tags": ["brute force", "implementation", "binary search"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.2565641410352588, "equal_cnt": 8, "replace_cnt": 3, "delete_cnt": 5, "insert_cnt": 0, "fix_ops_cnt": 8, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text.RegularExpressions;\n\nnamespace Rextester\n{\n public class Program\n {\n public static void Main(string[] args)\n {\n int num = 0;\n string res = \"NO\";\n num = Convert.ToInt32(Console.ReadLine());\n \n for (int i = 1; i < num - 1; i++) {\n for (int j = 1; j < num - 1; j++) {\n if (num == ((i * (i + 1)) / 2) + ((j * (j + 1)) / 2))\n res = \"YES\";\n }\n }\n \n Console.WriteLine(res);\n }\n }\n}", "lang": "Mono C#", "bug_code_uid": "fbb20d73818b21b64801dcd92dbfbc14", "src_uid": "245ec0831cd817714a4e5c531bffd099", "apr_id": "9c0d2df997f5b5514117a2ba9a4eddbd", "difficulty": 1300, "tags": ["brute force", "implementation", "binary search"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "delete", "lang_cluster": "C#"} {"similarity_score": 0.5826388888888889, "equal_cnt": 20, "replace_cnt": 11, "delete_cnt": 4, "insert_cnt": 4, "fix_ops_cnt": 19, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\nusing System.Collections;\n\nnamespace bad_numbers\n{\n class Program\n {\n static void Main(string[] args)\n {\n\n ArrayList list = new ArrayList();\n\n for (int i = 1; i < 45000; i++)\n {\n float temp = (float)(i * (i + 1)) / 2;\n list.Add(temp);\n\n }\n int nom = int.Parse(Console.ReadLine());\n\n bool flag = false;\n\n foreach (float temp in list)\n {\n if (temp < nom)\n {\n foreach (float temp2 in list)\n {\n if (temp2 + temp == nom)\n {\n flag = true;\n break;\n }\n else if (temp2 + temp > nom)\n break;\n }\n }\n else break;\n }\n\n if (flag)\n Console.WriteLine(\"YES\");\n else\n Console.WriteLine(\"NO\");\n\n Console.ReadKey();\n }\n\n }\n\n}\n\n", "lang": "MS C#", "bug_code_uid": "868517650fa61a3e4b9f7dce8ae6e240", "src_uid": "245ec0831cd817714a4e5c531bffd099", "apr_id": "4f7d11c4a21100a4d2314822e6bb7e71", "difficulty": 1300, "tags": ["brute force", "implementation", "binary search"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.567111735769501, "equal_cnt": 18, "replace_cnt": 11, "delete_cnt": 2, "insert_cnt": 4, "fix_ops_cnt": 17, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\nusing System.Collections;\n\nnamespace bad_numbers\n{\n class Program\n {\n static void Main(string[] args)\n {\n\n ArrayList list = new ArrayList();\n\n for (int i = 1; i < 45000; i++)\n {\n float temp = (float)(i * (i + 1)) / 2;\n list.Add(temp);\n\n }\n int nom = int.Parse(Console.ReadLine());\n\n bool flag = false;\n\n foreach (float temp in list)\n {\n if (temp < nom)\n {\n foreach (float temp2 in list)\n {\n if (temp2 + temp == nom)\n {\n flag = true;\n break;\n }\n else if (temp2 + temp > nom)\n break;\n }\n }\n else break;\n }\n\n if (flag)\n Console.WriteLine(\"YES\");\n else\n Console.WriteLine(\"NO\");\n }\n }\n}\n\n", "lang": "MS C#", "bug_code_uid": "d71ca46fce737680fa75d6ddb4fafb58", "src_uid": "245ec0831cd817714a4e5c531bffd099", "apr_id": "4f7d11c4a21100a4d2314822e6bb7e71", "difficulty": 1300, "tags": ["brute force", "implementation", "binary search"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.999563128003495, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "#define DEBUG\n//#undef DEBUG\nusing System;\nusing System.Collections.Generic ;\nusing System.Linq;\nusing System.Text;\nusing System.IO;\n\nnamespace OlympSchool_B\n{\n class Program\n {\n static void Main(string[] args)\n {\n int n,z,k,kn,zn;\n string s;\n string[] st;\n string toS;\n\n#if DEBUG\n StreamReader sr = new StreamReader(\"b68.txt\");\n s = sr.ReadLine();\n#else\n s = Console.ReadLine();\n#endif\n st = s.Split(' ');\n n = int.Parse(st[0].Trim());\n z = int.Parse(st[1].Trim());\n k = int.Parse(st[2].Trim());\n#if DEBUG\n toS = sr.ReadLine().Trim();\n s = sr.ReadLine().Trim();\n#else\n toS = Console.ReadLine().Trim();\n s = Console.ReadLine().Trim();\n#endif\n kn = toS[3] == 'h' ? -1 : 1;\n int o = s.Length;\n string win=\"\";\n\n for (int i = 0; i < o; i++)\n {\n if (z == k)\n {\n win = \"Controller 1\";\n break;\n }\n if (i+1==o)\n {\n win = \"Stowaway\";\n break;\n }\n\n if (k == n && kn>0) kn = -1;\n if (k == 1 && kn<0) kn = 1;\n\n if (s[i] == '0') //go\n {\n if (z > k) zn = 1;\n else zn = -1;\n\n if (zn > 0 && z < n) z++;\n if (zn < 0 && z > 1) z--;\n\n k += kn;\n if(k==z)\n {\n win = \"Controller \"+(i+1).ToString();\n break;\n }\n }\n else // stop\n {\n k += kn;\n if (kn > 0)\n {\n if (k > 1) z = 1;\n else z = n;\n }\n if (kn < 0)\n {\n if (k < n) z = n;\n else z = 1;\n }\n }\n }\n\n\n Console.WriteLine(win);\n#if DEBUG\n Console.ReadKey();\n#endif\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "cf943fd4751701fb7a540fa7a69fb14f", "src_uid": "2222ce16926fdc697384add731819f75", "apr_id": "39f6ff7ad86fe88836454776b1677d25", "difficulty": 1500, "tags": ["dp", "games", "greedy"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C#"} {"similarity_score": 0.01222992254382389, "equal_cnt": 12, "replace_cnt": 11, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 12, "bug_source_code": "\nMicrosoft Visual Studio Solution File, Format Version 12.00\n# Visual Studio 14\nVisualStudioVersion = 14.0.25420.1\nMinimumVisualStudioVersion = 10.0.40219.1\nProject(\"{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}\") = \"JogandoDado\", \"JogandoDado\\JogandoDado.csproj\", \"{8BD600EA-D66D-4028-ACEF-590E39A3970F}\"\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{8BD600EA-D66D-4028-ACEF-590E39A3970F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{8BD600EA-D66D-4028-ACEF-590E39A3970F}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{8BD600EA-D66D-4028-ACEF-590E39A3970F}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{8BD600EA-D66D-4028-ACEF-590E39A3970F}.Release|Any CPU.Build.0 = Release|Any CPU\n\tEndGlobalSection\n\tGlobalSection(SolutionProperties) = preSolution\n\t\tHideSolutionNode = FALSE\n\tEndGlobalSection\nEndGlobal\n", "lang": "Mono C#", "bug_code_uid": "715673507ad6ef768e8de5e4070fe1f7", "src_uid": "504b8aae3a3abedf873a3b8b127c5dd8", "apr_id": "0bb83fe16431912599f1d276cd87134a", "difficulty": 800, "tags": ["brute force"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.8421052631578947, "equal_cnt": 18, "replace_cnt": 8, "delete_cnt": 5, "insert_cnt": 4, "fix_ops_cnt": 17, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace JogandoDados\n{\n class Program\n {\n static void Main(string[] args)\n {\n int jogadaA;\n int jogadaB;\n\n jogadaA = int.Parse(Console.ReadLine());\n jogadaB = int.Parse(Console.ReadLine());\n\n ForcaBruta(jogadaA, jogadaB);\n }\n\n static void ForcaBruta(int palpiteA, int palpiteB)\n {\n int a = 0;\n int b = 0;\n int empate = 0;\n int[] dado = new int[6];\n for (int i = 0; i < dado.Length; i++)\n {\n dado[i] = i + 1;\n\n\n if (Modulo((palpiteA - dado[i])) < Modulo((palpiteB - dado[i])))\n {\n a++;\n }\n else\n {\n if (Modulo((palpiteA - dado[i])) == Modulo((palpiteB - dado[i])))\n empate++;\n else\n b++;\n }\n }\n Console.WriteLine(\" \" + a + \" \" + empate + \" \" + b);\n }\n\n\n static int Modulo(int x) //retorna o valor positivo\n {\n if (x < 0)\n x = (x * -1);\n return (x);\n }\n }\n}", "lang": "Mono C#", "bug_code_uid": "35b3243815cef181ab0241e1ab5c1449", "src_uid": "504b8aae3a3abedf873a3b8b127c5dd8", "apr_id": "0bb83fe16431912599f1d276cd87134a", "difficulty": 800, "tags": ["brute force"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9979899497487437, "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.Text;\nusing System.Threading.Tasks;\nusing System.Collections;\n\nnamespace ConsoleApplication6\n{\n class Program\n {\n \n static void Main(string[] args)\n {\n int[] mas = Console.ReadLine().Split(' ').Select(int.Parse).ToArray();\n int n = mas[0], pos = mas[1], l = mas[2], r = mas[3];\n string res =\"\";\n if (l == 1 && r == n)\n res = \"0\";\n else if ((l==1 && r!=n ))\n {\n res = (Math.Abs(pos - l)+1).ToString();\n }\n else if ((l!=1 &&r==n))\n {\n res = (Math.Abs(pos - r) + 1).ToString();\n }\n else\n {\n int rt = Math.Abs(pos - r) < Math.Abs(pos - l) ? Math.Abs(pos - r) : Math.Abs(pos - l);\n res = ((r - l + rt) + 2).ToString();\n }\n Console.WriteLine(res);\n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "71773b5bc78182127c2f60eb91ca2d24", "src_uid": "5deaac7bd3afedee9b10e61997940f78", "apr_id": "196711f316e8bc0a18f69a66c7d5dfd9", "difficulty": 1300, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9513590844062947, "equal_cnt": 15, "replace_cnt": 1, "delete_cnt": 12, "insert_cnt": 1, "fix_ops_cnt": 14, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace CodeforcesTest\n{\n class Program\n {\n // static void Main(string[] args)\n // {\n // int input = Convert.ToInt32(Console.ReadLine());\n // int temp = input;\n // int numberOfDigits = (int)Math.Floor(Math.Log10(input) + 1);\n // while (temp >= 10)\n // {\n // temp /= 10;\n // }\n // int nextLuckyYear = (int)((temp + 1) * Math.Pow(10, numberOfDigits - 1));\n // int requiredYears = nextLuckyYear - input;\n // Console.WriteLine(requiredYears);\n // }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "571335a8bf5b2fcaf9e78cabd51fd75a", "src_uid": "a3e15c0632e240a0ef6fe43a5ab3cc3e", "apr_id": "75aab65f31f51669e26ab32f181ee144", "difficulty": 900, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C#"} {"similarity_score": 0.25874125874125875, "equal_cnt": 20, "replace_cnt": 11, "delete_cnt": 4, "insert_cnt": 5, "fix_ops_cnt": 20, "bug_source_code": "using System;\n\nnamespace _808A\n{\n class Program\n {\n static void Main(string[] args)\n {\n int currentYear = int.Parse(Console.ReadLine());\n int foundYear = currentYear;\n bool isFoundHappy = false;\n while(!isFoundHappy)\n {\n foundYear++;\n if(IsHappyYear(foundYear))\n {\n isFoundHappy = true;\n }\n }\n Console.WriteLine(foundYear - currentYear);\n Console.ReadLine();\n }\n\n private static bool IsHappyYear(int currentYear)\n {\n int countNotZero = 0;\n foreach (var digit in currentYear.ToString())\n {\n if (digit != '0')\n {\n countNotZero++;\n }\n }\n if (countNotZero > 1)\n {\n return false;\n }\n else\n {\n return true;\n }\n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "72d67a9278208e2b728d90278937981b", "src_uid": "a3e15c0632e240a0ef6fe43a5ab3cc3e", "apr_id": "aae2bea41810bb45ec9b2e1974f996be", "difficulty": 900, "tags": ["implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.8856601389766267, "equal_cnt": 1, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": " static void Main(string[] args)\n {\n int input = Convert.ToInt32(Console.ReadLine());\n int s = NextLuckyYear(input);\n Console.WriteLine(s.ToString());\n }\n\n static int NextLuckyYear(int year)\n {\n int luckyYear = 0;\n string sYear = year.ToString();\n if (sYear.Length == 1)\n {\n return 1;\n }\n string a = (Convert.ToInt32(sYear[0].ToString()) + 1).ToString();\n for (int i = 0; i < sYear.Length - 1; i++)\n {\n a += \"0\";\n }\n luckyYear = year - Convert.ToInt32(a);\n return luckyYear * -1;\n }", "lang": "MS C#", "bug_code_uid": "52ee98af3344f53dcef34b16b23da8e8", "src_uid": "a3e15c0632e240a0ef6fe43a5ab3cc3e", "apr_id": "246f594f139f0f8af9474f8609c5083f", "difficulty": 900, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.6159964648696421, "equal_cnt": 9, "replace_cnt": 5, "delete_cnt": 2, "insert_cnt": 1, "fix_ops_cnt": 8, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Globalization;\nusing System.Linq;\nusing System.Runtime.ExceptionServices;\nusing System.Text.RegularExpressions;\nusing System.Threading;\n\nnamespace CodeForces\n{\n class Program\n {\n public static string Rw() => Console.ReadLine();\n public static int GetInt() => Int32.Parse(Console.ReadLine());\n public static int[] GetArr() => Array.ConvertAll(Console.ReadLine().Split(' '), Int32.Parse);\n\n public static void Main(string[] args)\n {\n int k = GetInt();\n\n int n = k;\n n++;\n if (n < 10)\n {\n Console.WriteLine(n -k);\n return;\n }\n while (true)\n {\n int a = n;\n int count = 0; //число ненулевых цифр\n while (a > 0)\n {\n if (a%10 != 0)\n count++;\n a /= 10;\n if (count > 1)\n break;\n }\n if (count == 1)\n {\n Console.WriteLine(n - k);\n return;\n }\n n++;\n }\n\n // Console.ReadKey();\n }\n }\n\n}\n\n", "lang": "MS C#", "bug_code_uid": "7f145184f61eb1377bffb6493704552e", "src_uid": "a3e15c0632e240a0ef6fe43a5ab3cc3e", "apr_id": "1f83f4cc2fc438a1bd51b9e503dbe712", "difficulty": 900, "tags": ["implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.19441944194419442, "equal_cnt": 12, "replace_cnt": 10, "delete_cnt": 1, "insert_cnt": 1, "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 ConsoleApplication1\n{\n class Program\n {\n static int[] CountNegMatrix(int[,] tab)\n {\n int[] a = new int[tab.GetLength(0)];\n int k = 0;\n for (int i = 0; i < tab.GetLength(0); i++)\n {\n for (int j = tab.GetLength(1) - 1; j >= 0; j--)\n {\n if (tab[i, j] % 2 != 0)\n {\n a[k] = -1;\n }\n else\n {\n int t = 0;\n int r = j;\n int count = 0;\n while (t < tab.GetLength(0))\n {\n if (tab[r, t] < 0)\n {\n count++;\n }\n t++;\n }\n a[k] = count;\n \n }\n k++;\n }\n }\n return a;\n }\n static void Main(string[] args)\n {\n int[,] tab = { { -10, -2, -3 }, { 2, 3, 4 }, { 5, -6, 72 } };\n int[] a = CountNegMatrix(tab);\n foreach(int i in a)\n {\n Console.WriteLine(i);\n }\n Console.ReadKey();\n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "44cea26078e4ca976c616e50dfec9b7a", "src_uid": "ec5e3b3f5ee6a13eaf01b9a9a66ff037", "apr_id": "5f06a4023d01c0308b78173b444caa74", "difficulty": 1000, "tags": ["brute force", "math", "constructive algorithms", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9950544015825915, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 2, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "using System;\nclass Program\n{\n static void Main(string[] args)\n {\n int[] mas = new int[2];\n\n string[] tokens = Console.ReadLine().Split(' ');\n\n int i = 0;\n\n foreach (string x in tokens)\n {\n mas[i] = mas[int.Parse(x)];\n i++;\n }\n\n if (mas[0] == 0 && mas[1] == 0)\n Console.WriteLine(\"NO\");\n\n else if (Math.Abs(mas[0] - mas[1]) < 2)\n Console.WriteLine(\"YES\");\n\n else Console.WriteLine(\"NO\");\n }\n}", "lang": "MS C#", "bug_code_uid": "c33f6722aec49275b05fc345470f297e", "src_uid": "ec5e3b3f5ee6a13eaf01b9a9a66ff037", "apr_id": "2d56c1fc033e5e1f7ae624331148c94e", "difficulty": 1000, "tags": ["brute force", "math", "constructive algorithms", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C#"} {"similarity_score": 0.9978931239226202, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\n\nclass Myon\n{\n public Myon() { }\n public static int Main()\n {\n new Myon().calc();\n return 0;\n }\n\n void calc()\n {\n Scanner cin = new Scanner();\n long n = cin.nextLong();\n int MAX = 100000;\n int[,] dp = new int[MAX, 10];\n int[,] next = new int[MAX, 10];\n if (n == 0)\n {\n Console.WriteLine(0);\n return;\n }\n\n for (int j = 1; j < 10; j++)\n {\n dp[0, j] = 0;\n next[0, j] = 100000;\n for (int i = 0; i < MAX; i++)\n {\n int b = i;\n int dec = j;\n while (b != 0)\n {\n int num = b % 10;\n b /= 10;\n if (num == 0) continue;\n dec = Math.Max(dec, num);\n }\n if (i < dec)\n {\n dp[i, j] = 1;\n next[i, j] = 100000 + i - dec;\n }\n else\n {\n dp[i, j] = dp[i - dec, j] + 1;\n next[i, j] = next[i - dec, j];\n }\n }\n }\n \n int up = (int)(n / 100000);\n int down = (int)(n % 100000);\n long ret = 0;\n for (int t = up; t > 0; t--)\n {\n int dec = 0;\n int b = up;\n while (b != 0)\n {\n int num = b % 10;\n b /= 10;\n if (num == 0) continue;\n dec = Math.Max(dec, num);\n }\n ret += dp[down, dec];\n down = next[down, dec];\n }\n\n while (down > 0)\n {\n int b = down;\n int dec = 0;\n while (b != 0)\n {\n int num = b % 10;\n b /= 10;\n if (num == 0) continue;\n dec = Math.Max(dec, num);\n }\n down -= dec;\n ret++;\n }\n Console.WriteLine(ret);\n }\n}\n\n\nclass Scanner\n{\n string[] s;\n int i;\n\n char[] cs = new char[] { ' ' };\n\n public Scanner()\n {\n s = new string[0];\n i = 0;\n }\n\n public string next()\n {\n if (i < s.Length) return s[i++];\n s = Console.ReadLine().Split(cs, StringSplitOptions.RemoveEmptyEntries);\n i = 0;\n return s[i++];\n }\n\n public int nextInt()\n {\n return int.Parse(next());\n }\n\n public long nextLong()\n {\n return long.Parse(next());\n }\n}", "lang": "MS C#", "bug_code_uid": "5525ccaf60db98ccc666733066218b85", "src_uid": "fc5765b9bd18dc7555fa76e91530c036", "apr_id": "0b2f5c7099f8f87ffbf0b98fa39cc345", "difficulty": 2400, "tags": ["dp"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.92401717872481, "equal_cnt": 10, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 7, "fix_ops_cnt": 9, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\n\nnamespace code_21_a\n{\n class Program\n {\n static void Main(string[] args)\n {\n\n string s = Console.ReadLine();\n bool can=true;\n int k = s.IndexOf('@');\n if(k==-1 || k==0 || k==s.Length-1 || k>=17) can =false;\n if(can)\n {\n string first = s.Substring(0, k);\n for (int i = 0; i < first.Length; i++)\n {\n if (first[i] == '_' || (first[i] >= 'A' && first[i] <= 'Z') ||\n (first[i] >= 'a' && first[i] <= 'z') || (first[i] >= '0' && first[i] <= '9'))\n {\n\n }\n else\n {\n can = false;\n break;\n }\n\n }\n }\n if (!can) {Console.WriteLine(\"NO\"); return;}\n int kk = s.IndexOf('/');\n int to;\n if (kk == -1)\n to = s.Length;\n else\n to = kk;\n string second = s.Substring(k+1 , to-k-1);\n if (second.Length==0 || second.Length > 32 || kk==s.Length-1) can = false;\n if (can)\n {\n int kol = 0;\n for (int i = 0; i < second.Length; i++)\n {\n if (second[i] == '_' || (second[i] >= 'A' && second[i] <= 'Z') ||\n (second[i] >= 'a' && second[i] <= 'z') || (second[i] >= '0' && second[i] <= '9'))\n {\n kol++;\n }\n else\n if (second[i] == '.')\n if (kol > 0 && kol < 17) kol = 0;\n else\n {\n can = false;\n break;\n }\n }\n }\n if (!can) {Console.WriteLine(\"NO\"); return;}\n if (kk !=-1)\n {\n string third = s.Substring(to+1,s.Length-to-1);\n if (third.Length > 16) {can = false; break;}\n for (int i = 0; i < third.Length; i++)\n {\n if (third[i] == '_' || (third[i] >= 'A' && third[i] <= 'Z') ||\n (third[i] >= 'a' && third[i] <= 'z') || (third[i] >= '0' && third[i] <= '9'))\n {\n\n }\n else\n {\n can = false;\n break;\n }\n\n }\n }\n if (!can) {Console.WriteLine(\"NO\"); return;}\n\n Console.WriteLine(\"YES\");\n \n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "fc2042f9e44b5c6d559f4d1665290311", "src_uid": "2a68157e327f92415067f127feb31e24", "apr_id": "e30796840a04a8d91e248781e6256db0", "difficulty": 1900, "tags": ["strings", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.9852216748768473, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 3, "bug_source_code": "using System;\nclass Program {\n static void Main()\n{ \n var s1 = Console.ReadLine();\n var s2 = Console.ReadLine();\n var i = 0;\n foreach (var c in s2) if (c == s1[i]) i++;\n Console.WriteLine(i+1);\n}", "lang": "MS C#", "bug_code_uid": "e8b220615b9cd8ff5116810434968d17", "src_uid": "f5a907d6d35390b1fb11c8ce247d0252", "apr_id": "4564eb80bebf88f489f60e8992b038b5", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.9944097336402499, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "using System;\nusing System.IO;\n\nclass Algo\n{\n int[] f = new int[22];\n public void Run()\n {\n f[0] = 1;\n for (int i = 1; i < 22; i++) f[i] = f[i - 1] * i;\n string s1 = cin.ReadLine();\n string s2 = cin.ReadLine();\n int plus1 = 0, plus2 = 0, q = 0;\n for (int i = 0; i < s1.Length; i++) plus1 += (s1[i] == '+' ? 1 : 0);\n for (int i = 0; i < s2.Length; i++)\n {\n plus2 += (s2[i] == '+' ? 1 : 0);\n q += (s2[i] == '?' ? 1 : 0);\n }\n if (plus1 > plus2 + q)\n {\n cout.WriteLine(\"0.0\");\n return;\n }\n int n = C(q, plus1 - plus2);\n int m = 1 << q;\n double ans = 1.0 * n / m;\n string res = ans.ToString();\n for (int i = 0; i < res.Length; i++)\n {\n if (res[i] == ',') cout.Write(\".\");\n else cout.Write(res[i]);\n }\n cout.WriteLine();\n }\n\n int C(int n, int m)\n {\n int ans = f[n] / f[m] / f[n - m];\n return ans;\n }\n\n public StreamReader cin = null;\n public StreamWriter cout = null;\n}\n\nclass Program\n{\n static void Main()\n {\n Algo task = new Algo();\n#if DEBUG\n task.cin = new StreamReader(\"input.txt\");\n task.cout = new StreamWriter(\"output.txt\");\n#else\n task.cin = new StreamReader(Console.OpenStandardInput());\n task.cout = new StreamWriter(Console.OpenStandardOutput());\n#endif\n task.cout.AutoFlush = true;\n task.Run();\n }\n}", "lang": "MS C#", "bug_code_uid": "ec4caa86b3dfb668ea5b935df9918937", "src_uid": "f7f68a15cfd33f641132fac265bc5299", "apr_id": "2f194e043d830c88734cc6b61100252d", "difficulty": 1300, "tags": ["dp", "probabilities", "combinatorics", "bitmasks", "math", "brute force"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.9812635400199075, "equal_cnt": 18, "replace_cnt": 11, "delete_cnt": 1, "insert_cnt": 5, "fix_ops_cnt": 17, "bug_source_code": "#region Using Statements\nusing GenericArithmetic;\nusing System;\nusing System.Collections;\nusing System.Collections.Generic;\nusing System.Diagnostics;\nusing System.IO;\nusing System.Linq;\nusing System.Text;\nusing System.Threading;\nusing System.Threading.Tasks;\n\n#endregion\nnamespace csConsoleforStudy\n{\n using System.Collections.Generic;\n using System.Globalization;\n\n class Program\n {\n static readonly Encoding TargetEcoding = Encoding.Unicode;\n static void Main(string[] args)\n {\n OpenStream();\n Solver s = new Solver();\n s.Solve();\n CloseStream();\n }\n\n static void OpenStream()\n {\n }\n\n static void CloseStream()\n {\n }\n\n static void CheckMemory()\n {\n }\n }\n\n class Solver\n {\n public static readonly Encoding TargetEncoding = Encoding.Unicode;\n const int SIZE = 5005;\n private const double AbsoluteError = 1e-10;\n private const double RelativeError = 1e-8;\n static int mod = 1000000007;\n public void Solve()\n {\n string s1 = rs();\n string s2 = rs();\n int target = 0;\n int pos = 0;\n int que = 0;\n double result = 0f;\n for (int i = 0; i < s1.Length; i++)\n {\n if (s1[i] == '+')\n target++;\n else\n target--;\n }\n\n for (int i = 0; i < s2.Length; i++)\n {\n if (s2[i] == '+')\n pos++;\n else if (s2[i] == '-')\n pos--;\n else\n {\n que++;\n }\n }\n\n if (que % 2 == 0)\n {\n if ((target - pos) % 2 == 0)\n {\n int d = target - pos;\n d = Math.Abs(d);\n int plus = d;\n int minus = 0;\n for (int i = 0;; i++)\n {\n if (plus + minus == que)\n break;\n plus++;\n minus++;\n }\n\n result = (double)C(que, plus) / Math.Pow(2, que);\n }\n else\n result = 0f;\n }\n else\n {\n if ((target - pos) % 2 == 1)\n {\n int d = target - pos;\n d = Math.Abs(d);\n int plus = d;\n int minus = 0;\n for (int i = 0;; i++)\n {\n if (plus + minus == que)\n break;\n plus++;\n minus++;\n }\n\n result = (double)C(que, plus) / Math.Pow(2, que);\n }\n else\n result = 0f;\n }\n\n string ans = result.ToString(\"F10\", CultureInfo.InvariantCulture);\n Console.Write(ans);\n }\n\n#region SolverUtils\n private static List factorial = new List(new int[]{1});\n private static int NextInt()\n {\n int c;\n int res = 0;\n do\n {\n c = Console.Read();\n if (c == -1)\n return res;\n }\n while (c < '0' || c > '9');\n res = c - '0';\n while (true)\n {\n c = Console.Read();\n if (c < '0' || c > '9')\n return res;\n res *= 10;\n res += c - '0';\n }\n }\n\n static string rs()\n {\n return Console.ReadLine();\n }\n\n static int ri()\n {\n return int.Parse(Console.ReadLine());\n }\n\n static uint rui()\n {\n return uint.Parse(Console.ReadLine());\n }\n\n static long rl()\n {\n return long.Parse(Console.ReadLine());\n }\n\n static ulong rul()\n {\n return ulong.Parse(Console.ReadLine());\n }\n\n static double rd()\n {\n return double.Parse(Console.ReadLine());\n }\n\n static string[] rsa()\n {\n return Console.ReadLine().Split(' ');\n }\n\n static int[] ria()\n {\n return Array.ConvertAll(Console.ReadLine().Split(' '), e => int.Parse(e));\n }\n\n static uint[] ruia()\n {\n return Array.ConvertAll(Console.ReadLine().Split(' '), e => uint.Parse(e));\n }\n\n static long[] rla()\n {\n return Array.ConvertAll(Console.ReadLine().Split(' '), e => long.Parse(e));\n }\n\n static ulong[] rula()\n {\n return Array.ConvertAll(Console.ReadLine().Split(' '), e => ulong.Parse(e));\n }\n\n static double[] rda()\n {\n return Array.ConvertAll(Console.ReadLine().Split(' '), e => double.Parse(e));\n }\n\n static void ReadLineAndAssign(string type, params object[] p)\n {\n dynamic input;\n if (type.StartsWith(\"i\"))\n input = ria();\n else if (type.StartsWith(\"l\"))\n input = rla();\n else if (type.StartsWith(\"d\"))\n input = rda();\n else\n throw new ArgumentException(\"no match \" + type.ToString());\n for (int i = 0; i < p.Length; i++)\n {\n p[i] = input[i];\n }\n }\n\n static void SwapIfGreater(ref T lhs, ref T rhs)where T : IComparable\n {\n T temp;\n if (lhs.CompareTo(rhs) > 0)\n {\n temp = lhs;\n lhs = rhs;\n rhs = temp;\n }\n }\n\n static bool DoubleEqual(double a, double b)\n {\n double diff = Math.Abs(a - b);\n if (diff < AbsoluteError)\n return true;\n return diff <= RelativeError * Math.Max(Math.Abs(a), Math.Abs(b));\n }\n\n static dynamic abs(dynamic num)\n {\n return Math.Abs(num);\n }\n\n static dynamic max(dynamic a, dynamic b)\n {\n return Math.Max(a, b);\n }\n\n static void For(int start, int end, Action method)\n {\n for (int i = start; i < end; i++)\n {\n method.Invoke();\n }\n }\n\n static void For(int start, int end, Action method, int i)\n {\n for (i = start; i < end; i++)\n {\n method.DynamicInvoke(i);\n }\n }\n\n static int C(int n, int k)\n {\n return P(n, k) / Factorial(k);\n }\n\n static int P(int n, int r)\n {\n return Factorial(n) / Factorial(n - r);\n }\n\n static int Factorial(int n)\n {\n if (factorial.Count <= n)\n factorial.Add(Factorial(n - 1) * n);\n return factorial[n];\n }\n\n static int powmod(int a, int b)\n {\n if (b == 0)\n return 1;\n if (b == 1)\n return a;\n int i = powmod(a, b / 2);\n i *= i;\n i %= mod;\n if (b % 2 == 0)\n return i;\n else\n return ((i * a) % mod);\n }\n#endregion\n }\n#region SolverUtils\n#endregion\n#region Data Structure\n#endregion\n#region Algorithm\n#endregion\n#region Library Method/Fields\n#region Members for Internal Support\n#endregion Members for Internal Support\n#region Public Properties\n#endregion Public Properties\n#region Public Instance Methods\n#endregion Public Instance Methods\n#region Constructors\n#endregion Constructors\n#region Public Static Methods\n#endregion Public Static Methods\n#region Operator Overloads\n#endregion Operator Overloads\n#region explicit conversions from BigRational\n#endregion explicit conversions from BigRational\n#region implicit conversions to BigRational\n#endregion implicit conversions to BigRational\n#region serialization\n#endregion serialization\n#region instance helper methods\n#endregion instance helper methods\n#region static helper methods\n#endregion static helper methods\n#region Exceptions\n#endregion\n#endregion\n}\n\n#region Libraries\nnamespace GenericArithmetic\n{\n public class Vector\n {\n public static readonly ICalculator Calculator = Number.Calculator;\n public T X\n {\n get;\n set;\n }\n\n public T Y\n {\n get;\n set;\n }\n\n public Vector(T x, T y)\n {\n X = x;\n Y = y;\n }\n\n public override bool Equals(object obj)\n {\n return base.Equals(obj);\n }\n\n public override int GetHashCode()\n {\n return base.GetHashCode();\n }\n\n public static bool operator ==(Vector a, Vector b)\n {\n return EqualityComparer.Default.Equals(a.X, b.X) && EqualityComparer.Default.Equals(a.Y, b.Y);\n }\n\n public static bool operator !=(Vector a, Vector b)\n {\n return !(EqualityComparer.Default.Equals(a.X, b.X) && EqualityComparer.Default.Equals(a.Y, b.Y));\n }\n\n public static Vector operator !(Vector a)\n {\n return new Vector(Calculator.Difference(new Number(default (T)), a.X), Calculator.Difference(new Number(default (T)), a.Y));\n }\n\n public static Vector operator +(Vector a, Vector b)\n {\n return new Vector(Calculator.Sum(a.X, b.X), Calculator.Sum(a.Y, b.Y));\n }\n\n public static Vector operator -(Vector a, Vector b)\n {\n return new Vector(Calculator.Difference(a.X, b.X), Calculator.Difference(a.Y, b.Y));\n }\n }\n\n public class Matrix\n {\n public static readonly ICalculator Calculator = Number.Calculator;\n public int W\n {\n get;\n set;\n }\n\n public int H\n {\n get;\n set;\n }\n\n public int rows\n {\n get\n {\n return H;\n }\n\n set\n {\n H = value;\n }\n }\n\n public int cols\n {\n get\n {\n return W;\n }\n\n set\n {\n W = value;\n }\n }\n\n public T[, ] Map\n {\n get;\n set;\n }\n\n public T this[int x, int y]\n {\n get\n {\n return Map[x, y];\n }\n\n set\n {\n Map[x, y] = value;\n }\n }\n\n public Matrix(T[, ] map)\n {\n Map = map;\n W = map.GetLength(0);\n H = map.GetLength(1);\n }\n\n public Matrix(int w, int h, T defaultValue = default (T))\n {\n W = w;\n H = h;\n Map = new T[W, H];\n }\n\n public override bool Equals(object obj)\n {\n if (obj is Matrix)\n {\n return this == (Matrix)obj;\n }\n\n return base.Equals(obj);\n }\n\n public override int GetHashCode()\n {\n return base.GetHashCode();\n }\n\n public static bool operator ==(Matrix a, Matrix b)\n {\n bool ret = true;\n if (a.Map != b.Map)\n ret = false;\n else if (a.W != b.W)\n ret = false;\n else if (a.H != b.H)\n ret = false;\n return ret;\n }\n\n public static bool operator !=(Matrix a, Matrix b)\n {\n bool ret = true;\n if (a.Map != b.Map)\n ret = false;\n else if (a.W != b.W)\n ret = false;\n else if (a.H != b.H)\n ret = false;\n return !ret;\n }\n\n public static Matrix operator +(Matrix a, Matrix b)\n {\n if (a.W != b.W)\n return null;\n else if (a.H != b.H)\n return null;\n else\n {\n Matrix ret = new Matrix(a.W, a.H);\n for (int i = 0; i < a.W; i++)\n {\n for (int j = 0; j < a.H; j++)\n {\n ret[i, j] = Calculator.Sum(a[i, j], b[i, j]);\n }\n }\n\n return ret;\n }\n }\n\n public static Matrix operator -(Matrix a, Matrix b)\n {\n if (a.W != b.W)\n return null;\n else if (a.H != b.H)\n return null;\n else\n {\n Matrix ret = new Matrix(a.W, a.H);\n for (int i = 0; i < a.W; i++)\n {\n for (int j = 0; j < a.H; j++)\n {\n ret[i, j] = Calculator.Difference(a[i, j], b[i, j]);\n }\n }\n\n return ret;\n }\n }\n\n public static Matrix operator *(Matrix a, Matrix b)\n {\n if (a.cols != b.rows)\n throw new FormatException(\"Cannot multiply : a.W = \" + a.W.ToString() + \" with b.H = \" + b.H.ToString());\n else\n {\n Matrix R = new Matrix(a.rows, b.cols);\n for (int i = 0; i < R.rows; i++)\n for (int j = 0; j < R.cols; j++)\n for (int k = 0; k < a.cols; k++)\n {\n R[i, j] = Calculator.Sum(R[i, j], Calculator.Multiply(a[i, k], b[k, j]));\n }\n\n return R;\n }\n }\n }\n\n public static class Calculator\n {\n public static T Sum(T a, T b)\n {\n return Number.Sum(a, b);\n }\n }\n\n public interface ICalculator\n {\n T Sum(T a, T b);\n T Difference(T a, T b);\n int Compare(T a, T b);\n T Multiply(T a, T b);\n T Divide(T a, T b);\n T Divide(T a, int b);\n }\n\n struct Int32Calculator : ICalculator\n {\n public Int32 Sum(Int32 a, Int32 b)\n {\n return a + b;\n }\n\n public Int32 Difference(Int32 a, Int32 b)\n {\n return a - b;\n }\n\n public int Compare(Int32 a, Int32 b)\n {\n return Difference(a, b);\n }\n\n public int Multiply(Int32 a, Int32 b)\n {\n return a * b;\n }\n\n public int Divide(Int32 a, Int32 b)\n {\n return a / b;\n }\n }\n\n struct Int64Calculator : ICalculator\n {\n public Int64 Sum(Int64 a, Int64 b)\n {\n return a + b;\n }\n\n public Int64 Difference(Int64 a, Int64 b)\n {\n return a - b;\n }\n\n public int Compare(Int64 a, Int64 b)\n {\n if (a > b)\n {\n return 1;\n }\n else if (a < b)\n {\n return -1;\n }\n else\n {\n return 0;\n }\n }\n\n public Int64 Multiply(Int64 a, Int64 b)\n {\n return a * b;\n }\n\n public Int64 Divide(Int64 a, Int64 b)\n {\n return a / b;\n }\n\n public Int64 Divide(Int64 a, int b)\n {\n return a / b;\n }\n }\n\n struct SingleCalculator : ICalculator\n {\n public Single Sum(Single a, Single b)\n {\n return a + b;\n }\n\n public Single Difference(Single a, Single b)\n {\n return a - b;\n }\n\n public int Compare(Single a, Single b)\n {\n if (a > b)\n {\n return 1;\n }\n else if (a < b)\n {\n return -1;\n }\n else\n {\n return 0;\n }\n }\n\n public Single Multiply(Single a, Single b)\n {\n return a * b;\n }\n\n public Single Divide(Single a, Single b)\n {\n return a / b;\n }\n\n public Single Divide(Single a, int b)\n {\n return a / b;\n }\n }\n\n struct DoubleCalculator : ICalculator\n {\n public double Sum(double a, double b)\n {\n return a + b;\n }\n\n public double Difference(double a, double b)\n {\n return a - b;\n }\n\n public int Compare(double a, double b)\n {\n if (a > b)\n {\n return 1;\n }\n else if (a < b)\n {\n return -1;\n }\n else\n {\n return 0;\n }\n }\n\n public double Multiply(double a, double b)\n {\n return a * b;\n }\n\n public Double Divide(Double a, Double b)\n {\n return a / b;\n }\n\n public Double Divide(Double a, int b)\n {\n return a / b;\n }\n }\n\n struct StringCalculator : ICalculator\n {\n public string Sum(string a, string b)\n {\n return a + b;\n }\n\n public string Difference(string a, string b)\n {\n if (b.Length < a.Length)\n {\n return a.Substring(0, b.Length);\n }\n else\n {\n return \"\";\n }\n }\n\n public int Compare(string a, string b)\n {\n return a.CompareTo(b);\n }\n\n public string Multiply(string a, string b)\n {\n if (a.Length == 1 && b.Length == 1)\n {\n return ((char)(((byte)a[0] * (byte)b[0]) % 256)) + \"\";\n }\n\n int bigLength = Math.Max(a.Length, b.Length);\n while (a.Length < bigLength)\n {\n a = \" \" + a;\n }\n\n while (b.Length < bigLength)\n {\n b = \" \" + b;\n }\n\n string result = \"\";\n for (int i = 0; i < bigLength; i++)\n {\n Number numA = a[i] + \"\";\n Number numB = b[i] + \"\";\n result += numA * numB;\n }\n\n return result;\n }\n\n public String Divide(String a, String b)\n {\n return String.Format(\"{0} / {1}\", a, b);\n }\n\n public String Divide(String a, int b)\n {\n return String.Format(\"{0} / {1}\", a, b);\n }\n }\n\n public class Number\n {\n private T value;\n public Number(T value)\n {\n this.value = value;\n Type calculatorType = GetCalculatorType();\n fCalculator = Activator.CreateInstance(calculatorType) as ICalculator;\n }\n\n public static Type GetCalculatorType()\n {\n Type tType = typeof (T);\n Type calculatorType = null;\n if (tType == typeof (Int32))\n {\n calculatorType = typeof (Int32Calculator);\n }\n else if (tType == typeof (Int64))\n {\n calculatorType = typeof (Int64Calculator);\n }\n else if (tType == typeof (Double))\n {\n calculatorType = typeof (DoubleCalculator);\n }\n else if (tType == typeof (string))\n {\n calculatorType = typeof (StringCalculator);\n }\n else\n {\n throw new InvalidCastException(String.Format(\"Unsupported Type- Type {0} does not have a partner implementation of interface ICalculator and cannot be used in generic arithmetic using type Number\", tType.Name));\n }\n\n return calculatorType;\n }\n\n private static ICalculator fCalculator = null;\n public static ICalculator Calculator\n {\n get\n {\n if (fCalculator == null)\n {\n MakeCalculator();\n }\n\n return fCalculator;\n }\n }\n\n public static void MakeCalculator()\n {\n Type calculatorType = GetCalculatorType();\n fCalculator = Activator.CreateInstance(calculatorType) as ICalculator;\n }\n\n#region operation methods\n public static T Sum(T a, T b)\n {\n return Calculator.Sum(a, b);\n }\n\n public static T Difference(T a, T b)\n {\n return Calculator.Difference(a, b);\n }\n\n public static int Compare(T a, T b)\n {\n return Calculator.Compare(a, b);\n }\n\n public static T Multiply(T a, T b)\n {\n return Calculator.Multiply(a, b);\n }\n\n public static T Divide(T a, T b)\n {\n return Calculator.Divide(a, b);\n }\n\n public static T Divide(T a, int b)\n {\n return Calculator.Divide(a, b);\n }\n\n#endregion\n#region Operators\n public static implicit operator Number(T a)\n {\n return new Number(a);\n }\n\n public static implicit operator T(Number a)\n {\n return a.value;\n }\n\n public static Number operator +(Number a, Number b)\n {\n return Calculator.Sum(a.value, b.value);\n }\n\n public static Number operator -(Number a, Number b)\n {\n return Calculator.Difference(a, b);\n }\n\n public static bool operator>(Number a, Number b)\n {\n return Calculator.Compare(a, b) > 0;\n }\n\n public static bool operator <(Number a, Number b)\n {\n return Calculator.Compare(a, b) < 0;\n }\n\n public static Number operator *(Number a, Number b)\n {\n return Calculator.Multiply(a, b);\n }\n\n public static Number operator /(Number a, Number b)\n {\n return Calculator.Divide(a, b);\n }\n\n public static Number operator /(Number a, int b)\n {\n return Calculator.Divide(a, b);\n }\n#endregion\n }\n}\n#region DataStructures\n#region IComparable implementation\n#endregion\n#region Model\n#endregion\n#region Constructors\n#endregion\n#region Internal\n#region IEqualityComparer implementation\n#endregion\n#endregion\n#region IGraph implementation\n#endregion\n#region Clique invariants\n#endregion\n#region Clique methods\n#endregion\n#region IEquatable implementation\n#endregion\n#endregion\n#region Algorithms\n#endregion\n#endregion\n", "lang": "MS C#", "bug_code_uid": "fbfda7aecf29e5955856808b19f604bb", "src_uid": "f7f68a15cfd33f641132fac265bc5299", "apr_id": "a325a0b284da1e1d1b4e84df4079f934", "difficulty": 1300, "tags": ["dp", "probabilities", "combinatorics", "bitmasks", "math", "brute force"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9862139683263074, "equal_cnt": 19, "replace_cnt": 15, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 18, "bug_source_code": "using CompLib.Util;\nusing System;\nusing System.Collections.Generic;\n\npublic class Program\n{\n private int N, M, A, B;\n private int G0, X, Y, Z;\n\n public void Solve()\n {\n var sc = new Scanner();\n N = sc.NextInt();\n M = sc.NextInt();\n A = sc.NextInt();\n B = sc.NextInt();\n\n G0 = sc.NextInt();\n X = sc.NextInt();\n Y = sc.NextInt();\n Z = sc.NextInt();\n\n long[] H = new long[N * M];\n H[0] = G0;\n for (int i = 1; i < N * M; i++)\n {\n H[i] = (H[i - 1] * X + Y) % Z;\n }\n\n MinimumQueue[] q = new MinimumQueue[N];\n for (int i = 0; i < N; i++)\n {\n q[i] = new MinimumQueue();\n for (int j = 0; j < B - 1; j++)\n {\n q[i].Enqueue(H[i * M + j]);\n }\n }\n\n long ans = 0;\n for (int j = B - 1; j < M; j++)\n {\n var q2 = new MinimumQueue();\n for (int i = 0; i < N; i++)\n {\n q[i].Enqueue(H[i * M + j]);\n q2.Enqueue(q[i].Min());\n if (i >= A - 1)\n {\n ans += q2.Min();\n q2.Dequeue();\n }\n q[i].Dequeue();\n }\n }\n\n Console.WriteLine(ans);\n }\n\n public static void Main(string[] args) => new Program().Solve();\n}\n\nclass MinimumStack\n{\n private readonly Stack<(long num, long min)> stack;\n\n public MinimumStack()\n {\n stack = new Stack<(long num, long min)>();\n }\n\n public void Push(long num)\n {\n if (Count == 0) stack.Push((num, num));\n else stack.Push((num, Math.Min(num, stack.Peek().min)));\n }\n\n public long Peek()\n {\n return stack.Peek().num;\n }\n\n public long Pop()\n {\n return stack.Pop().num;\n }\n\n public long Min()\n {\n return Count == 0 ? long.MaxValue : stack.Peek().min;\n }\n\n public int Count => stack.Count;\n}\n\nclass MinimumQueue\n{\n private readonly MinimumStack s1, s2;\n\n public MinimumQueue()\n {\n s1 = new MinimumStack();\n s2 = new MinimumStack();\n }\n\n public void Enqueue(long l)\n {\n s2.Push(l);\n }\n\n private void Exec()\n {\n if (s1.Count == 0)\n {\n while (s2.Count > 0)\n {\n s1.Push(s2.Pop());\n }\n }\n }\n\n public long Peek()\n {\n Exec();\n return s1.Peek();\n }\n\n public long Dequeue()\n {\n Exec();\n return s1.Pop();\n }\n\n public long Min()\n {\n return Math.Min(s1.Min(), s2.Min());\n }\n\n public int Count => s1.Count + s2.Count;\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": "Mono C#", "bug_code_uid": "19fdb7c47e7087989466147f85262e64", "src_uid": "4618fbffb2b9d321a6d22c11590a4773", "apr_id": "e60c714f813b67a501e50f69e4ffbc2b", "difficulty": 2100, "tags": ["data structures", "two pointers"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.5122667225833508, "equal_cnt": 47, "replace_cnt": 31, "delete_cnt": 7, "insert_cnt": 9, "fix_ops_cnt": 47, "bug_source_code": "using System;\nusing CompLib.Collections.Generic;\nusing CompLib.Util;\n\npublic class Program\n{\n private int N, M, A, B;\n private int G0, X, Y, Z;\n\n private long[] H;\n\n public void Solve()\n {\n var sc = new Scanner();\n N = sc.NextInt();\n M = sc.NextInt();\n A = sc.NextInt();\n B = sc.NextInt();\n G0 = sc.NextInt();\n X = sc.NextInt();\n Y = sc.NextInt();\n Z = sc.NextInt();\n\n /*\n * N*Mグリッド\n * セル(i,j) は高さH[i,j]\n *\n * 画面には a*bの範囲が収まる\n *\n * 表示されてる範囲で最小のHの総和\n *\n * \n * g_i = (g_{i-1}*x+y) % Z\n * H[i,j] = g_{(i-1)*m+j-1}\n */\n\n H = new long[N * M];\n H[0] = G0;\n for (int i = 1; i < N * M; i++)\n {\n H[i] = (H[i - 1] * X + Y) % Z;\n }\n\n var st = new SegmentTree[N];\n for (int i = 0; i < N; i++)\n {\n st[i] = new SegmentTree(M);\n for (int j = 0; j < M; j++)\n {\n st[i][j] = (int) H[Conv(i, j)];\n }\n }\n\n long ans = 0;\n for (int j = 0; j + B <= M; j++)\n {\n var st2 = new SegmentTree(A);\n for (int i = 0; i < A - 1; i++) st2[i] = st[i].Query(j, j + B);\n for (int i = A - 1; i < N; i++)\n {\n st2[i % A] = st[i].Query(j, j + B);\n ans += st2.Root();\n }\n }\n\n Console.WriteLine(ans);\n }\n\n int Conv(int i, int j)\n {\n return i * M + j;\n }\n\n public static void Main(string[] args) => new Program().Solve();\n}\n\nnamespace CompLib.Collections.Generic\n{\n using System;\n\n public class SegmentTree\n {\n private readonly int N;\n private int[] _array;\n\n private const int _identity = int.MaxValue;\n\n public SegmentTree(int size)\n {\n N = 1;\n while (N < size) N *= 2;\n\n _array = new int[N * 2];\n for (int i = 1; i < N * 2; i++)\n {\n _array[i] = _identity;\n }\n }\n\n /// \n /// A[i]をnに更新 O(log N)\n /// \n /// \n /// \n public void Update(int i, int n)\n {\n i += N;\n _array[i] = n;\n while (i > 1)\n {\n i /= 2;\n _array[i] = System.Math.Min(_array[i * 2], _array[i * 2 + 1]);\n }\n }\n\n private int Query(int left, int right, int k, int l, int r)\n {\n if (r <= left || right <= l)\n {\n return _identity;\n }\n\n if (left <= l && r <= right)\n {\n return _array[k];\n }\n\n return Math.Min(Query(left, right, k * 2, l, (l + r) / 2),\n Query(left, right, k * 2 + 1, (l + r) / 2, r));\n }\n\n public int Root() => _array[1];\n\n /// \n /// A[left] op A[left+1] ... op A[right-1]を求める\n /// \n /// \n /// \n /// \n public int Query(int left, int right)\n {\n return Query(left, right, 1, 0, N);\n }\n\n public int this[int i]\n {\n set { Update(i, value); }\n get { return _array[i + N]; }\n }\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 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": "Mono C#", "bug_code_uid": "0dc51a481044215c469b6a269ec59624", "src_uid": "4618fbffb2b9d321a6d22c11590a4773", "apr_id": "e60c714f813b67a501e50f69e4ffbc2b", "difficulty": 2100, "tags": ["data structures", "two pointers"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.3536475947270343, "equal_cnt": 26, "replace_cnt": 16, "delete_cnt": 5, "insert_cnt": 4, "fix_ops_cnt": 25, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing CompLib.Util;\nusing System.Threading;\nusing CompLib.Collections.Generic;\n\npublic class Program\n{\n private int N, M, A, B;\n private int G0, X, Y, Z;\n\n public void Solve()\n {\n var sc = new Scanner();\n N = sc.NextInt();\n M = sc.NextInt();\n A = sc.NextInt();\n B = sc.NextInt();\n\n\n long[] g = new long[N * M];\n g[0] = sc.NextInt();\n X = sc.NextInt();\n Y = sc.NextInt();\n Z = sc.NextInt();\n for (int i = 1; i < N * M; i++)\n {\n g[i] = (g[i - 1] * X + Y) % Z;\n }\n\n long[][] t = new long[N][];\n for (int i = 0; i < N; i++)\n {\n t[i] = new long[M];\n for (int j = 0; j < M; j++)\n {\n t[i][j] = g[i * M + j];\n }\n }\n\n var mq = new MinQueue[N];\n for (int i = 0; i < N; i++)\n {\n mq[i] = new MinQueue();\n }\n\n for (int j = 0; j < B - 1; j++)\n {\n for (int i = 0; i < N; i++)\n {\n mq[i].Enqueue(t[i][j]);\n }\n }\n\n long ans = 0;\n for (int j = B - 1; j < M; j++)\n {\n for (int i = 0; i < N; i++)\n {\n mq[i].Enqueue(t[i][j]);\n }\n\n var mq2 = new MinQueue();\n for (int i = 0; i < A - 1; i++)\n {\n mq2.Enqueue(mq[i].GetMin());\n }\n\n for (int i = A - 1; i < N; i++)\n {\n mq2.Enqueue(mq[i].GetMin());\n ans += mq2.GetMin();\n mq2.Dequeue();\n }\n \n for (int i = 0; i < N; i++)\n {\n mq[i].Dequeue();\n }\n }\n\n Console.WriteLine(ans);\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.Collections.Generic\n{\n using System;\n using System.Diagnostics;\n\n public class SegmentTree\n {\n // 見かけ上の大きさ、実際の大きさ\n private readonly int _n, _size;\n private T[] _array;\n\n private T _identity;\n private Func _operation;\n\n public SegmentTree(int n, Func operation, T identity)\n {\n _n = n;\n _size = 1;\n while (_size < _n)\n {\n _size *= 2;\n }\n\n _identity = identity;\n _operation = operation;\n _array = new T[_size * 2];\n for (int i = 1; i < _size * 2; i++)\n {\n _array[i] = _identity;\n }\n }\n\n public SegmentTree(T[] a, Func operation, T identity)\n {\n _n = a.Length;\n _size = 1;\n while (_size < _n)\n {\n _size *= 2;\n }\n\n _identity = identity;\n _operation = operation;\n _array = new T[_size * 2];\n for (int i = 0; i < a.Length; i++)\n {\n _array[i + _size] = a[i];\n }\n\n for (int i = a.Length; i < _size; i++)\n {\n _array[i + _size] = identity;\n }\n\n for (int i = _size - 1; i >= 1; i--)\n {\n _array[i] = operation(_array[i * 2], _array[i * 2 + 1]);\n }\n }\n\n /// \n /// A[i]をnに更新 O(log N)\n /// \n /// \n /// \n public void Update(int i, T n)\n {\n Debug.Assert(0 <= i && i < _n);\n i += _size;\n _array[i] = n;\n while (i > 1)\n {\n i /= 2;\n _array[i] = _operation(_array[i * 2], _array[i * 2 + 1]);\n }\n }\n\n /// \n /// A[left] op A[left+1] ... op A[right-1]を求める\n /// \n /// \n /// \n /// \n public T Query(int left, int right)\n {\n Debug.Assert(0 <= left && left <= right && right <= _n);\n T sml = _identity;\n T smr = _identity;\n\n left += _size;\n right += _size;\n while (left < right)\n {\n if ((left & 1) != 0) sml = _operation(sml, _array[left++]);\n if ((right & 1) != 0) smr = _operation(_array[--right], smr);\n left >>= 1;\n right >>= 1;\n }\n\n return _operation(sml, smr);\n }\n\n /// \n /// op(a[0],a[1],...,a[n-1])を返します\n /// \n /// \n public T All()\n {\n return _array[1];\n }\n\n /// \n /// f(op(a[l],a[l+1],...a[r-1])) = trueとなる最大のrを返します\n /// \n /// \n /// \n /// \n public int MaxRight(int l, Func f)\n {\n Debug.Assert(0 <= l && l <= _n);\n#if DEBUG\n Debug.Assert(f(_identity));\n#endif\n if (l == _n) return _n;\n l += _size;\n T sm = _identity;\n do\n {\n while (l % 2 == 0) l >>= 1;\n if (!f(_operation(sm, _array[l])))\n {\n while (l < _size)\n {\n l <<= 1;\n if (f(_operation(sm, _array[l])))\n {\n sm = _operation(sm, _array[l]);\n l++;\n }\n }\n\n return l - _size;\n }\n\n sm = _operation(sm, _array[l]);\n l++;\n } while ((l & -l) != l);\n\n return _n;\n }\n\n /// \n /// f(op(a[l],a[l+1],...a[r-1])) = trueとなる最小のlを返します\n /// \n /// \n /// \n /// \n public int MinLeft(int r, Func f)\n {\n Debug.Assert(0 <= r && r <= _n);\n#if DEBUG\n Debug.Assert(f(_identity));\n#endif\n if (r == 0) return 0;\n r += _size;\n T sm = _identity;\n\n do\n {\n r--;\n while (r > 1 && (r % 2 != 0)) r >>= 1;\n if (!f(_operation(_array[r], sm)))\n {\n while (r < _size)\n {\n r = (2 * r + 1);\n if (f(_operation(_array[r], sm)))\n {\n sm = _operation(_array[r], sm);\n r--;\n }\n }\n\n return r + 1 - _size;\n }\n\n sm = _operation(_array[r], sm);\n } while ((r & -r) != r);\n\n return 0;\n }\n\n public T this[int i]\n {\n set { Update(i, value); }\n get\n {\n Debug.Assert(0 <= i && i < _n);\n return _array[i + _size];\n }\n }\n }\n}\n\nclass MinStack\n{\n private Stack<(long val, long min)> S;\n\n public MinStack()\n {\n S = new Stack<(long val, long min)>();\n }\n\n public long GetMin()\n {\n if (S.Count == 0) return long.MaxValue;\n return S.Peek().min;\n }\n\n public void Push(long val)\n {\n S.Push((val, Math.Min(val, GetMin())));\n }\n\n public long Pop()\n {\n return S.Pop().val;\n }\n\n public int Count\n {\n get { return S.Count; }\n }\n}\n\nclass MinQueue\n{\n public MinStack L, R;\n\n public MinQueue()\n {\n L = new MinStack();\n R = new MinStack();\n }\n\n public void Enqueue(long val)\n {\n R.Push(val);\n }\n\n public void Dequeue()\n {\n if (L.Count == 0)\n {\n while (R.Count > 0)\n {\n L.Push(R.Pop());\n }\n }\n\n L.Pop();\n }\n\n public long GetMin()\n {\n return Math.Min(L.GetMin(), R.GetMin());\n }\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 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": "8bd5a6a172464e2aae3a54c640965d16", "src_uid": "4618fbffb2b9d321a6d22c11590a4773", "apr_id": "e60c714f813b67a501e50f69e4ffbc2b", "difficulty": 2100, "tags": ["data structures", "two pointers"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.964007047571105, "equal_cnt": 10, "replace_cnt": 5, "delete_cnt": 4, "insert_cnt": 1, "fix_ops_cnt": 10, "bug_source_code": "using System;\nusing System.Numerics;\nusing System.Collections.Generic;\nusing System.Text;\nusing System.IO;\nusing System.Linq;\n\nclass Solution\n{\n\tclass SlideMin\n\t{\n\t\tLinkedList lst = new LinkedList();\n\t\tpublic void Push(int x)\n\t\t{\n\t\t\twhile (lst.Count() > 0 && lst.Last() > x) lst.RemoveLast();\n\t\t\tlst.AddLast(x);\n\t\t}\n\t\tpublic void Pop(int x)\n\t\t{\n\t\t\tif (lst.Count() > 0 && lst.First() == x) lst.RemoveFirst();\n\t\t}\n\t\tpublic int Top()\n\t\t{\n\t\t\treturn lst.First();\n\t\t}\n\t};\n\n\tint n, m, a, b;\n\tint[,] M;\n\n\tvoid Make(int g, int x, int y, int z)\n\t{\n\t\tM = new int[n, m];\n\t\tfor (int i = 0; i < n; i++)\n\t\t{\n\t\t\tfor (int j = 0; j < m; j++)\n\t\t\t{\n\t\t\t\tM[i, j] = g;\n\t\t\t\tg = (int)(((long)g * x + y) % z);\n\t\t\t}\n\t\t}\n\t}\n\n\tvoid Run()\n\t{\n\t\tvar A = Array.ConvertAll(cin.ReadLine().Split(), int.Parse);\n\t\tn = A[0]; m = A[1]; a = A[2]; b = A[3];\n\t\tA = Array.ConvertAll(cin.ReadLine().Split(), int.Parse);\n\t\tMake(A[0], A[1], A[2], A[3]);\n\n\t\tint[,] MinRow = new int[n, m - b + 1];\n\t\tfor (int i = 0; i < n; i++)\n\t\t{\n\t\t\tSlideMin slide = new SlideMin();\n\t\t\tfor (int j = 0; j < b; j++)\n\t\t\t{\n\t\t\t\tslide.Push(M[i, j]);\n\t\t\t}\n\t\t\tfor (int j = 0; j < m - b + 1; j++)\n\t\t\t{\n\t\t\t\tMinRow[i, j] = slide.Top();\n\t\t\t\tif (j == m - b) break;\n\t\t\t\tslide.Pop(M[i, j]);\n\t\t\t\tslide.Push(M[i, j + b]);\n\t\t\t}\n\t\t}\n\n\t\tlong ans = 0;\n\t\tfor (int j = 0; j < m - b + 1; j++)\n\t\t{\n\t\t\tSlideMin slide = new SlideMin();\n\t\t\tfor (int i = 0; i < a; i++)\n\t\t\t{\n\t\t\t\tslide.Push(MinRow[i, j]);\n\t\t\t}\n\t\t\tfor (int i = 0; i < n - a + 1; i++)\n\t\t\t{\n\t\t\t\tans += slide.Top();\n\t\t\t\tif (i == n - a) break;\n\t\t\t\tslide.Pop(MinRow[i, j]);\n\t\t\t\tslide.Push(MinRow[i + a, j]);\n\t\t\t}\n\t\t}\n\n\t\tcout.Write(ans);\n\t}\n\n\tstatic TextReader cin;\n\tstatic TextWriter cout;\n\n\tstatic void Main()\n\t{\n#if NARUT_LOCAL\n\t\tcin = new StreamReader(\"io/test.in\", Encoding.ASCII);\n#else\n\t\tcin = new StreamReader(Console.OpenStandardInput(), Encoding.ASCII);\n#endif\n\t\tcout = new StreamWriter(Console.OpenStandardOutput(), Encoding.ASCII) { AutoFlush = false };\n\t\t(new Solution()).Run();\n\t\tcin.Close();\n\t\tcout.Close();\n\t}\n}\n", "lang": "Mono C#", "bug_code_uid": "cf7c3273044791f12e4ee6af9e362564", "src_uid": "4618fbffb2b9d321a6d22c11590a4773", "apr_id": "a4f30045440ad76d0eeef5923adc2361", "difficulty": 2100, "tags": ["data structures", "two pointers"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9827950498038032, "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.Text;\n\nnamespace Codeforces\n{\n\tclass Program\n\t{\n\t\tstatic void Main(string[] args) \n\t\t{\n\t\t\tstring input1 = Console.ReadLine();\n\t\t\tstring input2 = Console.ReadLine();\n\t\t\t//string input3 = Console.ReadLine();\n\t\t\t//string input4 = Console.ReadLine();\n\n\t\t\tvar inputs1 = input1.Split(new[] { ' ', '}', '{' , ',' }, StringSplitOptions.RemoveEmptyEntries).Select(int.Parse).ToArray();\n\t\t\tvar inputs2 = input2.Split(new[] { ' ' }, StringSplitOptions.RemoveEmptyEntries).Select(int.Parse).ToArray();\n\n\t\t\tint n = inputs1[0];\n\t\t\tint k = inputs1[1];\n\n\t\t\tif (n == 1) \n\t\t\t{\n\t\t\t\tConsole.WriteLine(inputs2[0] > k ? 0 : 1);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tint startIndex = 0, endIndex = n - 1;\n\t\t\tint min = Math.Min(inputs2[startIndex], inputs2[endIndex]);\n\t\t\tint count = 0;\n\t\t\twhile (min <= k) \n\t\t\t{\n\t\t\t\tif (min == inputs2[startIndex]) \n\t\t\t\t{\n\t\t\t\t\tstartIndex++;\n\t\t\t\t} \n\t\t\t\telse \n\t\t\t\t{\n\t\t\t\t\tendIndex--;\n\t\t\t\t}\n\n\t\t\t\tcount++;\n\t\t\t\tmin = Math.Min(inputs2[startIndex], inputs2[endIndex]);\n\t\t\t}\n\n\t\t\tConsole.WriteLine(count);\n\t\t}\n\n\t\tprivate static long NumbersSum(long a) \n\t\t{\n\t\t\tlong copyA = a, sum = 0;\n\t\t\twhile (copyA > 0) \n\t\t\t{\n\t\t\t\tsum += copyA % 10;\n\t\t\t\tcopyA /= 10;\n\t\t\t}\n\n\t\t\treturn sum;\n\t\t}\n\n\t\tprivate static long GCD(long a, long b)\n\t\t{\n\t\t\tlong max = Math.Max(a, b);\n\t\t\tlong min = Math.Min(a, b);\n\n\t\t\tif (min == 0)\n\t\t\t{\n\t\t\t\treturn max;\n\t\t\t}\n\t\t\ta = min;\n\t\t\tb = max % min;\n\t\t\treturn GCD(a, b);\n\t\t}\n\n\t\tprivate static long LCM(long a, long b)\n\t\t{\n\t\t\treturn Math.Abs(a * b) / GCD(a, b);\n\t\t}\n\n\t\tstatic long Factorial(long a) \n\t\t{\n\t\t\treturn a > 1 ? a * Factorial(a - 1) : 1;\n\t\t}\n\t}\n}\n", "lang": "Mono C#", "bug_code_uid": "f9d70fe3f6863bd411562414eb70e540", "src_uid": "ecf0ead308d8a581dd233160a7e38173", "apr_id": "5fcc3447b16849c259bff93f445ede85", "difficulty": 800, "tags": ["brute force", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.8585485854858549, "equal_cnt": 4, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 4, "fix_ops_cnt": 4, "bug_source_code": "using System;\n\nnamespace helloworld\n{\n class Program\n {\n static void Main(string[] args)\n {\n var line1 = Console.ReadLine().Split(' ');\n var line2 = Console.ReadLine().Split(' ');\n \n var n = int.Parse(line1[0]);\n var k = int.Parse(line1[1]);\n int count = 0;\n int i=0;\n int j = n-1;\n\n while(int.Parse(line2[i]) <= k && i!=j)\n {\n count++;\n i++;\n }\n while(int.Parse(line2[j]) <= k && i<=j)\n {\n count++;\n j--;\n }\n Console.WriteLine(count);\n }\n }\n}", "lang": "Mono C#", "bug_code_uid": "8b11cb76140f716f5827ba71a9795143", "src_uid": "ecf0ead308d8a581dd233160a7e38173", "apr_id": "4dc893efa70e98d8f74ea08c9694c132", "difficulty": 800, "tags": ["brute force", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.9953401677539608, "equal_cnt": 4, "replace_cnt": 2, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 3, "bug_source_code": "using System;\nusing System.Linq;\nusing System.Security.Cryptography;\nusing System.Text;\n\nnamespace CodeForces\n{\n class Program\n {\n static int NthRootFloor(double A, int N)\n {\n return (int)Math.Floor(Math.Pow(A, 1.0 / N));\n }\n\n static void generate(int limit, int k)\n {\n var source = \"codeforces\".ToCharArray();\n var output = new StringBuilder(k * source.Length);\n for(int i = 0; i < source.Length; ++i)\n {\n var addOne = i < limit ? 1 : 0;\n output.Append(new string(source[i], k + addOne)); \n }\n Console.WriteLine(output);\n }\n\n static void Main(string[] args)\n {\n var k = int.Parse(Console.ReadLine().Trim());\n var kInt = NthRootFloor(k, 10);\n if (kInt < 1)\n {\n kInt = 1;\n }\n int [] data = new int[10];\n for (int i = 0; i < data.Length; ++i)\n {\n data[i] = kInt;\n }\n long tmp = 1;\n for (int i = 0; i < data.Length; ++i)\n {\n tmp = tmp * kInt;\n }\n if (tmp >= k)\n {\n generate(0, kInt);\n return;\n }\n for (int i = 0; i < data.Length; ++i)\n {\n tmp /= kInt;\n tmp *= (kInt + 1);\n if (tmp >= k)\n {\n generate(i + 1, kInt);\n return;\n }\n }\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "a7ad39ed6d292d0a314f208b92cbfeae", "src_uid": "8001a7570766cadcc538217e941b3031", "apr_id": "926a4db269d9551f25d068613e1fed1b", "difficulty": 1500, "tags": ["greedy", "math", "brute force", "strings", "constructive algorithms"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9837479270315092, "equal_cnt": 8, "replace_cnt": 7, "delete_cnt": 0, "insert_cnt": 0, "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 Codeforces\n{\n class Program\n {\n static void Main(string[] args)\n {\n\n //Codeforces Subsequences\n\n long k = long.Parse(Console.ReadLine());\n\n long x = (long)Math.Pow(1.0 * k, 0.1), y;\n\n if (Math.Pow(1.0 * k, 0.1) == (long)Math.Pow(1.0 * k, 0.1))\n {\n\n y = x;\n\n }\n else\n {\n\n y = x + 1;\n\n }\n\n char[] ch = { 'C', 'O', 'd', 'E', 'f', 'o', 'r', 'c', 'e', 's' };\n\n int fy = 0, fx = 10;\n\n Dictionary f = new Dictionary();\n \n for (int i = 0; i < 10; i++)\n {\n\n f[ch[i]] = x;\n\n }\n\n int py = (int)Math.Pow(1.0 * y, 1.0 * fy);\n int px = (int)Math.Pow(1.0 * x, 1.0 * fx);\n\n int c = 0;\n\n while (py * px < k)\n {\n\n f[ch[c]] = y;\n\n c++;\n\n fy++;\n fx--;\n\n py = (int)Math.Pow(1.0 * y, 1.0 * fy);\n px = (int)Math.Pow(1.0 * x, 1.0 * fx);\n\n }\n\n for (long i = 0; i < 10; i++)\n {\n\n for (long j = 1; j <= f[ch[i]]; j++)\n {\n\n Console.Write(char.ToLower(ch[i]));\n\n }\n\n }\n\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "871455b8ef27ad15bb54dff78ec89e07", "src_uid": "8001a7570766cadcc538217e941b3031", "apr_id": "0481665468fd2e12647b2a352a5663bf", "difficulty": 1500, "tags": ["greedy", "math", "brute force", "strings", "constructive algorithms"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9710610932475884, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "using System;\n\nclass Program\n{\n\tstatic void Main()\n\t{\n\t\tint stone = int.Parse();\n\t\tstring colors = Console.ReadLine();\n\t\tint counter = 0;\n\t\tfor(int i = 1; i < stone; i++)\n\t\t{\n\t\t\tif(colors[i-1] != colors[i])\n\t\t\t{\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tcounter++;\n\t\t\t}\n\t\t}\n\t\tConsole.WriteLine(counter);\n\t}\n}", "lang": "Mono C#", "bug_code_uid": "d0b6a1149f4351b38ed0509c6b5d105b", "src_uid": "d561436e2ddc9074b98ebbe49b9e27b8", "apr_id": "6c22ce084670aac2c14bb52506b0df22", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.39266802443991855, "equal_cnt": 15, "replace_cnt": 5, "delete_cnt": 5, "insert_cnt": 5, "fix_ops_cnt": 15, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace B.Code_obfuscation\n{\n class Program\n {\n static void Main(string[] args)\n {\n string s = Console.ReadLine();\n char[] alphabets = { 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z' };\n int flag = 0;\n char x=' ';\n if (s[0] != 'a')\n {\n Console.WriteLine(\"NO\");\n }\n else\n {\n flag = 1;\n for (int i = 1; i < s.Length; i++)\n {\n flag = 0;\n for (int j = 1; j < alphabets.Length; j++)\n {\n if (s[i] == alphabets[i])\n {\n x = alphabets[i - 1];\n break;\n }\n }\n for (int k = 0; k < i; k++)\n {\n if (s[k] == x || s[k] == s[0])\n {\n flag = 1;\n break;\n }\n }\n if (flag == 1)\n {\n continue;\n }\n else\n {\n break;\n }\n }\n if (flag == 1)\n {\n Console.WriteLine(\"YES\");\n }\n else\n {\n Console.WriteLine(\"NO\");\n }\n }\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "7cae1e1352b7fdde19b070d89b8fc4b2", "src_uid": "c4551f66a781b174f95865fa254ca972", "apr_id": "1498f713490c1e8c85a3c60db7e63dbb", "difficulty": 1100, "tags": ["greedy", "strings", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9463948413990751, "equal_cnt": 14, "replace_cnt": 10, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 13, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing Solver.Ex;\nusing Debug = System.Diagnostics.Debug;\nusing Watch = System.Diagnostics.Stopwatch;\nusing StringBuilder = System.Text.StringBuilder;\nusing System.Numerics;\nnamespace Solver\n{\n public class Solver\n {\n public void Solve()\n {\n var H = sc.Long();\n var W = sc.Long();\n var k = sc.Long();\n long max = -1;\n for (long i = 1; i * i <= 2 * H; i++)\n {\n var h = H / i;\n var u = i - 1;\n var rem = k - u;\n var w = W / (rem + 1);\n if (h * w > 0)\n max = Math.Max(h * w, max);\n\n }\n IO.Printer.Out.WriteLine(max);\n\n }\n\n internal IO.StreamScanner sc;\n static T[] Enumerate(int n, Func f) { var a = new T[n]; for (int i = 0; i < n; i++) a[i] = f(i); return a; }\n\n }\n #region Main and Settings\n static class Program\n {\n static void Main(string[] arg)\n {\n#if DEBUG\n var errStream = new System.IO.FileStream(@\"..\\..\\dbg.out\", System.IO.FileMode.Create, System.IO.FileAccess.Write, System.IO.FileShare.ReadWrite);\n Debug.Listeners.Add(new System.Diagnostics.TextWriterTraceListener(errStream, \"debugStream\"));\n Debug.AutoFlush = false;\n var sw = new Watch(); sw.Start();\n IO.Printer.Out.AutoFlush = true;\n try\n {\n#endif\n\n var solver = new Solver();\n solver.sc = new IO.StreamScanner(Console.OpenStandardInput());\n solver.Solve();\n IO.Printer.Out.Flush();\n#if DEBUG\n }\n catch (Exception ex)\n {\n Console.Error.WriteLine(ex.Message);\n Console.Error.WriteLine(ex.StackTrace);\n }\n finally\n {\n sw.Stop();\n Console.ForegroundColor = ConsoleColor.Green;\n Console.Error.WriteLine(\"Time:{0}ms\", sw.ElapsedMilliseconds);\n Debug.Close();\n System.Threading.Thread.Sleep(System.Threading.Timeout.Infinite);\n }\n#endif\n }\n\n\n }\n #endregion\n}\n\n#region IO Helper\nnamespace Solver.IO\n{\n public class Printer : System.IO.StreamWriter\n {\n static Printer()\n {\n Out = new Printer(Console.OpenStandardOutput()) { AutoFlush = false };\n#if DEBUG\n Error = new Printer(Console.OpenStandardError()) { AutoFlush = true };\n#else\n Error = new Printer(System.IO.Stream.Null) { AutoFlush = false };\n#endif\n }\n public static Printer Out { get; set; }\n public static Printer Error { get; set; }\n public override IFormatProvider FormatProvider { get { return System.Globalization.CultureInfo.InvariantCulture; } }\n public Printer(System.IO.Stream stream) : base(stream, new System.Text.UTF8Encoding(false, true)) { }\n public Printer(System.IO.Stream stream, System.Text.Encoding encoding) : base(stream, encoding) { }\n public void Write(string format, IEnumerable source) { base.Write(format, source.OfType().ToArray()); }\n public void WriteLine(string format, IEnumerable source) { base.WriteLine(format, source.OfType().ToArray()); }\n }\n public class StreamScanner\n {\n public StreamScanner(System.IO.Stream stream) { iStream = stream; }\n private readonly System.IO.Stream iStream;\n private readonly byte[] buf = new byte[1024];\n private int len, ptr;\n private bool eof = false;\n public bool IsEndOfStream { get { return eof; } }\n const byte lb = 33, ub = 126, el = 10, cr = 13;\n public byte read()\n {\n if (eof) throw new System.IO.EndOfStreamException();\n if (ptr >= len) { ptr = 0; if ((len = iStream.Read(buf, 0, 1024)) <= 0) { eof = true; return 0; } }\n return buf[ptr++];\n }\n public char Char() { byte b = 0; do b = read(); while (b < lb || ub < b); return (char)b; }\n public char[] Char(int n) { var a = new char[n]; for (int i = 0; i < n; i++) a[i] = Char(); return a; }\n public char[][] Char(int n, int m) { var a = new char[n][]; for (int i = 0; i < n; i++) a[i] = Char(m); return a; }\n public string Scan()\n {\n if (eof) throw new System.IO.EndOfStreamException();\n StringBuilder sb = null;\n var enc = System.Text.UTF8Encoding.Default;\n do\n {\n for (; ptr < len && (buf[ptr] < lb || ub < buf[ptr]); ptr++) ;\n if (ptr < len) break;\n ptr = 0;\n if ((len = iStream.Read(buf, 0, 1024)) <= 0) { eof = true; return \"\"; }\n } while (true);\n do\n {\n var f = ptr;\n for (; ptr < len; ptr++)\n if (buf[ptr] < lb || ub < buf[ptr])\n //if (buf[ptr] == cr || buf[ptr] == el)\n {\n string s;\n if (sb == null) s = enc.GetString(buf, f, ptr - f);\n else { sb.Append(enc.GetChars(buf, f, ptr - f)); s = sb.ToString(); }\n ptr++; return s;\n }\n if (sb == null) sb = new StringBuilder(enc.GetString(buf, f, len - f));\n else sb.Append(enc.GetChars(buf, f, len - f));\n ptr = 0;\n\n }\n while (!eof && (len = iStream.Read(buf, 0, 1024)) > 0);\n eof = true; return (sb != null) ? sb.ToString() : \"\";\n }\n public long Long()\n {\n long ret = 0; byte b = 0; bool isMynus = false;\n const byte zr = 48, nn = 57, my = 45;\n do b = read();\n while (b != my && (b < zr || nn < b));\n if (b == my) { isMynus = true; b = read(); }\n for (; true; b = read())\n if (b < zr || nn < b)\n return isMynus ? -ret : ret;\n else ret = ret * 10 + b - zr;\n }\n public int Integer()\n {\n int ret = 0; byte b = 0; bool isMynus = false;\n const byte zr = 48, nn = 57, my = 45;\n do b = read();\n while (b != my && (b < zr || nn < b));\n if (b == my) { isMynus = true; b = read(); }\n for (; true; b = read())\n if (b < zr || nn < b)\n return isMynus ? -ret : ret;\n else ret = ret * 10 + b - zr;\n }\n public double Double() { return double.Parse(Scan(), System.Globalization.CultureInfo.InvariantCulture); }\n public string[] Scan(int n) { var a = new string[n]; for (int i = 0; i < n; i++) a[i] = Scan(); return a; }\n public double[] Double(int n) { var a = new double[n]; for (int i = 0; i < n; i++) a[i] = Double(); return a; }\n public int[] Integer(int n) { var a = new int[n]; for (int i = 0; i < n; i++) a[i] = Integer(); return a; }\n public long[] Long(int n) { var a = new long[n]; for (int i = 0; i < n; i++)a[i] = Long(); return a; }\n public void Flush() { iStream.Flush(); }\n }\n}\n#endregion\n#region Extension\nnamespace Solver.Ex\n{\n static public partial class EnumerableEx\n {\n static public string AsString(this IEnumerable ie) { return new string(ie.ToArray()); }\n static public string AsJoinedString(this IEnumerable ie, string st = \" \") { return string.Join(st, ie); }\n\n }\n}\n#endregion\n", "lang": "MS C#", "bug_code_uid": "d7627a97d766508cd426c9cf95166173", "src_uid": "bb453bbe60769bcaea6a824c72120f73", "apr_id": "4ec4d304ef95d968d76d79125f15494f", "difficulty": 1700, "tags": ["greedy", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9924494110540623, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\n\nnamespace CodeForcesTrainingCSharp\n{\n class Program\n {\n static int Main(string[] args)\n {\n Process();\n Console.ReadLine();\n return 0;\n }\n static void Process()\n {\n long[] nmk = Array.ConvertAll(Console.ReadLine().Split(' '), r => long.Parse(r));\n long n = nmk[0]>nmk[1]?nmk[1]:nmk[0], m = nmk[0]>nmk[1]?nmk[0]:nmk[1], k = nmk[2];\n if (n + m < k + 2) { Console.WriteLine(\"-1\"); return; }\n if (n + m == k + 2) { Console.WriteLine(\"1\"); return; }\n //x:x parts,y:y parts\n //left: x>=left ,right: x<=right\n long left = 0, right = 0, ans = 0;\n if (k <= n-1) { left = 1; right = k+1; }\n else if (k >= n && k <= m-1) { left = 1; right = n; }\n else { left = k - m + 1; right = n; }\n //\n for (long x = 1; x <= (long)Math.Sqrt(n); x++)\n {\n if (k + 2 - x <= m)\n {\n long t = (n / x) * (m / (k + 2 - x));\n ans = Math.Max(ans, t);\n }\n }\n for (long nDivx = 1; nDivx <= (long)Math.Sqrt(n); nDivx++)\n {\n long up = n / nDivx;\n if (right < up) up = right;\n if (k + 2 - up <= m)\n {\n long t = nDivx * (m / (k + 2 - up));\n ans = Math.Max(ans, t);\n }\n }\n Console.WriteLine(ans); \n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "7e93a741324823d77121502b706f4617", "src_uid": "bb453bbe60769bcaea6a824c72120f73", "apr_id": "1e169719690961d8104384c15044f932", "difficulty": 1700, "tags": ["greedy", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.8590189262263422, "equal_cnt": 18, "replace_cnt": 9, "delete_cnt": 2, "insert_cnt": 6, "fix_ops_cnt": 17, "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 D\n {\n //*\n\n\n static void Main(string[] args)\n {\n \n string s = Console.ReadLine();\n string[] splitStr = s.Split(' ');\n int n = Convert.ToInt32(splitStr[0]);\n int m = Convert.ToInt32(splitStr[1]);\n int k = Convert.ToInt32(splitStr[2]);\n\n int p = n * m / 2;\n\n\n while (true)\n {\n int res = 0;\n int count = 0;\n for (int i = 1; i <= m; i++)\n {\n int b = p / i;\n res += Math.Min(b, n);\n if ((p % i == 0) && (b <= n)) count++;\n }\n if ((k >= res - count) && (k <= res))\n {\n Console.WriteLine(p);\n return;\n }\n if (k < res - count)\n {\n p -= p / 2;\n }\n else p += p / 2;\n }\n }\n /**/\n }\n}\n", "lang": "MS C#", "bug_code_uid": "c2c9ed48aa7d4093bdf9ffa1869829e0", "src_uid": "13a918eca30799b240ceb9de47507a26", "apr_id": "0a7e1996263aa5d18adecc4e41b128e6", "difficulty": 1800, "tags": ["brute force", "binary search"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9936530324400564, "equal_cnt": 4, "replace_cnt": 3, "delete_cnt": 0, "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 Codeforces\n{\n class D\n {\n //*\n\n\n static void Main(string[] args)\n {\n \n string s = Console.ReadLine();\n string[] splitStr = s.Split(' ');\n int n = Convert.ToInt32(splitStr[0]);\n int m = Convert.ToInt32(splitStr[1]);\n long k = Convert.ToInt32(splitStr[2]);\n\n long p = n * m / 2;\n long d = p / 2;\n //if (p == 0) p = 1;\n while (true)\n {\n long res = 0;\n long count = 0;\n for (int i = 1; i <= m; i++)\n {\n long b = p / i;\n res += Math.Min(b, n);\n if ((p % i == 0) && (b <= n)) count++;\n }\n if ((k > res - count) && (k <= res))\n {\n Console.WriteLine(p);\n return;\n }\n if (k <= res - count)\n {\n\n p -= d;\n d /= 2;\n if (d == 0) d = 1;\n }\n else\n {\n p += d;\n d /= 2;\n if (d == 0) d = 1;\n }\n }\n }\n /**/\n }\n}\n", "lang": "MS C#", "bug_code_uid": "316422a86b2dcd22a5dbbe7a41d29506", "src_uid": "13a918eca30799b240ceb9de47507a26", "apr_id": "0a7e1996263aa5d18adecc4e41b128e6", "difficulty": 1800, "tags": ["brute force", "binary search"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9668508287292817, "equal_cnt": 11, "replace_cnt": 10, "delete_cnt": 0, "insert_cnt": 0, "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 ConsoleApp61\n{\n class Program\n {\n static void Main(string[] args)\n {\n int[] inp0 = Console.ReadLine().Split().Select(int.Parse).ToArray();\n int n = inp0[0];\n int m = inp0[1];\n int k = inp0[2];\n int start = 1;\n int end = (n*m)+1;\n while (start int.Parse(i)).ToArray();\n\t\t\tint[] c2 = reader.ReadLine().Split(' ').Select(i => int.Parse(i)).ToArray();\n\n\t\t\tint x1 = c1[0];\n\t\t\tint y1 = c1[1];\n\t\t\tint r1 = c1[2];\n\t\t\tint R1 = c1[3];\n\n\t\t\tint x2 = c2[0];\n\t\t\tint y2 = c2[1];\n\t\t\tint r2 = c2[2];\n\t\t\tint R2 = c2[3];\n\t\t\t#endregion\n\n\t\t\tint count = 0;\n\n\t\t\tif (AreCircleWithBallOk(x1, y1, r1, x2, y2, r2, R2)) count++;\n\t\t\tif (AreCircleWithBallOk(x1, y1, R1, x2, y2, r2, R2)) count++;\n\t\t\tif (AreCircleWithBallOk(x2, y2, r2, x1, y1, r1, R1)) count++;\n\t\t\tif (AreCircleWithBallOk(x2, y2, R2, x1, y1, r1, R1)) count++;\n\t\t\t\n\n\t\t\tConsole.WriteLine(count);\n\n\n#if DEBUG\n\t\t\tConsole.ReadKey();\n#endif\n\n\t\t}\n\n\n\t\tstatic bool AreCircleWithBallOk(int x1, int y1, int rd1, int x2, int y2, int rd2, int Rd2) {\n\n\t\t\tbool res1 = !(AreBallsIntercect(x1, y1, rd1, x2, y2, rd2) ||\n\t\t\t\t\t\t AreBallsIntercect(x1, y1, rd1, x2, y2, Rd2));\n\n\t\t\tif (!res1) return false;\n\n\t\t\tdouble centersDist = Math.Sqrt((x2 - x1) * (x2 - x1) + (y2 - y1) * (y2 - y1));\n\n\t\t\tdouble t1 = centersDist + rd2;\n\t\t\tdouble t2 = rd1;\n\t\t\tdouble t3 = centersDist + Rd2;\n\t\t\tif (t1 < t2 && t2 < t3) return false;\n\n\t\t\tt1 = centersDist - Rd2;\n\t\t\tt2 = -rd1;\n\t\t\tt3 = centersDist - rd2;\n\t\t\tif (t1 < t2 && t2 < t3) return false;\n\n\t\t\treturn true;\n\n\t\t}\n\n\t\tstatic bool AreBallsIntercect(int x1, int y1, int rd1, int x2, int y2, int rd2) {\n\t\t\t\n\t\t\tdouble centersDist = Math.Sqrt((x2 - x1) * (x2 - x1) + (y2 - y1) * (y2 - y1));\n\n\t\t\tdouble l1 = -rd1;\n\t\t\tdouble r1 = rd1;\n\n\t\t\tdouble l2 = centersDist - rd2;\n\t\t\tdouble r2 = centersDist + rd2;\n\n\t\t\tif (r1 <= l2) return false;\n\t\t\tif (l1 <= l2 && r1 >= r2) return false;\n\t\t\tif (l2 <= l1 && r2 >= r1) return false;\n\n\t\t\treturn true;\n\n\t\t}\n\n\t}\n}\n", "lang": "Mono C#", "bug_code_uid": "a2451b8cd0ba7a6826e07d5858807198", "src_uid": "4c2865e4742a29460ca64860740b84f4", "apr_id": "9a369d6800a51ad6bc68451920ed2098", "difficulty": 1900, "tags": ["geometry"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.6285615010423905, "equal_cnt": 29, "replace_cnt": 17, "delete_cnt": 6, "insert_cnt": 6, "fix_ops_cnt": 29, "bug_source_code": "using System;\nusing System.Diagnostics.Contracts;\nusing System.Globalization;\nusing System.IO;\nusing System.Linq;\n\nnamespace Codeforces.R300\n{\n public static class C\n {\n const int MOD = 1000000007;\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 Contract.Requires(tr != null);\n Contract.Requires(tw != null);\n\n var info = CultureInfo.CurrentCulture;\n var abn = tr.ReadLine().Split().Select(x => int.Parse(x, info)).ToArray();\n\n var res = Calc(abn[0], abn[1], abn[2]);\n\n tw.WriteLine(res);\n }\n\n private static int Calc(int a, int b, int n)\n {\n var res = 0L;\n\n for (int i = 0; i <= n; ++i)\n {\n var sum = a * (n - i) + b * i;\n if (IsGood(a, b, sum))\n {\n res = (res + Combination(n, i)) % MOD;\n }\n }\n\n return (int)res;\n }\n\n public static int Combination(int n, int r)\n {\n var res = 1L;\n for (int i = 0; i < r; ++i)\n {\n res = res * (n - i) % MOD;\n }\n for (int i = 0; i < r; ++i)\n {\n res = ModDiv(res, r - i, MOD);\n }\n return (int)res % MOD;\n }\n\n public static long ModDiv(long res, int v, int mod)\n {\n return res * ModPow(v, mod - 2, mod) % mod;\n }\n\n public static long ModPow(long x, int n, int mod)\n {\n var res = 1L;\n for (; n > 0; n >>= 1)\n {\n if ((n & 1) == 1)\n {\n res = res * x % mod;\n }\n x = x * x % mod;\n }\n return res;\n }\n\n public static bool IsExcellent(int a, int b, int n)\n {\n return IsGood(a, b, n) && IsGood(a, b, SumDigits(n));\n }\n\n public static bool IsGood(int a, int b, int n)\n {\n for (; n > 0; n /= 10)\n {\n var lastDigit = n % 10;\n\n if (lastDigit != a && lastDigit != b)\n {\n return false;\n }\n }\n return true;\n }\n\n public static int SumDigits(int n)\n {\n var res = 0;\n\n for (; n > 0; n /= 10)\n {\n res += n % 10;\n }\n\n return res;\n }\n\n public static int Pow10(int n)\n {\n var res = 1;\n for (int i = 0; i < n; ++i)\n {\n res *= 10;\n }\n return res;\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "ce32459857a0d7d0eefd7a555f31133f", "src_uid": "d3e3da5b6ba37c8ac5f22b18c140ce81", "apr_id": "264b3a57d45e912bd41f51ec91e70686", "difficulty": 1800, "tags": ["brute force", "combinatorics"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.8239564428312159, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "using System;\n\nnamespace K\n{\n\tclass MainClass\n\t{\n\t\tpublic static void Main (string[] args)\n\t\t{\n\t\t\tlong N = long.Parse(Console.ReadLine());\n\t\t\tConsole.WriteLine(N - N / 2 - N / 3 - N / 5 - N / 7 + N / 6 + N / 10);\t\t\t\t\t\n\t\t}\n\t}\n}\n", "lang": "Mono C#", "bug_code_uid": "515ae10845145cb9bdcdbab0cf3a539f", "src_uid": "e392be5411ffccc1df50e65ec1f5c589", "apr_id": "28310c584dcc524c88c9e88ac04fc371", "difficulty": 1500, "tags": ["math", "number theory"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9985528219971056, "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;\n\nnamespace ChallengePennants\n{\n class Program\n {\n static void Main(string[] args)\n {\n string s = Console.ReadLine();\n long n = long.Parse(s);\n if (n <= 10)\n {\n Console.WriteLine(0);\n }\n else\n {\n long x = n / 2 + n / 3 + n / 5 + n / 7;\n x -= n / 6 + n / 10 + n / 14 + n / 15 + n / 21 + n / 35;\n x += n / 30 + n / 42 + n / 70 + n / 105;\n x -= n / 210;\n Console.WriteLine(\"{0:d}\", n - x);\n }\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "ec3ae49b2aa0f0cb5b6579cc0ecce2e9", "src_uid": "e392be5411ffccc1df50e65ec1f5c589", "apr_id": "50b5545aee768cc48de1d46eb66d4cca", "difficulty": 1500, "tags": ["math", "number theory"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.980498866213152, "equal_cnt": 10, "replace_cnt": 6, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 9, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\n\nnamespace ConsoleApp1\n{\n class Program\n {\n const int MAXN = 1000000007;\n static long QMul(long a, long b)\n {\n long res = 1;\n long tmp = a;\n\n while(b != 0)\n {\n if((b & 1) == 1)\n {\n res *= tmp;\n res %= MAXN;\n }\n tmp *= tmp;\n tmp %= MAXN;\n b >>= 1;\n }\n\n return res;\n }\n\n static void Main(string[] args)\n {\n string[] input = Console.ReadLine().Split(' ');\n int[] arr = input.Select(x => Convert.ToInt32(x)).ToArray();\n\n int n = arr[0];\n int m = arr[1];\n int k = arr[2];\n\n if(k == -1 && (n+m) % 2 == -1)\n {\n Console.WriteLine(\"0\");\n }\n else\n {\n Console.WriteLine(QMul(2, (m - 1) * (n - 1)).ToString());\n }\n }\n }\n}", "lang": "Mono C#", "bug_code_uid": "ed81a9b82139fddd79d6fa311b408def", "src_uid": "6b9eff690fae14725885cbc891ff7243", "apr_id": "e7740ddd2aa09282cf747b288fb3ada7", "difficulty": 1800, "tags": ["math", "combinatorics", "number theory", "constructive algorithms"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9850746268656716, "equal_cnt": 7, "replace_cnt": 5, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 6, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\n\nnamespace ConsoleApp1\n{\n class Program\n {\n const int MAXN = 1000000007;\n static long QMul(long a, long b)\n {\n long res = 1;\n long tmp = a;\n\n while(b != 0)\n {\n if((b & 1L) == 1)\n {\n res *= tmp;\n res %= MAXN;\n }\n tmp *= tmp;\n tmp %= MAXN;\n b >>= 1;\n }\n\n return res;\n }\n\n static void Main(string[] args)\n {\n string[] input = Console.ReadLine().Split(' ');\n int[] arr = input.Select(x => Convert.ToInt32(x)).ToArray();\n\n int n = arr[0];\n int m = arr[1];\n int k = arr[2];\n\n if(k == -1 && (n+m) % 2 == -1)\n {\n Console.WriteLine(\"0\");\n }\n else\n {\n Console.WriteLine(QMul(QMul(2, (m - 1)), (n - 1)).ToString());\n }\n }\n }\n}", "lang": "Mono C#", "bug_code_uid": "297e860fec97b68f21a86b7a88654806", "src_uid": "6b9eff690fae14725885cbc891ff7243", "apr_id": "e7740ddd2aa09282cf747b288fb3ada7", "difficulty": 1800, "tags": ["math", "combinatorics", "number theory", "constructive algorithms"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9991079393398751, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "using System;\n\nnamespace Olymp602A\n{\n class Program\n {\n static void Main(string[] args)\n {\n string[] input = Console.ReadLine().Split();\n byte n = byte.Parse(input[0]), bx = byte.Parse(input[1]);\n byte[] x = new byte[n];\n input = Console.ReadLine().Split();\n for (int i = 0; i < n; ++i) x[i] = byte.Parse(input[i]);\n\n input = Console.ReadLine().Split();\n byte m = byte.Parse(input[0]), by = byte.Parse(input[1]);\n byte[] y = new byte[n];\n input = Console.ReadLine().Split();\n for (int i = 0; i < m; ++i) y[i] = byte.Parse(input[i]);\n\n long X = 0, Y = 0;\n\n for (int i = 0; i < n; ++i) X += x[i] * (long)Math.Pow(bx, n - i - 1);\n for (int i = 0; i < m; ++i) Y += y[i] * (long)Math.Pow(by, m - i - 1);\n\n //Console.Write(X + \" \");\n if (X > Y) Console.Write('>');\n else if (X < Y) Console.Write('<');\n else Console.Write('=');\n //Console.WriteLine(\" \" + Y);\n Console.ReadLine();\n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "ee8e1d31415cd49b83fa60e694948dd1", "src_uid": "d6ab5f75a7bee28f0af2bf168a0b2e67", "apr_id": "a6eba0ac6728e5051df2f50accada67c", "difficulty": 1100, "tags": ["brute force", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9992401215805471, "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;\nusing System.Text.RegularExpressions;\nusing System.IO;\nusing System.Numerics;\nusing System.Globalization;\nusing System.Threading;\n\n\nnamespace probleme {\n class Program {\n static void Main(string[] args) {\n //Console.SetIn(new StreamReader(\"file.txt\"));\n string[] s = Console.ReadLine().Split(' ');\n int n = int.Parse(s[0]), bx = int.Parse(s[1]);\n long x = 0;\n int[] vx = Array.ConvertAll(Console.ReadLine().Split(' '), tz => int.Parse(tz));\n for (int i = 0; i < n; i++) {\n x *= bx;\n x += vx[i];\n }\n s = Console.ReadLine().Split(' ');\n int m = int.Parse(s[1]), by = int.Parse(s[1]);\n long y = 0;\n int[] vy = Array.ConvertAll(Console.ReadLine().Split(' '), tz => int.Parse(tz));\n for (int i = 0; i < m; i++) {\n y *= by;\n y += vy[i];\n }\n if (x == y) {\n Console.Write('=');\n } else if (x < y) {\n Console.Write('<');\n } else {\n Console.Write('>');\n }\n //Console.ReadKey();\n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "05e0cc8f238a939f90d92a376ce9c1f0", "src_uid": "d6ab5f75a7bee28f0af2bf168a0b2e67", "apr_id": "7fe610e39ae2d3aadc62f7cd4e18b329", "difficulty": 1100, "tags": ["brute force", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9215686274509803, "equal_cnt": 9, "replace_cnt": 5, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 8, "bug_source_code": "using System;\nusing System.Text;\n\nnamespace pr111\n{\n class Program\n {\n public static void Main(string[] args)\n { int a,b,c,n;string s; \n n=Convert.ToInt16(Console.ReadLine());\n int[] arr;\n arr= new int[24];\n a = 0; b =0; c =0;\n string[] line=Console.ReadLine().Split();\n for (int i=0; i=b&&a>=c) {s=\"chest\";} else {if(b>c){s=\"biceps\";} else {s=\"back\";}}\n Console.WriteLine(Convert.ToString(s));\n //Console.ReadKey(true);\n }\n }\n}", "lang": "Mono C#", "bug_code_uid": "2a62351e99d4b637a6f692a08005ef6c", "src_uid": "579021de624c072f5e0393aae762117e", "apr_id": "a1492da3ba442915c0189e5c5c8be33b", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9950319375443577, "equal_cnt": 6, "replace_cnt": 4, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 5, "bug_source_code": "using System;\nusing System.Linq;\nusing System.Collections.Generic;\nusing Debug = System.Diagnostics.Debug;\nusing SB = System.Text.StringBuilder;\nusing Number = System.Int64;\nusing static System.Math;\n//using static MathEx;\nnamespace Program\n{\n public class Solver\n {\n public void Solve()\n {\n var n = ri;\n var c = new char[n];\n var a = new int[n];\n var b = new int[n];\n for (int i = 0; i < n; i++)\n {\n c[i] = rc;\n a[i] = ri;\n b[i] = ri;\n }\n var dp = new int[1 << n, 15 * 16 / 2];\n for (int i = 0; i < 1 << n; i++)\n for (int j = 0; j < 15 * 16 / 2; j++)\n dp[i, j] = -1000000000;\n dp[0, 0] = 0;\n for (int i = 0; i < 1 << n; i++)\n for (int j = 0; j < 15 * 16 / 2; j++)\n {\n if (dp[i, j] < 0) continue;\n var u = 0;\n var v = 0;\n for (int k = 0; k < n; k++)\n {\n if ((i >> k & 1) == 1)\n {\n if (c[k] == 'R') u++;\n else v++;\n }\n }\n for (int k = 0; k < n; k++)\n {\n if ((i >> k & 1) == 0)\n {\n var x = Min(u, a[k]);\n var y = Min(v, b[k]);\n dp[i | 1 << k, j + x] = Max(dp[i | 1 << k, j + x], dp[i, j] + y);\n }\n }\n }\n var min = 1000000000;\n for (int i = 0; i < 15 * 16 / 2; i++)\n {\n var u = a.Sum() - i;\n var v = b.Sum() - dp[(1 << n) - 1, i];\n min = Min(min, Max(u, v));\n }\n IO.Printer.Out.WriteLine(min + n);\n }\n\n int ri => sc.Integer();\n long rl => sc.Long();\n double rd => sc.Double();\n string rs => sc.Scan();\n char rc => sc.Char();\n\n [System.Diagnostics.Conditional(\"DEBUG\")]\n void put(params object[] a) => Debug.WriteLine(string.Join(\" \", a));\n\n public IO.StreamScanner sc = new IO.StreamScanner(Console.OpenStandardInput());\n static T[] Enumerate(int n, Func f) { var a = new T[n]; for (int i = 0; i < n; ++i) a[i] = f(i); return a; }\n static public void Swap(ref T a, ref T b) { var tmp = a; a = b; b = tmp; }\n }\n}\n\n#region main\nstatic class Ex\n{\n static public string AsString(this IEnumerable ie) { return new string(System.Linq.Enumerable.ToArray(ie)); }\n static public string AsJoinedString(this IEnumerable ie, string st = \" \") { return string.Join(st, ie); }\n static public void Main()\n {\n var solver = new Program.Solver();\n solver.Solve();\n Program.IO.Printer.Out.Flush();\n }\n}\n#endregion\n#region Ex\nnamespace Program.IO\n{\n using System.IO;\n using System.Text;\n using System.Globalization;\n public class Printer: StreamWriter\n {\n static Printer() { Out = new Printer(Console.OpenStandardOutput()) { AutoFlush = false }; }\n public static Printer Out { get; set; }\n public override IFormatProvider FormatProvider { get { return CultureInfo.InvariantCulture; } }\n public Printer(System.IO.Stream stream) : base(stream, new UTF8Encoding(false, true)) { }\n public Printer(System.IO.Stream stream, Encoding encoding) : base(stream, encoding) { }\n public void Write(string format, T[] source) { base.Write(format, source.OfType().ToArray()); }\n public void WriteLine(string format, T[] source) { base.WriteLine(format, source.OfType().ToArray()); }\n }\n public class StreamScanner\n {\n public StreamScanner(Stream stream) { str = stream; }\n public readonly Stream str;\n private readonly byte[] buf = new byte[1024];\n private int len, ptr;\n public bool isEof = false;\n public bool IsEndOfStream { get { return isEof; } }\n private byte read()\n {\n if (isEof) return 0;\n if (ptr >= len) { ptr = 0; if ((len = str.Read(buf, 0, 1024)) <= 0) { isEof = true; return 0; } }\n return buf[ptr++];\n }\n public char Char() { byte b = 0; do b = read(); while ((b < 33 || 126 < b) && !isEof); return (char)b; }\n\n public string Scan()\n {\n var sb = new StringBuilder();\n for (var b = Char(); b >= 33 && b <= 126; b = (char)read())\n sb.Append(b);\n return sb.ToString();\n }\n public string ScanLine()\n {\n var sb = new StringBuilder();\n for (var b = Char(); b != '\\n'; b = (char)read())\n if (b == 0) break;\n else if (b != '\\r') sb.Append(b);\n return sb.ToString();\n }\n public long Long()\n {\n if (isEof) return long.MinValue;\n long ret = 0; byte b = 0; var ng = false;\n do b = read();\n while (b != 0 && b != '-' && (b < '0' || '9' < b));\n if (b == 0) return long.MinValue;\n if (b == '-') { ng = true; b = read(); }\n for (; true; b = read())\n {\n if (b < '0' || '9' < b)\n return ng ? -ret : ret;\n else ret = ret * 10 + b - '0';\n }\n }\n public int Integer() { return (isEof) ? int.MinValue : (int)Long(); }\n public double Double() { var s = Scan(); return s != \"\" ? double.Parse(s, CultureInfo.InvariantCulture) : double.NaN; }\n private T[] enumerate(int n, Func f)\n {\n var a = new T[n];\n for (int i = 0; i < n; ++i) a[i] = f();\n return a;\n }\n\n public char[] Char(int n) { return enumerate(n, Char); }\n public string[] Scan(int n) { return enumerate(n, Scan); }\n public double[] Double(int n) { return enumerate(n, Double); }\n public int[] Integer(int n) { return enumerate(n, Integer); }\n public long[] Long(int n) { return enumerate(n, Long); }\n }\n}\n#endregion\n\n\n", "lang": "MS C#", "bug_code_uid": "377bc7e00adc56890766958d4b61a0d1", "src_uid": "25a77f2b7cb281ff3c7800a20b3e5969", "apr_id": "be285e9584c5dd872e37441350fe4196", "difficulty": 2400, "tags": ["dp", "brute force", "bitmasks"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.808870116156283, "equal_cnt": 14, "replace_cnt": 6, "delete_cnt": 3, "insert_cnt": 4, "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 nonSquareEquation\n{\n class Program\n {\n static ulong sum(ulong n)\n {\n ulong sum = 0;\n while (n>0)\n {\n sum += n % 10;\n n /= 10;\n }\n return sum;\n }\n static void Main(string[] args)\n {\n ulong n = ulong.Parse(Console.ReadLine());\n ulong max_number = (ulong)Math.Sqrt(n);\n int number = -1;\n for (ulong i=1;i<=max_number;i++)\n if (i*i+sum(i)*i==n)\n {\n number = (int)i;\n break;\n }\n Console.WriteLine(number);\n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "bd4d11527a46566f177ed78aaec14d20", "src_uid": "e1070ad4383f27399d31b8d0e87def59", "apr_id": "711bfa6cd282034ba0ec8d8d6ea9bc47", "difficulty": 1400, "tags": ["math", "brute force", "binary search"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.992081974848626, "equal_cnt": 4, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 3, "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 nonSquareEquation\n{\n class Program\n {\n static long sum(long n)\n {\n long sum = 0;\n while (n>0)\n {\n sum += n % 10;\n n /= 10;\n }\n return sum;\n }\n static void Main(string[] args)\n {\n long n = long.Parse(Console.ReadLine());\n long max_number = (long)Math.Sqrt(n);\n int maxDigitSum = 0;\n long k = max_number;\n while (k>0)\n {\n maxDigitSum += 9;\n k /= 10;\n }\n long p = max_number - (long)maxDigitSum;\n long number = -1;\n for (long i = p; i <= max_number;i++)\n if (n%i==0 && i+sum(i)==n/i)\n {\n number = (long)i;\n break;\n }\n Console.WriteLine(number);\n \n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "adf3c571e1fbd389c59ce8770d4e6a19", "src_uid": "e1070ad4383f27399d31b8d0e87def59", "apr_id": "711bfa6cd282034ba0ec8d8d6ea9bc47", "difficulty": 1400, "tags": ["math", "brute force", "binary search"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.7540740740740741, "equal_cnt": 29, "replace_cnt": 5, "delete_cnt": 23, "insert_cnt": 1, "fix_ops_cnt": 29, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace cf233B\n{\n class Program\n {\n static long sum(long n)\n {\n long r = 0;\n while (n > 0)\n {\n r += n % 10;\n n /= 10;\n }\n return r;\n }\n static void Main(string[] args)\n {\n var n = long.Parse(Console.ReadLine());\n for (long i = (long)Math.Sqrt(n)/2; i < (long)Math.Sqrt(n) * 2; i++)\n {\n if (i * i + sum(i) * i == n)\n {\n Console.WriteLine(i);\n return;\n }\n }\n Console.WriteLine(-1);\n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "f58834915122625a3fb28a3d7dc82780", "src_uid": "e1070ad4383f27399d31b8d0e87def59", "apr_id": "5a35a06928a5f87b0ad83947a03dcbf7", "difficulty": 1400, "tags": ["math", "brute force", "binary search"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "delete", "lang_cluster": "C#"} {"similarity_score": 0.999003984063745, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\n\nnamespace CodeForce\n{\n class _38b\n {\n public static void Main()\n {\n var fig = new string[2];\n fig[0] = Console.ReadLine();\n fig[1] = Console.ReadLine();\n var board = new bool[8,8];\n for (var i = 0; i < 8; i++)\n {\n board[i, fig[0][0] - 'a'] = true;\n board[fig[0][1] - '1', i] = true;\n }\n var d1 = new[] {1, -1};\n var d2 = new[] {2, -2};\n board[fig[1][1] - '1', fig[1][0] - 'a'] = true;\n for (var i = 0; i < 2; i++)\n {\n for (var j = 0; j < 2; j++)\n {\n for (var k = 0; k < 2; k++)\n {\n var dx = d1[j];\n var dy = d2[k];\n var x = fig[i][0] - 'a' + dx;\n var y = fig[i][1] - '1' + dy;\n if (x >= 0 && y >= 0 && x < 8 && y < 8)\n {\n board[y, x] = true;\n }\n\n dx = d2[k];\n dy = d1[j];\n x = fig[i][0] - 'a' + dx;\n y = fig[i][1] - '1' + dy;\n if (x >= 0 && y >= 0 && x < 8 && y < 8)\n {\n board[y, x] = true;\n }\n }\n }\n }\n var result = 0;\n for (var i = 0; i < 8; i++)\n {\n for (var j = 0; j < 8; j++)\n {\n Console.Write(board[i, j] ? 'x' : 'o');\n if (!board[i,j])\n {\n result++;\n }\n }\n Console.WriteLine();\n }\n Console.WriteLine(result);\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "0d6304a4127b71aa0b19c49bf27b65f9", "src_uid": "073023c6b72ce923df2afd6130719cfc", "apr_id": "03760591a308f0adbe1ca2622714cd81", "difficulty": 1200, "tags": ["math", "brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.9997612225405922, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "//#undef DEBUG\n\nusing System;\nusing System.Collections.Generic;\nusing System.Text;\nusing System.Diagnostics;\n\nnamespace codeforces\n{\n class C\n {\n // test\n static CodeforcesUtils CF = new CodeforcesUtils(\n@\"\na1\nb2\n\");\n\n class Solver\n {\n public void Solve()\n {\n string s = CF.ReadLine();\n int r1 = s[0] - 'a'+1;\n int r2 = s[1] - '1'+1;\n s = CF.ReadLine();\n int k1 = s[0] - 'a'+1;\n int k2 = s[1] - '1'+1;\n\n b = new int[10, 10];\n for (int i = 1; i <=8; i++)\n {\n b[r1, i] = 1;\n b[i, r2] = 1;\n }\n\n b[k1, k2] = 1;\n\n for (int i = -2; i <= 2; i++)\n {\n if (i == 0)\n continue;\n\n bs(r1 + i, r2 + (3 - Math.Abs(i)) );\n bs(r1 + i, r2 -(3 - Math.Abs(i)) );\n bs(k1 + i, k2 + 3 - Math.Abs(i) );\n bs(k1 + i, k2 - (3 - Math.Abs(i)));\n }\n\n int a = 8 * 8;\n for (int i = 1; i <= 8; i++)\n {\n for (int j = 1; j <= 8; j++)\n {\n a -= b[i, j];\n }\n }\n\n CF.WriteLine(a);\n }\n\n int[,] b;\n\n void bs(int x, int y)\n {\n if (x < 1 || y > 8)\n return;\n if (y < 1 || y > 8)\n return;\n b[x, y] = 1;\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": "7358b43eecc63fdfbd1305b3877fac1c", "src_uid": "073023c6b72ce923df2afd6130719cfc", "apr_id": "4d977888072e304685e6a7fa154f614e", "difficulty": 1200, "tags": ["math", "brute force", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9700787401574803, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "using System;\n\nclass A448 {\n public static void Main() {\n var a = Console.ReadLine().Split().Sum(int.Parse);\n var b = Console.ReadLine().Split().Sum(int.Parse);\n var n = int.Parse(Console.ReadLine());\n Console.WriteLine((a + 4) / 5 + (b + 9) / 10 <= n ? \"YES\" : \"NO\");\n }\n}\n", "lang": "MS C#", "bug_code_uid": "4768b7a63312c08cc276ea91982a95a5", "src_uid": "fe6301816dea7d9cea1c3a06a7d1ea7e", "apr_id": "05be3b533295ba33163d3e26a264f66d", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.9950248756218906, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace Preparation\n{\n public class CodeForces710A\n {\n public void Main(string[] args)\n {\n var str = Console.ReadLine();\n if(str[0] == 'a' && str[1] == '1' ||\n str[0] == 'a' && str[1] == '8' ||\n str[0] == 'h' && str[1] == '1' ||\n str[0] == 'h' && str[1] == '8')\n Console.WriteLine(3);\n else if(str[0] == 'h' || str[1] == '8' || str[0] == 'a' || str[1] == '1')\n Console.WriteLine(5);\n else\n Console.WriteLine(8);\n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "45e6a17bd7f61195c53cb86973609aa0", "src_uid": "6994331ca6282669cbb7138eb7e55e01", "apr_id": "226de5b8cf2b1d796e8c710a02afbe75", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.9653991092840014, "equal_cnt": 12, "replace_cnt": 11, "delete_cnt": 1, "insert_cnt": 0, "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 ConsoleApplication2\n{\n class Program\n {\n static void Main(string[] args)\n {\n\n\n for (; ; )\n {\n string a = Console.ReadLine();\n if ((a[0] == 'a' && (a[1] == '8' || a[1] == '1')) || (a[0] == 'h' && (a[1] == '8' || a[1] == '1')))\n {\n Console.WriteLine(3);\n continue;\n }\n if ((a[0] == 'a' && (a[1] < '8' && a[1] > '1')) || (a[0] == 'h' && (a[1] < '8' && a[1] > '1')))\n {\n Console.WriteLine(5);\n continue;\n }\n if ((a[0] == '1' && (a[1] < 'h' && a[1] > 'a')) || (a[0] == '8' && (a[1] < 'h' && a[1] > 'a')))\n {\n Console.WriteLine(5);\n continue;\n }\n if (((a[0] > 'a' && a[0] < 'h') && a[1] == '8') || ((a[0] > 'a' && a[0] < 'h') && a[1] == '1'))\n {\n Console.WriteLine(5);\n continue;\n }\n if (((a[0] > '1' && a[0] < '8') && a[1] == 'a') || ((a[0] > '1' && a[0] < '8') && a[1] == 'h'))\n {\n Console.WriteLine(5);\n continue;\n }\n Console.WriteLine(8);\n }\n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "9bbd3a68df97bbdda8f3cdb15ca4a2b0", "src_uid": "6994331ca6282669cbb7138eb7e55e01", "apr_id": "2d9e6f3d11e4eec515125a2f1d4a7adc", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.7076109315310021, "equal_cnt": 40, "replace_cnt": 11, "delete_cnt": 2, "insert_cnt": 26, "fix_ops_cnt": 39, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace ConsoleApp6\n{\n class Program\n {\n static void Main(string[] args)\n {\n string[] Input = Console.ReadLine().Split(' ');\n int a = 1;\n int b = 1;\n string c = \"\";\n string d = \"\";\n if (Input[0].Length >= 8)\n {\n for (var j = 0; j < 8; j++)\n {\n c += Input[0][Input[0].Length - 8 + j];\n }\n }\n else\n {\n c = Input[0];\n }\n if (Input[1].Length >= 8)\n {\n for (var j = 0; j < 8; j++)\n {\n d += Input[1][Input[1].Length - 8 + j];\n }\n }\n else\n {\n {\n d = Input[1];\n }\n }\n a = Convert.ToInt32(c);\n b = Convert.ToInt32(d);\n int result = 1;\n if (a == 0 || b == 0)\n {\n result = 0;\n }\n for (int i = a + 1; i <= b; i++)\n {\n result = Convert.ToInt32(Convert.ToString(Convert.ToString(result)[Convert.ToString(result).Length - 1]))%100;\n\n if (i == 0 || result == 0)\n {\n result = 0;\n continue;\n }\n else\n {\n result *= Convert.ToInt32(Convert.ToString(Convert.ToString(i)[Convert.ToString(i).Length - 1]))%100;\n }\n }\n string ans = Convert.ToString(result);\n Console.WriteLine(ans[ans.Length - 1]);\n\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "3835b75723ca5b556bc03300ff286026", "src_uid": "2ed5a7a6176ed9b0bda1de21aad13d60", "apr_id": "8966766536243ed13ec385154f70626a", "difficulty": 1100, "tags": ["math"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.8323603002502085, "equal_cnt": 6, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 5, "bug_source_code": "using System;\n\nnamespace _869_B\n{\n class MyClass\n {\n static void Main(string[] args)\n {\n string[] s = Console.ReadLine().Split();\n ulong a = ulong.Parse(s[0]), b = ulong.Parse(s[1]), Ans;\n if (b == a) Ans = 1;\n else\n {\n ulong result = 1;\n for (ulong i = a+1; i <= b; i++)\n result = result * (i%10);\n Ans = result;\n }\n Console.WriteLine(Ans%10);\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "7cb8f88e8ff57768938e23ca980c81b1", "src_uid": "2ed5a7a6176ed9b0bda1de21aad13d60", "apr_id": "06859f3d1553801d7541218aee096080", "difficulty": 1100, "tags": ["math"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.9744463373083475, "equal_cnt": 7, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 4, "fix_ops_cnt": 6, "bug_source_code": "using System;\nclass Program\n {\n static void Main(string[] args)\n {\n long a, b, lstTkn = 1;\n {\n string[] input = Console.ReadLine().Split(new char[] { ' ', '\\t'}, StringSplitOptions.RemoveEmptyEntries);\n a = int.Parse(input[0]);\n b = int.Parse(input[1]);\n if (a == 0) { a++; if (b == 0) b++; }\n }\n while(++a<=b)\n {\n lstTkn *= (a%10);\n lstTkn %= 10;\n }\n Console.WriteLine(lstTkn);\n }\n }", "lang": "Mono C#", "bug_code_uid": "1952bd3f4dae19feb717738655f177f5", "src_uid": "2ed5a7a6176ed9b0bda1de21aad13d60", "apr_id": "1f812960fbd62c794da8bf4cc5e49e79", "difficulty": 1100, "tags": ["math"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.7301173402868318, "equal_cnt": 6, "replace_cnt": 3, "delete_cnt": 3, "insert_cnt": 0, "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 string[]y=Console.ReadLine().Split(' ');\n int[]a=new int[3];\n a[0]=int.Parse(y[0]);\n a[1]=int.Parse(y[1]);\n a[2]=int.Parse(y[2]);\n int n=int.Parse(y[3]);\n Array.Sort(a);\n int o1=a[1]-n;\n int o2=a[1]+n;\n int t=0;\n while(a[0]>o1)\n {\n a[0]--;\n t++;\n }\n while(a[2](3) { a, b, c };\n list.Sort();\n var left = d - (list[1] - list[0]);\n var right = d - (list[2] - list[1]);\n Console.WriteLine(left + right);\n }\n\n \n }\n}", "lang": "Mono C#", "bug_code_uid": "dddd441866ce11974e4370c90984d93c", "src_uid": "47c07e46517dbc937e2e779ec0d74eb3", "apr_id": "0263d597ac05f953dd14cf632f6099eb", "difficulty": 800, "tags": ["math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.8801020408163265, "equal_cnt": 4, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 3, "bug_source_code": "using System;\nusing System.Linq;\n\nnamespace CSharp\n{\n public class _478C\n {\n public static void Main()\n {\n int[] counts = Console.ReadLine().Split().Select(token => int.Parse(token)).ToArray();\n\n int sum = counts.Sum();\n int max = counts.Max();\n\n Console.WriteLine(2 * sum >= 3 * max ? sum / 3 : sum - max);\n }\n }\n}", "lang": "Mono C#", "bug_code_uid": "98d2c90e527129d3feb2913b8f757069", "src_uid": "bae7cbcde19114451b8712d6361d2b01", "apr_id": "2a5864f1d2f2a5acae5f98b0b978588e", "difficulty": 1800, "tags": ["greedy"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.7854297097324986, "equal_cnt": 11, "replace_cnt": 8, "delete_cnt": 0, "insert_cnt": 2, "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 CodeForce\n{\n class Program\n {\n static void Main(string[] args)\n {\n int s, v1, v2, t1, t2;\n s = int.Parse(Console.ReadLine());\n v1 = int.Parse(Console.ReadLine());\n v2 = int.Parse(Console.ReadLine());\n t1 = int.Parse(Console.ReadLine());\n t2 = int.Parse(Console.ReadLine());\n\n int sum1 = 0;\n int sum2 = 0;\n\n sum1 = v1 * s + 2 * t1;\n sum2 = v2 * s + 2 * t2;\n\n if (sum1 < sum2) \n Console.WriteLine(\"First\");\n\n if (sum2 < sum1)\n Console.WriteLine(\"Second\");\n\n if(sum1 == sum2)\n Console.WriteLine(\"Friendship\");\n\n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "913b08796a0ca1102e47d398f73e2b48", "src_uid": "10226b8efe9e3c473239d747b911a1ef", "apr_id": "eefad7aca8dac674958f57833c1e006c", "difficulty": 800, "tags": ["math"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.8573667711598746, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 2, "insert_cnt": 0, "fix_ops_cnt": 3, "bug_source_code": "using System;\nusing System.Linq;\n\npublic class Program\n{\n public static void Main(string[] args)\n {\n var input = args[0].Split().Select(x => Convert.ToInt32(x)).ToList();\n var s = input[0];\n var v1 = input[1];\n var v2 = input[2];\n var t1 = input[3];\n var t2 = input[4];\n var r1 = t1 * 2 + s * v1;\n var r2 = t2 * 2 + s * v2;\n if (r1 < r2)\n {\n Console.WriteLine(\"First\");\n }\n else if (r1 > r2)\n {\n Console.WriteLine(\"Second\");\n }\n else\n {\n Console.WriteLine(\"Friendship\");\n }\n }\n}", "lang": "MS C#", "bug_code_uid": "ed0f8e877300bfa682b43f8097f52ca7", "src_uid": "10226b8efe9e3c473239d747b911a1ef", "apr_id": "c405b30369f444e27b43b4b6dc0443e3", "difficulty": 800, "tags": ["math"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C#"} {"similarity_score": 0.9406979233568828, "equal_cnt": 11, "replace_cnt": 7, "delete_cnt": 3, "insert_cnt": 0, "fix_ops_cnt": 10, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\n\nnamespace SortingProblems\n{\n class Program\n {\n static void Main(string[] args)\n {\n List list = new List();\n int length = Convert.ToInt32(Console.ReadLine());\n for (int i = 0; i < length; i++)\n {\n list.Add(Convert.ToInt32(Console.ReadLine()));\n }\n var sorted = SortMerge(list);\n int current = 0;\n for (int i = 0; i < sorted.Count; i = i + 2)\n {\n current += sorted[i + 1] - sorted[i];\n }\n Console.WriteLine(current);\n }\n\n static List SortMerge(List list)\n {\n if (list.Count <= 1) return list;\n List left = new List();\n List right = new List();\n\n for (int i = 0; i < list.Count / 2; i++)\n {\n left.Add(list[i]);\n }\n\n for (int i = list.Count / 2; i < list.Count; i++)\n {\n right.Add(list[i]);\n }\n\n left = SortMerge(left);\n right = SortMerge(right);\n return Merge(left, right);\n }\n\n static List Merge(List left, List right)\n {\n List merged = new List();\n while (left.Count > 0 || right.Count > 0)\n {\n if (left.Count > 0 && right.Count > 0)\n {\n if (left.First() <= right.First())\n {\n merged.Add(left.First());\n left.Remove(left.First());\n }\n else\n {\n merged.Add(right.First());\n right.Remove(right.First());\n }\n }\n else if (left.Count > 0)\n {\n merged.Add(left.First());\n left.Remove(left.First());\n }\n else if (right.Count > 0)\n {\n merged.Add(right.First());\n right.Remove(right.First());\n }\n }\n return merged;\n }\n\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "c180f7edec74dc0761c786225b28e889", "src_uid": "55485fe203a114374f0aae93006278d3", "apr_id": "d6bdee3c014d70a43a19911320569b3c", "difficulty": 800, "tags": ["sortings"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9473170731707317, "equal_cnt": 6, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 5, "bug_source_code": "using System.Collections.Generic;\nusing System;\nnamespace ProblemToAlgorithms\n{\nclass Solution\n{\n public static int arrayManipulation(List list)\n {\n int sum = 0;\n for (int i = 0; i < list.Count; i++)\n {\n var next = list[i];\n int j = i - 1;\n while (j >= 0 && list[j] > next)\n {\n list[j + 1] = list[j];\n --j;\n }\n list[j + 1] = next;\n }\n for (int i = 0; i < list.Count; i += 2)\n {\n sum = sum + list[i + 1] - list[i];\n }\n return sum;\n }\n\n\n static void Main(string[] args)\n {\n List list = new List();\n string t = Console.ReadLine();\n String []coll = t.Split(' ');\n foreach (var item in coll)\n {\n list.Add(Int32.Parse(item));\n }\n var i = Solution.arrayManipulation(list);\n Console.WriteLine(i);\n \n }\n}\n \n}", "lang": "Mono C#", "bug_code_uid": "759ce37112f56d5f6454e9a5887750de", "src_uid": "55485fe203a114374f0aae93006278d3", "apr_id": "84806a7271749a4e94ed728dc4de0ad3", "difficulty": 800, "tags": ["sortings"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.9730392156862745, "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.IO;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace _112_b\n{\n\tclass Program\n\t{\n\t\tstatic void Main(string[] args)\n\t\t{\n\t\t\tConsole.SetIn(File.OpenText(\"in.txt\"));\n\t\t\tvar d = Console.ReadLine().Split(' ').Select(l => int.Parse(l)).ToArray();\n\t\t\tvar n = d[0];\n\t\t\tvar k = d[1];\n\n\t\t\tvar min = 0;\n\t\t\tvar max = n;\n\t\t\twhile (true)\n\t\t\t{\n\t\t\t\tif (min == max)\n\t\t\t\t{\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tvar m = min + (max - min) / 2;\n\t\t\t\tvar written = m;\n\t\t\t\tvar koeff = k;\n\t\t\t\twhile (true)\n\t\t\t\t{\n\t\t\t\t\tvar next = m / koeff;\n\t\t\t\t\tif (next == 0)\n\t\t\t\t\t{\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\tkoeff *= k;\n\t\t\t\t\twritten += next;\n\t\t\t\t}\n\n\t\t\t\tif (written >= n)\n\t\t\t\t{\n\t\t\t\t\tmax = m;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tmin = m + 1;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tConsole.WriteLine(min);\n\t\t}\n\t}\n}\n", "lang": "MS C#", "bug_code_uid": "9dce003d04bf0930e8e78ac76e862fe1", "src_uid": "41dfc86d341082dd96e089ac5433dc04", "apr_id": "511d22f5de802cc85a14446a5b84eaed", "difficulty": 1500, "tags": ["implementation", "binary search"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9482090428655314, "equal_cnt": 14, "replace_cnt": 7, "delete_cnt": 3, "insert_cnt": 3, "fix_ops_cnt": 13, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Globalization;\nusing System.IO;\nusing System.Linq;\nusing System.Text;\nusing System.Numerics;\npublic class Codeforces\n{\n protected static TextReader reader;\n protected static TextWriter writer;\n static object Solve()\n {\n var n = ReadLong();\n var k = ReadLong();\n var v = 0L;\n var r = 0L;\n for (long i = n; i > 0; i--)\n {\n var kk = 1L;\n r = 0L;\n v = i;\n while (v / kk > 0)\n {\n r += v / kk;\n kk *= k;\n }\n if (r <= n)\n {\n break;\n }\n }\n Write(r == n ? v : v + 1);\n return null;\n }\n static void Main()\n {\n reader = new StreamReader(Console.OpenStandardInput(1024 * 10), System.Text.Encoding.ASCII, false, 1024 * 10);\n writer = new StreamWriter(Console.OpenStandardOutput(1024 * 10), System.Text.Encoding.ASCII, 1024 * 10);\n try\n {\n object result = Solve();\n if (result != null)\n writer.WriteLine(result);\n }\n catch (Exception ex)\n {\n Console.WriteLine(ex);\n throw;\n }\n reader.Close();\n writer.Close();\n }\n #region Read / Write\n\n private static Queue currentLineTokens = new Queue();\n\n private static string[] ReadAndSplitLine()\n {\n return reader.ReadLine().Split(new[] { ' ', '\\t' }, StringSplitOptions.RemoveEmptyEntries);\n }\n\n public static string ReadToken()\n {\n while (currentLineTokens.Count == 0)\n currentLineTokens = new Queue(ReadAndSplitLine());\n return currentLineTokens.Dequeue();\n }\n\n public static int ReadInt()\n {\n return int.Parse(ReadToken());\n }\n\n public static long ReadLong()\n {\n return long.Parse(ReadToken());\n }\n\n public static double ReadDouble()\n {\n return double.Parse(ReadToken(), CultureInfo.InvariantCulture);\n }\n\n public static int[] ReadIntArray()\n {\n return ReadAndSplitLine().Select(int.Parse).ToArray();\n }\n\n public static long[] ReadLongArray()\n {\n return ReadAndSplitLine().Select(long.Parse).ToArray();\n }\n\n public static double[] ReadDoubleArray()\n {\n return ReadAndSplitLine().Select(s => double.Parse(s, CultureInfo.InvariantCulture)).ToArray();\n }\n public static int[][] ReadIntMatrix(int numberOfRows)\n {\n int[][] matrix = new int[numberOfRows][];\n for (int i = 0; i < numberOfRows; i++)\n matrix[i] = ReadIntArray();\n return matrix;\n }\n public static int[][] ReadAndTransposeIntMatrix(int numberOfRows)\n {\n int[][] matrix = ReadIntMatrix(numberOfRows);\n int[][] ret = new int[matrix[0].Length][];\n for (int i = 0; i < ret.Length; i++)\n {\n ret[i] = new int[numberOfRows];\n for (int j = 0; j < numberOfRows; j++)\n ret[i][j] = matrix[j][i];\n }\n return ret;\n }\n\n public static string[] ReadLines(int quantity)\n {\n string[] lines = new string[quantity];\n for (int i = 0; i < quantity; i++)\n lines[i] = reader.ReadLine().Trim();\n return lines;\n }\n public static void WriteArray(IEnumerable array)\n {\n writer.WriteLine(string.Join(\" \", array));\n }\n\n public static void Write(params T[] array)\n {\n WriteArray(array);\n }\n\n public static void WriteLines(IEnumerable array)\n {\n foreach (var a in array)\n writer.WriteLine(a);\n }\n 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 != '-' && (c < '0' || c > '9'));\n int sign = 1;\n if (c == '-')\n {\n sign = -1;\n c = reader.Read();\n }\n res = c - '0';\n while (true)\n {\n c = reader.Read();\n if (c < '0' || c > '9')\n return res * sign;\n res *= 10;\n res += c - '0';\n }\n }\n #endregion\n}", "lang": "MS C#", "bug_code_uid": "d648192d57b5d982f132394d4b61cb03", "src_uid": "41dfc86d341082dd96e089ac5433dc04", "apr_id": "e57b475e16389768caa324ab50408a6f", "difficulty": 1500, "tags": ["implementation", "binary search"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9471463729051917, "equal_cnt": 15, "replace_cnt": 8, "delete_cnt": 3, "insert_cnt": 3, "fix_ops_cnt": 14, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Globalization;\nusing System.IO;\nusing System.Linq;\nusing System.Text;\nusing System.Numerics;\npublic class Codeforces\n{\n protected static TextReader reader;\n protected static TextWriter writer;\n static object Solve()\n {\n var n = ReadLong();\n var k = ReadLong();\n var v = 0L;\n var r = 0L;\n for (long i = n / v + n / (v * v); i > 0; i--)\n {\n var kk = 1L;\n r = 0L;\n v = i;\n while (v / kk > 0)\n {\n r += v / kk;\n kk *= k;\n }\n if (r <= n)\n {\n break;\n }\n }\n Write(r == n ? v : v + 1);\n return null;\n }\n static void Main()\n {\n reader = new StreamReader(Console.OpenStandardInput(1024 * 10), System.Text.Encoding.ASCII, false, 1024 * 10);\n writer = new StreamWriter(Console.OpenStandardOutput(1024 * 10), System.Text.Encoding.ASCII, 1024 * 10);\n try\n {\n object result = Solve();\n if (result != null)\n writer.WriteLine(result);\n }\n catch (Exception ex)\n {\n Console.WriteLine(ex);\n throw;\n }\n reader.Close();\n writer.Close();\n }\n #region Read / Write\n\n private static Queue currentLineTokens = new Queue();\n\n private static string[] ReadAndSplitLine()\n {\n return reader.ReadLine().Split(new[] { ' ', '\\t' }, StringSplitOptions.RemoveEmptyEntries);\n }\n\n public static string ReadToken()\n {\n while (currentLineTokens.Count == 0)\n currentLineTokens = new Queue(ReadAndSplitLine());\n return currentLineTokens.Dequeue();\n }\n\n public static int ReadInt()\n {\n return int.Parse(ReadToken());\n }\n\n public static long ReadLong()\n {\n return long.Parse(ReadToken());\n }\n\n public static double ReadDouble()\n {\n return double.Parse(ReadToken(), CultureInfo.InvariantCulture);\n }\n\n public static int[] ReadIntArray()\n {\n return ReadAndSplitLine().Select(int.Parse).ToArray();\n }\n\n public static long[] ReadLongArray()\n {\n return ReadAndSplitLine().Select(long.Parse).ToArray();\n }\n\n public static double[] ReadDoubleArray()\n {\n return ReadAndSplitLine().Select(s => double.Parse(s, CultureInfo.InvariantCulture)).ToArray();\n }\n public static int[][] ReadIntMatrix(int numberOfRows)\n {\n int[][] matrix = new int[numberOfRows][];\n for (int i = 0; i < numberOfRows; i++)\n matrix[i] = ReadIntArray();\n return matrix;\n }\n public static int[][] ReadAndTransposeIntMatrix(int numberOfRows)\n {\n int[][] matrix = ReadIntMatrix(numberOfRows);\n int[][] ret = new int[matrix[0].Length][];\n for (int i = 0; i < ret.Length; i++)\n {\n ret[i] = new int[numberOfRows];\n for (int j = 0; j < numberOfRows; j++)\n ret[i][j] = matrix[j][i];\n }\n return ret;\n }\n\n public static string[] ReadLines(int quantity)\n {\n string[] lines = new string[quantity];\n for (int i = 0; i < quantity; i++)\n lines[i] = reader.ReadLine().Trim();\n return lines;\n }\n public static void WriteArray(IEnumerable array)\n {\n writer.WriteLine(string.Join(\" \", array));\n }\n\n public static void Write(params T[] array)\n {\n WriteArray(array);\n }\n\n public static void WriteLines(IEnumerable array)\n {\n foreach (var a in array)\n writer.WriteLine(a);\n }\n 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 != '-' && (c < '0' || c > '9'));\n int sign = 1;\n if (c == '-')\n {\n sign = -1;\n c = reader.Read();\n }\n res = c - '0';\n while (true)\n {\n c = reader.Read();\n if (c < '0' || c > '9')\n return res * sign;\n res *= 10;\n res += c - '0';\n }\n }\n #endregion\n}", "lang": "MS C#", "bug_code_uid": "97d164f9402b3ac008da39c4a3738043", "src_uid": "41dfc86d341082dd96e089ac5433dc04", "apr_id": "e57b475e16389768caa324ab50408a6f", "difficulty": 1500, "tags": ["implementation", "binary search"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9986772486772487, "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\nnamespace NetExperiment\n{\n class Program\n {\n static void Main(string[] args)\n {\n int[] nm = Console.ReadLine().Split().Select(s => int.Parse(s)).ToArray();\n int n = nm[0];\n int m = nm[1];\n int[] b = Console.ReadLine().Split().Select(s => int.Parse(s)).ToArray();\n int[] ind = new int[5];\n for(int i = 0; i < m; i++)\n {\n int k = b[i] - 1;\n while(k < n)\n {\n if (ind[k] == 0)\n ind[k] = b[i];\n k++;\n }\n }\n foreach (var i in ind)\n Console.Write(i + \" \");\n }\n }\n}", "lang": "Mono C#", "bug_code_uid": "4f9b08343841166791900b211a88fc56", "src_uid": "2e44c8aabab7ef7b06bbab8719a8d863", "apr_id": "a13bc2e4f141f849ffe208670c6c6263", "difficulty": 900, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.30449251247920134, "equal_cnt": 22, "replace_cnt": 12, "delete_cnt": 6, "insert_cnt": 4, "fix_ops_cnt": 22, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace CrazyComputer\n{\n class Program\n {\n static void Main(string[] args)\n {\n int[] arr1 = new int[2];\n int[] arr2 = new int[arr1[0]];\n\n arr1 = Array.ConvertAll( Console.ReadLine().Split(' '), int.Parse);\n arr2 = Array.ConvertAll(Console.ReadLine().Split(' '), int.Parse);\n\n int counter = 0;\n for (int i = 1; i < arr1[0]; i++)\n {\n \n if (arr2[i] - arr2[i - 1] <= arr1[1])\n counter++;\n else\n counter = 0;\n \n }\n counter++;\n Console.WriteLine(counter);\n\n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "567f980f8be7d56f552771c2e900620b", "src_uid": "ecc890b3bdb9456441a2a265c60722dd", "apr_id": "5c2b8ac2be099a30983ca3c67d07ce13", "difficulty": 800, "tags": ["strings", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.5534391534391534, "equal_cnt": 14, "replace_cnt": 10, "delete_cnt": 3, "insert_cnt": 1, "fix_ops_cnt": 14, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace _743B {\n class Program {\n static void Main(string[] args) {\n\n int n = 0;\n int k = 0;\n\n string argLine = Console.ReadLine();\n string[] argString = argLine.Split(' ');\n\n n = Int32.Parse(argString[0]);\n k = Int32.Parse(argString[1]);\n\n List numSequence = new List();\n\n string sequence = \"\";\n for (int i = 1; i <= n; i++) {\n if (i == 1) {\n numSequence.Add(1);\n }\n else {\n numSequence.Add(i);\n numSequence.AddRange(numSequence.GetRange(0, numSequence.Count - 1));\n\n }\n }\n\n Console.WriteLine(numSequence.ElementAt(k-1));\n\n\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "38556adde2af9856aca02e8eb2bd950b", "src_uid": "0af400ea8e25b1a36adec4cc08912b71", "apr_id": "bbe66224e83e6957e0ac3b1b47ba643b", "difficulty": 1200, "tags": ["implementation", "constructive algorithms", "bitmasks", "binary search"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.5383050847457627, "equal_cnt": 11, "replace_cnt": 7, "delete_cnt": 3, "insert_cnt": 1, "fix_ops_cnt": 11, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace ExTraining\n{\n class Program\n {\n static void Main(string[] args)\n {\n var nums = Console.ReadLine().Split();\n long n = long.Parse(nums[0]);\n long k = long.Parse(nums[1]) - 1;\n\n List ch = new List();\n\n List nech = new List();\n nech.Add(1);\n\n for (long i = 2; i <= n; i++)\n {\n if (i % 2 == 0)\n ch.Add(i);\n else\n nech.Add(i);\n }\n\n if (k >= nech.Count)\n Console.WriteLine(ch[(int)(k - nech.Count)]);\n else\n Console.WriteLine(nech[(int)k]);\n\n }\n\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "f7f0cac4e371f0143997d027f7ef3e8c", "src_uid": "1f8056884db00ad8294a7cc0be75fe97", "apr_id": "2fb6bf305b09792b95e10bb2da1e9f28", "difficulty": 900, "tags": ["math"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.4954128440366973, "equal_cnt": 13, "replace_cnt": 8, "delete_cnt": 3, "insert_cnt": 2, "fix_ops_cnt": 13, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\n\nnamespace BulkaProga\n{\n class Program\n {\n static void Main(string[] args)\n {\n string[] lines = Console.ReadLine().Split(' ');\n long max = long.Parse(lines[0]);\n long index = long.Parse(lines[1]);\n var list1 = new List();\n var list2 = new List();\n var list3 = new List();\n for (int i = 1; i < max + 1; ++i)\n {\n if (i % 2 > 0)\n list1.Add(i);\n else\n list2.Add(i);\n }\n for (int i = 0; i < list1.Count; ++i)\n list3.Add(list1[i]);\n for (int i = 0; i < list2.Count; ++i)\n list3.Add(list2[i]);\n Console.WriteLine(list3[(int)index - 1]);\n }\n }\n}", "lang": "Mono C#", "bug_code_uid": "fff40876bc5cd2eb39bd557d8a86c2ed", "src_uid": "1f8056884db00ad8294a7cc0be75fe97", "apr_id": "747e3ed76f93e21bdfac344a41321e4c", "difficulty": 900, "tags": ["math"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.5641025641025641, "equal_cnt": 13, "replace_cnt": 8, "delete_cnt": 0, "insert_cnt": 5, "fix_ops_cnt": 13, "bug_source_code": "using System;\nusing System.Linq;\n\nnamespace CSharp\n{\n class _741A\n {\n public static void Main()\n {\n int n = int.Parse(Console.ReadLine());\n var crush = Console.ReadLine().Split().Select(token => int.Parse(token) - 1).ToArray();\n\n for (int t = 1; t <= 2 * n * n; t++)\n {\n if (Enumerable.Range(0, n).All(i => Enumerable.Repeat(i, 2 * t + 1).Aggregate((a, b) => crush[a]) == i))\n {\n Console.WriteLine(t);\n return;\n }\n }\n\n Console.WriteLine(-1);\n }\n }\n}", "lang": "Mono C#", "bug_code_uid": "7cbd150a6c62a7b5dc572ee8ec364b22", "src_uid": "149221131a978298ac56b58438df46c9", "apr_id": "da8e310ff82c72af603f01e0833d6e8a", "difficulty": 1600, "tags": ["math", "dfs and similar"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.7083037615330021, "equal_cnt": 20, "replace_cnt": 9, "delete_cnt": 9, "insert_cnt": 2, "fix_ops_cnt": 20, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace CodeForces_Eevee\n{\n class Program\n {\n static void Main(string[] args)\n {\n int[] x = Console.ReadLine().Split('+').Select(int.Parse).ToArray();\n Array.Sort(x);\n for (int i = 0; i < x.Length; i++)\n {\n if (i == x.Length - 1)\n {\n Console.Write(x[i]);\n Continue;\n }\n\n if (x.Length == 1)\n {\n Console.Write(x[0]);\n }\n \n else\n {\n Console.Write(x[i] + \"+\" );\n }\n }\n Console.ReadKey();\n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "ab07d7066d9c404913431ab586b140f8", "src_uid": "76c7312733ef9d8278521cf09d3ccbc8", "apr_id": "eb6b59a1dd766757c0d8f39094be2fdd", "difficulty": 800, "tags": ["greedy", "strings", "sortings", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.7116883116883117, "equal_cnt": 1, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "string[] y = Console.ReadLine().Split();\n\t\tint a = int.Parse(y[0]);\n\t\tint b = int.Parse(y[1]);\n\t\tint c = int.Parse(y[2]);\n\t\tchar q='?';\n\t\tif(a-b-c>0)\n\t\t{\n\t\t\tq = '+';\n\t\t} \n\t\telse if(b-a-c>0)\n\t\t{\n\t\t\tq='-';\n\t\t} \n\t\telse if(a==b && c==0)\n\t\t{\n\t\t\tq='0';\n\t\t}\n\t\tConsole.WriteLine(q);", "lang": "Mono C#", "bug_code_uid": "1e55efd8a4ebf0a3abbea24c53330686", "src_uid": "66398694a4a142b4a4e709d059aca0fa", "apr_id": "e72f33d9ac9a85619c900762629dc605", "difficulty": 800, "tags": ["greedy"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.849334267694464, "equal_cnt": 6, "replace_cnt": 3, "delete_cnt": 2, "insert_cnt": 0, "fix_ops_cnt": 5, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Text;\nusing System.IO;\n\nnamespace mono\n{\n public class Program\n {\n public static char res(int a, int b)\n {\n return a > b ? '+' : (a < b ? '-' : '0');\n }\n \n public static void Main(string[] args)\n {\n StreamReader sr = new StreamReader(\"standard.input\");\n string s = sr.ReadLine();\n sr.Close();\n string[] arr = s.Split(new char[]{ ' ' });\n char c;\n StreamWriter sw = new StreamWriter(\"standard.output\");\n sw.WriteLine((c = res(int.Parse(arr[0]) + int.Parse(arr[2]), int.Parse(arr[1]))) == res(int.Parse(arr[0]), int.Parse(arr[1]) + int.Parse(arr[2])) ? c : '?');\n sw.Close();\n }\n }\n}", "lang": "Mono C#", "bug_code_uid": "820128b1fb63677f671b129cfe69818d", "src_uid": "66398694a4a142b4a4e709d059aca0fa", "apr_id": "f11b6dae9989cd0e5b15582fe23499b2", "difficulty": 800, "tags": ["greedy"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.043635632415041224, "equal_cnt": 50, "replace_cnt": 28, "delete_cnt": 6, "insert_cnt": 17, "fix_ops_cnt": 51, "bug_source_code": "#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nusing namespace std;\n#define rep(i, n) for(int i = 0; i < (n); i++)\ntypedef long long ll;\ntemplate static void amax(T &x, U y) { if(x < y) x = y; }\ntemplate static void amin(T &x, U y) { if(x > y) x = y; }\n\nconst int a=1234;\nconst int b=123456;\nconst int c=1234567;\nint main()\n{\n int n,x,y; scanf(\"%d\",&n);\n if(n%a==0){printf(\"YES\\n\"); return 0;}\n if(n%b==0){printf(\"YES\\n\"); return 0;}\n if(n%c==0){printf(\"YES\\n\"); return 0;}\n x=n/c; y=n/b;\n for(int i=0;i<=x;i++)\n {\n if((n-i*a)%b==0){printf(\"YES\\n\"); return 0;}\n for(int j=0;j<=y;j++){\n if((n-i*a-j*b)%c==0){printf(\"YES\\n\"); return 0;}\n }\n }\n printf(\"NO\\n\");\n return 0;\n}\n\n", "lang": "MS C#", "bug_code_uid": "5a3d7d1253d20f24c3a7bcfb3b3ec291", "src_uid": "72d7e422a865cc1f85108500bdf2adf2", "apr_id": "1093dcb16f7c3a65a69c67a1fa60bf50", "difficulty": 1300, "tags": ["brute force"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.5865102639296188, "equal_cnt": 12, "replace_cnt": 9, "delete_cnt": 2, "insert_cnt": 0, "fix_ops_cnt": 11, "bug_source_code": "using System;\n\nnamespace CodeforcesProblemSolving\n{\n\tclass Program\n\t{\n\t\tstatic void Main(string[] args)\n\t\t{\n\t\t\tint n = int.Parse(Console.ReadLine());\n\t\t\tbool result = false;\n\n\t\t\t// a × 1234567 + b × 123456 + c × 1234 = n\n\t\t\tfor (int a = 1; a < n; a++)\n\t\t\t{\n\t\t\t\tfor (int b = 1; b < n; b++)\n\t\t\t\t{\n\t\t\t\t\tfor (int c = 1; c < n; c++)\n\t\t\t\t\t{\n\t\t\t\t\t\tif (a*1234567 + b*123456 + c*1234 == n)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tresult = true;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tConsole.WriteLine(result ? \"YES\" : \"NO\");\n\t\t}\n\t}\n}\n", "lang": "MS C#", "bug_code_uid": "b437b9e84c562f6feedf2efd4e50ea1d", "src_uid": "72d7e422a865cc1f85108500bdf2adf2", "apr_id": "96286220dabf7234ec387191f8f10c56", "difficulty": 1300, "tags": ["brute force"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.7071111111111111, "equal_cnt": 17, "replace_cnt": 5, "delete_cnt": 0, "insert_cnt": 11, "fix_ops_cnt": 16, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace OmNomCandies\n{\n class Program\n {\n static void Main(string[] args)\n {\n string[] s = Console.ReadLine().Split(' ');\n long c = Convert.ToInt64(s[0]);\n long hr = Convert.ToInt64(s[1]);\n long hb = Convert.ToInt64(s[2]);\n long wr = Convert.ToInt64(s[3]);\n long wb = Convert.ToInt64(s[4]);\n long c0 = 0;\n //c0 += ((double)hr / (double)wr) > ((double)hb / (double)wb) ? (c / wr) * hr : (c / wb) * hb;\n //c %= ((double)hr / (double)wr) > ((double)hb / (double)wb) ? wr : wb;\n //int max = c / wr;\n long tempw = 0;\n long temph = 0;\n if ((double)hr / (double)wr > (double)hb / (double)wb)\n {\n for (int i = 0; i < wr; i++)\n {\n if (i * wb < c)\n {\n tempw = c - i * wb;\n temph = temph < (i * hb + hr * (tempw / wr)) ? (i * hb + hr * (tempw / wr)) : temph;\n }\n }\n }\n else\n {\n for (int i = 0; i < wb; i++)\n {\n if (i * wr < c)\n {\n tempw = c - i * wr;\n temph = temph < (i * hr + hb * (tempw / wb)) ? (i * hr + hb * (tempw / wb)) : temph;\n }\n }\n }\n c0 += temph;\n Console.WriteLine(c0);\n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "0435532c03ffa0a848ba3a422ed64a13", "src_uid": "eb052ca12ca293479992680581452399", "apr_id": "131436c40a37ae0f0e691c170e94e4cf", "difficulty": 2000, "tags": ["math", "brute force", "greedy"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.7495019920318725, "equal_cnt": 18, "replace_cnt": 6, "delete_cnt": 1, "insert_cnt": 10, "fix_ops_cnt": 17, "bug_source_code": "using System;\nusing System.IO;\nusing System.Text;\n\nnamespace Om_Nom_and_Candies\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 C = Next(), Hr = Next(), Hb = Next(), Wr = Next(), Wb = Next();\n long max = Math.Max((C/Wr)*Hr, (C/Wb)*Hb);\n\n if (Hr*Wb > Hb*Wr)\n {\n Swap(ref Hr, ref Hb);\n Swap(ref Wr, ref Wb);\n }\n\n long min = Math.Max(0, C/Wb - Wr);\n for (long i = C/Wb; i >= min; i--)\n {\n long Cr = C - i * Wb;\n if (Cr < 0)\n continue;\n long count = i * Hb + (Cr / Wr) * Hr;\n if (count > max)\n max = count;\n }\n\n writer.WriteLine(\"{0}\", max);\n writer.Flush();\n }\n\n private static void Swap(ref long a, ref long b)\n {\n long c = a;\n a = b;\n b = c;\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": "2bbd579956295aa7042c9d1bf5dfa251", "src_uid": "eb052ca12ca293479992680581452399", "apr_id": "a2a021e62723f776dec58cfed4ddf9c7", "difficulty": 2000, "tags": ["math", "brute force", "greedy"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.7115456938698759, "equal_cnt": 22, "replace_cnt": 6, "delete_cnt": 2, "insert_cnt": 13, "fix_ops_cnt": 21, "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 input = Console.ReadLine();\n string[] values = input.Split(' ');\n double n = Convert.ToDouble(values[0]);\n double m = Convert.ToDouble(values[1]);\n double a = Convert.ToDouble(values[2]);\n double b = Convert.ToDouble(values[3]);\n\n int burles = 0;\n\n if (n / m % 1 > 0\n || n / m % 1 < 0)\n {\n double diff = n % m;\n\n double burlesDemolish = diff * b;\n double burlesBuild = (m - diff) * a;\n\n if (burlesDemolish > burlesBuild)\n {\n burles = Convert.ToInt32(burlesBuild);\n }\n else if (burlesDemolish < burlesBuild)\n {\n burles = Convert.ToInt32(burlesDemolish);\n }\n else\n {\n burles = Convert.ToInt32(burlesBuild);\n }\n }\n\n Console.WriteLine(burles);\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "f421dec24fe8da9495c7ed1adb7652b9", "src_uid": "c05d753b35545176ad468b99ff13aa39", "apr_id": "f2eeb6115cde083a2334e7ea4a1b0082", "difficulty": 1000, "tags": ["math", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.8968512486427795, "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;\n\t\t\t\t\t\npublic class Program\n{\n\tpublic static void Main()\n\t{\n\t\tvar line=Array.ConvertAll(Console.ReadLine().Split(), long.Parse);\n\t\tlong n=line[0], m=line[1], a=line[2], b=line[3];\n\t\tlong result=0;\n\t\t\n\t\tif(n%m==0)\n\t\t\tresult=0;\n\t\telse\n\t\t{\n\t\t\t\tlong demolish=(n%m)*b;\n\t\t\t\tint i=1;\n\t\t\t\twhile((n+i)%m!=0)\n\t\t\t\t{\n\t\t\t\t\ti++;\n\t\t\t\t}\n\t\t\t\tlong build=i*a;\n\t\t\t\tresult=Math.Min(demolish,build);\n\t\t}\n\t\tConsole.WriteLine(result);\n\t}\n}", "lang": "Mono C#", "bug_code_uid": "9dfb225524b47b8ba4770cea10d743f0", "src_uid": "c05d753b35545176ad468b99ff13aa39", "apr_id": "0c2d23182305108a470aac12d652d620", "difficulty": 1000, "tags": ["math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.8521505376344086, "equal_cnt": 7, "replace_cnt": 6, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 6, "bug_source_code": "using System;\n\nnamespace bla\n{\n\tclass MainClass\n\t{\n\t\tpublic static void Main (string[] args)\n\t\t{\n\t\t\tstring[] s = Console.ReadLine ().Split ();\n\t\t\tint n = int.Parse (s [0]);\n\t\t\tint m = int.Parse (s [1]);\n\t\t\tint a = int.Parse (s [2]);\n\t\t\tint b = int.Parse (s [3]);\n\t\t\tint fd = (n%m) * b;\n\t\t\tint fb = (m - (n % m)) * a;\n\t\t\tConsole.WriteLine (Math.Min(fd, fb));\n\t\t}\n\t}\n}\n", "lang": "Mono C#", "bug_code_uid": "692a0a205c275d0c105340bad7395859", "src_uid": "c05d753b35545176ad468b99ff13aa39", "apr_id": "d0193f234490b8f0fa7d6f8441ddb757", "difficulty": 1000, "tags": ["math", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.28949416342412454, "equal_cnt": 13, "replace_cnt": 8, "delete_cnt": 3, "insert_cnt": 2, "fix_ops_cnt": 13, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\n\nnamespace ConsoleApplication6\n{\n public static class CF186_1\n {\n public static string GetBestPrice(string d)\n {\n long res = Convert.ToInt64(d);\n if (res<0)\n {\n string str = d.ToString();\n long dn = Convert.ToInt64(str.Substring(0, str.Length - 1));\n \n string lastCh = str.Substring(str.Length - 1, 1);\n long dn1 = Convert.ToInt64(str.Substring(0, str.Length - 2)+lastCh);\n res = dn > dn1 ? dn : dn1;\n } \n return res.ToString();\n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "08110cc374b346d31f93c62c213e547d", "src_uid": "4b0a8798a6d53351226d4f06e3356b1e", "apr_id": "a1009d567ae83c7b56350d030ae7b7b6", "difficulty": 900, "tags": ["number theory", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.0014914243102162564, "equal_cnt": 1, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "-20", "lang": "MS C#", "bug_code_uid": "7eac1b3c35d3f2dc8c9e90ffa88a4d4f", "src_uid": "4b0a8798a6d53351226d4f06e3356b1e", "apr_id": "61da3cfe44ca63947007a359ac507ece", "difficulty": 900, "tags": ["number theory", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9913670918696045, "equal_cnt": 4, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 3, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\n\nnamespace FootballChampionship\n{\n internal class Team\n {\n public String Name\n {\n get;\n set;\n }\n\n public int GamesPlayed\n {\n get;\n set;\n }\n\n public int Points\n {\n get;\n set;\n }\n\n public int Scored\n {\n get;\n set;\n }\n\n public int Missed\n {\n get;\n set;\n }\n }\n\n internal class Program\n {\n private static readonly Dictionary tournament = new Dictionary();\n\n private static void Main(string[] args)\n {\n Process(Console.ReadLine());\n Process(Console.ReadLine());\n Process(Console.ReadLine());\n Process(Console.ReadLine());\n Process(Console.ReadLine());\n\n String result = Solve();\n Console.Out.WriteLine(result);\n }\n\n private static string Solve()\n {\n var teams = new List(tournament.Values);\n Team o = teams.Where(t => t.GamesPlayed == 2 && t.Name != \"BERLAND\").First();\n Team b = teams[2].Name == \"BERLAND\" ? teams[2] : teams[3];\n int bScored = b.Scored;\n int oScored = o.Scored;\n int bMissed = b.Missed;\n int oMissed = o.Missed;\n\n b.Points += 3;\n for (int i = 1; i < 60; i++)\n {\n for(int j = 0; j < 60; j++)\n {\n b.Scored = bScored;\n o.Scored = oScored;\n b.Missed = bMissed;\n o.Missed = oMissed;\n\n b.Scored += (i + j);\n b.Missed += j;\n o.Scored += j;\n o.Missed += (i + j);\n SortTeams(teams);\n if (teams[0].Name == \"BERLAND\" || teams[1].Name == \"BERLAND\")\n {\n return String.Format(\"{0}:{1}\", i + j, j);\n }\n }\n }\n return \"IMPOSSIBLE\";\n }\n\n private static void SortTeams(List teams)\n {\n teams.Sort(\n (t1, t2) =>\n {\n int x = t2.Points.CompareTo(t1.Points);\n if (x != 0)\n {\n return x;\n }\n x = (t2.Scored - t2.Missed).CompareTo(t1.Scored - t1.Missed);\n if (x != 0)\n {\n return x;\n }\n x = t2.Scored.CompareTo(t1.Scored);\n if (x != 0)\n {\n return x;\n }\n return t1.Name.CompareTo(t2.Name);\n });\n }\n\n private static void Process(string line)\n {\n String[] parts = line.Split(' ');\n String team1 = parts[0];\n String team2 = parts[1];\n int[] scores = parts[2].Split(':').Select(x => Convert.ToInt32(x)).ToArray();\n int score1 = scores[0];\n int score2 = scores[1];\n\n AddTeam(team1, score1, score2);\n AddTeam(team2, score2, score1);\n }\n\n private static void AddTeam(string team, int scored, int missed)\n {\n if (!tournament.ContainsKey(team))\n {\n tournament[team] = new Team { Name = team };\n }\n tournament[team].GamesPlayed++;\n tournament[team].Scored += scored;\n tournament[team].Missed += missed;\n tournament[team].Points += scored > missed ? 3 : (scored == missed ? 1 : 0);\n }\n }\n}", "lang": "Mono C#", "bug_code_uid": "bb57704eaf9c3f9fcf2c0e071f1f04e3", "src_uid": "5033d51c67b7ae0b1a2d9fd292fdced1", "apr_id": "b3422c932e29aa1d1ff44a654fb2a04f", "difficulty": 1800, "tags": ["brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9595854922279793, "equal_cnt": 10, "replace_cnt": 3, "delete_cnt": 1, "insert_cnt": 6, "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 Task7_NEW\n{\n class Task7_NEW\n {\n static void Main(string[] args)\n {\n // Console.WriteLine(\"Enter an area of floor. Enter a number that is in the range\" +\n // \"1<=floor<=10000\");\n //parameter A\n string floorAreaString = Console.ReadLine();\n int floorArea = Convert.ToInt32(floorAreaString);\n\n // Console.WriteLine(\"Enter area of wall B.\");\n //parameter B\n string wallAreaBString = Console.ReadLine();\n int wallAreaB = Convert.ToInt32(wallAreaBString);\n\n //Console.WriteLine(\"Enter area of wall C.\");\n //parameter C\n string wallAreaCString = Console.ReadLine();\n int wallAreaC = Convert.ToInt32(wallAreaCString);\n int result = SolveTask(floorArea, wallAreaB, wallAreaC);\n\n Console.WriteLine(result);\n // Console.ReadKey();\n }\n\n private static int SolveTask(int floorArea, int wallAreaB, int wallAreaC)\n {\n double width = Math.Sqrt(floorArea * wallAreaC / wallAreaB);\n double length = floorArea / width;\n double height = wallAreaB / length;\n int amount;\n return amount = Convert.ToInt32(width + length + height);\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "9d7b01eec50aebd11c4b2f49cbf2eccf", "src_uid": "c0a3290be3b87f3a232ec19d4639fefc", "apr_id": "43a242535c67e021ce6a5b4e98447d54", "difficulty": 1100, "tags": ["geometry", "math", "brute force"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.9714673913043478, "equal_cnt": 5, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 4, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\n\nnamespace ConsoleApplication1.Combynatorycs\n{\n class _610\n {\n public static long nCr(int n, int r)\n {\n // naive: return Factorial(n) / Factorial(r) * Factorial(n - r);\n return nPr(n, r) / Factorial(r);\n }\n public static long nPr(int n, int r)\n {\n // naive: return Factorial(n) / Factorial(n - r);\n return FactorialDivision(n, n - r);\n }\n\n private static long FactorialDivision(int topFactorial, int divisorFactorial)\n {\n long result = 1;\n for (int i = topFactorial; i > divisorFactorial; i--)\n result *= i;\n return result;\n }\n\n private static long Factorial(int i)\n {\n if (i <= 1)\n return 1;\n return i * Factorial(i - 1);\n }\n static void Main(String[] args)\n {\n var n = int.Parse(Console.ReadLine());\n int d = (int)Math.Pow(10, 9) + 7;\n var result = 1;\n for(var i = 1; i <= 3 * n; i++)\n {\n result *= 3;\n result = result % d;\n }\n var m = 1;\n for(var i = 0; i < n; i++)\n {\n m *= 7;\n m = m % d;\n }\n\n Console.WriteLine(Math.Abs(result - m));\n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "0cb79177d32e57866ca469fbb7895434", "src_uid": "eae87ec16c284f324d86b7e65fda093c", "apr_id": "9db45a5e10f2a6ce1749b25f7dc25488", "difficulty": 1500, "tags": ["combinatorics"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.8445274259474189, "equal_cnt": 33, "replace_cnt": 2, "delete_cnt": 18, "insert_cnt": 13, "fix_ops_cnt": 33, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\n\n\nclass PairVariable : IComparable\n{\n public int a, b;\n public int c;\n public PairVariable()\n {\n a = b = 0;\n c = 0;\n }\n public PairVariable(string s)\n {\n string[] q = s.Split();\n a = int.Parse(q[0]);\n b = int.Parse(q[1]);\n c = 0;\n\n }\n\n public PairVariable(int a, int b, int c)\n {\n this.a = a;\n this.b = b;\n this.c = c;\n\n }\n public PairVariable(int a, int b)\n {\n this.a = a;\n this.b = b;\n }\n\n\n\n\n public int CompareTo(PairVariable other)\n {\n return this.a.CompareTo(other.a);\n }\n}\nnamespace ConsoleApplication1\n{\n class Program\n {\n\n static char[,] s = new char[10, 10];\n\n static List position = new List();\n\n\n\n\n\n static void Main(string[] args)\n {\n\t\t\tint[,]mark=new int[10,10];\n bool f = true;\n for (int i = 1; i <= 8; i++)\n {\n string q=Console.ReadLine();\n for (int e = 1; e <= 8; e++)\n {\n s[i, e] = q[e - 1];\n }\n }\n \n for (int i = 1; i <= 8; i++)\n {\n for (int e = 1; e <= 8; e++)\n {\n if (s[i, e] == 'S')\n {\n s[i, e] = '.';\n position.Add(new PairVariable(i, e));\n }\n }\n }\n int x = 8;\n int y = 1;\n List d = new List();\n d.Add(new PairVariable(x, y));\n for (int i = 0; i < 8; i++)\n {\n if (d.Count == 0)\n {\n Console.WriteLine(\"LOSE\");\n return;\n }\n int kk = d.Count;\n for (int e = 0; e < kk; e++)\n {\n int xx = d[e].a;\n int yy = d[e].b;\n int x1 = xx - 1;\n int y1 = yy;\n bool q = true;\n for (int j = 0; j < position.Count; j++)\n {\n if (position[j].a == x1 && position[j].b == y1)\n {\n q = false;\n }\n }\n if (s[x1, y1] != '.')\n {\n q = false;\n }\n\t\t\t\t\t\tif(mark[x1,y1]==1)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tq=false;\n\t\t\t\t\t\t}\n if (q)\n {\n\t\t\t\t\t\t\tmark[x1,y1]=1;\n d.Add(new PairVariable(x1, y1));\n }\n x1 = xx - 1;\n y1 = yy - 1;\n q = true;\n for (int j = 0; j < position.Count; j++)\n {\n if (position[j].a == x1 && position[j].b == y1)\n {\n q = false;\n }\n }\n if (s[x1, y1] != '.')\n {\n q = false;\n }\n\t\t\t\t\t\tif(mark[x1,y1]==1)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tq=false;\n\t\t\t\t\t\t}\n if (q)\n {\n\t\t\t\t\t\t\tmark[x1,y1]=1;\n d.Add(new PairVariable(x1, y1));\n }\n x1 = xx - 1;\n y1 = yy + 1;\n\n q = true;\n for (int j = 0; j < position.Count; j++)\n {\n if (position[j].a == x1 && position[j].b == y1)\n {\n q = false;\n }\n }\n\n if (s[x1, y1] != '.')\n {\n q = false;\n }\n\n\t\t\t\t\t\tif(mark[x1,y1]==1)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tq=false;\n\t\t\t\t\t\t}\n if (q)\n {\n\t\t\t\t\t\t\tmark[x1,y1]=1;\n d.Add(new PairVariable(x1, y1));\n }\n x1 = xx;\n y1 = yy + 1;\n q = true;\n for (int j = 0; j < position.Count; j++)\n {\n if (position[j].a == x1 && position[j].b == y1)\n {\n q = false;\n }\n }\n if (s[x1, y1] != '.')\n {\n q = false;\n }\n\t\t\t\t\t\tif(mark[x1,y1]==1)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tq=false;\n\t\t\t\t\t\t}\n if (q)\n {\n\t\t\t\t\t\t\tmark[x1,y1]=1;\n d.Add(new PairVariable(x1, y1));\n }\n x1 = xx;\n y1 = yy - 1;\n q = true;\n for (int j = 0; j < position.Count; j++)\n {\n if (position[j].a == x1 && position[j].b == y1)\n {\n q = false;\n }\n }\n if (s[x1, y1] != '.')\n {\n q = false;\n }\n\t\t\t\t\t\tif(mark[x1,y1]==1)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tq=false;\n\t\t\t\t\t\t}\n if (q)\n {\n\t\t\t\t\t\t\tmark[x1,y1]=1;\n d.Add(new PairVariable(x1, y1));\n }\n x1 = xx+1;\n y1 = yy - 1;\n q = true;\n for (int j = 0; j < position.Count; j++)\n {\n if (position[j].a == x1 && position[j].b == y1)\n {\n q = false;\n }\n }\n if (s[x1, y1] != '.')\n {\n q = false;\n }\n\t\t\t\t\t\tif(mark[x1,y1]==1)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tq=false;\n\t\t\t\t\t\t}\n if (q)\n {\n\t\t\t\t\t\t\tmark[x1,y1]=1;\n d.Add(new PairVariable(x1, y1));\n }\n x1 = xx+1;\n y1 = yy + 1;\n q = true;\n for (int j = 0; j < position.Count; j++)\n {\n if (position[j].a == x1 && position[j].b == y1)\n {\n q = false;\n }\n }\n if (s[x1, y1] != '.')\n {\n q = false;\n }\n\t\t\t\t\t\tif(mark[x1,y1]==1)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tq=false;\n\t\t\t\t\t\t}\n if (q)\n {\n\t\t\t\t\t\t\tmark[x1,y1]=1;\n d.Add(new PairVariable(x1, y1));\n }\n x1 = xx+1;\n y1 = yy;\n q = true;\n for (int j = 0; j < position.Count; j++)\n {\n if (position[j].a == x1 && position[j].b == y1)\n {\n q = false;\n }\n }\n if (s[x1, y1] != '.')\n {\n q = false;\n }\n\t\t\t\t\t\tif(mark[x1,y1]==1)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tq=false;\n\t\t\t\t\t\t}\n if (q)\n {\n\t\t\t\t\t\t\tmark[x1,y1]=1;\n d.Add(new PairVariable(x1, y1));\n }\n }\n for (int e = 0; e < position.Count; e++)\n {\n position[e].a++;\n }\n \n \n for (int e = 0; e < position.Count; e++)\n {\n for (int j = 0; j < d.Count; j++)\n {\n if (position[e].a == d[j].a && position[e].b == d[j].b)\n {\n d.RemoveAt(j);\n }\n\n }\n }\n \n\n }\n Console.WriteLine(\"WIN\");\n\n \n\n }\n }\n}/**/", "lang": "MS C#", "bug_code_uid": "e9c89258db5cb5fde6a7fbe24b361fac", "src_uid": "f47e4ab041288ba9567c19930eb9a090", "apr_id": "ee48ddec4aca2097c18369db575f7e50", "difficulty": 1500, "tags": ["dfs and similar"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "C#"} {"similarity_score": 0.9740634005763689, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "using System;\nusing System.Linq;\n\nnamespace ConsoleApp1\n{\n class Program\n {\n static void Main(string[] args)\n {\n string s = Console.ReadLine(), s1 = s, s2 = \"\", s3 = s, s4 = \"\";\n for(int i = s.Length - 1; i >= 0; i--)\n s2 += s[i];\n s4 = s2;\n while (s1.Equals(s2) && s3.Equals(s4) && s1.Length > 0)\n {\n s1 = s1.Substring(0, s1.Length - 1);\n s2 = s2.Substring(1, s2.Length - 1);\n s3 = s3.Substring(1, s3.Length - 1);\n s4 = s4.Substring(0, s4.Length - 1);\n }\n Console.WriteLine(s1.Length);\n Console.WriteLine(s2);\n\n }\n }\n}", "lang": "Mono C#", "bug_code_uid": "6807800c6c3e8043625702e364291c91", "src_uid": "6c85175d334f811617e7030e0403f706", "apr_id": "0716c057f90e9aa027dc9c81d331b30a", "difficulty": 900, "tags": ["strings", "brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "C#"} {"similarity_score": 0.8413654618473896, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "using System;\n\nnamespace CF_981_A\n{\n class Program\n {\n static void Main(string[] args)\n {\n string str = Console.ReadLine();\n\n for (int i = 0; i < str.Length-2; i++)\n {\n for (int j = str.Length-i; j > 1; j--)\n {\n if (!IsPalindrom(str.Substring(i, j)))\n {\n Console.WriteLine(j);\n return;\n }\n }\n }\n Console.WriteLine(0);\n }\n\n private static bool IsPalindrom(string v)\n {\n int i = 0;\n int j = v.Length - 1;\n while (i= 0; i--)\n {\n long next = prev + pow*(s[i] - '0');\n if (next >= n)\n {\n ans = ans + bpow*prev;\n bpow *= n;\n pow = 10;\n while (i + 1 < lastback0 && s[i + 1] == '0')\n {\n i++;\n }\n lastback0 = Math.Min(i, lastback0);\n prev = s[i] - '0';\n }\n else\n {\n prev = next;\n pow *= 10;\n }\n }\n ans = ans + bpow*prev;\n\n writer.WriteLine(ans);\n writer.Flush();\n }\n }\n}", "lang": "MS C#", "bug_code_uid": "3f49cac1cbaedd0f574e37038c775240", "src_uid": "be66399c558c96566a6bb0a63d2503e5", "apr_id": "5adcd6d55817220d45124892355eef8d", "difficulty": 2000, "tags": ["dp", "greedy", "math", "constructive algorithms", "strings"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.5613305613305614, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\n\nnamespace A\n{\n class Program\n {\n static int rec(int n, int k)\n {\n if (n==1 && (k==3 || k==4 || k==5))\n {\n return 0;\n }\n if (n==1 && k==2)\n {\n return 1;\n }\n if (n==1)\n {\n return 1000000;\n }\n int min = int.MaxValue;\n for (int i = 2; i <= 5; i++)\n {\n min = Math.Min(min, rec(n - 1, k - i));\n if (i==2)\n {\n min++;\n } \n }\n return min;\n }\n static void Main(string[] args)\n {\n string[] input = Console.ReadLine().Split(' ');\n int n = int.Parse(input[0]);\n int k = int.Parse(input[1]);\n Console.WriteLine(rec(n, k));\n Console.ReadLine();\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "8994902ca1bcb2b00967e541eef4100b", "src_uid": "5a5e46042c3f18529a03cb5c868df7e8", "apr_id": "946d3cac785231bb2cb1bf999dba0432", "difficulty": 900, "tags": ["math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.8566055477197931, "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;\n\nnamespace ConsoleApplication1\n{\n class Program\n {\n static void Main(string[] args)\n {\n int n, s;\n int tempsum;\n \n int diff;\n int[] marks = new int[n];\n int i;\n for (i = 0; i < n; i++)\n marks[i] = 2;\n int cnt;\n \n while (true)\n {\n tempsum = marks.Sum();\n diff = s - tempsum;\n if (diff == 0)\n break;\n\n if (diff > n)\n cnt = n;\n else\n cnt = diff;\n for (i = 0; i < diff; i++)\n marks[i] += 1;\n }\n\n cnt = marks.Where(item => item == 2).Count();\n System.Console.WriteLine(cnt.ToString());\n System.Console.ReadKey();\n\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "e9f3fc83fb010e9e71ee6a18c4ca9b4f", "src_uid": "5a5e46042c3f18529a03cb5c868df7e8", "apr_id": "b78ac9a39cc279055f4ca1938b18e53b", "difficulty": 900, "tags": ["math", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9956483899042646, "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.Text;\n\nnamespace ConsoleApplication1\n{\n class Program\n {\n static void Main(string[] args)\n {\n int n, s;\n int tempsum;\n string ptr;\n ptr = System.Console.ReadLine().Trim();\n string[] sarr = ptr.Split(' ');\n n = Int32.Parse(sarr[0].Trim());\n s = Int32.Parse(sarr[1].Trim());\n int diff;\n int[] marks = new int[n];\n int i;\n for (i = 0; i < n; i++)\n marks[i] = 2;\n int cnt;\n \n while (true)\n {\n tempsum = marks.Sum();\n diff = s - tempsum;\n if (diff == 0)\n break;\n\n if (diff > n)\n cnt = n;\n else\n cnt = diff;\n for (i = 0; i < diff; i++)\n marks[i] += 1;\n }\n\n cnt = marks.Where(item => item == 2).Count();\n System.Console.WriteLine(cnt.ToString());\n \n\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "9ec4e9c4bb762ac27268c66487b14a50", "src_uid": "5a5e46042c3f18529a03cb5c868df7e8", "apr_id": "b78ac9a39cc279055f4ca1938b18e53b", "difficulty": 900, "tags": ["math", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9854604200323102, "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;\nusing System.Text;\n\nnamespace ConsoleApplication1\n{\n class Program\n {\n static int nextInt()\n {\n int t = Console.Read();\n while ((t < '0' || t > '9') && t != '-') t = Console.Read();\n int sign = 1;\n if (t == '-')\n {\n sign = -1;\n t = Console.Read();\n }\n int x = 0;\n while (t >= '0' && t <= '9')\n {\n x *= 10;\n x += t - '0';\n t = Console.Read();\n }\n return x * sign;\n }\n static void Main(string[] args)\n {\n int n = nextInt();\n int k = nextInt();\n if (n * 3 <= k)\n Console.WriteLine(0);\n else\n Console.WriteLine(n * 3 - k);\n n = nextInt();\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "48e9cc758995002aef17904781de499d", "src_uid": "5a5e46042c3f18529a03cb5c868df7e8", "apr_id": "8fda4af22aa61126c9b1fa6811d67568", "difficulty": 900, "tags": ["math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "delete", "lang_cluster": "C#"} {"similarity_score": 0.9791249891275985, "equal_cnt": 5, "replace_cnt": 1, "delete_cnt": 2, "insert_cnt": 1, "fix_ops_cnt": 4, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.IO;\nusing System.Collections;\nusing System.Diagnostics;\nusing System.Globalization;\nusing System.Threading;\n\nnamespace CodeForces {\n struct Node {\n public int X, Y, D; \n public Node(int x,int y, int d) {\n X = x;\n Y = y;\n D = d;\n } \n }\n\n class Pair : IComparable {\n public int First, Second;\n public Pair(int f, int s) {\n First = f;\n Second = s;\n }\n\n public int CompareTo(Pair other) {\n return other.Second.CompareTo(Second);\n }\n }\n\n class Desc : IComparer {\n public int Compare(int x, int y) {\n return y.CompareTo(x);\n }\n }\n \n class Cf { \n static TextReader input;\n static void Main(string[] args) { \n#if TESTS \n Stopwatch sw = new Stopwatch();\n sw.Start();\n input = new StreamReader(\"input.txt\"); \n#else\n input = Console.In;\n#endif\n Solve();\n#if TESTS\n Console.WriteLine();\n Console.WriteLine(\"Milliseconds: {0}\", sw.ElapsedMilliseconds);\n Console.ReadLine();\n#endif\n }\n\n static int n, m, k, ans = int.MaxValue;\n static Graph g;\n static void Solve() {\n n = nextInt();\n k = nextInt();\n go(k, 0, 0);\n Console.WriteLine(ans);\n }\n\n static void go(int num, int cnt, int pos) {\n if (num < 0)\n return;\n if (num == 0 && pos == n)\n ans = Math.Min(ans, cnt);\n for (int i = 2; i < 6; i++) {\n int t = i == 2 ? 1 : 0;\n go(num - i, cnt + t, pos + 1);\n }\n }\n\n\n \n static int SquaredDistanceBetweenSegments(int x1, int y1, int x2, int y2, int xx1, int yy1, int xx2, int yy2) {\n return Math.Min(Math.Min(SquaredDistanceToSegment(x1, y1, xx1, yy1, xx2, yy2), SquaredDistanceToSegment(x2, y2, xx1, yy1, xx2, yy2)),\n Math.Min(SquaredDistanceToSegment(xx1, yy1, x1, y1, x2, y2), SquaredDistanceToSegment(xx2, yy2, x1, y1, x2, y2)));\n }\n\n static int SquaredDistanceToSegment(int x, int y, int x1, int y1, int x2, int y2) {\n int result = Math.Min(SquaredDistance(x, y, x1, y1), SquaredDistance(x, y, x2, y2));\n if (x1 == x2 && y1 <= y && y <= y2)\n result = (x - x1) * (x - x1);\n else if (y1 == y2 && x1 <= x && x <= x2)\n result = (y - y1) * (y - y1);\n return result;\n }\n\n static int SquaredDistance(int ax, int ay, int bx, int by) {\n return (ax - bx) * (ax - bx) + (ay - by) * (ay - by);\n }\n\n #region read helpers\n static int nextInt() {\n int t = input.Read();\n while (t < '0' || t > '9') t = input.Read();\n int x = 0;\n while (t >= '0' && t <= '9') {\n x *= 10;\n x += t - '0';\n t = input.Read();\n }\n return x;\n }\n\n static long nextLong() {\n int t = input.Read();\n while (t < '0' || t > '9') t = input.Read();\n long x = 0;\n while (t >= '0' && t <= '9') {\n x *= 10;\n x += t - '0';\n t = input.Read();\n }\n return x;\n }\n\n public static List ReadIntList() {\n return input.ReadLine().Split(' ').Select(x => int.Parse(x)).ToList();\n }\n\n public static int[] ReadIntArray() { \n return input.ReadLine().Split(' ').Select(x => int.Parse(x)).ToArray();\n }\n\n public static long[] ReadLongArray() {\n return input.ReadLine().Split(' ').Select(x => long.Parse(x)).ToArray();\n }\n\n public static List ReadLongList() {\n return input.ReadLine().Split(' ').Select(x => long.Parse(x)).ToList();\n } \n\n public static string ReadLine() {\n return input.ReadLine();\n }\n\n public static int ReadInt() {\n return int.Parse(input.ReadLine());\n }\n\n public static long ReadLong() {\n return long.Parse(input.ReadLine());\n }\n#endregion\n }\n \n public class SegmentTree {\n private int[] a, t;\n private int n;\n public SegmentTree(int[] a) {\n n = a.Length;\n this.a = a; \n t = new int[n << 2];\n buildSegmentTree(0, n - 1, 1);\n }\n\n private void buildSegmentTree(int l, int r, int v) {\n if (l == r)\n t[v] = a[l];\n else {\n int m = (l + r) >> 1;\n int vl = v << 1;\n int vr = (v << 1) | 1;\n buildSegmentTree(l, m, vl);\n buildSegmentTree(m + 1, r, vr);\n t[v] = t[vl] + t[vr];\n }\n }\n\n public int QuerySegmentTree(int l, int r) {\n return querySegmentTree(1, l, r, 0, n - 1);\n }\n\n public void Update(int v, int tl, int tr, int pos, int new_val) {\n if (tl == tr)\n t[v] = new_val;\n else {\n int tm = (tl + tr) / 2;\n if (pos <= tm)\n Update(v << 1, tl, tm, pos, new_val);\n else\n Update(v << 1 + 1, tm + 1, tr, pos, new_val);\n t[v] = t[v << 1] + t[v << 1 + 1];\n }\n }\n\n private int querySegmentTree(int v, int l, int r, int tl, int tr) {\n if (l > r)\n return 0;\n if (l == tl && r == tr)\n return t[v];\n int m = (tl + tr) >> 1; \n return querySegmentTree(v << 1, l, Math.Min(r, m), tl, m) + querySegmentTree((v << 1) | 1, Math.Max(l, m + 1), r, m + 1, tr);\n }\n }\n class Graph : List> {\n public Graph(int num): base(num) {\n for (int i = 0; i < num; i++) {\n this.Add(new List());\n }\n }\n }\n\n class Heap : IEnumerable where T : IComparable {\n private List heap = new List();\n private int heapSize;\n private int Parent(int index) {\n return (index - 1) >> 1;\n }\n public int Count {\n get { return heap.Count; }\n }\n private int Left(int index) {\n return (index << 1) | 1;\n }\n private int Right(int index) {\n return (index << 1) + 2;\n }\n private void Max_Heapify(int i) {\n int l = Left(i);\n int r = Right(i);\n int largest = i;\n if (l < heapSize && heap[l].CompareTo(heap[i]) > 0)\n largest = l;\n if (r < heapSize && heap[r].CompareTo(heap[largest]) > 0)\n largest = r;\n if (largest != i) {\n T temp = heap[largest];\n heap[largest] = heap[i];\n heap[i] = temp;\n Max_Heapify(largest);\n }\n }\n private void BuildMaxHeap() {\n for (int i = heap.Count >> 1; i >= 0; --i)\n Max_Heapify(i);\n }\n\n public IEnumerator GetEnumerator() {\n return heap.GetEnumerator();\n }\n\n public void Sort() {\n for (int i = heap.Count - 1; i > 0; --i) {\n T temp = heap[i];\n heap[i] = heap[0];\n heap[0] = temp;\n --heapSize;\n Max_Heapify(0);\n }\n }\n\n public T Heap_Extract_Max() {\n T max = heap[0];\n heap[0] = heap[--heapSize];\n Max_Heapify(0);\n return max;\n }\n\n public void Clear() {\n heap.Clear();\n heapSize = 0;\n }\n\n public void Insert(T item) {\n if (heapSize < heap.Count)\n heap[heapSize] = item;\n else\n heap.Add(item);\n int i = heapSize;\n while (i > 0 && heap[Parent(i)].CompareTo(heap[i]) < 0) {\n T temp = heap[i];\n heap[i] = heap[Parent(i)];\n heap[Parent(i)] = temp;\n i = Parent(i);\n }\n ++heapSize;\n }\n\n IEnumerator IEnumerable.GetEnumerator() {\n return ((IEnumerable)heap).GetEnumerator();\n }\n } \n public class Treap {\n private static Random rand = new Random();\n public static Treap Merge(Treap l, Treap r) {\n if (l == null) return r;\n if (r == null) return l;\n Treap res;\n if (l.y > r.y) {\n Treap newR = Merge(l.right, r);\n res = new Treap(l.x, l.y, l.left, newR);\n }\n else {\n Treap newL = Merge(l, r.left);\n res = new Treap(r.x, r.y, newL, r.right);\n } \n return res;\n }\n\n public void Split(int x, out Treap l, out Treap r) {\n Treap newTree = null;\n if (this.x <= x) {\n if (right == null)\n r = null;\n else\n right.Split(x, out newTree, out r);\n l = new Treap(this.x, y, left, newTree); \n }\n else {\n if (left == null)\n l = null;\n else\n left.Split(x, out l, out newTree);\n r = new Treap(this.x, y, newTree, right); \n }\n }\n\n public Treap Add(int x) {\n Treap l, r;\n Split(x, out l, out r);\n Treap m = new Treap(x, rand.Next());\n return Merge(Merge(l, m), r);\n }\n\n public Treap Remove(int x) {\n Treap l, m, r;\n Split(x - 1, out l, out r);\n r.Split(x, out m, out r);\n return Merge(l, r);\n }\n\n private int x, y, cost, maxTreeCost;\n private Treap left, right;\n public Treap(int x, int y, Treap l, Treap r) {\n this.x = x;\n this.y = y;\n left = l;\n right = r;\n }\n public Treap(int x, int y) : this(x, y, null, null) { }\n public void InOrder() {\n inOrder(this);\n }\n private void inOrder(Treap t) {\n if (t == null) return;\n inOrder(t.left);\n Console.WriteLine(t.x);\n inOrder(t.right);\n }\n }\n public static class Extensions {\n public static void Fill(this int[] array, int val) {\n for (int i = 0; i < array.Length; i++) {\n array[i] = val;\n }\n }\n\n public static void Fill(this double[] array, double val) {\n for (int i = 0; i < array.Length; i++) {\n array[i] = val;\n }\n }\n\n public static int ToInt(this string s) {\n return int.Parse(s);\n }\n\n public static string Fill(this char c, int count) {\n char[] r = new char[count];\n for (int i = 0; i < count; ++i)\n r[i] = c;\n return new string(r);\n }\n \n public static void Print(this IEnumerable arr) {\n foreach (T t in arr)\n Console.Write(\"{0} \", t);\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "ab411f3efb14b53dbdc7058a7888cb1d", "src_uid": "5a5e46042c3f18529a03cb5c868df7e8", "apr_id": "7aa4c165266f12c911af684f5a4145c5", "difficulty": 900, "tags": ["math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "delete", "lang_cluster": "C#"} {"similarity_score": 0.9988571428571429, "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.Text;\nusing System.Collections;\n\nnamespace ConsoleApplication1\n{\n class Program\n {\n static void Main(string[] args)\n {\n string[] str = Console.ReadLine().Split(' ');\n int n = int.Parse(str[0]);\n int m = int.Parse(str[1]);\n\n ArrayList A = new ArrayList();\n for (int i = 1; i <= n; i++)\n {\n A.Add(1);\n }\n int current = (int)A[0];\n int c = 1;\n int x = 1;\n int count = 1;\n while (c < c + 1) {\n if (x == m) { A.Add(1); x = 1; } else { x++; }\n if (A.Count<= c) { break; }\n count++;\n c++;\n }\n Console.WriteLine(count);\n Main(new string[0]) ;\n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "8ffe08a38249a6cb11df632317abfac6", "src_uid": "42b25b7335ec01794fbb1d4086aa9dd0", "apr_id": "5d5b72d75c1df312fe142659fb3aac93", "difficulty": 900, "tags": ["math", "brute force", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.8686312310658221, "equal_cnt": 7, "replace_cnt": 4, "delete_cnt": 2, "insert_cnt": 0, "fix_ops_cnt": 6, "bug_source_code": "\nusing System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\n\nnamespace ConsoleApplication1\n{\n class Program\n {\n private static void MyMain()\n {\n int initial;\n int buyDay;\n RInts(out initial, out buyDay);\n\n int worn = initial;\n int div = initial/buyDay;\n int rem = initial % buyDay;\n while (!(rem == 0 && div ==1)) {\n worn += div;\n var newDiv = (div + rem) / buyDay;\n rem = (div + rem) % buyDay;\n div = newDiv;\n }\n worn = 1 + worn;\n WLine(worn);\n\n\n\n }\n\n\n static void Main()\n {\n#if !HOME\n MyMain();\n#else\n var tmp = Console.In;\n Console.SetIn(new StreamReader(\"in.txt\"));\n while (Console.In.Peek() > 0)\n {\n MyMain();\n }\n Console.In.Close();\n Console.SetIn(tmp);\n Console.ReadKey();\n#endif\n }\n\n #region Utils\n static string RLine()\n {\n return Console.ReadLine();\n }\n\n static int RInt()\n {\n var str = Console.ReadLine();\n return Convert.ToInt32(str);\n }\n\n static int[] RInts()\n {\n return Array.ConvertAll(Console.ReadLine().Split(' '), s => Convert.ToInt32(s));\n }\n\n static void RInts(out int a, out int b)\n {\n var ints = RInts();\n a = ints[0];\n b = ints[1];\n }\n\n static void WLine(T s)\n {\n Console.WriteLine(s);\n }\n\n static void WYES()\n {\n WLine(\"YES\");\n }\n\n static void WNO()\n {\n WLine(\"NO\");\n }\n #endregion\n }\n}\n", "lang": "MS C#", "bug_code_uid": "8b73ab8609baaf8eaea08080c9c27d01", "src_uid": "42b25b7335ec01794fbb1d4086aa9dd0", "apr_id": "7f41bf95aec6d1b315cd43ecd1c4def4", "difficulty": 900, "tags": ["math", "brute force", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.42709529276693453, "equal_cnt": 9, "replace_cnt": 3, "delete_cnt": 5, "insert_cnt": 1, "fix_ops_cnt": 9, "bug_source_code": "using System;\n\nnamespace CodeforcesTasks\n{\n internal class Program\n {\n public static void Main(string[] args)\n {\n var number = Convert.ToInt32(Console.ReadLine(), 2);\n var n = 1;\n for (var i = 0;; i++)\n {\n if (number <= n)\n {\n Console.WriteLine(i);\n return;\n }\n\n n *= 4;\n }\n }\n\n }\n}", "lang": "Mono C#", "bug_code_uid": "1e8be1ad275b906e62896da84e1cbafb", "src_uid": "d8ca1c83b431466eff6054d3b422ab47", "apr_id": "7773c8577bd13f8e44de0eaa87a0acaf", "difficulty": 1000, "tags": ["math"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C#"} {"similarity_score": 0.22913256955810146, "equal_cnt": 8, "replace_cnt": 3, "delete_cnt": 4, "insert_cnt": 1, "fix_ops_cnt": 8, "bug_source_code": "using System;\n\nnamespace codeforceCSharp\n{\n class Program\n {\n static int binToDec(int bin)\n {\n int dec = 0;\n int n = 0;\n while (bin != 0)\n {\n if (bin % 2 == 1)\n dec += (int)Math.Pow(2, n);\n bin /= 10;\n n++;\n }\n return dec;\n }\n static void Main(string[] args)\n {\n\n int bin, dec;\n\n bin = int.Parse(Console.ReadLine());\n\n dec = binToDec(bin);\n\n int n = 0;\n while (Math.Pow(4, n) < dec)\n {\n n++;\n }\n Console.WriteLine(n);\n Console.ReadLine();\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "9def52a21b5296cadba6620d210d9e82", "src_uid": "d8ca1c83b431466eff6054d3b422ab47", "apr_id": "6340abf19aba3b51700a7e20fd6b0b03", "difficulty": 1000, "tags": ["math"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C#"} {"similarity_score": 0.9573273441886581, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "namespace _17A\n{\n class Program\n {\n static void Main(string[] args)\n {\n string line = Console.ReadLine();\n string[] parts = line.Split(new char[] { ' ' });\n\n int n = int.Parse(parts[0]);\n int k = int.Parse(parts[1]);\n\n int count = 0;\n\n while (n >=1)\n {\n int temp0 = previousPrime(n);\n int temp1 = temp0;\n\n while (temp1 >= 1)\n {\n int temp2 = previousPrime(temp1);\n int temp3 = previousPrime(temp2);\n\n if (temp2 + temp3 + 1 == temp0)\n {\n count++;\n break;\n }\n temp1 = temp2;\n \n }\n\n \n\n n = temp0;\n }\n\n if (count >= k)\n {\n Console.WriteLine(\"YES\");\n }\n else\n Console.WriteLine(\"NO\");\n\n\n Console.ReadKey();\n }\n\n\n static bool isPrime(int n)\n {\n if (n <= 2)\n {\n return true;\n }\n else\n {\n int i = 2;\n\n while (i < n)\n {\n if (n % i == 0)\n return false;\n i++;\n }\n return true;\n }\n \n }\n\n static int previousPrime(int p)\n {\n int temp = p - 1;\n while (true)\n {\n if (isPrime(temp))\n return temp;\n\n temp--;\n }\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "1e0c704bb14bfdfc284890d0e437afca", "src_uid": "afd2b818ed3e2a931da9d682f6ad660d", "apr_id": "3792a60430ea3ee54de4a587c1fe2c5e", "difficulty": 1000, "tags": ["math", "brute force", "number theory"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.7482108002602472, "equal_cnt": 1, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": " public static string GetBestSolution(int n, string str)\n {\n if (n < 26)\n {\n return \"NO\";\n }\n char[] letters = new char[n];\n\n letters = str.ToLower().ToCharArray();\n List charCount = new List();\n for (int i = 0; i < n; i++)\n {\n if (!charCount.Contains(letters[i]))\n {\n charCount.Add(letters[i]);\n }\n\n }\n\n\n return charCount.Count == 26 ? \"YES\" : \"NO\";\n }", "lang": "MS C#", "bug_code_uid": "5941973e342111a8db5ff92e155b50b9", "src_uid": "f13eba0a0fb86e20495d218fc4ad532d", "apr_id": "d7d292bdbe50081303caac07814d5a6b", "difficulty": 800, "tags": ["strings", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.5859872611464968, "equal_cnt": 12, "replace_cnt": 8, "delete_cnt": 3, "insert_cnt": 1, "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 C_Anton_and_tale\n{\n class Program\n {\n static void Main(string[] args)\n {\n long[] input = Console.ReadLine().Split(' ').Select(x => long.Parse(x)).ToArray();\n //long t1 = input[0] * 2;\n long z = input[0];\n long d = input[1];\n long lim = input[0];\n long step = 0;\n do\n {\n step++;\n z += d; z = Math.Min(z, lim);\n z -= step;\n\n } while (z > 0);\n Console.WriteLine(step);\n \n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "41eb9ba25df49ce2c57662d2d62e7aa8", "src_uid": "3b585ea852ffc41034ef6804b6aebbd8", "apr_id": "0b621dac47d76d3e3ca2eb6fd27b4e75", "difficulty": 1600, "tags": ["math", "binary search"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.8717948717948718, "equal_cnt": 9, "replace_cnt": 2, "delete_cnt": 1, "insert_cnt": 5, "fix_ops_cnt": 8, "bug_source_code": "using System;\nusing System.Collections.Generic;\n\npublic class Program\n{\n public static HashSet vowels = new HashSet(new string[] { 'A', 'E', 'I', 'O', 'U', 'Y' });\n\n public static void Main(string[] args)\n {\n var input = Console.ReadLine().ToUpper();\n\n var max = int.MinValue;\n var position = 0;\n\n while (position != input.Length)\n {\n var tuple = NextVowel(input, position);\n if (tuple.Item1 == -1)\n {\n break;\n }\n position = tuple.Item1;\n max = Math.Max(tuple.Item2, max);\n }\n\n Console.WriteLine(max);\n }\n\n public static Tuple NextVowel(string input, int position)\n {\n for (var i = position; i < input.Length; i++)\n {\n if (vowels.Contains(input[i]))\n {\n return new Tuple(i, (i + 1) - position);\n }\n }\n\n return new Tuple(-1, -1);\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "8d6a66d3d86b2462b7fd578bb0b51b7a", "src_uid": "1fc7e939cdeb015fe31f3cf1c0982fee", "apr_id": "145b8e7ef2523ce1214d2c6e9a970e69", "difficulty": 1000, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.9948542024013722, "equal_cnt": 7, "replace_cnt": 4, "delete_cnt": 1, "insert_cnt": 3, "fix_ops_cnt": 8, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Diagnostics;\nusing System.IO;\nusing System.Linq;\n\npublic static partial class MyExtension\n{\n public class Solution\n {\n /* Head ends here */\n\n public const int PAD_FACTOR = 7;\n\n public static int greedy(int a, int b, int f, int k)\n {\n var ans = 0;\n var stock = b;\n var spbu = f;\n while (k-- > 0)\n {\n var canSpbu = stock >= spbu;\n if (!canSpbu)\n return -1;\n // decide whether to refill or not\n var canStopNoRefill = stock >= a;\n var last = k == 0;\n var nextSpbu = a - spbu;\n var nextCanSpbuNoRefill = stock >= (a + nextSpbu);\n var skipRefill = new Func(() =>\n {\n if (last) return canStopNoRefill;\n return nextCanSpbuNoRefill;\n });\n // simul\n stock -= spbu; // to spbu\n assert(stock >= 0);\n if (skipRefill() == false)\n {\n // refill\n stock = b;\n ans++;\n }\n stock -= (a - spbu); // to stop\n assert(stock >= 0);\n // next loop\n spbu = a - spbu;\n }\n return ans;\n }\n\n int solve()\n {\n // a, b, f, k (0 < f < a ≤ e6, 1 ≤ b ≤ e9, 1 ≤ k ≤ e4)\n var A = ReadInt32();//e6\n var B = ReadInt32();//e6\n var F = ReadInt32();//e9\n var K = ReadInt32();//e4\n // only refill if necessary -> can't finish k\n return greedy(A, B, F, K);\n // Print the minimum number of times the bus needs to refuel to make k journeys. If it is impossible for the bus to make k journeys, print -1.\n }\n\n public void zStart()\n {\n Console.WriteLine(solve());\n\n ///////////////////////////////////////\n\n //foreach (var @__ in Enumerable.Range(1, ReadInt32()))\n //{\n // start... - no CONSOLE\n\n // end...\n\n //var ansLines = new List(9999);\n //{\n // // ANS start...\n \n // //ansLines.AddRange(inp.Select(x => new string(x)));\n // //...\n\n // Console.Write(\"Case #{0}: \", @__);\n // Console.WriteLine(string.Join(\" \", __getFormattedString(ans)));\n // ansLines.ForEach(x => Console.WriteLine(x));\n //}\n //Trace.WriteLine(string.Format(\"DONE_{0}.\", @__));\n //}\n }\n\n T __getFormattedString(T val) { return val; }\n#if DEBUG\n string __getFormattedString(double d) { return d.ToString(\"0.000000\"); }\n#endif\n /* Tail starts here */\n }\n\n#if TORIQ\n static void Pretest()\n {\n assert(Solution.greedy(6, 9, 2, 4), 4);\n assert(Solution.greedy(6, 10, 2, 4), 2);\n assert(Solution.greedy(2, 1, 1, 1), 1);\n }\n static void MainTest()\n {\n Test(File.ReadAllText(\"input.txt\")\n , File.ReadAllText(\"output.txt\")\n );\n //\n }\n#endif\n\n // =============================================================================================\n\n #region faSTDIO\n [DebuggerNonUserCode]\n static void Main(String[] args)\n {\n#if TORIQ\n zTestSuite();\n //new Solution().zInternalTestSuite();\n return;\n#endif\n#if GOOGLE\n zGoogle();\n return;\n#endif\n new Solution().zStart();\n }\n\n static IEnumerable Read()\n {\n int cin;\n var empty = true;\n while ((cin = Console.Read()) > -1)\n {\n var c = (char)cin;\n if (c == ' ' || c == '\\n' || c == '\\r' || c == '\\t')\n {\n if (empty) continue;\n else break;\n }\n yield return c;\n empty = false;\n }\n }\n static T Read(Converter convert, int capacity = 20)\n { var temp = ReadString(capacity); return convert(temp); }\n static string ReadString(int capacity = 1000000)\n {\n capacity += Solution.PAD_FACTOR;\n var ans = new System.Text.StringBuilder(capacity);\n foreach (var c in Read()) ans.Append(c);\n return ans.ToString();\n }\n static string ReadLine(int capacity = 1000000)\n {\n capacity += Solution.PAD_FACTOR;\n var ans = Console.ReadLine();\n if (string.IsNullOrWhiteSpace(ans.Trim()))\n ans = Console.ReadLine();\n return ans;\n }\n static int ReadInt32() { return Read(Convert.ToInt32); }\n static long ReadLong64() { return Read(Convert.ToInt64); }\n\n #endregion\n #region Convert\n public static int int32(this long i64) { return Convert.ToInt32(i64); }\n public static int int32(this double dec64) { return Convert.ToInt32(dec64); }\n public static long long64(this int i32) { return (long)i32; }\n public static long long64(this double dec64) { return Convert.ToInt64(dec64); }\n public static double double64(this long i64) { return Convert.ToDouble(i64); }\n public static double double64(this int i32) { return (double)i32; }\n #endregion\n #region LIBS\n [DebuggerNonUserCode]\n public static void assert(bool mustBeTrue, string message = \"ASSERTION FAILED\", params object[] args)\n {\n if (mustBeTrue == false)\n throw new ApplicationException(string.Format(message, args));\n }\n\n [DebuggerNonUserCode]\n public static T assert(T actual, T expected)\n {\n if (object.Equals(actual, expected) == false)\n {\n Debug.WriteLine(expected, \"CORRECT\");\n Debug.WriteLine(actual, \"ACTUAL\");\n assert(false, \"[{0}] SHOULD BE [{1}]\", actual, expected);\n }\n return actual;\n }\n\n [Conditional(\"DEBUG\")]\n public static void EmptyConditionalDebugBreak() { }\n \n public static bool isLrLeftRight(T left, T right) where T : IComparable\n { return left.CompareTo(right) <= 0; }\n\n [DebuggerNonUserCode]\n public static void lrLeftRight_ASSERT(T left, T right) where T : IComparable\n { assert(isLrLeftRight(left, right), \"Expect left [{0}] <= [{1}] right\", left, right); }\n\n public static IEnumerable forEach(this IEnumerable range, Action action)\n { foreach (var elem in range) action(elem); return range; }\n\n [DebuggerNonUserCode]\n public static void __AssertIncrStep(double incrStep) { assert(incrStep > 0, \"Expect 'incrStep [{0}] > 0'\", incrStep); }\n\n public static long add64(long a, long b) { return a + b; }\n public static long mult64(long a, long b) { return a * b; }\n public static double div(double dividend, double divisor) { return dividend / divisor; }\n public static int ceil(double d) { return Convert.ToInt32(Math.Ceiling(d)); }\n public static int ceil(double dividend, double divisor) { return ceil(div(dividend, divisor)); }\n public static long ceil64(double d) { return Convert.ToInt64(Math.Ceiling(d)); }\n public static int floor(double d) { return Convert.ToInt32(Math.Floor(d)); }\n public static int floor(double dividend, double divisor) { return floor(div(dividend, divisor)); }\n public static long floor64(double d) { return Convert.ToInt64(Math.Floor(d)); }\n\n public static IEnumerable rangeUntil(int left, int right, int incrStep = 1)\n {\n lrLeftRight_ASSERT(left, right);\n __AssertIncrStep(incrStep);\n for (var i = left; i <= right; i += incrStep) yield return i;\n }\n public static IEnumerable rangeReverse(int left, int right, int decrStep = 1)\n {\n lrLeftRight_ASSERT(left, right);\n __AssertIncrStep(decrStep);\n for (var i = right; i >= left; i -= decrStep) yield return i;\n }\n\n #endregion\n\n // =============================================================================================\n\n\n}", "lang": "MS C#", "bug_code_uid": "15d17afce368b6d01125f15836fe5583", "src_uid": "283aff24320c6518e8518d4b045e1eca", "apr_id": "fa44c08f63797803a5e67acb8f43f5c2", "difficulty": 1500, "tags": ["greedy", "math", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9888289676425269, "equal_cnt": 5, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 4, "fix_ops_cnt": 4, "bug_source_code": "using System;\nusing System.IO;\nusing System.Text;\n\nnamespace Bus\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 a = Next(), b = Next(), f = Next(), k = Next();\n\n if (2*f > b || 2*(a - f) > b)\n {\n writer.WriteLine(\"-1\");\n writer.Flush();\n return;\n }\n\n int count = 0;\n int x = b;\n bool to = true;\n for (int i = 1; i <= k; i++)\n {\n if (to)\n {\n if (i != k)\n {\n if (a + (a - f) <= x)\n {\n x -= a;\n }\n else\n {\n count++;\n x = b - (a - f);\n }\n }\n else\n {\n if (x < a)\n count++;\n }\n }\n else\n {\n if (i != k)\n {\n if (a + f <= x)\n {\n x -= a;\n }\n else\n {\n count++;\n x = b - f;\n }\n }\n else\n {\n if (x < a)\n count++;\n }\n }\n to = !to;\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": "16e69175b26c3a2f125d4e750f63f888", "src_uid": "283aff24320c6518e8518d4b045e1eca", "apr_id": "312bc6774423ee2018dd1734867fc098", "difficulty": 1500, "tags": ["greedy", "math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.7703751617076326, "equal_cnt": 15, "replace_cnt": 8, "delete_cnt": 4, "insert_cnt": 2, "fix_ops_cnt": 14, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\n\nnamespace ConsoleApp1\n{\n\n class Program\n {\n static void Main(string[] args)\n {\n int[] n = ((Console.ReadLine().Split(' ')).Select(int.Parse)).ToArray();\n int [] array = ((Console.ReadLine().Split(' ')).Select(int.Parse)).ToArray();\n int sum = 0;\n int prev = -1;\n for (int i = 0; i < n[0]/2; i++)\n {\n if (array[i] != array[n[0] - 1 - i])\n {\n int s = array[i] + array[n[0] - 1 - i];\n if (s == 1)\n {\n sum = -1;\n break;\n }\n else\n if (s == 2)\n {\n prev = 0;\n sum += n[1];\n }\n else\n {\n prev = 1;\n sum += n[2];\n }\n }\n else if(array[i] == 2)\n {\n if(prev == 1) sum += n[1];\n else if(prev == 0) sum += n[2];\n else if(n[1] < n2)\n {\n prev = 0;\n sum += n[1];\n }\n else{ prev = 1; sum += n[2];}\n }\n }\n if (sum >= 0 && array[n[0] / 2] == 2)\n sum += n[0]%2==0 ? 2* (int)Math.Min(n[1], n[2]) : (int)Math.Min(n[1], n[2]);\n Console.WriteLine(sum);\n Console.ReadLine();\n }\n \n }\n}", "lang": "Mono C#", "bug_code_uid": "d3b65f6c5980a5b04b167de7fe4c3788", "src_uid": "af07223819aeb5bd6ded4340c472b2b6", "apr_id": "9d66b105395ade341290dab23f2a478c", "difficulty": 1000, "tags": ["greedy"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.38574283810792803, "equal_cnt": 25, "replace_cnt": 18, "delete_cnt": 3, "insert_cnt": 4, "fix_ops_cnt": 25, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\n\nnamespace _1040A\n{\n class Program\n {\n static void Main(string[] args)\n {\n IEnumerable container = Console.ReadLine().Split().Select(int.Parse);\n int n = container.ElementAt(0), whiteCost = container.ElementAt(1), blackCost=container.ElementAt(2);\n List colorslist = Console.ReadLine().Split().Select(int.Parse).ToList();\n int minCost = 0;\n if (n == 1 || !colorslist.Contains(2)) Console.WriteLine(0);\n else if (!CheckPalin(colorslist, n)) Console.WriteLine(-1);\n else\n {\n for (int i = 0; i < n / 2; i++)\n {\n if (colorslist[i] == 1 && colorslist[n - 1] == 2 || colorslist[i] == 2 && colorslist[n - 1] == 1)\n minCost += blackCost;\n else if (colorslist[i] == 0 && colorslist[n - 1] == 2 || colorslist[i] == 2 && colorslist[n - 1] == 0)\n minCost += whiteCost;\n else\n {\n minCost += (Math.Min(whiteCost, blackCost)) * 2;\n }\n }\n if (n % 2 == 1 && colorslist[n / 2 + 1] == 2) minCost += Math.Min(whiteCost, blackCost);\n Console.WriteLine(minCost);\n }\n }\n public static bool CheckPalin(List colorslist,int n)\n {\n bool answer = true;\n for(int i=0;i<(n/2);i++)\n {\n if(colorslist[i]!=colorslist[n-1] && (colorslist[i]!=2 && colorslist[n-1]!=2))\n {\n answer = false;\n break;\n }\n }\n return answer;\n }\n }\n}\n\n\n \n \n\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "9af6889cae32fd6288f02837a96ccb34", "src_uid": "af07223819aeb5bd6ded4340c472b2b6", "apr_id": "5dab8ad9b62d605f5a8ef08b6117f04c", "difficulty": 1000, "tags": ["greedy"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.4425287356321839, "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 _630E_Rectangle\n{\n class Program\n {\n static void Main(string[] args)\n {\n var temp = Array.ConvertAll(Console.ReadLine().Split(' '), x => Convert.ToInt32(x));\n int x1 = temp[0];\n int y1 = temp[1];\n int x2 = temp[2];\n int y2 = temp[3];\n\n int oddscount;\n int evencount;\n int oddsheight;\n int evenheight;\n\n if ((x2 - x1)%2 == 0)\n {\n if (x2%2 == 0)\n {\n evencount = (x2 - x1)/2 + 1;\n oddscount = evencount - 1;\n }\n else\n {\n oddscount = (x2 - x1)/2 + 1;\n evencount = oddscount - 1;\n }\n }\n else\n {\n oddscount = (x2 - x1 + 1)/2;\n evencount = oddscount;\n }\n\n oddsheight = (int)Math.Floor((y2 - y1)/2.0)+1;\n evenheight = (int) Math.Ceiling((y2 - y1)/2.0);\n\n Console.WriteLine(oddscount*oddsheight+evencount*evenheight);\n }\n }\n}\n\n", "lang": "MS C#", "bug_code_uid": "e82f26ece7699b678b601fb73abc9371", "src_uid": "00cffd273df24d1676acbbfd9a39630d", "apr_id": "d0b018054e38c45a2448321b05cc3a47", "difficulty": 1900, "tags": ["math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.4954499494438827, "equal_cnt": 10, "replace_cnt": 5, "delete_cnt": 3, "insert_cnt": 2, "fix_ops_cnt": 10, "bug_source_code": "using System;\nclass Program\n{\n static void Main()\n {\n var p = Console.ReadLine();\n var w = new int[8];\n for (int i = 0; i < 10; i++)\n {\n var c = Console.ReadLine();\n var id = 0;\n for (int j = 0; j < 80; j += 10)\n {\n if ((id = p.Substring(j, 10).IndexOf(c)) >= 0)\n {\n w[j] = i;\n break;\n }\n }\n }\n foreach (var i in w)\n {\n Console.Write(i);\n }\n }\n}", "lang": "MS C#", "bug_code_uid": "a59305e3c9ca8874104d4a5d6db855e0", "src_uid": "0f4f7ca388dd1b2192436c67f9ac74d9", "apr_id": "deedc7d54c49122069d2f6629ee8357e", "difficulty": 900, "tags": ["strings", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.706031746031746, "equal_cnt": 9, "replace_cnt": 4, "delete_cnt": 3, "insert_cnt": 1, "fix_ops_cnt": 8, "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 Int32 i;\n string ans=\"NO\", sInput;\n string fInput=Console.ReadLine();\n for(i=0; i<5; i++)\n {\n sInput = Console.ReadLine();\n if((fInput[0] == sInput[0]) || (fInput[0] == sInput[1]) || (fInput[1] == sInput[0]) || (fInput[1] == sInput[1]))\n {\n ans = \"YES\";\n }\n }\n Console.WriteLine(ans);\n \n// Console.ReadKey();\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "7731c8c8039fb686ab9968c41edfb1b6", "src_uid": "699444eb6366ad12bc77e7ac2602d74b", "apr_id": "8703db1834f01102a399d9237c26b3c2", "difficulty": 800, "tags": ["brute force", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.994904149478282, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "using System;\n\n\nnamespace Contest\n{\n class Scanner\n {\n private string[] line = new string[0];\n private int index = 0;\n\n public string Next()\n {\n if (line.Length <= index)\n {\n line = Console.ReadLine().Split(' ');\n index = 0;\n }\n\n var res = line[index];\n index++;\n return res;\n }\n\n public int NextInt()\n {\n return int.Parse(Next());\n }\n\n public long NextLong()\n {\n return long.Parse(Next());\n }\n\n public ulong NextUlong()\n {\n return ulong.Parse(Next());\n }\n\n public string[] Array()\n {\n line = Console.ReadLine().Split(' ');\n index = line.Length;\n return line;\n }\n\n public int[] IntArray()\n {\n var array = Array();\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\n public long[] LongArray()\n {\n var array = Array();\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 }\n\n class Program\n {\n private string card;\n private string[] myCard;\n void Scan()\n {\n var sc = new Scanner();\n card = sc.Next();\n myCard = sc.Array();\n }\n\n public void Solve()\n {\n foreach (var s in myCard)\n {\n if (card[0] == s[0] || card[1] == s[1])\n {\n Console.WriteLine(\"YES\");\n return;\n }\n\n }\n Console.WriteLine(\"NO\");\n }\n\n\n\n static void Main() => new Program().Solve();\n }\n\n\n}\n", "lang": "Mono C#", "bug_code_uid": "b8e45aad09bbc81d3369f1bc178a4e33", "src_uid": "699444eb6366ad12bc77e7ac2602d74b", "apr_id": "7a161f5ecadff34c5be23fc02d96fa07", "difficulty": 800, "tags": ["brute force", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C#"} {"similarity_score": 0.9308943089430894, "equal_cnt": 10, "replace_cnt": 2, "delete_cnt": 4, "insert_cnt": 3, "fix_ops_cnt": 9, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\n\nnamespace ConsoleApp1\n{\n class Program\n {\n static void Main(string[] args)\n {\n int n =Int32.Parse(Console.ReadLine());\n int m = Int32.Parse(Console.ReadLine());\n List peoples = new List();\n\n while (Console.ReadLine() != \"\")\n {\n peoples.Add(Int32.Parse(Console.ReadLine()));\n }\n\n int maxK = peoples.Max() + m;\n\n for (int i = 0; i < m; i++)\n {\n peoples[peoples.IndexOf(peoples.Min())]++;\n }\n\n int minK = peoples.Max();\n\n Console.WriteLine(minK + \" \" + maxK);\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "97c4264564f1e26d123cf1e257ac88d8", "src_uid": "78f696bd954c9f0f9bb502e515d85a8d", "apr_id": "5cc4ce95d8634dc513d126a9c54ba6b4", "difficulty": 1100, "tags": ["implementation", "binary search"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C#"} {"similarity_score": 0.9622363903874448, "equal_cnt": 4, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 4, "fix_ops_cnt": 4, "bug_source_code": "using System;\n\nnamespace ConsoleApp1\n{\n class Program\n {\n static void Main(string[] args)\n {\n int numBenches = Convert.ToInt32(Console.ReadLine());\n int numExtraPeople = Convert.ToInt32(Console.ReadLine());\n int modifiedNumExtraPeople = numExtraPeople;\n int[] benches = new int[numBenches];\n for (int i = 0; i < numBenches; i++) benches[i] = Convert.ToInt32(Console.ReadLine());\n int maxPeopleCount = FindMax(benches);\n foreach (var i in benches) modifiedNumExtraPeople -= maxPeopleCount - i;\n Console.WriteLine(\"{} {}\", maxPeopleCount + Math.Ceiling((double)modifiedNumExtraPeople / numBenches), numExtraPeople + maxPeopleCount);\n }\n\n static int FindMax(int[] array)\n {\n int max = Int32.MinValue;\n foreach(var i in array)\n {\n if (i > max) max = i;\n }\n return max;\n }\n }\n}", "lang": "Mono C#", "bug_code_uid": "10799e6d35eb196f056826eebb411a92", "src_uid": "78f696bd954c9f0f9bb502e515d85a8d", "apr_id": "b821b9236a9d2c5e0afbb14b8fe351ff", "difficulty": 1100, "tags": ["implementation", "binary search"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.9829545454545454, "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.Text.RegularExpressions;\nusing System.IO;\n\nnamespace Rextester\n{\n public class Program\n {\n public static void Main(string[] args)\n {\n string s = Console.ReadLine();\n string []ast = s.Split(new char[]{' '});\n int a = int.Parse(ast[0]);\n int b = int.Parse(ast[1]);\n int c = int.Parse(ast[2]);\n int n = int.Parse(ast[3]);\n \n int otv = n - ((a - c) + (b - c) + c);\n if((otv > 0) && (n > c))\n Console.WriteLine(otv);\n else\n Console.WriteLine(\"-1\");\n } \n }\n}", "lang": "Mono C#", "bug_code_uid": "b5e2fec59064ed80515619b39675cf22", "src_uid": "959d56affbe2ff5dd999a7e8729f60ce", "apr_id": "9721d3efb7451311f043116957315753", "difficulty": 1000, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.9896602658788775, "equal_cnt": 4, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 3, "bug_source_code": "// Problem: 991A - If at first you don't succeed...\n// Author: Gusztav Szmolik\n\nusing System;\n\nclass IfAtFirstYouDontSucceed\n {\n static int Main ()\n {\n string[] words = ReadSplitLine (4);\n if (words == null)\n return -1;\n byte a;\n if (!Byte.TryParse (words[0], out a))\n return -1;\n if (a > 100)\n return -1;\n byte b;\n if (!Byte.TryParse (words[1], out b))\n return -1;\n if (b > 100)\n return -1;\n byte c;\n if (!Byte.TryParse (words[2], out c))\n return -1;\n if (c > 100)\n return -1;\n byte n;\n if (!Byte.TryParse (words[3], out n))\n return -1;\n if (n > 100)\n return -1;\n sbyte ans = Convert.ToSByte (a >= c && b >= c ? a+b-c : -1);\n ans = Convert.ToSByte (ans > -1 && n > ans ? n-ans : -1);\n Console.WriteLine (ans);\n return 0;\n }\n \n static string[] ReadSplitLine (uint numWordNeed)\n {\n string line = Console.ReadLine ();\n if (line == null)\n return null;\n char[] delims = new char[2] {' ', '\\t'};\n string[] words = line.Split (delims,StringSplitOptions.RemoveEmptyEntries);\n return (words.Length == numWordNeed ? words : null);\n } \n }\n", "lang": "Mono C#", "bug_code_uid": "4380fc3883263328f6183c69114105ab", "src_uid": "959d56affbe2ff5dd999a7e8729f60ce", "apr_id": "0eb53625da6a39c1e067437aeb5617ac", "difficulty": 1000, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9722070844686649, "equal_cnt": 7, "replace_cnt": 6, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 7, "bug_source_code": " static void Main()\n {\n string[] d = Console.ReadLine().Split(' ');\n int r = Convert.ToInt32(d[0]);\n int c = Convert.ToInt32(d[1]);\n bool b = false;\n int a=0;\n int ra = r;\n string[] s= new string[r];\n for (int i=0; i < r; i++) {\n s[i] = Console.ReadLine();\n }\n\n for (int i = 0; i < r; i++) {\n b = false;\n for (int j = 0; j < c; j++) {\n if (s[i][j] == 's') { b = true; break; }\n }\n if (!b)\n {\n a += c;\n ra--;\n }\n }\n\n for (int j = 0; j < c; j++)\n {\n b = false;\n for (int i = 0; i < r; i++)\n {\n if (s[i][j] == 's') { b = true; break; }\n }\n if (!b) a += ra;\n \n }\n Console.WriteLine(a);\n }\n}\n\n", "lang": "MS C#", "bug_code_uid": "355b63fa5466d72189cdccb2a895f696", "src_uid": "ebaf7d89c623d006a6f1ffd025892102", "apr_id": "b9b231d1625076c250cb14245eb47b6b", "difficulty": 800, "tags": ["brute force", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9505520883341335, "equal_cnt": 4, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Collections;\nusing System.Linq;\nusing System.Text;\nusing System.IO;\nusing System.Threading.Tasks;\n\nnamespace fun\n{\n class Program\n {\n private static TextReader cin = Console.In;\n private static TextWriter cout = Console.Out;\n static void Main(string[] args)\n {\n string s = cin.ReadLine() ;\n int a = int.Parse(s.Split(' ')[0]);\n var t = Array.ConvertAll(cin.ReadLine().Split(' '), int.Parse);\n var ar = new ArrayList(t);\n var br = new ArrayList(t);\n int ans = 100000000;\n int m = -100000000;\n\n for (int i = 1; i+1 < a; i++)\n {\n ar.RemoveAt(i);\n for(int j=0;j+1= 1 && n <= Math.Pow(10, 9))\n {\n if (n == 1)\n {\n Console.WriteLine(n);\n }\n else if (n == 2)\n {\n Console.WriteLine(n-1);\n }\n else if (n % 2 == 0)\n {\n for (; n != 0;)\n {\n if (Cheak == false)\n {\n n--;\n step++;\n if (n != 0)\n Cheak = true;\n }\n if (Cheak == true)\n {\n n -= 2;\n step++;\n if (n != 0)\n Cheak = false;\n }\n }\n n = step;\n Console.WriteLine(n);\n }\n else if ((n % 2 != 0))\n {\n for (; n != 0;)\n {\n if (Cheak == true)\n {\n n--;\n step++;\n if (n != 0)\n Cheak = false;\n }\n if (Cheak == false)\n {\n n -= 2;\n step++;\n if (n != 0)\n Cheak = true;\n }\n }\n n = step;\n Console.WriteLine(n);\n }\n\n\n }\n }\n\n }\n}\n", "lang": "MS C#", "bug_code_uid": "deaa87e708f8e7f765012b01fe1aab3c", "src_uid": "a993069e35b35ae158d35d6fe166aaef", "apr_id": "00e3dc91160e778a5267eb8e4a27a942", "difficulty": 800, "tags": ["math"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.6909894969596462, "equal_cnt": 29, "replace_cnt": 8, "delete_cnt": 6, "insert_cnt": 14, "fix_ops_cnt": 28, "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 int n = int.Parse(Console.ReadLine());\n int step = 0;\n bool Cheak = false;\n if (n >= 1 && n <= Math.Pow(10, 9))\n {\n if (n == 1)\n {\n Console.WriteLine(n);\n }\n else if (n == 2)\n {\n Console.WriteLine(n-1);\n }\n else if (n % 2 == 0)\n {\n for (; n != 0;)\n {\n if (Cheak == false)\n {\n n--;\n step++;\n if (n != 0)\n Cheak = true;\n }\n if (Cheak == true)\n {\n n -= 2;\n step++;\n if (n != 0)\n Cheak = false;\n }\n }\n n = step;\n Console.WriteLine(n);\n }\n else if ((n % 2 != 0))\n {\n for (; n != 0;)\n {\n if (Cheak == true)\n {\n n--;\n step++;\n if (n != 0)\n Cheak = false;\n }\n if (Cheak == false)\n {\n n -= 2;\n step++;\n if (n != 0)\n Cheak = true;\n }\n }\n n = step;\n Console.WriteLine(n);\n }\n\n\n }\n Console.ReadKey();\n }\n\n }\n}\n", "lang": "MS C#", "bug_code_uid": "9548bbbf6b00a2315ad65b52f535750e", "src_uid": "a993069e35b35ae158d35d6fe166aaef", "apr_id": "00e3dc91160e778a5267eb8e4a27a942", "difficulty": 800, "tags": ["math"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.9043845747490755, "equal_cnt": 6, "replace_cnt": 4, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 5, "bug_source_code": "/*\ncsc -debug A.cs && mono --debug A.exe <<< \"2\n3\n5\n1\n8\"\n*/\n\nusing System;\nusing System.Collections;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading;\nusing System.Reflection;\n\npublic class HelloWorld {\n public static void SolveCodeForces() {\n var a1 = cin.NI();\n var a2 = cin.NI();\n var k1 = cin.NI();\n var k2 = cin.NI();\n var n = cin.NI();\n\n var min = -1;\n var max = -1;\n\n for (var n1 = 0; n1 <= a1 * k1; n1++) {\n var n2 = n - n1;\n if (n2 < 0 || n2 > a2 * k2) continue;\n\n var mm1 = GetMinMax(a1, k1, n1);\n var mm2 = GetMinMax(a2, k2, n2);\n\n if (min < 0) {\n min = mm1[0] + mm2[0];\n max = mm1[1] + mm2[1];\n }\n min = Math.Min(min, mm1[0] + mm2[0]);\n max = Math.Max(max, mm1[1] + mm2[1]);\n }\n\n System.Console.WriteLine(\"{0} {1}\", min, max);\n }\n\n static int[] GetMinMax(int a, int k, int n) {\n var P = new int[a];\n var nn = n;\n for (var i = 0; i < a; i++) {\n var d = Math.Min(nn, k - 1);\n P[i] = d;\n nn -= d;\n }\n// System.Console.WriteLine(new { a, k, n, P=P.Join(), nn });\n for (var i = 0; i < a; i++) {\n var d = Math.Min(nn, k - P[i]);\n P[i] += d;\n nn -= d;\n }\n// System.Console.WriteLine(new { a, k, n, P=P.Join(), nn });\n var min = P.Count(p => p >= k);\n\n P = new int[a];\n nn = n;\n for (var i = 0; i < a; i++) {\n var d = Math.Min(nn, k);\n P[i] = d;\n nn -= d;\n }\n var max = P.Count(p => p >= k);\n return new[] { min, max };\n }\n\n static Scanner cin = new Scanner();\n static StringBuilder cout = new StringBuilder();\n\n static public void Main () {\n SolveCodeForces();\n // IncreaseStack(SolveCodeForces);\n // System.Console.Write(cout.ToString());\n }\n\n public static void IncreaseStack(ThreadStart action, int stackSize = 128000000)\n {\n var thread = new Thread(action, stackSize);\n thread.Start();\n thread.Join();\n }\n}\n\npublic static class Helpers {\n public static string Join(this IEnumerable arr, string sep = \" \") {\n return string.Join(sep, arr);\n }\n\n public static void Swap(ref T a, ref T b) {\n var tmp = a;\n a = b;\n b = tmp;\n }\n\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\npublic class Scanner\n{\n private string[] line = new string[0];\n private int index = 0;\n\n public string Next() {\n if (line.Length <= index) {\n line = Console.ReadLine().Split(' ');\n index = 0;\n }\n var res = line[index];\n index++;\n return res;\n }\n\n public int NI() {\n return int.Parse(Next());\n }\n\n public long NL() {\n return long.Parse(Next());\n }\n\n public ulong NUL() {\n return ulong.Parse(Next());\n }\n\n public string[] Array() {\n line = Console.ReadLine().Split(' ');\n index = line.Length;\n return line;\n }\n\n public int[] NIA(int emptyPrefixLen = 0) {\n var array = Array();\n var result = new int[emptyPrefixLen + array.Length];\n for (int i = 0; i < array.Length; i++)\n result[emptyPrefixLen + i] = int.Parse(array[i]);\n return result;\n }\n\n public long[] NLA() {\n var array = Array();\n var result = new long[array.Length];\n for (int i = 0; i < array.Length; i++)\n result[i] = long.Parse(array[i]);\n return result;\n }\n\n public ulong[] NULA() {\n var array = Array();\n var result = new ulong[array.Length];\n for (int i = 0; i < array.Length; i++)\n result[i] = ulong.Parse(array[i]);\n return result;\n }\n}", "lang": "Mono C#", "bug_code_uid": "94991931b6c39939b4844dad8ac70c6f", "src_uid": "2be8e0b8ad4d3de2930576c0209e8b91", "apr_id": "3a5c10e2f63d8ebe818fbdc14845e913", "difficulty": 1000, "tags": ["greedy", "math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.3238480771520419, "equal_cnt": 48, "replace_cnt": 26, "delete_cnt": 8, "insert_cnt": 15, "fix_ops_cnt": 49, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\n\nnamespace aWholeMuseum\n{\n /*you are a museum full of art but I choose to shut and keep my eyes shut*/\n class Program\n {\n static void Main(string[] args)\n {\n int nomFirst = int.Parse(Console.ReadLine());\n int nomSecond = int.Parse(Console.ReadLine());\n int maxOfFirst = int.Parse(Console.ReadLine());\n int maxOfSecond = int.Parse(Console.ReadLine());\n int totalCards = int.Parse(Console.ReadLine());\n\n int maxAnswer = getMax(nomFirst, nomSecond, maxOfFirst, maxOfSecond, totalCards);\n int minAnswer = getMin(nomFirst, nomSecond, maxOfFirst, maxOfSecond, totalCards);\n Console.WriteLine(minAnswer.ToString() + \" \" + maxAnswer.ToString());\n // Console.ReadLine();\n }\n static int getMax(int nomFirst, int nomSecond, int maxOfFirst, int maxOfSecond, int totalCards)\n {\n int weightFirst = nomFirst / maxOfFirst;\n int weightSecond = nomSecond / maxOfSecond;\n int flag = 0;\n if (weightFirst > weightSecond) { flag = 1; }\n else if (weightFirst < weightSecond) { flag = 2; }\n\n int Answer = 0;\n int some = nomFirst + nomSecond;\n\n while (totalCards > 0)\n {\n if (flag == 1)\n {\n\n while (nomFirst > 0 && totalCards > 0)\n {\n nomFirst--;\n totalCards -= maxOfFirst;\n Answer++;\n }\n if (nomFirst <= 0) flag = 2;\n if (totalCards < maxOfFirst) break;\n }\n else if (flag == 2)\n {\n\n while (nomSecond > 0 && totalCards > 0)\n {\n nomSecond--;\n totalCards -= maxOfSecond;\n Answer++;\n }\n if (nomSecond <= 0) flag = 1;\n if (totalCards < maxOfSecond) break;\n }\n else\n {\n while (some > 0 && totalCards > 0)\n {\n some--;\n totalCards -= maxOfSecond;\n Answer++;\n }\n if (totalCards < maxOfSecond) break;\n }\n }\n return Answer;\n }\n\n static int getMin(int nomFirst, int nomSecond, int maxOfFirst, int maxOfSecond, int totalCards)\n {\n //eliminate the cards\n double weightFirst = Double.Parse(nomFirst.ToString()) /Double.Parse( maxOfFirst.ToString());\n double weightSecond = Double.Parse(nomSecond.ToString()) / Double.Parse(maxOfSecond.ToString());\n int flag = 0;\n if (weightFirst < weightSecond) { flag = 1; }\n else if (weightFirst > weightSecond) { flag = 2; }\n \n int Answer = 0;\n int some = nomFirst + nomSecond;\n\n while (totalCards > 0 && (nomFirst + nomSecond) > 0)\n {\n \n if (flag == 1)\n {\n\n while (nomFirst > 0 && totalCards > 0)\n {\n nomFirst--;\n \n\n if (maxOfFirst - 1 >= 0) totalCards -= (maxOfFirst - 1);\n\n }\n if (nomFirst <= 0) flag = 2;\n }\n else if (flag == 2)\n {\n\n while (nomSecond > 0 && totalCards > 0)\n {\n nomSecond--;\n \n if (maxOfSecond - 1 >= 0) totalCards -= (maxOfSecond - 1);\n\n }\n if (nomSecond <= 0) flag = 1;\n }\n else\n {\n while (some > 0 && totalCards > 0)\n {\n some--;\n if (maxOfSecond - 1 >= 0) totalCards -= (maxOfSecond - 1);\n\n }\n if (some <= 0) break;\n }\n }\n Answer = totalCards;\n return Answer;\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "6b2ac5750a5c30ddfb6c4dbeacee91e1", "src_uid": "2be8e0b8ad4d3de2930576c0209e8b91", "apr_id": "2c32e513755dd6020e02f31b3067e2a6", "difficulty": 1000, "tags": ["greedy", "math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.2761596548004315, "equal_cnt": 11, "replace_cnt": 8, "delete_cnt": 4, "insert_cnt": 0, "fix_ops_cnt": 12, "bug_source_code": "using Coding;\nusing System;\nusing System.Collections.Generic;\n\nnamespace ProblemSolving\n{\n class Program\n {\n static void Main(string[] args)\n {\n \n\n Console.WriteLine(\"Enter The Number Of The Cube \");\n int x = Convert.ToInt32(Console.ReadLine());\n int sum = 0;\n int c = 0;\n while (x > 0)\n {\n c++;\n for (int i = 1; i <= c; i++)\n {\n sum += i;\n }\n x -= sum;\n }\n Console.WriteLine(c);\n\n\n\n\n\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "55f5daa4d62355550ee43db88b046643", "src_uid": "873a12edffc57a127fdfb1c65d43bdb0", "apr_id": "81c49368545a37965d2b82f380b22302", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9971048060220035, "equal_cnt": 3, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "using System;\nusing System.Linq;\n\nclass P {\n static void Main() {\n var r = Console.ReadLine().Split(' ').Select(int.Parse).ToArray();\n var c = Console.ReadLine().Split(' ').Select(int.Parse).ToArray();\n var d = Console.ReadLine().Split(' ').Select(int.Parse).ToArray();\n var res = new [] { new int[2], new int[2] };\n res[0][1] = r[0] + c[1] - d[0];\n if (res[0,1] % 2 == 1) { Console.WriteLine(-1); return; }\n res[0][1] /= 2;\n res[0][0] = r[0] - res[0][1];\n res[1][0] = c[0] - res[0][0];\n res[1][1] = r[1] - res[1][1];\n if (res.SelectMany(aa => aa).Distinct().Count(x => x>=1 && x<=9)<4 || res[0][1]+res[1][1] != c[1] || res[0][0]+res[1][1] != d[0] || res[0][1]+res[1][0] != d[1]) { Console.Write(-1); return; }\n\n Console.WriteLine(\"{0} {1}\", res[0][0], res[0][1]);\n Console.WriteLine(\"{0} {1}\", res[1][0], res[1][1]);\n }\n}", "lang": "MS C#", "bug_code_uid": "47057d8ff3d9123b48d3cce3ccfbf4d8", "src_uid": "6821f502f5b6ec95c505e5dd8f3cd5d3", "apr_id": "98225b25d13660b6b26bd71840d748b4", "difficulty": 1000, "tags": ["math", "brute force"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9812431040823832, "equal_cnt": 5, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 3, "fix_ops_cnt": 4, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\nclass Startup\n{\n static void Main()\n {\n int[] intInput = ReadLineAndParseToArray();\n int n = intInput[0];\n int nTemp = n;\n int m = intInput[1];\n\n\n if(n == m) { Console.WriteLine($\"0\"); return; }\n if((m % 2*n != 0 || m < 2*n ) && ( m % 3*n != 0 || m < 3*n) && ( m % 6*n != 0 || m < 6*n)) { Console.WriteLine(\"-1\"); return; }\n\n \n int counter2 = 0;\n int counter3 = 0;\n while(nTemp % 2 == 0) { nTemp /= 2; counter2++; }\n while(nTemp % 3 == 0) { nTemp /= 3; counter3++; }\n \n int counter22 = 0;\n int counter33 = 0;\n while(m % 2 == 0 ) { m /= 2; counter22++; }\n while(m % 3 == 0) { m /= 3; counter33++; }\n counter22 -= counter2;\n counter33 -= counter3;\n for(int i = 0; i < counter22; i++){\n n *= 2;\n }\n for(int i = 0 ; i < counter33; i++){\n n *= 3;\n }\n if(n != m) { Console.WriteLine(\"-1\"); return; } \n counter = counter22 + counter33 - counter2 - counter3;\n Console.WriteLine($\"{counter}\");\n \n }\n\n static int[] ReadLineAndParseToArray()\n {\n return Console.ReadLine().Split().Select(int.Parse).ToArray();\n }\n \n \n}", "lang": "Mono C#", "bug_code_uid": "fa72a37cf83e8fa1d434f2ceff6cf452", "src_uid": "3f9980ad292185f63a80bce10705e806", "apr_id": "14c7a40f9bef8c199ed7b109c4791a6f", "difficulty": 1000, "tags": ["math", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.967687074829932, "equal_cnt": 8, "replace_cnt": 5, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 7, "bug_source_code": "using System;\n\nnamespace CF_SoldierAndBanana {\n class Program {\n static void Main(string[] args) {\n string[] inputs = Console.ReadLine().Split(' ');\n short startprice = Int16.Parse(inputs[0]);\n short cash = Int16.Parse(inputs[1]);\n short bananacount = Int16.Parse(inputs[2]);\n if ((startprice * bananacount * (bananacount + 1) / 2) > cash) {\n Console.WriteLine((startprice * bananacount * (bananacount + 1) / 2) - cash);\n return;\n }\n Console.WriteLine(0);\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "c55fd96579c383f54a7dba6be3366386", "src_uid": "e87d9798107734a885fd8263e1431347", "apr_id": "777c6456002a935c97b8de3e764edd56", "difficulty": 800, "tags": ["math", "brute force", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.8375209380234506, "equal_cnt": 7, "replace_cnt": 3, "delete_cnt": 2, "insert_cnt": 1, "fix_ops_cnt": 6, "bug_source_code": "using System;\n\nnamespace testrun\n{\n class Program\n {\n static void Main(string[] args)\n {\n int n = int.Parse(Console.ReadLine());\n int m = int.Parse(Console.ReadLine());\n\n if (n == m)\n {\n System.Console.WriteLine(0);\n return;\n }\n\n int maxGroups = n / 2;\n int maxGroupsGap = n % 2 != 0 ? 1 : 0;\n\n if (m < maxGroups)\n {\n System.Console.WriteLine(m + 1);\n return;\n }\n\n if (m > maxGroups + maxGroupsGap)\n {\n System.Console.WriteLine(maxGroups - (m - maxGroups - maxGroupsGap));\n return;\n }\n\n System.Console.WriteLine(maxGroups);\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "6a68e96855588d4403592734b4060035", "src_uid": "c05d0a9cabe04d8fb48c76d2ce033648", "apr_id": "ec6721e60ca82afe427e492ded72c00b", "difficulty": 900, "tags": ["math", "greedy"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9245901639344263, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "using System;\n\nnamespace testrun\n{\n class Program\n {\n static void Main(string[] args)\n {\n string[] values = Console.ReadLine().Split(' ');\n int n = int.Parse(values[0]);\n int m = int.Parse(values[1]);\n\n if (n == m)\n {\n System.Console.WriteLine(0);\n return;\n }\n\n int maxGroups = n / 2;\n int maxGroupsGap = n % 2 != 0 ? 1 : 0;\n\n if (m < maxGroups)\n {\n System.Console.WriteLine(m);\n return;\n }\n\n if (m > maxGroups + maxGroupsGap)\n {\n System.Console.WriteLine(maxGroups - (m - maxGroups - maxGroupsGap));\n return;\n }\n\n System.Console.WriteLine(maxGroups);\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "2e16bf8db7991046f78520e2c8e300f7", "src_uid": "c05d0a9cabe04d8fb48c76d2ce033648", "apr_id": "ec6721e60ca82afe427e492ded72c00b", "difficulty": 900, "tags": ["math", "greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.017200674536256323, "equal_cnt": 28, "replace_cnt": 18, "delete_cnt": 5, "insert_cnt": 5, "fix_ops_cnt": 28, "bug_source_code": "\n\n \n \n Debug\n AnyCPU\n {25B6AE56-020D-4B7D-824A-5834F25493CD}\n Exe\n _825\n 825\n v4.5.2\n 512\n true\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": "MS C#", "bug_code_uid": "fde532cfdeff32096e4464cebc966494", "src_uid": "d5541028a2753c758322c440bdbf9ec6", "apr_id": "6dd5f0c1f6945a19abaf4ac7dfc54e44", "difficulty": 1600, "tags": ["brute force", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9569029696418232, "equal_cnt": 12, "replace_cnt": 3, "delete_cnt": 2, "insert_cnt": 6, "fix_ops_cnt": 11, "bug_source_code": "using System;\nusing System.Collections;\nusing System.IO;\nusing System.Linq;\nusing System.Collections.Generic;\nusing System.Text;\n\nnamespace TestConsole\n{\n class Program\n {\n static void Main(string[] args)\n {\n var data = GetInput();\n SolveProblem(data);\n }\n\n public static void SolveProblem(List input)\n {\n var inputLine = input[0] + input[1] + input[2];\n if (IsIllegalState(inputLine))\n {\n Console.WriteLine(\"illegal\");\n return;\n }\n else\n {\n var positionData = GetCountAndPositions(inputLine);\n int xWonStateCount = IsWonPosition(positionData['X'].Item1);\n int zeroWonStateCount = IsWonPosition(positionData['0'].Item1);\n if (xWonStateCount > 0 && zeroWonStateCount == 0)\n {\n Console.WriteLine(\"the first player won\");\n return;\n }\n else if (xWonStateCount == 0 && zeroWonStateCount > 0)\n {\n Console.WriteLine(\"the second player won\");\n return;\n }\n else\n {\n if (xWonStateCount == 0 && zeroWonStateCount == 0 && positionData['.'].Item2 == 0)\n {\n Console.WriteLine(\"draw\");\n return;\n }\n else if (positionData['.'].Item2 > 0)\n {\n if (positionData['X'].Item2 > positionData['0'].Item2)\n {\n Console.WriteLine(\"second\");\n return;\n }\n else\n {\n Console.WriteLine(\"first\");\n return;\n }\n }\n }\n }\n }\n\n public static List GetInput()\n {\n var list = new List();\n list.Add(Console.ReadLine());\n list.Add(Console.ReadLine());\n list.Add(Console.ReadLine());\n return list;\n }\n\n private static List GetWonStateIndices()\n {\n var wonStates = new List();\n wonStates.Add(\"0,1,2\");\n wonStates.Add(\"3,4,5\");\n wonStates.Add(\"6,7,8\");\n wonStates.Add(\"0,3,6\");\n wonStates.Add(\"1,4,7\");\n wonStates.Add(\"2,5,8\");\n wonStates.Add(\"0,4,8\");\n wonStates.Add(\"2,4,6\");\n return wonStates;\n }\n\n private static int IsWonPosition(string input)\n {\n int wonStateCount = 0;\n var wonStates = GetWonStateIndices();\n foreach (var state in wonStates)\n {\n bool isStatePresent = true;\n var positions = state.Split(',');\n foreach (var position in positions)\n {\n if (!input.Contains(position))\n {\n isStatePresent = false;\n break;\n }\n }\n if (isStatePresent)\n wonStateCount++;\n }\n return wonStateCount;\n }\n\n public static bool IsIllegalState(string input)\n {\n int xWonStateCount = 0;\n int zeroWonStateCount = 0;\n var positionData = GetCountAndPositions(input);\n if (positionData['0'].Item2 > positionData['X'].Item2)\n return true;\n if (Math.Abs(positionData['X'].Item2 - positionData['0'].Item2) > 1)\n return true;\n if (positionData['X'].Item2 > 5 || positionData['0'].Item2 > 4)\n return true;\n if (positionData['X'].Item2 >= 3)\n {\n xWonStateCount = IsWonPosition(positionData['X'].Item1);\n if (xWonStateCount > 1)\n return true;\n }\n\n if (positionData['0'].Item2 >= 3)\n {\n zeroWonStateCount = IsWonPosition(positionData['0'].Item1);\n if (zeroWonStateCount > 1)\n return true;\n }\n if (xWonStateCount > 0 && zeroWonStateCount > 0)\n return true;\n return false;\n }\n\n private static Dictionary> GetCountAndPositions(string input)\n {\n var zeroBuilder = new StringBuilder();\n var xBuilder = new StringBuilder();\n var dotBuilder = new StringBuilder();\n int zeroCount = 0;\n int xCount = 0;\n int dotCount = 0;\n for (int i = 0; i < input.Length; i++)\n {\n if (input[i] == '0')\n {\n zeroBuilder.Append(i.ToString() + \",\");\n zeroCount++;\n }\n else if (input[i] == 'X')\n {\n xBuilder.Append(i.ToString() + \",\");\n xCount++;\n }\n else\n {\n dotBuilder.Append(i.ToString() + \",\");\n dotCount++;\n }\n }\n zeroBuilder.Remove(zeroBuilder.Length - 1, 1);\n xBuilder.Remove(xBuilder.Length - 1, 1);\n dotBuilder.Remove(dotBuilder.Length - 1, 1);\n\n var data = new Dictionary>();\n data.Add('0', Tuple.Create(zeroBuilder.ToString(), zeroCount));\n data.Add('X', Tuple.Create(xBuilder.ToString(), xCount));\n data.Add('.', Tuple.Create(dotBuilder.ToString(), dotCount));\n return data;\n }\n }\n}", "lang": "MS C#", "bug_code_uid": "3627cb8b8f7769524ac5133291233926", "src_uid": "892680e26369325fb00d15543a96192c", "apr_id": "95b484829f26bbde4dd2227f7e845f79", "difficulty": 1800, "tags": ["games", "brute force", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.9952017060600675, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "using System;\n\nnamespace _3A_TicTacToe\n{\n\n class Program\n {\n static bool IsValidCoord(int x, int y)\n {\n if (x < 0 || x >= 3) return false;\n if (y < 0 || y >= 3) return false;\n return true;\n }\n static bool CheckWin(string[] grid, char val)\n {\n int[] dx = new int[] { -1, 0, 1, -1, 1, -1, 0, 1 };\n int[] dy = new int[] { -1, -1, -1, 0, 0, 1, 1, 1 };\n\n for (int i = 0; i < 3; i++)\n {\n for (int j = 0; j < 3; j++)\n {\n\n if (grid[i][j] == val)\n {\n int numCellInLine = 0;\n\n\n //move next state\n for (int k = 0; k < dx.Length; k++)\n {\n var x = i;\n var y = j;\n while (IsValidCoord(x, y) && grid[x][y] == val)\n {\n x += dx[k];\n y += dy[k];\n ++numCellInLine;\n }\n //check if win\n if (numCellInLine == 3) return true;\n else numCellInLine = 0;\n\n }\n\n\n\n }\n\n }\n }\n\n return false;\n }\n static void Print(string status)\n {\n System.Console.WriteLine(status);\n }\n static void Main(string[] args)\n {\n //input\n int k = -1;\n var grid = new string[3];\n for (int i = 0; i < 3; i++)\n {\n grid[i] = args[++k];\n }\n\n //counting\n int num0 = 0;\n int numX = 0;\n\n for (int i = 0; i < 3; i++)\n {\n for (int j = 0; j < 3; j++)\n {\n if (grid[i][j] == 'X') ++numX;\n if (grid[i][j] == '0') ++num0;\n }\n }\n\n //process\n bool isXWin = CheckWin(grid, 'X');\n bool is0Win = CheckWin(grid, '0');\n if (Math.Abs(num0 - numX) >= 2 || num0 > numX || (is0Win && isXWin) \n ||(isXWin && num0 == numX) /*X win but O still play*/\n || (is0Win && numX > num0)) /*O win but X still play*/\n Print(\"illegal\");\n else if(isXWin) Print(\"the first player won\");\n else if(is0Win) Print(\"the second player won\");\n else if(num0 + numX == 9) Print(\"draw\");\n else\n {\n if (num0 >= numX) Print(\"first\");\n else Print(\"second\");\n }\n\n\n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "cf6f78e4931ae9a1b1de0e467851e4ac", "src_uid": "892680e26369325fb00d15543a96192c", "apr_id": "e949e565831154312bf8ab7ee3c347aa", "difficulty": 1800, "tags": ["games", "brute force", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9488349747778044, "equal_cnt": 9, "replace_cnt": 5, "delete_cnt": 2, "insert_cnt": 1, "fix_ops_cnt": 8, "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 long xwin(long[,] z)\n {\n int count = 0;\n for (long i = 0; i < 3; i++)\n if (z[i, 0] == 1 && z[i, 1] == 1 && z[i, 2] == 1)\n count++;\n for (long j = 0; j < 3; j++)\n if (z[0, j] == 1 && z[1, j] == 1 && z[2, j] == 1)\n count++;\n if (z[0, 0] == 1 && z[1, 1] == 1 && z[2, 2] == 1)\n count++;\n if (z[0, 2] == 1 && z[1, 1] == 1 && z[2, 0] == 1)\n count++;\n return count;\n }\n static long owin(long[,] z)\n {\n int count = 0;\n for (long i = 0; i < 3; i++)\n if (z[i, 0] == 2 && z[i, 1] == 2 && z[i, 2] == 2)\n count++;\n for (long j = 0; j < 3; j++)\n if (z[0, j] == 2 && z[1, j] == 2 && z[2, j] == 2)\n count++;\n if (z[0, 0] == 2 && z[1, 1] == 2 && z[2, 2] == 2)\n count++;\n if (z[0, 2] == 2 && z[1, 1] == 2 && z[2, 0] == 2)\n count++;\n return count;\n }\n static void delay(long i)\n {\n for (long j = 0; j < i; j++)\n delay(i - 1);\n }\n static bool check(long[,] z)\n {\n long countx = 0, counto = 0;\n for (long i = 0; i < 3; i++)\n {\n for (long j = 0; j < 3; j++)\n {\n if (z[i, j] == 1)\n countx++;\n if (z[i, j] == 2)\n counto++;\n }\n }\n if (counto > countx)\n return false;\n if (countx - counto > 1)\n return false;\n if (xwin(z) > 0 || owin(z) > 0)\n return false;\n return true;\n }\n static bool legal(long[,] z)\n {\n for (long i = 0; i < 3; i++)\n {\n for (long j = 0; j < 3; j++)\n {\n if (z[i, j] == 0)\n continue;\n long temp = z[i, j];\n z[i, j] = 0;\n if(check(z))\n {\n z[i,j]=temp;\n return true;\n }\n z[i, j] = temp;\n }\n }\n return false;\n }\n static void Main(string[] args)\n {\n long[,] z = new long[3, 3];\n for (long i = 0; i < 3; i++)\n {\n string s = Console.ReadLine();\n for (int j = 0; j < 3; j++)\n {\n z[i, j] = 0;\n if (s[j] == 'X')\n z[i, j] = 1;\n if (s[j] == '0')\n z[i, j] = 2;\n }\n }\n long countx = 0, count0 = 0;\n for (int i = 0; i < 3; i++)\n {\n for (int j = 0; j < 3; j++)\n {\n if (z[i, j] == 1)\n countx++;\n if (z[i, j] == 2)\n count0++;\n }\n }\n if (!legal(z))\n {\n Console.WriteLine(\"illegal\");\n return;\n }\n if (xwin(z) == 1)\n {\n delay(1000);\n Console.WriteLine(\"the first player won\");\n return;\n }\n if (owin(z) == 1)\n {\n delay(1000);\n Console.WriteLine(\"the second player won\");\n return;\n }\n if (countx + count0 == 9)\n {\n delay(1000);\n Console.WriteLine(\"draw\");\n return;\n }\n if (countx - count0 == 0)\n {\n Console.WriteLine(\"first\");\n return;\n }\n Console.WriteLine(\"second\");\n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "3a7907e6a440cd5349f6b76b33240527", "src_uid": "892680e26369325fb00d15543a96192c", "apr_id": "ddd0102c46616c87d3628f70dd648db5", "difficulty": 1800, "tags": ["games", "brute force", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9577187807276303, "equal_cnt": 4, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 3, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\n\nnamespace CodeForceContest\n{\n class Program\n {\n static void Main(string[] args)\n {\n var s = Console.ReadLine().Split(' ').Select(ss => int.Parse(ss)).ToArray();\n //var s = \"401 4\".Split(' ').Select(ss => int.Parse(ss)).ToArray();\n var a = s[0];\n var b = s[1];\n var res = a + 1;\n for (; ; )\n {\n if(TakeMask(res)==b)\n {\n break;\n }\n }\n Console.WriteLine(res);\n }\n static int TakeMask(int a)\n {\n var e = a.ToString();\n var list = new List();\n foreach (var i in e)\n {\n if(i=='4' ||i=='7')list.Add(i);\n }\n return int.Parse(String.Join(\"\", list.Select(s => s.ToString()).ToArray()));\n }\n }\n\n}\n", "lang": "Mono C#", "bug_code_uid": "c8b1345c686544b709c0b49be80d4ad9", "src_uid": "e5e4ea7a5bf785e059e10407b25d73fb", "apr_id": "a1deccc2c23ee4495e1f210c5de6c9a6", "difficulty": 1300, "tags": ["brute force", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.6850618458610847, "equal_cnt": 17, "replace_cnt": 12, "delete_cnt": 4, "insert_cnt": 0, "fix_ops_cnt": 16, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Text;\n\nnamespace problemB\n{\n class Program\n {\n static bool Contain47(int a)\n {\n int am10;\n while (a > 0)\n {\n am10=a%10;\n if (am10 == 4 || am10 == 7)\n return true;\n a /= 10;\n }\n return false;\n }\n\n static void Main(string[] args)\n {\n int[] data = Array.ConvertAll(Console.ReadLine().Split(), int.Parse);\n int a = data[0], b = data[1];\n int coef = 1;\n if (b < 10) coef = 10;\n else if (b < 100) coef = 100;\n else if (b < 1000) coef = 1000;\n else coef = 10000;\n int first = 0;\n while (true)\n {\n if (Contain47(first)) continue;\n if (first * coef + b > a)\n {\n Console.WriteLine(\"{0}\", first*coef+b);\n break;\n }\n first++;\n }\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "6fa87e60dadf5599c70638555bcef1f1", "src_uid": "e5e4ea7a5bf785e059e10407b25d73fb", "apr_id": "4411e5cf57ab585ff13657c8714900e0", "difficulty": 1300, "tags": ["brute force", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.8894165535956581, "equal_cnt": 39, "replace_cnt": 31, "delete_cnt": 0, "insert_cnt": 8, "fix_ops_cnt": 39, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace starwars\n{\n class Program\n {\n static void Main(string[] args)\n {\n int n;\n \n n = Convert.ToInt32 (Console.ReadLine());\n char[,] array1 = new char[n, n];\n for (int i = 0; i <= n - 1; i++)\n {\n char[] temp = Console.ReadLine().ToCharArray();\n for (int j = 0; j <= n - 1; j++)\n {\n array1[i, j] = temp[j];\n }\n }\n char[,] array2 = new char[n, n];\n for (int i = 0; i <= n - 1; i++)\n {\n char[] temp = Console.ReadLine().ToCharArray();\n for (int j = 0; j <= n - 1; j++)\n {\n array2[i, j] = temp[j];\n }\n }\n\n\n char[,] t90 = new char[n, n];\n for(int i = 0; i<=n-1;i++)\n {\n for (int j = 0; j <= n - 1; j++)\n t90[j, n - 1 - i] = array1[i, j];\n }\n\n char[,] t180 = new char[n, n];\n for (int i = 0; i <= n - 1; i++)\n {\n for (int j = 0; j <= n - 1; j++)\n t180[j, n - 1 - i] = t90[i, j];\n }\n\n char[,] t270 = new char[n, n];\n for (int i = 0; i <= n - 1; i++)\n {\n for (int j = 0; j<=n-1; j++)\n t270[j, n - 1 - i] = t180[i, j];\n }\n\n char[,] flippGorarray1 = new char[n, n];\n for (int i = 0; i <= n - 1; i++)\n {\n for (int j = 0; j <= n - 1; j++)\n flippGorarray1[n - 1 - i, j] = array1[i, j];\n }\n\n char[,] flippvertarray1 = new char[n, n];\n for (int i = 0; i <= n - 1; i++)\n {\n for (int j = 0; j <= n - 1; j++)\n flippvertarray1[i, n-1-j] = array1[i, j];\n }\n\n char[,] flippGort90 = new char[n, n];\n for (int i = 0; i <= n - 1; i++)\n {\n for (int j = 0; j <= n - 1; j++)\n flippGort90[n - 1 - i, j] = t90[i, j];\n }\n\n char[,] flippvert90 = new char[n, n];\n for (int i = 0; i <= n - 1; i++)\n {\n for (int j = 0; j <= n - 1; j++)\n flippvert90[i, n - 1 - j] = t90[i, j];\n }\n\n char[,] flippGort180 = new char[n, n];\n for (int i = 0; i <= n - 1; i++)\n {\n for (int j = 0; j <= n - 1; j++)\n flippGort180[n - 1 - i, j] = t180[i, j];\n }\n\n char[,] flippvert180 = new char[n, n];\n for (int i = 0; i <= n - 1; i++)\n {\n for (int j = 0; j <= n - 1; j++)\n flippvert180[i, n - 1 - j] = t180[i, j];\n }\n\n char[,] flippGorart270 = new char[n, n];\n for (int i = 0; i <= n - 1; i++)\n {\n for (int j = 0; j <= n - 1; j++)\n flippGorart270[n - 1 - i, j] = t270[i, j];\n }\n\n char[,] flippvert270 = new char[n, n];\n for (int i = 0; i <= n - 1; i++)\n {\n for (int j = 0; j <= n - 1; j++)\n flippvert270[i, n - 1 - j] = t270[i, j];\n }\n \n\n\n if (array2.ToString()== array1.ToString() || array2.ToString()== t90.ToString() || array2.ToString()== t180.ToString() ||\n array2.ToString()== t270.ToString() ||\n array2.ToString()== flippGorarray1.ToString() || array2.ToString()== flippvertarray1.ToString() ||\n array2.ToString() == flippGort90.ToString()||\n array2.ToString() == flippvert90.ToString()|| array2.ToString() == flippGort180.ToString() ||\n array2.ToString() == flippvert180.ToString()||\n array2.ToString() == flippGorart270.ToString() || array2.ToString() == flippvert270.ToString())\n {\n Console.WriteLine(\"Yes\");\n }\n else Console.WriteLine(\"No\");\n\n\n }\n\n \n }\n}\n", "lang": "Mono C#", "bug_code_uid": "22594b626f0d791abc1f998385a40eaf", "src_uid": "2e793c9f476d03e8ba7df262db1c06e4", "apr_id": "ac52b941d6a6340166c7610a3f5cd569", "difficulty": 1400, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9565017261219793, "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.Globalization;\nusing System.IO;\n\nclass Program\n{\n public static int[] Read(string str)\n {\n string[] tokens = str.Trim().Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries);\n int[] ret = new int[tokens.Length];\n for (int i = 0; i < ret.Length; i++)\n {\n ret[i] = int.Parse(tokens[i]);\n }\n\n return ret;\n }\n\n public static long[] ReadLong(string str)\n {\n string[] tokens = str.Trim().Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries);\n long[] ret = new long[tokens.Length];\n for (int i = 0; i < ret.Length; i++)\n {\n ret[i] = long.Parse(tokens[i]);\n }\n\n return ret;\n }\n\n public static double[] ReadDouble(string str)\n {\n string[] tokens = str.Trim().Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries);\n double[] ret = new double[tokens.Length];\n for (int i = 0; i < ret.Length; i++)\n {\n ret[i] = double.Parse(tokens[i], CultureInfo.InvariantCulture);\n }\n\n return ret;\n }\n\n static string Reverse(string s)\n {\n char[] a = s.ToCharArray();\n Array.Reverse(a);\n return new string(a);\n }\n\n static bool Check(string t)\n {\n for (int i = 0; i < t.Length; i++)\n {\n if (char.IsLetterOrDigit(t[i]) == false && t[i] != '_')\n {\n return false;\n }\n }\n\n return true;\n }\n\n static void Main(string[] args)\n {\n int[] abc = Read(Console.ReadLine());\n int[] def = Read(Console.ReadLine());\n\n if (abc[0] * def[1] == abc[1] * def[0])\n {\n if (abc[0] * def[2] == abc[2] * def[0] && abc[1] * def[2] == abc[2] * def[1])\n {\n Console.WriteLine(\"-1\");\n }\n else\n {\n Console.WriteLine(\"0\");\n }\n }\n else\n {\n Console.WriteLine(\"1\");\n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "b748a72f84a09d2b446fb8449d9d654d", "src_uid": "c8e869cb17550e888733551c749f2e1a", "apr_id": "e2f9d685b2aef34c49afc8347f5e9fe4", "difficulty": 2000, "tags": ["math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.9206989247311828, "equal_cnt": 13, "replace_cnt": 7, "delete_cnt": 1, "insert_cnt": 4, "fix_ops_cnt": 12, "bug_source_code": "using System;\nusing System.Linq;\n\nnamespace codeforces\n{\n class Program\n {\n static bool IsGood(int ch)\n {\n while(ch>0)\n {\n if (ch % 10 != 4 && ch % 10 != 7)\n return false;\n ch = ch / 10;\n }\n return true;\n }\n static void Main(string[] args)\n {\n int count = int.Parse(Console.ReadLine());\n string str = Console.ReadLine();\n int a = str.Substring(0, count / 2).Select(x => int.Parse(x.ToString())).Sum();\n int b = str.Substring(count / 2).Select(x => int.Parse(x.ToString())).Sum();\n\n Console.WriteLine(IsGood(int.Parse(str))&&(a==b)?\"YES\":\"NO\") ;\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "31f2185f1a558b0ffcfc9785837a5456", "src_uid": "435b6d48f99d90caab828049a2c9e2a7", "apr_id": "d2782c895ea30b4ce41214e0533945f3", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.09510010537407798, "equal_cnt": 185, "replace_cnt": 151, "delete_cnt": 5, "insert_cnt": 29, "fix_ops_cnt": 185, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Diagnostics;\nusing System.IO;\nusing System.Linq;\nusing System.Text;\n//using DebugerVisualizer;\n\nnamespace _105\n{\n\n class Program\n {\n //static StreamReader inStream = new StreamReader(\"input.txt\");\n //static string ReadLine()\n //{\n // return inStream.ReadLine();\n //}\n\n static string ReadLine()\n {\n return Console.ReadLine();\n }\n\n static int AbsoluteMax = int.MinValue;\n static string AbsoluteMaxStr = \"\";\n\n static void Main(string[] args)\n {\n Player[] players = new Player[3];\n for (int i = 0; i < 3; i++)\n {\n players[i] = new Player();\n string[] arg = ReadLine().Split();\n players[i].Start = int.Parse(arg[0]);\n players[i].Walk = int.Parse(arg[1]);\n players[i].Throws = int.Parse(arg[2]);\n players[i].StartNode = new ExpressionNode();\n players[i].StartNode.Comment = string.Format(\"S({0})\", i);\n }\n\n var builder = new ExpressionBuilder(Array.ConvertAll(players, x => x.StartNode));\n Solve(builder, Array.ConvertAll(players, x => x.StartNode), players);\n Console.WriteLine(AbsoluteMax);\n //Console.WriteLine(AbsoluteMaxStr);\n }\n\n static void Solve(ExpressionBuilder builder, ExpressionNode[] pNodes, Player[] players)\n {\n builder.ClearCalcs();\n\n for (int i = 0; i < 3; i++)\n players[i].StartNode.Min = players[i].StartNode.Max = players[i].Start;\n\n for (int i = 0; i < 3; i++)\n {\n if (!TraceMin(players[i].StartNode))\n return;\n if (!TraceMax(players[i].StartNode))\n return;\n }\n\n if (!builder.Validate())\n return;\n\n int max = builder.Max;\n if (AbsoluteMax < max)\n {\n AbsoluteMax = max;\n AbsoluteMaxStr = builder.ToString();\n }\n\n for (int i = 0; i < 3; i++)\n for (int j = 0; j < 3; j++)\n if (i != j)\n {\n DoUp(i, j, builder, pNodes, players);\n }\n\n for (int i = 0; i < 3; i++)\n {\n DoMove(i, builder, pNodes, players);\n }\n\n\n for (int i = 0; i < 3; i++)\n {\n DoThrow(i, builder, pNodes, players);\n }\n }\n\n static private void DoMove(int i, ExpressionBuilder builder, ExpressionNode[] pNodes, Player[] players)\n {\n if (players[i].alreadyWalked || players[i].Up >= 0 || players[i].Upped)\n return;\n\n players[i].alreadyWalked = true;\n\n ExpressionNode a = pNodes[i];\n\n builder.Start();\n\n ExpressionNode moved = builder.AddNode();\n pNodes[i] = moved;\n moved.Comment = string.Format(\"M({0})\", i);\n\n builder.AddMin(moved, a, players[i].Walk);\n builder.AddMin(a, moved, players[i].Walk);\n\n NotEqual(players, i, builder, pNodes);\n\n builder.Rollback();\n pNodes[i] = a;\n players[i].alreadyWalked = false;\n }\n\n private static void DoThrow(int i, ExpressionBuilder builder, ExpressionNode[] pNodes, Player[] players)\n {\n if (players[i].alreadyThrowed || players[i].Up < 0 || players[i].Upped)\n return;\n\n players[i].alreadyThrowed = true;\n\n int j = players[i].Up;\n players[i].Up = -1;\n players[j].Upped = false;\n\n ExpressionNode a = pNodes[i];\n ExpressionNode b = pNodes[j];\n\n builder.Start();\n\n ExpressionNode moved = builder.AddNode();\n pNodes[j] = moved;\n moved.Comment = string.Format(\"T({0}, {1})\", i, j);\n\n builder.AddMin(moved, a, players[i].Throws);\n builder.AddMin(a, moved, players[i].Throws);\n\n NotEqual(players, j, builder, pNodes);\n\n builder.Rollback();\n pNodes[j] = b;\n players[j].Upped = true;\n players[i].Up = j;\n players[i].alreadyThrowed = false;\n }\n\n private static void DoUp(int i, int j, ExpressionBuilder builder, ExpressionNode[] pNodes, Player[] players)\n {\n if (players[i].alreadyUpped || players[i].Up >= 0 || players[i].Upped || players[j].Upped || i == j)\n return;\n\n players[i].alreadyUpped = true;\n players[i].Up = j;\n players[j].Upped = true;\n\n ExpressionNode a = pNodes[i];\n ExpressionNode b = pNodes[j];\n\n builder.Start();\n\n ExpressionNode moved = builder.AddNode();\n pNodes[j] = moved;\n moved.Comment = string.Format(\"U({0}, {1})\", i, j);\n\n builder.AddMin(moved, a, 0);\n builder.AddMin(a, moved, 0);\n\n builder.Start();\n builder.AddMin(a, b, -1);\n builder.AddMin(b, a, 1);\n Solve(builder, pNodes, players);\n builder.Rollback();\n\n builder.Start();\n builder.AddMin(a, b, 1);\n builder.AddMin(b, a, -1);\n Solve(builder, pNodes, players);\n builder.Rollback();\n\n builder.Rollback();\n pNodes[j] = b;\n players[j].Upped = false;\n players[i].Up = -1;\n players[i].alreadyUpped = false;\n }\n\n static private void NotEqual(Player[] players, int i, ExpressionBuilder builder, ExpressionNode[] pNodes)\n {\n ExpressionNode a = pNodes[i]; //current \n ExpressionNode b = pNodes[(i + 1) % 3]; //not equal to\n ExpressionNode c = pNodes[(i + 2) % 3]; //and not equal to\n\n builder.Start();\n builder.AddMin(a, b, -1);\n builder.AddMin(a, c, -1);\n Solve(builder, pNodes, players);\n builder.Rollback();\n\n builder.Start();\n builder.AddMin(b, a, -1);\n builder.AddMin(a, c, -1);\n Solve(builder, pNodes, players);\n builder.Rollback();\n\n builder.Start();\n builder.AddMin(b, a, -1);\n builder.AddMin(c, a, -1);\n Solve(builder, pNodes, players);\n builder.Rollback();\n\n builder.Start();\n builder.AddMin(a, b, -1);\n builder.AddMin(c, a, -1);\n Solve(builder, pNodes, players);\n builder.Rollback();\n }\n\n static bool TraceMin(ExpressionNode x)\n {\n x.Traced = true;\n\n try\n {\n foreach (var path in x.Maximize)\n {\n // x <= path.Max + path.Mark\n\n if (path.Max.Traced)\n {\n if (path.Max.Min < x.Min - path.Mark)\n return false;\n }\n else\n {\n if (path.Max.Min < x.Min - path.Mark)\n {\n path.Max.Min = x.Min - path.Mark;\n if (!TraceMin(path.Max))\n return false;\n }\n }\n }\n return true;\n }\n finally\n {\n x.Traced = false;\n }\n }\n\n static bool TraceMax(ExpressionNode x)\n {\n x.Traced = true;\n\n try\n {\n foreach (var path in x.Minimize)\n {\n if (path.Min.Traced)\n {\n if (path.Min.Max > x.Max + path.Mark)\n return false;\n }\n else\n {\n if (path.Min.Max > x.Max + path.Mark)\n {\n path.Min.Max = x.Max + path.Mark;\n if (!TraceMax(path.Min))\n return false;\n }\n }\n }\n return true;\n }\n finally\n {\n x.Traced = false;\n }\n }\n }\n\n //[DebuggerVisualizer(typeof(ExpressionBuilderVisualizer))]\n [Serializable]\n class ExpressionBuilder\n {\n Stack actions = new Stack();\n Actions current = null;\n List nodes = new List();\n List paths = new List();\n\n public List Nodes\n {\n get { return nodes; }\n }\n\n public List Paths\n {\n get { return paths; }\n }\n \n public ExpressionBuilder(IEnumerable startNodes)\n {\n nodes.AddRange(startNodes);\n }\n\n public int Max\n {\n get\n {\n int max = Int32.MinValue;\n foreach (var node in nodes)\n {\n if (max < node.Max)\n max = node.Max;\n }\n\n return max;\n }\n }\n\n public ExpressionNode AddNode()\n {\n var node = new ExpressionNode();\n nodes.Add(node);\n current.Nodes.Add(node);\n return node;\n }\n\n //a <= b + c\n public void AddMin(ExpressionNode a, ExpressionNode b, int c)\n {\n var path = new ExpressionPath() { Min = a, Max = b, Mark = c };\n paths.Add(path);\n a.Maximize.Add(path);\n b.Minimize.Add(path);\n current.Paths.Add(path);\n }\n\n public void Start()\n {\n current = new Actions();\n actions.Push(current);\n }\n\n public void Rollback()\n {\n RollbackActions(current);\n actions.Pop();\n if (actions.Count > 0)\n current = actions.Peek();\n else\n current = null;\n }\n\n private void RollbackActions(Actions action)\n {\n //int nc = nodes.Count;\n //int pc = paths.Count;\n\n\n if (action.Paths.Count > 0)\n paths.RemoveRange(paths.Count - action.Paths.Count, action.Paths.Count);\n if (action.Nodes.Count > 0)\n nodes.RemoveRange(nodes.Count - action.Nodes.Count, action.Nodes.Count);\n\n //Debug.Assert(!paths.Exists(x => action.Paths.Contains(x)));\n //Debug.Assert(!nodes.Exists(x => action.Nodes.Contains(x)));\n\n //System.Diagnostics.Debug.Assert(paths.Count == pc - action.Paths.Count);\n //System.Diagnostics.Debug.Assert(nodes.Count == nc - action.Nodes.Count);\n\n foreach (var p in action.Paths)\n {\n p.Max.Minimize.Remove(p);\n p.Min.Maximize.Remove(p);\n }\n }\n\n public void ClearCalcs()\n {\n foreach (var node in nodes)\n {\n node.Min = Int32.MinValue;\n node.Max = Int32.MaxValue;\n node.Traced = false;\n }\n }\n\n public bool Validate()\n {\n foreach (var node in nodes)\n {\n if (node.Min > node.Max)\n return false;\n\n if (node.Min == Int32.MinValue || node.Min == Int32.MaxValue)\n throw new Exception();\n if (node.Max == Int32.MinValue || node.Max == Int32.MaxValue)\n throw new Exception();\n }\n\n return true;\n }\n\n public override string ToString()\n {\n string result = \"\";\n\n foreach (var node in nodes)\n {\n result += node.ToString();\n }\n\n result += \"{\";\n foreach (var path in paths)\n {\n result += String.Format(\"{0} <= {1} + {2}; \", path.Min, path.Max, path.Mark);\n }\n result += \"}\";\n\n return result;\n }\n }\n\n [Serializable]\n class Actions\n {\n public List Nodes = new List(10);\n public List Paths = new List(10);\n }\n\n [Serializable]\n internal class Player\n {\n public int Start;\n public int Walk;\n public int Throws;\n\n public bool alreadyWalked = false;\n public bool alreadyUpped = false;\n public bool alreadyThrowed = false;\n public bool Upped = false;\n public int Up = -1;\n public ExpressionNode StartNode;\n }\n\n [Serializable]\n class ExpressionNode\n {\n public List Minimize = new List(10);\n public List Maximize = new List(10);\n\n public int Min = Int32.MinValue;\n public int Max = Int32.MaxValue;\n\n public bool Traced = false;\n\n public string Comment;\n\n public override string ToString()\n {\n return Comment + String.Format(\"[{0}:{1}]\", Min, Max);\n }\n }\n\n [Serializable]\n internal class ExpressionPath\n {\n public ExpressionNode Max;\n public ExpressionNode Min;\n public int Mark;\n\n public override string ToString()\n {\n return String.Format(\"{0} <= {1} + {2}\", Min, Max, Mark);\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "dd2e94e8033c53ff77fe86e92f3e2796", "src_uid": "a14739b86d1fd62a030226263cdc1afc", "apr_id": "4c20e57b881509515b8ea34ce261e5eb", "difficulty": 2500, "tags": ["brute force"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.13046241262008898, "equal_cnt": 140, "replace_cnt": 89, "delete_cnt": 7, "insert_cnt": 44, "fix_ops_cnt": 140, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.ComponentModel;\nusing System.Diagnostics;\nusing System.IO;\nusing System.Linq;\nusing System.Text;\n//using DebugerVisualizer;\n\nnamespace _105\n{\n\n\tclass Program\n\t{\n\t\t//static StreamReader inStream = new StreamReader(\"input.txt\");\n\t\t//static string ReadLine()\n\t\t//{\n\t\t// return inStream.ReadLine();\n\t\t//}\n\n\t\tstatic string ReadLine()\n\t\t{\n\t\t\treturn Console.ReadLine();\n\t\t}\n\n\t\tstatic int AbsoluteMax = int.MinValue;\n\t\tstatic string AbsoluteMaxStr = \"\";\n\n\t\tstatic void Main(string[] args)\n\t\t{\n\t\t\tPlayer[] players = new Player[3];\n\t\t\tfor (int i = 0; i < 3; i++)\n\t\t\t{\n\t\t\t\tplayers[i] = new Player();\n\t\t\t\tstring[] arg = ReadLine().Split();\n\t\t\t\tplayers[i].Start = int.Parse(arg[0]);\n\t\t\t\tplayers[i].Walk = int.Parse(arg[1]);\n\t\t\t\tplayers[i].Throws = int.Parse(arg[2]);\n\t\t\t}\n\n\n\t\t\tvar state = new GameState(players);\n\t\t\t\n\t\t\tSolve(state, players);\n\t\t\tConsole.WriteLine(AbsoluteMax);\n\t\t\t//Console.WriteLine(AbsoluteMaxStr);\n\t\t}\n\n\t\tstatic void Solve(GameState state, Player[] players)\n\t\t{\n\t\t\tstate.ClearTrace();\n\t\t\tfor (int i = 0; i < 3; i++)\n\t\t\t{\n\t\t\t\tif (!TraceMin(state, state.GetPlayerStartNode(i)))\n\t\t\t\t\treturn;\n\t\t\t\tif (!TraceMax(state, state.GetPlayerStartNode(i)))\n\t\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (!state.Validate())\n\t\t\t\treturn;\n\n\t\t\tif (EuristicGetMax(state, players) <= AbsoluteMax)\n\t\t\t\treturn;\n\n\t\t\tint max = state.Max;\n\t\t\tif (AbsoluteMax < max)\n\t\t\t{\n\t\t\t\tAbsoluteMax = max;\n\t\t\t\tAbsoluteMaxStr = state.ToString();\n\t\t\t}\n\n\t\t\tfor (int i = 0; i < 3; i++)\n\t\t\t{\n\t\t\t\tDoMove(i, state.Clone(), players);\n\t\t\t}\n\n\t\t\tfor (int i = 0; i < 3; i++)\n\t\t\t\tfor (int j = 0; j < 3; j++)\n\t\t\t\t\tif (i != j)\n\t\t\t\t\t{\n\t\t\t\t\t\tDoUp(i, j, state.Clone(), players);\n\t\t\t\t\t}\n\n\t\t\tfor (int i = 0; i < 3; i++)\n\t\t\t{\n\t\t\t\tDoThrow(i, state.Clone(), players);\n\t\t\t}\n\t\t}\n\n\t\tstatic private void DoMove(int i, GameState state, Player[] players)\n\t\t{\n\t\t\tif (players[i].alreadyWalked || players[i].Up >= 0 || players[i].Upped)\n\t\t\t\treturn;\n\n\t\t\tplayers[i].alreadyWalked = true;\n\n\t\t\tExpressionNode a = state.GetPlayerNode(i);\n\t\t\tExpressionNode moved = state.AddPlayerNode(i);\n\n\t\t\tmoved.Comment = string.Format(\"M({0})\", i);\n\n\t\t\tstate.AddMin(moved, a, players[i].Walk);\n\t\t\tstate.AddMin(a, moved, players[i].Walk);\n\n\t\t\tNotEqual(players, i, state.Clone());\n\n\t\t\tplayers[i].alreadyWalked = false;\n\t\t}\n\n\t\tprivate static void DoThrow(int i, GameState state, Player[] players)\n\t\t{\n\t\t\tif (players[i].alreadyThrowed || players[i].Up < 0 || players[i].Upped)\n\t\t\t\treturn;\n\n\t\t\tplayers[i].alreadyThrowed = true;\n\n\t\t\tint j = players[i].Up;\n\t\t\tplayers[i].Up = -1;\n\t\t\tplayers[j].Upped = false;\n\n\t\t\tExpressionNode a = state.GetPlayerNode(i);\n\n\t\t\tExpressionNode moved = state.AddPlayerNode(j);\n\t\t\tmoved.Comment = string.Format(\"T({0}, {1})\", i, j);\n\n\t\t\tstate.AddMin(moved, a, players[i].Throws);\n\t\t\tstate.AddMin(a, moved, players[i].Throws);\n\n\t\t\tNotEqual(players, j, state.Clone());\n\n\t\t\tplayers[j].Upped = true;\n\t\t\tplayers[i].Up = j;\n\t\t\tplayers[i].alreadyThrowed = false;\n\t\t}\n\n\t\tprivate static void DoUp(int i, int j, GameState state, Player[] players)\n\t\t{\n\t\t\tif (players[i].alreadyUpped || players[i].Up >= 0 || players[i].Upped || players[j].Upped || i == j)\n\t\t\t\treturn;\n\n\t\t\tplayers[i].alreadyUpped = true;\n\t\t\tplayers[i].Up = j;\n\t\t\tplayers[j].Upped = true;\n\n\t\t\tExpressionNode a = state.GetPlayerNode(i);\n\t\t\tExpressionNode b = state.GetPlayerNode(j);\n\n\t\t\tExpressionNode moved = state.AddPlayerNode(j);\n\t\t\tmoved.Comment = string.Format(\"U({0}, {1})\", i, j);\n\n\t\t\tstate.AddMin(moved, a, 0);\n\t\t\tstate.AddMin(a, moved, 0);\n\n\t\t\tvar v1 = state.Clone();\n\t\t\tv1.AddMin(a, b, -1);\n\t\t\tv1.AddMin(b, a, 1);\n\t\t\tSolve(v1, players);\n\n\t\t\tvar v2 = state;\n\t\t\tv2.AddMin(a, b, 1);\n\t\t\tv2.AddMin(b, a, -1);\n\t\t\tSolve(v2.Clone(), players);\n\n\t\t\tplayers[j].Upped = false;\n\t\t\tplayers[i].Up = -1;\n\t\t\tplayers[i].alreadyUpped = false;\n\t\t}\n\n\t\tstatic private void NotEqual(Player[] players, int i, GameState state)\n\t\t{\n\t\t\tExpressionNode a = state.GetPlayerNode(i); //current \n\t\t\tExpressionNode b = state.GetPlayerNode((i + 1) % 3); //not equal to\n\t\t\tExpressionNode c = state.GetPlayerNode((i + 2) % 3); //and not equal to\n\n\t\t\tvar v1 = state.Clone();\n\t\t\tv1.AddMin(a, b, -1);\n\t\t\tv1.AddMin(a, c, -1);\n\t\t\tSolve(v1, players);\n\n\t\t\tvar v2 = state.Clone();\n\t\t\tv2.AddMin(b, a, -1);\n\t\t\tv2.AddMin(a, c, -1);\n\t\t\tSolve(v2, players);\n\n\t\t\tvar v3 = state.Clone();\n\t\t\tv3.AddMin(b, a, -1);\n\t\t\tv3.AddMin(c, a, -1);\n\t\t\tSolve(v3, players);\n\n\t\t\tvar v4 = state;\n\t\t\tv4.AddMin(a, b, -1);\n\t\t\tv4.AddMin(c, a, -1);\n\t\t\tSolve(v4, players);\n\t\t}\n\n\t\tstatic bool TraceMin(GameState state, ExpressionNode x)\n\t\t{\n\t\t\tx.Traced = true;\n\n\t\t\ttry\n\t\t\t{\n\t\t\t\tforeach (var vector in state.Maximize(x))\n\t\t\t\t{\n\t\t\t\t\t// x <= path.Max + path.Mark\n\n\t\t\t\t\tif (vector.Target.Traced)\n\t\t\t\t\t{\n\t\t\t\t\t\tif (vector.Target.Min < x.Min - vector.Mark)\n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tif (vector.Target.Min < x.Min - vector.Mark)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tvector.Target.Min = x.Min - vector.Mark;\n\t\t\t\t\t\t\tif (!TraceMin(state, vector.Target))\n\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\tfinally\n\t\t\t{\n\t\t\t\tx.Traced = false;\n\t\t\t}\n\t\t}\n\n\t\tstatic bool TraceMax(GameState state, ExpressionNode x)\n\t\t{\n\t\t\tx.Traced = true;\n\n\t\t\ttry\n\t\t\t{\n\t\t\t\tforeach (var vector in state.Minimize(x))\n\t\t\t\t{\n\t\t\t\t\tif (vector.Target.Traced)\n\t\t\t\t\t{\n\t\t\t\t\t\tif (vector.Target.Max > x.Max + vector.Mark)\n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tif (vector.Target.Max > x.Max + vector.Mark)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tvector.Target.Max = x.Max + vector.Mark;\n\t\t\t\t\t\t\tif (!TraceMax(state, vector.Target))\n\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\tfinally\n\t\t\t{\n\t\t\t\tx.Traced = false;\n\t\t\t}\n\t\t}\n\n\t\tstatic int EuristicGetMax(GameState state, Player[] players)\n\t\t{\n\t\t\tint radius = 0;\n\n\t\t\tfor (int i = 0; i < 3; i++)\n\t\t\t{\n\t\t\t\tif (!players[i].alreadyThrowed)\n\t\t\t\t\tradius += players[i].Throws;\n\t\t\t\tif (!players[i].alreadyWalked)\n\t\t\t\t\tradius += players[i].Walk;\n\t\t\t\tif (!players[i].alreadyUpped)\n\t\t\t\t\tradius += 1;\n\t\t\t}\n\n\t\t\tvar result = Enumerable.Range(0,2).Max(i => state.GetPlayerNode(i).Max + radius);\n\t\t\treturn result;\n\t\t}\n\t}\n\n\n\t[Serializable]\n\tstruct Vector\n\t{\n\t\tpublic int Mark;\n\t\tpublic ExpressionNode Target;\n\n\t\tpublic Vector(int mark, ExpressionNode target)\n\t\t{\n\t\t\tMark = mark;\n\t\t\tTarget = target;\n\t\t}\n\t}\n\n\t//[DebuggerVisualizer(typeof(ExpressionBuilderVisualizer))]\n\t[Serializable]\n\tclass GameState\n\t{\n\t\tconst int MaxVariables = 20;\n\t\tconst int MaxDepth = 20;\n\n\t\tList nodes = new List();\n\t\tint[] playerNodes = new int[3];\n\n\t\tpublic List Nodes\n\t\t{\n\t\t\tget { return nodes; }\n\t\t}\n\n\t\tprivate GameState()\n\t\t{\n\t\t}\n\n\t\tpublic void ClearTrace()\n\t\t{\n\t\t\tfor (int i = 3; i < nodes.Count; i++)\n\t\t\t{\n\t\t\t\tnodes[i].Min = int.MinValue;\n\t\t\t\tnodes[i].Max = int.MaxValue;\n\t\t\t}\n\t\t}\n\n\t\tpublic GameState(Player[] players)\n\t\t{\n\t\t\tfor (int i = 0; i < 3; i++)\n\t\t\t{\n\t\t\t\tnodes.Add(\n\t\t\t\t\tnew ExpressionNode()\n\t\t\t\t\t{\n\t\t\t\t\t\tId = i,\n\t\t\t\t\t\tMin = players[i].Start,\n\t\t\t\t\t\tMax = players[i].Start\n\t\t\t\t\t});\n\t\t\t\tplayerNodes[i] = i;\n\t\t\t}\n\t\t}\n\n\t\tpublic GameState Clone()\n\t\t{\n\t\t\tvar result = new GameState();\n\t\t\tresult.nodes = nodes.ConvertAll(x => x.Clone());\n\t\t\tresult.playerNodes = (int[])playerNodes.Clone();\n\t\t\treturn result;\n\t\t}\n\n\t\tpublic int Max\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\tint max = Int32.MinValue;\n\t\t\t\tforeach (var node in nodes)\n\t\t\t\t{\n\t\t\t\t\tif (max < node.Max)\n\t\t\t\t\t\tmax = node.Max;\n\t\t\t\t}\n\n\t\t\t\treturn max;\n\t\t\t}\n\t\t}\n\n\t\tpublic ExpressionNode AddPlayerNode(int i)\n\t\t{\n\t\t\tvar node = new ExpressionNode() { Id = nodes.Count };\n\t\t\tnodes.Add(node);\n\t\t\tplayerNodes[i] = node.Id;\n\t\t\treturn node;\n\t\t}\n\n\t\tpublic ExpressionNode GetPlayerNode(int i)\n\t\t{\n\t\t\treturn nodes[playerNodes[i]];\n\t\t}\n\n\t\tpublic ExpressionNode GetPlayerStartNode(int i)\n\t\t{\n\t\t\treturn nodes[i];\n\t\t}\n\n\t\t//a <= b + c\n\t\tpublic void AddMin(ExpressionNode a, ExpressionNode b, int c)\n\t\t{\n\t\t\tvar path = new ExpressionPath() { MinId = a.Id, MaxId = b.Id, Mark = c };\n\t\t\tnodes[a.Id].Maximize.Add(path);\n\t\t\tnodes[b.Id].Minimize.Add(path);\n\t\t}\n\n\t\tpublic IEnumerable Maximize(ExpressionNode a)\n\t\t{\n\t\t\treturn nodes[a.Id].Maximize.Select(path => new Vector(path.Mark, nodes[path.MaxId]));\n\t\t}\n\n\t\tpublic IEnumerable Minimize(ExpressionNode a)\n\t\t{\n\t\t\treturn nodes[a.Id].Minimize.Select(path => new Vector(path.Mark, nodes[path.MinId]));\n\t\t}\n\n\t\tpublic bool Validate()\n\t\t{\n\t\t\tforeach (var node in nodes)\n\t\t\t{\n\t\t\t\tif (node.Min > node.Max)\n\t\t\t\t\treturn false;\n\n\t\t\t\tif (node.Min == Int32.MinValue || node.Min == Int32.MaxValue)\n\t\t\t\t\tthrow new Exception();\n\t\t\t\tif (node.Max == Int32.MinValue || node.Max == Int32.MaxValue)\n\t\t\t\t\tthrow new Exception();\n\t\t\t}\n\n\t\t\treturn true;\n\t\t}\n\n\t\tpublic override string ToString()\n\t\t{\n\t\t\tstring result = \"\";\n\n\t\t\tforeach (var node in nodes)\n\t\t\t{\n\t\t\t\tresult += node.ToString();\n\t\t\t}\n\n\t\t\treturn result;\n\t\t}\n\t}\n\n\t[Serializable]\n\tinternal class Player\n\t{\n\t\tpublic int Start;\n\t\tpublic int Walk;\n\t\tpublic int Throws;\n\n\t\tpublic bool alreadyWalked = false;\n\t\tpublic bool alreadyUpped = false;\n\t\tpublic bool alreadyThrowed = false;\n\t\tpublic bool Upped = false;\n\t\tpublic int Up = -1;\n\n\t\tpublic Player Clone()\n\t\t{\n\t\t\tvar result = (Player)this.MemberwiseClone();\n\t\t\treturn result;\n\t\t}\n\t}\n\n\t[Serializable]\n\tclass ExpressionNode\n\t{\n\t\tpublic int Id;\n\t\tpublic List Minimize = new List();\n\t\tpublic List Maximize = new List();\n\n\t\tpublic int Min = Int32.MinValue;\n\t\tpublic int Max = Int32.MaxValue;\n\n\t\tpublic bool Traced = false;\n\n\t\tpublic string Comment;\n\n\t\tpublic ExpressionNode Clone()\n\t\t{\n\t\t\tvar result = (ExpressionNode)this.MemberwiseClone();\n\t\t\tresult.Minimize = new List(Minimize);\n\t\t\tresult.Maximize = new List(Maximize);\n\t\t\tresult.Minimize = Minimize.ConvertAll(x => x);\n\t\t\tresult.Maximize = Maximize.ConvertAll(x => x);\n\n\t\t\treturn result;\n\t\t}\n\n\t\tpublic override string ToString()\n\t\t{\n\t\t\treturn Comment + String.Format(\"[{0}:{1}]\", Min, Max);\n\t\t}\n\n\t}\n\n\t[Serializable]\n\t[ReadOnly(true)]\n\tstruct ExpressionPath\n\t{\n\t\tpublic int MaxId;\n\t\tpublic int MinId;\n\t\tpublic int Mark;\n\n\t\tpublic override string ToString()\n\t\t{\n\t\t\tvar result = String.Format(\"X{0} <= X{1}\", MinId, MaxId);\n\n\t\t\tif (Mark > 0)\n\t\t\t\tresult += string.Format(\" + {0}\", Mark);\n\t\t\telse if (Mark < 0)\n\t\t\t\tresult += string.Format(\" - {0}\", -Mark);\n\n\t\t\treturn result;\n\t\t}\n\t}\n}\n", "lang": "Mono C#", "bug_code_uid": "fa5d238f088cf2773cdb5e6a42aae7af", "src_uid": "a14739b86d1fd62a030226263cdc1afc", "apr_id": "4c20e57b881509515b8ea34ce261e5eb", "difficulty": 2500, "tags": ["brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.2813793103448276, "equal_cnt": 13, "replace_cnt": 6, "delete_cnt": 1, "insert_cnt": 7, "fix_ops_cnt": 14, "bug_source_code": "#include \nvoid main()\n{\n int n, m, moves;\n scanf(\"%d %d\", &n , &m);\n\n if(m <=n)\n {\n moves = (n % 2) + (n / 2);\n while(moves % m != 0)\n moves++;\n \n printf(\"%d\", moves);\n }\n else\n printf(\"-1\");\n}", "lang": "MS C#", "bug_code_uid": "5f8694862a413bc44f89b947ad58f4de", "src_uid": "0fa526ebc0b4fa3a5866c7c5b3a4656f", "apr_id": "96dceb2da1f84d9f96986eeb34a6a235", "difficulty": 1000, "tags": ["math", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.8380281690140845, "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;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace Presents\n{\n class Program\n {\n static void Main(string[] args)\n {\n int n = int.Parse(Console.ReadLine());\n int m = int.Parse(Console.ReadLine());\n\n int[] presents = Console.ReadLine().Split(' ').Select(int.Parse).ToArray();\n Array.Sort(presents);\n\n int answer = int.MaxValue;\n for (int i = 0; i < m - n; i++)\n {\n answer = Math.Min(answer, presents[i + n - 1] - presents[i]);\n }\n\n Console.WriteLine(answer);\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "0b86a80936e5f181e17bc75aa640c1d3", "src_uid": "7830aabb0663e645d54004063746e47f", "apr_id": "e4c7a9145966c2488d43332a3eb1532e", "difficulty": 900, "tags": ["greedy"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.6511499030202272, "equal_cnt": 18, "replace_cnt": 10, "delete_cnt": 3, "insert_cnt": 4, "fix_ops_cnt": 17, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\n\nnamespace DimaAndHorses\n{\n class Program\n {\n private static bool[] p;\n\n private static bool Check(List[] war, int i)\n {\n return war[i].Count(e => p[e] == p[i]) <= 1;\n }\n\n private static bool Dfs(List[] war, int i)\n {\n if (i == p.Length)\n {\n for (int j = 0; j < i; j++)\n {\n if (!Check(war, j))\n return false;\n }\n\n return true;\n }\n\n if (!Check(war, i))\n {\n p[i] = !p[i];\n if (Check(war, i))\n {\n if (Dfs(war, i + 1))\n return true;\n }\n\n p[i] = !p[i];\n }\n\n return Dfs(war, i + 1);\n } \n\n static void Main(string[] args)\n {\n // var fin = File.OpenText(\"test.txt\");\n // Console.SetIn(fin);\n\n string[] nm = Console.ReadLine().Split(' ');\n int n = int.Parse(nm[0]);\n int m = int.Parse(nm[1]);\n\n var war = new List[n];\n for (int i = 0; i < n; i++)\n {\n war[i] = new List();\n }\n\n for (int i = 0; i < m; i++)\n {\n string[] ab = Console.ReadLine().Split(' ');\n int a = int.Parse(ab[0]) - 1;\n int b = int.Parse(ab[1]) - 1;\n\n war[a].Add(b);\n war[b].Add(a);\n }\n\n p = new bool[n];\n Dfs(war, 0);\n Console.WriteLine(string.Concat(p.Select(x => x ? 1 : 0)));\n\n // fin.Close();\n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "365ee3fb35daa944c4905c9aecb84524", "src_uid": "7017f2c81d5aed716b90e46480f96582", "apr_id": "7450652dd794ea2952652198d4a647ce", "difficulty": 2200, "tags": ["graphs", "combinatorics", "constructive algorithms"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9974626444883, "equal_cnt": 4, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 3, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\n\nnamespace DimaAndHorses\n{\n class Program\n {\n private static List[] war;\n private static bool[] p;\n\n private static bool Check(int i)\n {\n return war[i].Count(e => p[e] == p[i]) <= 1;\n }\n\n private static void Fix(int i)\n {\n p[i] = !p[i];\n\n foreach (var e in war[i])\n {\n if (p[e] == p[i] && !Check(e))\n {\n Fix(e);\n }\n }\n }\n\n private static void FixAll()\n {\n for (int i = 0; i < p.Length; i++)\n {\n if (!p[i] && !Check(i))\n {\n Fix(i); \n }\n }\n } \n\n static void Main(string[] args)\n {\n var fin = File.OpenText(\"test.txt\");\n Console.SetIn(fin);\n\n string[] nm = Console.ReadLine().Split(' ');\n int n = int.Parse(nm[0]);\n int m = int.Parse(nm[1]);\n\n war = new List[n];\n p = new bool[n];\n for (int i = 0; i < n; i++)\n {\n war[i] = new List();\n p[i] = false;\n }\n\n for (int i = 0; i < m; i++)\n {\n string[] ab = Console.ReadLine().Split(' ');\n int a = int.Parse(ab[0]) - 1;\n int b = int.Parse(ab[1]) - 1;\n\n war[a].Add(b);\n war[b].Add(a);\n }\n \n FixAll();\n Console.WriteLine(string.Concat(p.Select(x => x ? 1 : 0)));\n\n fin.Close();\n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "f85ae440ade0d2f44fd7fe9a7d7d184e", "src_uid": "7017f2c81d5aed716b90e46480f96582", "apr_id": "7450652dd794ea2952652198d4a647ce", "difficulty": 2200, "tags": ["graphs", "combinatorics", "constructive algorithms"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.5086705202312138, "equal_cnt": 13, "replace_cnt": 8, "delete_cnt": 3, "insert_cnt": 2, "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 Constest3\n{\n class Program\n {\n static void Main(string[] args)\n {\n String path = Console.ReadLine();\n for (int i = 0; i < path.Length; i++)\n {\n if (path[i] == '/')\n {\n int j;\n for (j = i; path[j] == '/' && j < path.Length; j++)\n {\n if (j == i)\n Console.Write(path[i]);\n }\n i = j - 1;\n continue;\n }\n else\n {\n Console.Write(path[i]);\n }\n }\n }\n }\n}", "lang": "Mono C#", "bug_code_uid": "324e612e9d9dd52a9b718600101aeff3", "src_uid": "6c2e658ac3c3d6b0569dd373806fa031", "apr_id": "f71ad0857ab42b0654f4117058146a92", "difficulty": 1700, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.4447900466562986, "equal_cnt": 10, "replace_cnt": 7, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 9, "bug_source_code": "using System;\n\nnamespace Task1\n{\n class Program\n {\n static void Main(string[] args)\n {\n int n = Convert.ToInt32(Console.ReadLine());\n\n if (n == 0)\n {\n Console.WriteLine(0);\n return;\n }\n\n if (n <= 9)\n {\n Console.WriteLine(n);\n return;\n }\n\n int s = 0;\n for (int i = 1; i <= n; i++)\n {\n s += i.ToString().Length;\n }\n\n Console.WriteLine(s);\n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "106723fe50da20340094320eb08ae3c6", "src_uid": "4e652ccb40632bf4b9dd95b9f8ae1ec9", "apr_id": "09346b4a79a38842b648bb748f8ac93a", "difficulty": 1200, "tags": ["math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.8282753515914137, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "using System;\nusing System.IO;\nusing System.Linq;\n\nclass Program\n{\n static char[] SPACE = new[] { ' ' };\n\n static void Main(string[] args)\n {\n#if DEBUG\n using (var input = new StreamReader(\"input.txt\"))\n using (var output = new StreamWriter(\"output.txt\"))\n {\n Console.SetIn(input);\n Console.SetOut(output);\n\n int n = 0;\n do\n {\n Console.WriteLine();\n Console.WriteLine(\"Sample {0}\", ++n);\n Prog();\n } while (Console.ReadLine() == string.Empty);\n }\n#else\n Prog();\n#endif\n }\n\n static int __ptr = 0;\n static string[] __input;\n static int NextInt()\n {\n return int.Parse(__input[__ptr++]);\n }\n static long NextLong()\n {\n return long.Parse(__input[__ptr++]);\n }\n static void ReadTokens(int n)\n {\n __ptr = 0;\n __input = Console.ReadLine().Split(SPACE, n);\n }\n\n //\n\n static void Prog()\n {\n ReadTokens(1);\n int n = NextInt();\n \n Console.WriteLine(Enumerable.Range(1, n).Aggregate(\"\", (a, b) => a + \"\" + b).Length);\n }\n}\n\n\n\n\n\n\n\n\n\n\n\n", "lang": "MS C#", "bug_code_uid": "501f877ec713b5546b4d37777c4bc5c2", "src_uid": "4e652ccb40632bf4b9dd95b9f8ae1ec9", "apr_id": "15e61a766dedf09936e32412f19153ec", "difficulty": 1200, "tags": ["math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.6579212916246215, "equal_cnt": 11, "replace_cnt": 6, "delete_cnt": 2, "insert_cnt": 2, "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 ConsoleApplication4\n{\n class Program\n {\n static void Main(string[] args)\n {\n int a =Convert.ToInt32( Console.ReadLine());\n string s=string.Empty;\n for (int i = 1; i <= a; i++)\n {\n s += i;\n }\n Console.WriteLine(s.Length);\n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "02426e64d27870f0d5ed5337150fe397", "src_uid": "4e652ccb40632bf4b9dd95b9f8ae1ec9", "apr_id": "8faa759eb73b51908bc3860b32d18fae", "difficulty": 1200, "tags": ["math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.5947242206235012, "equal_cnt": 14, "replace_cnt": 9, "delete_cnt": 5, "insert_cnt": 0, "fix_ops_cnt": 14, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace Contest308\n{\n internal class Program\n {\n private static void Main(string[] args)\n {\n int n = int.Parse(Console.ReadLine());\n \n int ans = 0;\n\n int k = 1;\n if (n <= 9) ans = n;\n else\n {\n while (k<=n)\n { \n ans += k.ToString().Length;\n k++;\n }\n\n }\n\n Console.WriteLine(ans);\n }\n }\n}", "lang": "MS C#", "bug_code_uid": "f72750b1baa0440c3844cc4f3ee9293a", "src_uid": "4e652ccb40632bf4b9dd95b9f8ae1ec9", "apr_id": "32ae7bb7c26e9ce6839188025b5be6be", "difficulty": 1200, "tags": ["math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.5401854714064915, "equal_cnt": 9, "replace_cnt": 4, "delete_cnt": 1, "insert_cnt": 3, "fix_ops_cnt": 8, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace VanyaAndBooks\n{\n class Program\n {\n static void Main(string[] args)\n {\n Int64 number = Convert.ToInt64(Console.ReadLine());\n int sum = 0;\n for (int i = 1; i <= number; i++)\n {\n if (i >= 10)\n {\n sum += numberOfDigits(i);\n }\n else\n {\n sum += 1;\n }\n }\n Console.WriteLine(\"{0}\", sum);\n }\n\n static int numberOfDigits(Int64 num)\n {\n int digCount = 0;\n while (num != 0)\n {\n num = num / 10;\n digCount += 1;\n }\n return digCount;\n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "31920351542b31d45ce49585ae1f7a28", "src_uid": "4e652ccb40632bf4b9dd95b9f8ae1ec9", "apr_id": "5125d72c8ebe4c9a1dc63d6686b70e56", "difficulty": 1200, "tags": ["math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.2942084942084942, "equal_cnt": 18, "replace_cnt": 13, "delete_cnt": 2, "insert_cnt": 2, "fix_ops_cnt": 17, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace Codeforces_335\n{\n class Program\n {\n static void Main(string[] args)\n {\n string[] input = Console.ReadLine().Split();\n int[] input1 = new int[3];\n for (int i = 0; i < input.Length; i++)\n {\n input1[i] = int.Parse(input[i]);\n }\n\n string[] rez = Console.ReadLine().Split();\n int[] rez1 = new int[3];\n for (int i = 0; i < rez.Length; i++)\n {\n rez1[i] = int.Parse(rez[i]);\n }\n\n bool f = false;\n int a = input1.Sum();\n int b = rez1.Sum();\n int c = 0;\n\n for (int i = 0; true; i++)\n {\n if (a - 2 == b)\n {\n f = true;\n break;\n }\n else\n a = a - 2;\n \n if(a + 1 == b)\n {\n f = false;\n break;\n } \n else\n {\n a = a + 1;\n } \n }\n\n if (f)\n Console.WriteLine(\"Yes\");\n else\n Console.WriteLine(\"No\");\n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "5e9e813fdfeccc45da19286fc6ec2e39", "src_uid": "1db4ba9dc1000e26532bb73336cf12c3", "apr_id": "654e10d77735de79cb40c70b6249b42a", "difficulty": 1200, "tags": ["implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.930327868852459, "equal_cnt": 7, "replace_cnt": 4, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 6, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace B\n{\n class Program\n {\n static void Main(string[] args)\n { \n string[] input = Console.ReadLine().Split();\n string[] rez = Console.ReadLine().Split();\n int[] lol = new int[3];\n\n for (int l = 0; l < input.Length; l++)\n {\n if (int.Parse(input[l]) - int.Parse(rez[l]) >= 0)\n lol[l] = 1;\n else\n lol[l] = 0;\n }\n\n int a = int.Parse(input[0]);\n int b = int.Parse(input[1]);\n int c = int.Parse(input[2]);\n int x = int.Parse(rez[0]);\n int y = int.Parse(rez[1]);\n int z = int.Parse(rez[2]);\n int i = lol[0];\n int j = lol[1];\n int k = lol[2];\n\n Console.WriteLine(rer);\n Console.WriteLine(pop);\n Console.WriteLine(3 / 2);\n if ((i * (a - x) + j * (b - y) + k * (c - z)) / 2 >= (1 - i) * -1 * (a - x) - (1 - j) * (b - y) - (1 - k) * (c - z))\n Console.WriteLine(\"Yes\");\n else\n Console.WriteLine(\"No\");\n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "7cbb05b9db9d941af9f0dfe33a0bac69", "src_uid": "1db4ba9dc1000e26532bb73336cf12c3", "apr_id": "654e10d77735de79cb40c70b6249b42a", "difficulty": 1200, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.024539877300613498, "equal_cnt": 28, "replace_cnt": 22, "delete_cnt": 3, "insert_cnt": 3, "fix_ops_cnt": 28, "bug_source_code": "\n\n \n \n Debug\n AnyCPU\n {A1D172DB-AD28-42C7-9ECB-5588BF7545D2}\n Exe\n Properties\n _606_A\n _606_A\n v4.5.2\n 512\n true\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 \n", "lang": "MS C#", "bug_code_uid": "f7299aa9402d152e8866a5876fc42c58", "src_uid": "1db4ba9dc1000e26532bb73336cf12c3", "apr_id": "5f1939afa75f4485a518e9ef2939a880", "difficulty": 1200, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9927983006061862, "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 Solver.Ex;\nusing Debug = System.Diagnostics.Debug;\nusing Watch = System.Diagnostics.Stopwatch;\nusing StringBuilder = System.Text.StringBuilder;\nusing System.Numerics;\nnamespace Solver\n{\n public class Solver\n {\n public void Solve()\n {\n var n = sc.Integer();\n var d = sc.Integer();\n x = sc.Long();\n var a = new int[n];\n var b = new int[n];\n for (int i = 0; i < n; i++)\n a[i] = i + 1;\n for (int i = 0; i < n; i++)\n {\n nextX();\n var tmp = a[i];\n a[i] = a[x % (i + 1)];\n a[x % (i + 1)] = tmp;\n }\n for (int i = 0; i < n; i++)\n {\n if (i < d) b[i] = 1;\n else b[i] = 0;\n }\n for (int i = 0; i < n; i++)\n {\n nextX();\n var tmp = b[i];\n b[i] = b[x % (i + 1)];\n b[x % (i + 1)] = tmp;\n }\n\n if (d <= 1000)\n {\n var position = new List();\n for (int i = 0; i < n; i++)\n if (b[i] == 1) position.Add(i);\n for (int i = 0; i < n; i++)\n {\n var max = 0;\n foreach (var p in position)\n {\n if (p <= i)\n max = Math.Max(max, a[i - p]);\n }\n IO.Printer.Out.WriteLine(max);\n }\n\n }\n\n else\n {\n var position = new int[n];\n for (int i = 0; i < n; i++)\n position[a[i] - 1] = i;\n for (int i = 0; i < n; i++)\n {\n var f = false;\n for (int j = n - 1; j >= n - 1000; j--)\n {\n if (position[j] > i) continue;\n if (b[i - position[j]] > 0)\n {\n IO.Printer.Out.WriteLine(j + 1);\n f = true;\n break;\n }\n }\n if (f) continue;\n var max = 0;\n foreach (var p in position)\n {\n if (p > i) break;\n max = Math.Max(max, a[i - p]);\n }\n IO.Printer.Out.WriteLine(max);\n }\n\n\n }\n }\n long x;\n long nextX()\n {\n return x = (x * 37 + 10007) % 1000000007;\n }\n\n\n\n internal IO.StreamScanner sc;\n static T[] Enumerate(int n, Func f) { var a = new T[n]; for (int i = 0; i < n; i++) a[i] = f(i); return a; }\n }\n\n #region Main and Settings\n static class Program\n {\n static void Main(string[] arg)\n {\n#if DEBUG\n var errStream = new System.IO.FileStream(@\"..\\..\\dbg.out\", System.IO.FileMode.Create, System.IO.FileAccess.Write, System.IO.FileShare.ReadWrite);\n Debug.Listeners.Add(new System.Diagnostics.TextWriterTraceListener(errStream, \"debugStream\"));\n Debug.AutoFlush = false;\n var sw = new Watch(); sw.Start();\n IO.Printer.Out.AutoFlush = true;\n try\n {\n#endif\n\n var solver = new Solver();\n solver.sc = new IO.StreamScanner(Console.OpenStandardInput());\n solver.Solve();\n IO.Printer.Out.Flush();\n#if DEBUG\n }\n catch (Exception ex)\n {\n Console.Error.WriteLine(ex.Message);\n Console.Error.WriteLine(ex.StackTrace);\n }\n finally\n {\n sw.Stop();\n Console.ForegroundColor = ConsoleColor.Green;\n Console.Error.WriteLine(\"Time:{0}ms\", sw.ElapsedMilliseconds);\n Debug.Close();\n System.Threading.Thread.Sleep(System.Threading.Timeout.Infinite);\n }\n#endif\n }\n\n\n }\n #endregion\n}\n\n#region IO Helper\nnamespace Solver.IO\n{\n public class Printer : System.IO.StreamWriter\n {\n static Printer()\n {\n Out = new Printer(Console.OpenStandardOutput()) { AutoFlush = false };\n#if DEBUG\n Error = new Printer(Console.OpenStandardError()) { AutoFlush = true };\n#else\n Error = new Printer(System.IO.Stream.Null) { AutoFlush = false };\n#endif\n }\n public static Printer Out { get; set; }\n public static Printer Error { get; set; }\n public override IFormatProvider FormatProvider { get { return System.Globalization.CultureInfo.InvariantCulture; } }\n public Printer(System.IO.Stream stream) : base(stream, new System.Text.UTF8Encoding(false, true)) { }\n public Printer(System.IO.Stream stream, System.Text.Encoding encoding) : base(stream, encoding) { }\n public void Write(string format, IEnumerable source) { base.Write(format, source.OfType().ToArray()); }\n public void WriteLine(string format, IEnumerable source) { base.WriteLine(format, source.OfType().ToArray()); }\n }\n public class StreamScanner\n {\n public StreamScanner(System.IO.Stream stream) { iStream = stream; }\n private readonly System.IO.Stream iStream;\n private readonly byte[] buf = new byte[1024];\n private int len, ptr;\n private bool eof = false;\n public bool IsEndOfStream { get { return eof; } }\n const byte lb = 33, ub = 126, el = 10, cr = 13;\n public byte read()\n {\n if (eof) throw new System.IO.EndOfStreamException();\n if (ptr >= len) { ptr = 0; if ((len = iStream.Read(buf, 0, 1024)) <= 0) { eof = true; return 0; } }\n return buf[ptr++];\n }\n public char Char() { byte b = 0; do b = read(); while (b < lb || ub < b); return (char)b; }\n public char[] Char(int n) { var a = new char[n]; for (int i = 0; i < n; i++) a[i] = Char(); return a; }\n public char[][] Char(int n, int m) { var a = new char[n][]; for (int i = 0; i < n; i++) a[i] = Char(m); return a; }\n public string Scan()\n {\n if (eof) throw new System.IO.EndOfStreamException();\n StringBuilder sb = null;\n var enc = System.Text.UTF8Encoding.Default;\n do\n {\n for (; ptr < len && (buf[ptr] < lb || ub < buf[ptr]); ptr++) ;\n if (ptr < len) break;\n ptr = 0;\n if ((len = iStream.Read(buf, 0, 1024)) <= 0) { eof = true; return \"\"; }\n } while (true);\n do\n {\n var f = ptr;\n for (; ptr < len; ptr++)\n if (buf[ptr] < lb || ub < buf[ptr])\n //if (buf[ptr] == cr || buf[ptr] == el)\n {\n string s;\n if (sb == null) s = enc.GetString(buf, f, ptr - f);\n else { sb.Append(enc.GetChars(buf, f, ptr - f)); s = sb.ToString(); }\n ptr++; return s;\n }\n if (sb == null) sb = new StringBuilder(enc.GetString(buf, f, len - f));\n else sb.Append(enc.GetChars(buf, f, len - f));\n ptr = 0;\n\n }\n while (!eof && (len = iStream.Read(buf, 0, 1024)) > 0);\n eof = true; return (sb != null) ? sb.ToString() : \"\";\n }\n public long Long()\n {\n long ret = 0; byte b = 0; bool isMynus = false;\n const byte zr = 48, nn = 57, my = 45;\n do b = read();\n while (b != my && (b < zr || nn < b));\n if (b == my) { isMynus = true; b = read(); }\n for (; true; b = read())\n if (b < zr || nn < b)\n return isMynus ? -ret : ret;\n else ret = ret * 10 + b - zr;\n }\n public int Integer()\n {\n int ret = 0; byte b = 0; bool isMynus = false;\n const byte zr = 48, nn = 57, my = 45;\n do b = read();\n while (b != my && (b < zr || nn < b));\n if (b == my) { isMynus = true; b = read(); }\n for (; true; b = read())\n if (b < zr || nn < b)\n return isMynus ? -ret : ret;\n else ret = ret * 10 + b - zr;\n }\n public double Double() { return double.Parse(Scan(), System.Globalization.CultureInfo.InvariantCulture); }\n public string[] Scan(int n) { var a = new string[n]; for (int i = 0; i < n; i++) a[i] = Scan(); return a; }\n public double[] Double(int n) { var a = new double[n]; for (int i = 0; i < n; i++) a[i] = Double(); return a; }\n public int[] Integer(int n) { var a = new int[n]; for (int i = 0; i < n; i++) a[i] = Integer(); return a; }\n public long[] Long(int n) { var a = new long[n]; for (int i = 0; i < n; i++)a[i] = Long(); return a; }\n public void Flush() { iStream.Flush(); }\n }\n}\n#endregion\n#region Extension\nnamespace Solver.Ex\n{\n static public partial class EnumerableEx\n {\n static public string AsString(this IEnumerable ie) { return new string(ie.ToArray()); }\n static public string AsJoinedString(this IEnumerable ie, string st = \" \") { return string.Join(st, ie); }\n\n }\n}\n#endregion\n", "lang": "MS C#", "bug_code_uid": "178b76f9f8707c94085b7258ba4b3c66", "src_uid": "948ae7a0189ada07c8c67a1757f691f0", "apr_id": "913278d9be2864fd3e90f7d600e043a9", "difficulty": 2300, "tags": ["probabilities"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "C#"} {"similarity_score": 0.9276803913575214, "equal_cnt": 5, "replace_cnt": 0, "delete_cnt": 2, "insert_cnt": 2, "fix_ops_cnt": 4, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\nusing System.Net.Http.Headers;\n\nnamespace ConsoleApp1\n{\n public static class PositionHelper\n {\n private static Dictionary> cache = new Dictionary>();\n\n public static HashSet GetSurrondings(this Program.Position position)\n {\n if (!cache.ContainsKey(position))\n {\n cache.Add(position, new HashSet\n {\n position,\n new Program.Position(position.X - 1, position.Y),\n new Program.Position(position.X - 1, position.Y - 1),\n new Program.Position(position.X - 1, position.Y + 1),\n new Program.Position(position.X, position.Y - 1),\n new Program.Position(position.X, position.Y + 1),\n new Program.Position(position.X + 1, position.Y),\n new Program.Position(position.X + 1, position.Y - 1),\n new Program.Position(position.X + 1, position.Y + 1)\n });\n }\n return cache[position];\n }\n\n }\n\n public static class Program\n {\n public static void Main()\n {\n Console.WriteLine(HasAvailablePosition(ReadData()) ? \"OTHER\" : \"CHECKMATE\");\n }\n\n public static bool HasAvailablePosition(string positions)\n {\n var lines = positions.Split(' ');\n var l1Position = new Position(lines[0]);\n var l2Position = new Position(lines[1]);\n var kingPosition = new Position(lines[2]);\n var aimPosition = new Position(lines[3]);\n\n var positionsForCheck = aimPosition.GetSurrondings();\n\n foreach (var position in positionsForCheck)\n {\n if (IsAvailablePosition(position, aimPosition, l1Position, l2Position, kingPosition))\n {\n return true;\n }\n }\n return false;\n }\n\n private static bool IsAvailablePosition(Position position, Position aimPosition, Position l1, Position l2, Position kingPosition)\n {\n if (position.X <= 0 || position.X > 8 || position.Y <= 0 || position.Y > 8)\n return false;\n \n if (kingPosition.GetSurrondings().Contains(position))\n return false;\n\n if (HasProblemsWithL(position, aimPosition, l1, l2, kingPosition))\n return false;\n \n if (HasProblemsWithL(position, aimPosition, l2, l1, kingPosition))\n return false;\n return true;\n }\n\n private static bool HasProblemsWithL(Position position, Position aimPosition, Position l1, Position l2, Position kingPosition)\n {\n if (position.X == l1.X || position.Y == l1.Y)\n {\n if (l1.X == l2.X || l1.Y == l2.Y)\n return true;\n if (kingPosition.GetSurrondings().Contains(l1))\n return true;\n if (!position.GetSurrondings().Contains(l1))\n return true;\n if (!position.Equals(aimPosition) && !position.Equals(l1))\n return true;\n }\n return false;\n }\n\n \n public class Position\n {\n \n private static readonly Dictionary Positions = new Dictionary\n {\n {'a', 1},\n {'b', 2},\n {'c', 3},\n {'d', 4},\n {'e', 5},\n {'f', 6},\n {'g', 7},\n {'h', 8}\n };\n \n public int X { get; }\n public int Y { get; }\n private char q;\n\n public Position(string position)\n {\n var splits = position.ToCharArray();\n X = Positions[splits[0]];\n Y = int.Parse(splits[1].ToString());\n q = splits[0];\n }\n\n public Position(int x, int y)\n {\n X = x;\n Y = y;\n q = Positions.FirstOrDefault(z => z.Value == x).Key;\n }\n\n \n protected bool Equals(Position other)\n {\n return X == other.X && Y == other.Y;\n }\n\n public override string ToString()\n {\n return $\"{q}{Y}\";\n }\n\n public override bool Equals(object obj)\n {\n if (ReferenceEquals(null, obj)) return false;\n if (ReferenceEquals(this, obj)) return true;\n if (obj.GetType() != this.GetType()) return false;\n return Equals((Position) obj);\n }\n\n public override int GetHashCode()\n {\n unchecked\n {\n return (X * 397) ^ Y;\n }\n }\n }\n \n private static string ReadData()\n {\n //return File.ReadAllLines(\"1.txt\").Single();\n return Console.ReadLine();\n //yield return Console.ReadLine();\n }\n\n //private static IEnumerable ReadData()\n //{\n // //return File.ReadAllLines(\"1.txt\");\n // while (true)\n // {\n // var line = Console.ReadLine();\n // if (string.IsNullOrEmpty(line))\n // yield break;\n // yield return line;\n\n // }\n //}\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "e2b97dbff330af6f23ddb3e93ddd8239", "src_uid": "5d05af36c7ccb0cd26a4ab45966b28a3", "apr_id": "40a2113d490e5680733ad39e69b5c2a0", "difficulty": 1700, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C#"} {"similarity_score": 0.9833359289830245, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\n\nnamespace ConsoleApp1\n{\n public static class PositionHelper\n {\n private static Dictionary> cache = new Dictionary>();\n\n public static HashSet GetSurrondings(this Program.Position position)\n {\n if (!cache.ContainsKey(position))\n {\n cache.Add(position, new HashSet\n {\n position,\n new Program.Position(position.X - 1, position.Y),\n new Program.Position(position.X - 1, position.Y - 1),\n new Program.Position(position.X - 1, position.Y + 1),\n new Program.Position(position.X, position.Y - 1),\n new Program.Position(position.X, position.Y + 1),\n new Program.Position(position.X + 1, position.Y),\n new Program.Position(position.X + 1, position.Y - 1),\n new Program.Position(position.X + 1, position.Y + 1)\n });\n }\n return cache[position];\n }\n\n }\n\n public static class Program\n {\n public static void Main()\n {\n Console.WriteLine(HasAvailablePosition(ReadData()) ? \"OTHER\" : \"CHECKMATE\");\n }\n\n public static bool HasAvailablePosition(string positions)\n {\n var lines = positions.Split(' ');\n var l1Position = new Position(lines[0]);\n var l2Position = new Position(lines[1]);\n var kingPosition = new Position(lines[2]);\n var aimPosition = new Position(lines[3]);\n\n var positionsForCheck = aimPosition.GetSurrondings();\n\n foreach (var position in positionsForCheck)\n {\n if (IsAvailablePosition(position, aimPosition, l1Position, l2Position, kingPosition))\n {\n return true;\n }\n }\n return false;\n }\n\n private static bool IsAvailablePosition(Position position, Position aimPosition, Position l1, Position l2, Position kingPosition)\n {\n if (position.X <= 0 || position.X > 8 || position.Y <= 0 || position.Y > 8)\n return false;\n \n if (kingPosition.GetSurrondings().Contains(position))\n return false;\n\n if (HasProblemsWithL(position, aimPosition, l1, l2, kingPosition))\n return false;\n \n if (HasProblemsWithL(position, aimPosition, l2, l1, kingPosition))\n return false;\n return true;\n }\n\n private static bool HasProblemsWithL(Position position, Position aimPosition, Position l1, Position l2, Position kingPosition)\n {\n if (position.X == l1.X || position.Y == l1.Y)\n {\n if (KingBetween(position, l1, kingPosition))\n return false;\n if (l1.X == l2.X || l1.Y == l2.Y)\n return true;\n if (kingPosition.GetSurrondings().Contains(l1))\n return true;\n if (!position.GetSurrondings().Contains(l1))\n return true;\n if (!position.Equals(aimPosition) && !position.Equals(l1))\n return true;\n }\n return false;\n }\n\n private static bool KingBetween(Position position, Position l1, Position kingPosition)\n {\n if (position.X == l1.X && kingPosition.X == l1.X)\n {\n if (kingPosition.Y > l1.Y && kingPosition.Y < position.Y)\n return true;\n }\n\n if (position.Y == l1.Y && kingPosition.Y == l1.Y)\n {\n if (kingPosition.X > l1.X && kingPosition.X < position.X)\n return true;\n }\n return false;\n }\n\n\n public class Position\n {\n \n private static readonly Dictionary Positions = new Dictionary\n {\n {'a', 1},\n {'b', 2},\n {'c', 3},\n {'d', 4},\n {'e', 5},\n {'f', 6},\n {'g', 7},\n {'h', 8}\n };\n \n public int X { get; }\n public int Y { get; }\n private char q;\n\n public Position(string position)\n {\n var splits = position.ToCharArray();\n X = Positions[splits[0]];\n Y = int.Parse(splits[1].ToString());\n q = splits[0];\n }\n\n public Position(int x, int y)\n {\n X = x;\n Y = y;\n q = Positions.FirstOrDefault(z => z.Value == x).Key;\n }\n\n \n protected bool Equals(Position other)\n {\n return X == other.X && Y == other.Y;\n }\n\n public override string ToString()\n {\n return $\"{q}{Y}\";\n }\n\n public override bool Equals(object obj)\n {\n if (ReferenceEquals(null, obj)) return false;\n if (ReferenceEquals(this, obj)) return true;\n if (obj.GetType() != this.GetType()) return false;\n return Equals((Position) obj);\n }\n\n public override int GetHashCode()\n {\n unchecked\n {\n return (X * 397) ^ Y;\n }\n }\n }\n \n private static string ReadData()\n {\n //return File.ReadAllLines(\"1.txt\").Single();\n return Console.ReadLine();\n //yield return Console.ReadLine();\n }\n\n //private static IEnumerable ReadData()\n //{\n // //return File.ReadAllLines(\"1.txt\");\n // while (true)\n // {\n // var line = Console.ReadLine();\n // if (string.IsNullOrEmpty(line))\n // yield break;\n // yield return line;\n\n // }\n //}\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "d8ddd3ab3d6b9aceb58a07b31ddf92f5", "src_uid": "5d05af36c7ccb0cd26a4ab45966b28a3", "apr_id": "40a2113d490e5680733ad39e69b5c2a0", "difficulty": 1700, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.9888021717000339, "equal_cnt": 7, "replace_cnt": 4, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 6, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace Lib\n{\n public class DivideCandies\n {\n public static void Main()\n {\n Solve(Console.In, Console.Out);\n }\n\n public static void Solve(TextReader tr, TextWriter tw)\n {\n var tokens = tr.ReadLine().Split();\n var n = long.Parse(tokens[0]);\n var m = long.Parse(tokens[1]);\n\n var t = new long[m, m];\n\n var res = 0L;\n for (long i = 0; i < m; i++)\n {\n for (long j = 0; j < m; j++)\n {\n t[i, j] = ((i+1) * (i+1) + (j+1) * (j+1)) % m;\n if (t[i, j] == 0)\n res++;\n }\n }\n\n var p = n / m;\n res *= p * p;\n\n var r = n % m;\n\n var res2 = 0L;\n for (int i = 0; i < r; i++)\n {\n for (int j = 0; j < m; j++)\n {\n if (t[i, j] == 0)\n res2++;\n }\n }\n\n res += res2 * 2;\n\n for (int i = 0; i < r; i++)\n {\n for (int j = 0; j < r; j++)\n {\n if (t[i, j] == 0)\n res++;\n }\n }\n\n tw.WriteLine(res);\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "65978fd9f30868e02d13177072ee5362", "src_uid": "2ec9e7cddc634d7830575e14363a4657", "apr_id": "fce78aabfe7affe0d5dde3e8d7446b4b", "difficulty": 1600, "tags": ["math", "number theory"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.265048052604957, "equal_cnt": 13, "replace_cnt": 10, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 13, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.IO;\n\nnamespace ConsoleApplication12_a\n{\n class Program\n {\n static void Main(string[] args)\n {\n string z1 = \"\", z2 = \"\", z3=\"\";\n string k1 = \"\", k2 = \"\", k3 = \"\";\n z1 = Console.ReadLine();\n z2 = Console.ReadLine();\n z3 = Console.ReadLine();\n k1 = Convert.ToString(Convert.ToInt32(\n (z2.Substring(3,1))+Convert.ToInt32(z3.Substring(2,1)))/2\n );\n z1.Replace(\"0\", k1);\n\n k2 = Convert.ToString(Convert.ToInt32(\n (z1.Substring(3, 1)) + Convert.ToInt32(z3.Substring(1, 1))) / 2\n );\n z2.Replace(\"0\", k2);\n\n k3= Convert.ToString(Convert.ToInt32(\n (z2.Substring(1, 1)) + Convert.ToInt32(z1.Substring(2, 1))) / 2\n );\n\n z3.Replace(\"0\", k3);\n \n Console.WriteLine(z1);\n Console.WriteLine(z2);\n Console.WriteLine(z3);\n\n\n }\n }\n}\n\n", "lang": "Mono C#", "bug_code_uid": "beb23949a1c8f9a19b7bcb42af3e0635", "src_uid": "0c42eafb73d1e30f168958a06a0f9bca", "apr_id": "d5dfc7277f907875f812a06c13460c05", "difficulty": 1100, "tags": ["brute force", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9840786376851723, "equal_cnt": 6, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 5, "bug_source_code": "//#define LOCAL\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.IO;\nnamespace _258_E\n{\n class Program\n {\n class Files\n {\n StreamReader fin = new StreamReader(\"d:\\\\date.in\");\n StreamWriter fout = new StreamWriter(\"d:\\\\date.out\");\n public string ReadLine()\n {\n return fin.ReadLine();\n }\n public void Write(string s)\n {\n fout.Write(s);\n }\n public void WriteLine(string s)\n {\n fout.WriteLine(s);\n }\n public void Close()\n {\n fout.Close();\n }\n }\n #if LOCAL\n static Files Console = new Files();\n #endif\n const Int64 Mod = (Int64)1e9+7;\n static string[] s;\n static string Line;\n static int step = 0, Length = 0;\n static Int64 GetNext()\n {\n if (step == Length)\n {\n Line = Console.ReadLine();\n s = Line.Split(' ');\n Length = s.Length;\n step = 0;\n }\n ++step;\n return Int64.Parse(s[step - 1]);\n }\n static Int64[] a = new Int64[30];\n static Int64 Inv = 1;\n static Int64 Comb(Int64 n, Int64 k)\n {\n if (n < k)\n return 0;\n Int64 result = 1;\n for (Int64 i = n - k + 1; i <= n; ++i)\n result = (Int64)result*i%Mod;\n result = (Int64)result*Inv%Mod;\n return result; \n }\n static Int64 Fix(Int64 x)\n {\n Int64 ret = x;\n while(ret >= Mod)\n ret -= Mod;\n while(ret < 0) \n ret += Mod;\n return ret;\n }\n\n static Int64 Pow_Log(Int64 x,Int64 p)\n {\n if (p == 0)\n return 1;\n Int64 y;\n if(p%2==1)\n y = (Int64)Pow_Log(x,p-1)*x%Mod;\n else\n {\n y = Pow_Log(x,p/2);\n y = (Int64)y*y%Mod;\n }\n return y;\n }\n static void Main(string[] args)\n {\n Int64 n = GetNext(), S = GetNext(), sum = 0, Max = 1;\n Inv = 1;\n for (int i = 0; i < n; ++i)\n {\n Max *= 2;\n if (i > 0)\n Inv *= i;\n a[i] = GetNext();\n sum += a[i];\n }\n if (sum < S)\n {\n Console.WriteLine(\"0\");\n return;\n }\n Inv = Pow_Log(Inv, Mod - 2); \n Int64 Solution = Comb(S + n - 1, n - 1),cnt = 0;\n for (int i = 1; i < Max; ++i)\n {\n Int64 k = 0;\n int nr = 0;\n for (int j = 0; j < n; ++j)\n if (((1 << j) & i) != 0) \n {\n ++nr;\n k += a[j]+1;\n }\n k = S - k;\n if (nr % 2 == 1)\n cnt += Comb(k + n - 1, n - 1);\n else\n cnt -= Comb(k + n - 1, n - 1);\n cnt = Fix(cnt);\n }\n Solution -= cnt;\n Solution = Fix(Solution);\n Console.WriteLine(Solution.ToString());\n #if LOCAL\n Console.Close(); \n #endif\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "a30c9bc8dd37528faa7d2eb865e4f585", "src_uid": "8b883011eba9d15d284e54c7a85fcf74", "apr_id": "6c8dd70411704c880ecf78ed96777ff8", "difficulty": 2300, "tags": ["bitmasks", "combinatorics", "number theory"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.9739372822299651, "equal_cnt": 11, "replace_cnt": 6, "delete_cnt": 0, "insert_cnt": 5, "fix_ops_cnt": 11, "bug_source_code": "#define LOCAL\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.IO;\nnamespace _258_E\n{\n class Program\n {\n class Files\n {\n StreamReader fin = new StreamReader(\"d:\\\\date.in\");\n StreamWriter fout = new StreamWriter(\"d:\\\\date.out\");\n public string ReadLine()\n {\n return fin.ReadLine();\n }\n public void Write(string s)\n {\n fout.Write(s);\n }\n public void WriteLine(string s)\n {\n fout.WriteLine(s);\n }\n public void Close()\n {\n fout.Close();\n }\n }\n #if LOCAL\n static Files Console = new Files();\n #endif\n const int Mod = (int)1e9+7;\n static string[] s;\n static string Line;\n static int step = 0, Length = 0;\n static Int64 GetNext()\n {\n if (step == Length)\n {\n Line = Console.ReadLine();\n s = Line.Split(' ');\n Length = s.Length;\n step = 0;\n }\n ++step;\n return Int64.Parse(s[step - 1]);\n }\n static Int64[] a = new Int64[30];\n static Int64 Inv = 1;\n static Int64 Comb(Int64 n, Int64 k)\n {\n if (n < k)\n return 0;\n Int64 result = 1;\n for (Int64 i = n - k + 1; i <= n; ++i)\n result = (Int64)result*i%Mod;\n result = (Int64)result*Inv%Mod;\n return result; \n }\n static Int64 Fix(Int64 x)\n {\n Int64 ret = x;\n if (ret >= Mod)\n ret -= Mod;\n if (ret < 0) \n ret += Mod;\n return ret;\n }\n\n static Int64 Pow_Log(Int64 x,Int64 p)\n {\n if (p == 0)\n return 1;\n Int64 y;\n if(p%2==1)\n y = (Int64)Pow_Log(x,p-1)*x%Mod;\n else\n {\n y = Pow_Log(x,p/2);\n y = (Int64)y*y%Mod;\n }\n return y;\n }\n static void Main(string[] args)\n {\n Int64 n = GetNext(), S = GetNext(), sum = 0, Max = 1;\n Inv = 1;\n for (int i = 0; i < n; ++i)\n {\n Max *= 2;\n if (i > 0)\n Inv *= i;\n a[i] = GetNext();\n sum += a[i];\n }\n if (sum < S)\n {\n Console.WriteLine(\"0\");\n return;\n }\n Inv = Pow_Log(Inv, Mod - 2); \n Int64 Solution = Comb(S + n - 1, n - 1),cnt = 0;\n for (int i = 1; i < Max; ++i)\n {\n Int64 k = 0;\n int nr = 0;\n for (int j = 0; j < n; ++j)\n if (((1 << j) & i) != 0) \n {\n ++nr;\n k += a[j]+1;\n }\n k = S - k;\n if (nr % 2 == 1)\n cnt += Comb(k + n - 1, n - 1);\n else\n cnt -= Comb(k + n - 1, n - 1);\n cnt = Fix(cnt);\n }\n Solution -= cnt;\n Console.WriteLine(Solution.ToString());\n #if LOCAL\n Console.Close(); \n #endif\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "aa966e2efe0d92cd35b782fa7331f662", "src_uid": "8b883011eba9d15d284e54c7a85fcf74", "apr_id": "6c8dd70411704c880ecf78ed96777ff8", "difficulty": 2300, "tags": ["bitmasks", "combinatorics", "number theory"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.8125, "equal_cnt": 6, "replace_cnt": 4, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 5, "bug_source_code": "using System; using System.Linq;\n\nclass P {\n static void Main() {\n var s = Console.ReadLine().Split(' ').Select(long.Parse).ToArray();\n var a = s[0]; var n = s[1];\n var digits = Enumerable.Repeat(0,0).ToList();\n while (a > 0 && n > 0) {\n var d = (int)((n%3 + 3 - a%3) % 3);\n digits.Add(d);\n } \n var res = digits.Aggregate(0, (acc,x) => acc*3+x);\n Console.Write(res);\n }\n}", "lang": "MS C#", "bug_code_uid": "7bab50fb1500610059feed813e8d71ab", "src_uid": "5fb635d52ddccf6a4d5103805da02a88", "apr_id": "f2ad3c4639e612b5a3e7c6da08b53948", "difficulty": 1100, "tags": ["math", "implementation"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9675870348139256, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\nusing System.Numerics;\n\nnamespace ConsoleApplication2\n{\n\n \n\n class Program\n {\n\n static void Main(string[] args)\n {\n string[] str = Console.ReadLine().Split(' ');\n long a = long.Parse(str[0]);\n long c = long.Parse(str[1]);\n\n int length = (int)Math.Max(Math.Ceiling(Math.Log(a, 3)), Math.Ceiling(Math.Log(c, 3)))+1;\n\n //Console.WriteLine(length);\n\n int[] astr = new int[length];\n for (int i = 0; i < length; i++ )\n {\n astr[i] = (int)((a / (int)Math.Pow(3, i)) % 3);\n }\n\n\n int[] cstr = new int[length];\n for (int i = 0; i < length; i++)\n {\n cstr[i] = (int)((c / (int)Math.Pow(3, i)) % 3);\n }\n\n\n\n int[] bstr = new int[length];\n for (int i = 0; i < length; i++)\n {\n if (astr[i] <= cstr[i])\n {\n bstr[i] = cstr[i] - astr[i];\n }\n else \n {\n bstr[i] = cstr[i] - astr[i] + 3;\n }\n }\n\n\n\n /*\n for (int i = 0; i < length; i++ )\n {\n Console.Write(astr[i]);\n }\n Console.WriteLine();\n\n for (int i = 0; i < length; i++)\n {\n Console.Write(bstr[i]);\n }\n Console.WriteLine();\n\n for (int i = 0; i < length; i++)\n {\n Console.Write(cstr[i]);\n }\n Console.WriteLine();\n */\n\n long res = 0;\n for (int i = 0; i < length; i++)\n {\n //Console.WriteLine(bstr[i] + \" \" + (int)Math.Pow(3, i));\n res += bstr[i] * (long)Math.Pow(3, i);\n }\n Console.WriteLine(res);\n }\n\n\n }\n}\n", "lang": "MS C#", "bug_code_uid": "13f75d8bbb5fdb52abae67fb5237aedd", "src_uid": "5fb635d52ddccf6a4d5103805da02a88", "apr_id": "dfcad41a4ebb5d8427ea3c816fedde2e", "difficulty": 1100, "tags": ["math", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.7655769768091646, "equal_cnt": 14, "replace_cnt": 4, "delete_cnt": 3, "insert_cnt": 6, "fix_ops_cnt": 13, "bug_source_code": "using System;\nusing System.IO;\nusing System.Text;\n\nnamespace Pyramid_of_Glasses\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 int t = Next();\n\n var nn = new int[n,n];\n int d = 1;\n nn[0, 0] = 1;\n for (int i = 1; i < n; i++)\n {\n d *= 2;\n nn[0, i] = nn[0, i - 1] + d;\n }\n\n d = 1;\n for (int i = 1; i < n; i++)\n {\n d *= 2;\n for (int j = 0; j < n; j++)\n {\n nn[i, j] = nn[i - 1, j] + d;\n }\n }\n\n int count = 0;\n for (int i = 0; i < n; i++)\n {\n for (int j = 0; j < n; j++)\n {\n if (i + j > n)\n break;\n if (nn[i, j] <= t)\n count++;\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": "d71b581d1a0f583dd321264bf5743281", "src_uid": "b2b49b7f6e3279d435766085958fb69d", "apr_id": "7edb797b84e0e55bdf77cfbd3cad00d9", "difficulty": 1500, "tags": ["math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.9967637540453075, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "using System;\nusing System.Linq;\nusing System.Collections.Generic;\nusing System.Text;\nusing System.Globalization;\n\nnamespace CodeForces\n{\n\tclass MainClass\n\t{\n\t\tpublic static void Main (string[] args)\n\t\t{\n\t\t\tint[] nums = Console.ReadLine ().Split (' ').Select (int.Parse).ToArray ();\n\t\t\tint n = nums [0];\n\t\t\tint t = nums [1];\n\t\t\tdouble[,] triangle = new double[n, n];\n\t\t\tfor (int k = 0; k < t; k++) {\n\t\t\t\ttriangle [0, 0] += 1;\n\t\t\t\tfor (int col = 0; col < n; col++) {\n\t\t\t\t\tfor (int row = 0; row <= col; row++) {\n\t\t\t\t\t\tif (triangle [col, row] > 1) {\n\t\t\t\t\t\t\tdouble diff = triangle [col, row] - 1;\n\t\t\t\t\t\t\ttriangle [col, row] = 1;\n\t\t\t\t\t\t\ttriangle [col + 1, row] += diff / 2;\n\t\t\t\t\t\t\ttriangle [col + 1, row + 1] += diff / 2;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tint count = 0;\n\t\t\tfor (int i = 0; i < n; i++) {\n\t\t\t\tfor (int j = 0; j < n; j++) {\n\t\t\t\t\tif (triangle [i, j] == 1)\n\t\t\t\t\t\tcount++;\n\t\t\t\t}\n\t\t\t}\n\t\t\tConsole.WriteLine (count);\n\t\t}\n\t}\n}\n", "lang": "MS C#", "bug_code_uid": "24f576b805f6c60fbfcfa0dc734f9ded", "src_uid": "b2b49b7f6e3279d435766085958fb69d", "apr_id": "be2806304023f7e2d0f3d246d92ddeb4", "difficulty": 1500, "tags": ["math", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9985754985754985, "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.Text;\n\nnamespace ConsoleApp2\n{\n class Program\n {\n static void Main(string[] args)\n {\n string s = Console.ReadLine();\n char maxC = 'a';\n int maxKol = 0;\n for (int i=0;i= k ? \"YES\" : \"NO\");\n }\n }\n}", "lang": "Mono C#", "bug_code_uid": "8cebee14e07bcac06db2bc2bbfbde0b2", "src_uid": "05fd61dd0b1f50f154eec85d8cfaad50", "apr_id": "660e7cd5d29c0aa1e21e28c6527bc8a0", "difficulty": 800, "tags": ["math", "games"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.6564690885914596, "equal_cnt": 6, "replace_cnt": 4, "delete_cnt": 1, "insert_cnt": 0, "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 A\n{\n class Program\n {\n static void Main(string[] args)\n {\n string[] buffer = Console.ReadLine().Split(' ');\n int a = int.Parse(buffer[0]);\n int b = int.Parse(buffer[1]);\n int summ = 0;\n for (int i = 1; i <= a; i++)\n {\n for (int j = 1; j <= b; j++)\n {\n if ((i + j) % 5 == 0)\n {\n summ++;\n }\n }\n }\n Console.WriteLine(summ);\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "69a5fcb7a19e0df21d6cd38dadbc777e", "src_uid": "df0879635b59e141c839d9599abd77d2", "apr_id": "b88ea3307de2fadfa0c9fa899096f28f", "difficulty": 1100, "tags": ["math", "constructive algorithms", "number theory"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.8822815533980582, "equal_cnt": 9, "replace_cnt": 6, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 8, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\nusing System.Numerics;\n\nnamespace A\n{\n class Program\n {\n static void Main(string[] args)\n {\n string[] buffer = Console.ReadLine().Split(' ');\n int a = int.Parse(buffer[0]);\n int b = int.Parse(buffer[1]);\n int index = b / 5;\n BigInteger summ = a * index;\n for (int i = 1; i <= a; i++)\n {\n for (int j = (5*index)+1; j <= b; j++)\n {\n if ((i + j) % 5 == 0)\n {\n summ++;\n }\n }\n }\n Console.WriteLine(summ);\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "f9ee9b14ceba1198991a6e60de0acb92", "src_uid": "df0879635b59e141c839d9599abd77d2", "apr_id": "b88ea3307de2fadfa0c9fa899096f28f", "difficulty": 1100, "tags": ["math", "constructive algorithms", "number theory"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.3719887955182073, "equal_cnt": 13, "replace_cnt": 9, "delete_cnt": 3, "insert_cnt": 1, "fix_ops_cnt": 13, "bug_source_code": "using System;\nusing System.Linq;\nnamespace Alyona_and_Numbers\n{\n class Program\n {\n static void Main(string[] args)\n {\n int[] input = Array.ConvertAll(Console.ReadLine().Split(), int.Parse);\n int max = input.Max(),\n min = input.Min();\n int pairsCount = 0;\n for (int i = 1; i <= min; i++)\n {\n int intial = 5;\n int j = 1;\n while (true)\n {\n int subtract = intial - i;\n if(subtract<=0)\n {\n j++;\n intial = 5 * j;\n continue;\n }\n if (subtract <= max)\n {\n //Console.WriteLine($\"({i},{subtract})\");\n pairsCount++;\n j++;\n intial =5*j;\n }\n else\n {\n break;\n }\n }\n }\n Console.WriteLine(pairsCount);\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "eb412c571f9cc4507ec0a330a670dbe8", "src_uid": "df0879635b59e141c839d9599abd77d2", "apr_id": "1550a51796e448dd9d86496f8566d78a", "difficulty": 1100, "tags": ["math", "constructive algorithms", "number theory"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.8834175084175084, "equal_cnt": 4, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 3, "bug_source_code": "using System;\nusing System.Collections;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\n\nclass TEST{\n\tstatic void Main(){\n\t\tSol mySol =new Sol();\n\t\tmySol.Solve();\n\t}\n}\n\nclass Sol{\n\tpublic void Solve(){\n\t\t\n\t\tbool[] used = new bool[N];\n\t\tvar SH = new SkewHeap();\n\t\tused[0] = true;\n\t\tfor(int j=1;j0){\n\t\t\tvar p = SH.Top; SH.Pop();\n\t\t\tint now = p.Pos;\n\t\t\tlong cost = p.Cost;\n\t\t\tif(used[now]) continue;\n\t\t\tmin += cost;\n\t\t\tused[now] = true;\n\t\t\tvis++;\n\t\t\tif(vis == N) break;\n\t\t\tfor(int j=0;jint.Parse(e));}\n\tstatic long[] rla(char sep=' '){return Array.ConvertAll(Console.ReadLine().Split(sep),e=>long.Parse(e));}\n\tstatic double[] rda(char sep=' '){return Array.ConvertAll(Console.ReadLine().Split(sep),e=>double.Parse(e));}\n}\n\n\nclass Pair : IComparable {\n\tpublic int Pos;\n\tpublic long Cost;\n\tpublic Pair(int p, long c) {\n\t\tPos = p; Cost = c;\n\t}\n\tpublic int CompareTo(Pair t) {\n\t\t//return this.Cost > t.Cost ? -1 : this.Cost < t.Cost ? 1 : 0;\n\t\treturn this.Cost > t.Cost ? 1 : this.Cost < t.Cost ? -1 : 0;\n\t}\n}\n\n\nclass SkewHeap where T:IComparable{\n\tpublic int Count{\n\t\tget{return cnt;}\n\t\tprivate set{cnt=value;}\n\t}\n\t\n\tpublic SkewHeap(){\n\t\troot=null;\n\t\tthis.Count=0;\n\t}\n\t\n\tpublic void Push(T v){\n\t\tNodeSH p=new NodeSH(v);\n\t\troot=NodeSH.Meld(root,p);\n\t\tthis.Count++;\n\t}\n\t\n\tpublic void Pop(){\n\t\tif(root==null)return;\n\t\troot=NodeSH.Meld(root.L,root.R);\n\t\tthis.Count--;\n\t}\n\t\n\tpublic T Top{\n\t\tget{return root.Val;}\n\t}\n\t\n\tint cnt;\n\tNodeSH root;\n\t\n\tclass NodeSH where S : IComparable {\n\t\tpublic NodeSH L, R;\n\t\tpublic S Val;\n\n\t\tpublic NodeSH(S v){\n\t\t\tVal = v;\n\t\t\tL = null; R = null;\n\t\t}\n\t\tpublic static NodeSH Meld(NodeSH a, NodeSH b){\n\t\t\tif(a == null)return b;\n\t\t\tif (b == null) return a;\n\t\t\tif (a.Val.CompareTo(b.Val) > 0) swap(ref a, ref b);\n\t\t\ta.R = Meld(a.R, b);\n\t\t\tswap(ref a.L, ref a.R);\n\t\t\treturn a;\n\t\t}\n\n\t\tstatic void swap(ref U x, ref U y) {\n\t\t\tU t = x; x = y; y = t;\n\t\t}\n\t}\n}\n", "lang": "Mono C#", "bug_code_uid": "cdc693fd453366ef5788ec9f56028a52", "src_uid": "dfe9446431325c73e88b58ba204d0e47", "apr_id": "c876ce72fbab56ef42d736daac2467ad", "difficulty": 1000, "tags": ["constructive algorithms"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.34340006786562605, "equal_cnt": 13, "replace_cnt": 9, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 12, "bug_source_code": "using System;\nusing System.Collections.Generic;\n\n\nclass Program\n{ \n private static void Main(string[] args)\n {\n int[] inputData = Console.ReadLine().Split(' ').Select(item => Int32.Parse(item)).ToArray();\n\n double platesCount = inputData[0];\n double firstCakePieces = inputData[1];\n double secondCakePieces = inputData[2];\n \n int findedValue;\n\n if (firstCakePieces + secondCakePieces == platesCount || firstCakePieces == secondCakePieces)\n {\n findedValue = (int)((firstCakePieces + secondCakePieces) / platesCount);\n }\n else\n {\n double piecesOnFirstPlate;\n double piecesOnSecondPlate;\n double lessPart = firstCakePieces > secondCakePieces\n ? Math.Ceiling(platesCount * secondCakePieces / firstCakePieces)\n : Math.Ceiling(platesCount * firstCakePieces / secondCakePieces);\n\n\n if (firstCakePieces > secondCakePieces)\n {\n piecesOnFirstPlate = firstCakePieces / (platesCount - lessPart);\n piecesOnSecondPlate = secondCakePieces / lessPart;\n }\n else\n {\n piecesOnFirstPlate = firstCakePieces / lessPart;\n piecesOnSecondPlate = secondCakePieces / (platesCount - lessPart);\n }\n\n findedValue = (int) (piecesOnFirstPlate < piecesOnSecondPlate ? Math.Ceiling(piecesOnFirstPlate) : Math.Ceiling(piecesOnSecondPlate));\n }\n\n Console.WriteLine(findedValue);\n Console.ReadLine();\n }\n}", "lang": "MS C#", "bug_code_uid": "4a4a1e1c373fece7af43679f6d40d751", "src_uid": "a254b1e3451c507cf7ce3e2496b3d69e", "apr_id": "101def8cdbeab091f5f8cc6d8a8c6e8d", "difficulty": 1200, "tags": ["brute force", "implementation", "binary search"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9596076913150083, "equal_cnt": 12, "replace_cnt": 7, "delete_cnt": 1, "insert_cnt": 3, "fix_ops_cnt": 11, "bug_source_code": "#region imports\nusing System;\nusing System.Collections.Generic;\nusing System.ComponentModel;\nusing System.Data;\nusing System.Diagnostics;\nusing System.Globalization;\nusing System.IO;\nusing System.Linq;\nusing System.Numerics;\nusing System.Runtime.CompilerServices;\nusing System.Runtime.InteropServices;\n\n#endregion\n\nnamespace CodeForces\n{\n class Problem\n {\n const bool IsContest = true;\n long[,] _adj = { { 0, 1, 1, 1 }, { 1, 0, 1, 1 }, { 1, 1, 0, 1 }, { 1, 1, 1, 0 } };\n\n long[,] Identity()\n {\n var result = new long[Dim, Dim];\n for (var i = 0; i < Dim; i++) result[i, i] = 1;\n return result;\n }\n\n const long Modulo = 1000000007;\n const int Dim = 4;\n\n long[,] Product(long[,] a, long[,] b)\n {\n var result = new long[Dim, Dim];\n for (var i = 0; i < Dim; i++)\n for (var j = 0; j < Dim; j++)\n for (var k = 0; k < Dim; k++) result[i, j] = (result[i, j] + a[i, k] * b[k, j]) % Modulo;\n return result;\n }\n\n long[,] Power(long[,] a, long n)\n {\n if (n == 0) return Identity();\n if (n == 1) return a;\n\n var result = Product(Power(a, n / 2), Power(a, n / 2));\n if (n % 2 == 1) result = Product(result, a);\n return result;\n }\n\n private void Solve()\n {\n var n = _.NextInt();\n var t = Power(_adj, n);\n _.WriteLine(t[0, 0]);\n }\n\n #region shit\n private readonly InOut _ = new InOut(IsContest);\n static void Main(string[] args)\n {\n var p = new Problem();\n p.Solve();\n p._.Close();\n }\n }\n class InOut\n {\n private const string InputFile = \"input.txt\";\n private const string OutputFile = \"output.txt\";\n public StreamWriter Cout { get; private set; }\n public StreamReader Cin { get; private set; }\n private void SetConsoleIo()\n {\n Cin = new StreamReader(new BufferedStream(Console.OpenStandardInput()));\n Cout = new StreamWriter(new BufferedStream(Console.OpenStandardOutput()));\n }\n private void SetFileIo(string inputFile, string outputFile) { Cin = new StreamReader(inputFile); Cout = new StreamWriter(outputFile); }\n public InOut() { SetConsoleIo(); }\n public InOut(string inputFile, string outputFile) { SetFileIo(inputFile, outputFile); }\n public InOut(bool isContest) { if (isContest) SetConsoleIo(); else SetFileIo(InputFile, OutputFile); }\n public void WriteLine(object x) { Cout.WriteLine(x); }\n public void Close() { Cin.Close(); Cout.Close(); }\n public void WriteLine(string format, params object[] args) { Cout.WriteLine(format, args); }\n private int _pos;\n private string[] _tokens;\n\n private string[] NextStringArray() { return Cin.ReadLine().Split(\" \\t\".ToCharArray(), StringSplitOptions.RemoveEmptyEntries); }\n public string NextToken()\n {\n while (_tokens == null || _pos == _tokens.Length)\n {\n // ReSharper disable once PossibleNullReferenceException\n _tokens = NextStringArray();\n _pos = 0;\n }\n return _tokens[_pos++];\n }\n public int NextInt() { return int.Parse(NextToken()); }\n public long NextLong() { return long.Parse(NextToken()); }\n public double NextDouble() { return double.Parse(NextToken(), CultureInfo.InvariantCulture); }\n public int[] NextIntArray() { return NextStringArray().Select(int.Parse).ToArray(); }\n public byte[] NextByteArray() { return NextStringArray().Select(byte.Parse).ToArray(); }\n public long[] NextLongArray() { return NextStringArray().Select(long.Parse).ToArray(); }\n #endregion\n }\n}", "lang": "MS C#", "bug_code_uid": "16bc30d3cfca1a5662201b74c266286c", "src_uid": "77627cc366a22e38da412c3231ac91a8", "apr_id": "309cafc8de9dbe90b3af0871d3e9cacd", "difficulty": 1500, "tags": ["matrices", "dp", "math"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9980023971234518, "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;\nnamespace Task26A\n{\n class Program\n {\n static void Main(string[] args)\n {\n int n, ans = 0;\n n = Convert.ToInt32(Console.ReadLine());\n List primes=new List ();\n for(int i = 2; i <= n; i++) \n if (isPrime(i))\n primes.Add(i);\n \n \n for (int i = 1; i <= n; i++)\n if (isAlmastPrime(ref primes,i))\n ans++;\n\n Console.WriteLine(ans);\n }\n\n private static bool isPrime(int N)\n {\n if (N == 2) return true;\n if (N < 2 || N % 2 == 0) return false;\n for (int i = 3; i <=Math.Sqrt(N); i += 2)\n if (N % i == 0) return false;\n return true;\n }\n\n private static bool isAlmastPrime(ref List mylist, int item)\n {\n int count = 0;\n for (int i = 0; i <= mylist.Count; i++) { \n \n if (i%mylist[i]== 0)\n count++;\n if (count > 2)\n return false;\n }\n return count == 2;\n }\n\n\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "5211aa089f5f71c7b8fd396b1b8f176d", "src_uid": "356666366625bc5358bc8b97c8d67bd5", "apr_id": "48845526ac929b42356dce14b6b4e4f1", "difficulty": 900, "tags": ["number theory"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C#"} {"similarity_score": 0.9990638836179633, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "/*\n * TemplateCS\n * Copyright (C) 2014-2016 Markus Himmel\n * This file is distributed under the terms of the MIT license\n */\n\n//#define CodeJam\n#define CodeForces\n\nusing System;\nusing System.Collections;\nusing System.Collections.Generic;\nusing System.Diagnostics;\nusing System.Globalization;\nusing System.Linq;\n\n// ReSharper disable RedundantUsingDirective\nusing System.IO;\n\n// ReSharper restore RedundantUsingDirective\n\n// ReSharper disable UnusedMember.Local\n\n// ReSharper disable once CheckNamespace\n\nnamespace ProgrammingCompetitions\n{\n internal class Program\n {\n #region GCJ\n\n#if CodeJam\n\t\tprivate static bool DEBUG = false;\n\n\t\tstatic void debug()\n\t\t{\n\t\t}\n\n\t\tstatic string solveCase(int num)\n\t\t{\n\t\t\tchecked\n\t\t\t{\n\t\t\t\treturn null;\n\t\t\t}\n\t\t}\n#endif\n\n #endregion\n\n #region CodeForces\n\n#if CodeForces\n#if DEBUG\n private static readonly Queue testInput = new Queue(@\"\n\n3\nBBW\n\n\n\".Split(new[] { Environment.NewLine }, StringSplitOptions.RemoveEmptyEntries));\n#endif\n\n\n\n private static object solve()\n {\n // ReSharper disable once RedundantOverflowCheckingContext\n checked\n {\n int n = read();\n var e = read().ToCharArray();\n List res = new List();\n\n int cur = 0;\n foreach (char c in e)\n {\n if (c == 'W')\n {\n if (cur > 0)\n {\n res.Add(cur);\n cur = 0;\n }\n }\n else\n {\n cur++;\n }\n }\n if (res.Count == 0 || cur > 0)\n res.Add(cur);\n\n Console.WriteLine(res.Count);\n return res;\n }\n }\n#endif\n\n #endregion\n\n // Everything after this comment is template code\n\n private static T read()\n {\n return (T)Convert.ChangeType(read(), typeof(T));\n }\n\n private static T[] readMany()\n {\n // ReSharper disable once PossiblyMistakenUseOfParamsMethod\n return readMany(' ');\n }\n\n private static T[] readMany(params char[] ___)\n {\n return read().Split(___).Select(__ => (T)Convert.ChangeType(__, typeof(T))).ToArray();\n }\n\n private static string[] readMany()\n {\n return readMany();\n }\n\n private static T[][] readMany(int n)\n {\n var res = new T[n][];\n for (int i = 0; i < n; i++)\n res[i] = readMany();\n return res;\n }\n\n private static T[][] readField(int height, Func map)\n {\n var res = new T[height][];\n for (int _ = 0; _ < height; _++)\n res[_] = read().Select(map).ToArray();\n return res;\n }\n\n private static char[][] readField(int height)\n {\n return readField(height, c => c);\n }\n\n private static T[][] readField(int height, Dictionary dic)\n {\n return readField(height, c => dic[c]);\n }\n\n private static void read(out T1 t1)\n {\n string[] vals = readMany();\n t1 = (T1)Convert.ChangeType(vals[0], typeof(T1));\n }\n\n private static void read(out T1 t1, out T2 t2)\n {\n string[] vals = readMany();\n t1 = (T1)Convert.ChangeType(vals[0], typeof(T1));\n t2 = (T2)Convert.ChangeType(vals[1], typeof(T2));\n }\n\n private static void read(out T1 t1, out T2 t2, out T3 t3)\n {\n string[] vals = readMany();\n t1 = (T1)Convert.ChangeType(vals[0], typeof(T1));\n t2 = (T2)Convert.ChangeType(vals[1], typeof(T2));\n t3 = (T3)Convert.ChangeType(vals[2], typeof(T3));\n }\n\n private static void read(out T1 t1, out T2 t2, out T3 t3, out T4 t4)\n {\n string[] vals = readMany();\n t1 = (T1)Convert.ChangeType(vals[0], typeof(T1));\n t2 = (T2)Convert.ChangeType(vals[1], typeof(T2));\n t3 = (T3)Convert.ChangeType(vals[2], typeof(T3));\n t4 = (T4)Convert.ChangeType(vals[3], typeof(T4));\n }\n\n private static void read(out T1 t1, out T2 t2, out T3 t3, out T4 t4, out T5 t5)\n {\n string[] vals = readMany();\n t1 = (T1)Convert.ChangeType(vals[0], typeof(T1));\n t2 = (T2)Convert.ChangeType(vals[1], typeof(T2));\n t3 = (T3)Convert.ChangeType(vals[2], typeof(T3));\n t4 = (T4)Convert.ChangeType(vals[3], typeof(T4));\n t5 = (T5)Convert.ChangeType(vals[4], typeof(T5));\n }\n\n private static Func dp(Func, TResult> f)\n {\n var cache = new Dictionary, TResult>();\n Func res = null;\n res = t1 =>\n {\n Tuple key = Tuple.Create(t1);\n if (!cache.ContainsKey(key))\n cache.Add(key, f(t1, res));\n return cache[key];\n };\n return res;\n }\n\n private static Func dp(Func, TResult> f)\n {\n var cache = new Dictionary, TResult>();\n Func res = null;\n res = (t1, t2) =>\n {\n Tuple key = Tuple.Create(t1, t2);\n if (!cache.ContainsKey(key))\n cache.Add(key, f(t1, t2, res));\n return cache[key];\n };\n return res;\n }\n\n private static Func dp(Func, TResult> f)\n {\n var cache = new Dictionary, TResult>();\n Func res = null;\n res = (t1, t2, t3) =>\n {\n Tuple key = Tuple.Create(t1, t2, t3);\n if (!cache.ContainsKey(key))\n cache.Add(key, f(t1, t2, t3, res));\n return cache[key];\n };\n return res;\n }\n\n private static Func dp(Func, TResult> f)\n {\n var cache = new Dictionary, TResult>();\n Func res = null;\n res = (t1, t2, t3, t4) =>\n {\n Tuple key = Tuple.Create(t1, t2, t3, t4);\n if (!cache.ContainsKey(key))\n cache.Add(key, f(t1, t2, t3, t4, res));\n return cache[key];\n };\n return res;\n }\n\n private static IEnumerable single(T it)\n {\n yield return it;\n }\n\n private static IEnumerable range(long first, long last, long step = 1)\n {\n for (long i = first; i <= last; i += step)\n yield return i;\n }\n\n private static IEnumerable range(int first, int last, int step = 1)\n {\n for (int i = first; i <= last; i += step)\n yield return i;\n }\n\n private static T id(T a)\n {\n return a;\n }\n\n public static T[][] Mkarr(int x, int y)\n {\n var res = new T[x][];\n for (int i = 0; i < x; i++)\n res[i] = new T[y];\n return res;\n }\n\n public static T[][][] Mkarr(int x, int y, int z)\n {\n var res = new T[x][][];\n for (int i = 0; i < x; i++)\n {\n res[i] = new T[y][];\n for (int j = 0; j < y; j++)\n res[i][j] = new T[z];\n }\n return res;\n }\n\n private static long ternarySearch(long from, long to, Func comp)\n {\n from--;\n while (to - from > 1)\n {\n long mid = (from + to) >> 1;\n if (comp(mid))\n to = mid;\n else\n from = mid;\n }\n return to;\n }\n\n public static KeyValuePair Min(Func f, long from, long to)\n {\n long i = ternarySearch(from, to, mid => f(mid) < f(mid + 1));\n return new KeyValuePair(i, f(i));\n }\n\n public static long Max(params long[] p)\n {\n return p.Max();\n }\n\n public static int Max(params int[] p)\n {\n return p.Max();\n }\n\n public static double Max(params double[] p)\n {\n return p.Max();\n }\n\n public static KeyValuePair Max(Func f, long from, long to)\n {\n long i = ternarySearch(from, to, mid => f(mid) > f(mid + 1));\n return new KeyValuePair(i, f(i));\n }\n\n public static long Min(params long[] p)\n {\n return p.Min();\n }\n\n public static int Min(params int[] p)\n {\n return p.Min();\n }\n\n public static double Min(params double[] p)\n {\n return p.Min();\n }\n\n private static bool[] tf = { true, false };\n\n#if CodeJam\n\n\t\tstatic void Main(string[] args)\n\t\t{\n\t\t\tif (DEBUG)\n\t\t\t{\n\t\t\t\tdebug();\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tInitialize();\n\t\t\t\tSolveAll(solveCase);\n\t\t\t}\n\t\t\tConsole.ReadKey();\n\t\t}\n\n\t\tprivate static StreamReader inf;\n\t\tprivate static StreamWriter outf;\n\n\t\tprivate delegate void o(string format, params object[] args);\n\t\tprivate static o Output;\n\n\t\tpublic static void Initialize()\n\t\t{\n\t\t\tConsole.ForegroundColor = ConsoleColor.Yellow;\n\t\t\tConsole.Write(\"File name: \");\n\t\t\tstring name = Console.ReadLine();\n\t\t\tinf = new StreamReader($\"D:\\\\Users\\\\marku\\\\Downloads\\\\{name}.in\");\n\t\t\toutf = new StreamWriter($\"D:\\\\Users\\\\marku\\\\Downloads\\\\{name}.out\");\n\t\t\tConsole.ForegroundColor = ConsoleColor.White;\n\t\t\tOutput = highlightedPrint;\n\t\t\tOutput += outf.WriteLine;\n\t\t}\n\n\t\tprivate static void highlightedPrint(string format, params object[] args)\n\t\t{\n\t\t\tConsoleColor prev = Console.ForegroundColor;\n\t\t\tConsole.ForegroundColor = ConsoleColor.Green;\n\t\t\tConsole.WriteLine(format, args);\n\t\t\tConsole.ForegroundColor = prev;\n\t\t}\n\n\t\tpublic static void SolveAll(Func calc)\n\t\t{\n\t\t\tint cases = int.Parse(inf.ReadLine());\n\t\t\tfor (int _ = 1; _ <= cases; _++)\n\t\t\t{\n\t\t\t\tOutput($\"Case #{_}: {calc(_)}\");\n\t\t\t}\n\t\t\tinf.Close();\n\t\t\toutf.Close();\n\t\t\tConsole.ForegroundColor = ConsoleColor.Cyan;\n\t\t\tConsole.WriteLine(\"Eureka!\");\n\t\t}\n\n\t\tprivate static string read()\n\t\t{\n\t\t\treturn inf.ReadLine();\n\t\t}\n#endif\n\n#if CodeForces\n private static string asString(object s)\n {\n if (s is double)\n return ((double)s).ToString(\"0.000000000\", CultureInfo.InvariantCulture);\n return s.ToString();\n }\n\n public static void Main(string[] args)\n {\n#if DEBUG\n Stopwatch sw = new Stopwatch();\n sw.Start();\n#endif\n object o = solve();\n if (o != null)\n {\n string s;\n IEnumerable e = o as IEnumerable;\n if ((e != null) && !(o is string))\n s = string.Join(\" \", e.OfType().Select(asString));\n else\n s = asString(o);\n if (!string.IsNullOrEmpty(s))\n Console.WriteLine(s);\n }\n#if DEBUG\n sw.Stop();\n Console.WriteLine(sw.Elapsed);\n Console.ReadKey();\n#endif\n }\n\n private static string read()\n {\n#if !DEBUG\n\t\t\treturn Console.ReadLine();\n#else\n return testInput.Dequeue();\n#endif\n }\n#endif\n }\n\n public static class ExtensionMethods\n {\n public static int BinarySearch(this IList it, Func compare)\n {\n int len = it.Count;\n int first = 0;\n\n while (len > 0)\n {\n int half = len >> 1;\n T middle = it[first + half];\n if (compare(middle))\n len = half;\n else\n {\n first += half + 1;\n len -= half + 1;\n }\n }\n\n return first;\n }\n\n public static int Upper(this IList it, T val)\n {\n Comparer comp = Comparer.Default;\n return it.BinarySearch(other => comp.Compare(val, other) < 0);\n }\n\n public static int Lower(this IList it, T val)\n {\n Comparer comp = Comparer.Default;\n return it.BinarySearch(other => comp.Compare(other, val) >= 0);\n }\n\n public static T[] Of(this int n, Func gen)\n {\n return n.Of2(gen).ToArray();\n }\n\n public static T[] Of(this int n, Func gen)\n {\n return n.Of2(gen).ToArray();\n }\n\n public static T[] Of(this int n, T gen)\n {\n return n.Of2(gen).ToArray();\n }\n\n public static IEnumerable Of2(this int n, Func gen)\n {\n for (int i = 0; i < n; i++)\n yield return gen();\n }\n\n public static IEnumerable Of2(this int n, Func gen)\n {\n for (int i = 0; i < n; i++)\n yield return gen(i);\n }\n\n public static IEnumerable Of2(this int n, T gen)\n {\n for (int i = 0; i < n; i++)\n yield return gen;\n }\n\n public static IEnumerable Cartesian(this IEnumerable first, IEnumerable second, Func collector)\n {\n return first.SelectMany(f => second.Select(s => collector(f, s)));\n }\n\n public static IEnumerable> Cartesian(this IEnumerable first, IEnumerable second)\n {\n return first.Cartesian(second, Tuple.Create);\n }\n\n public static IEnumerable> CartesianE(this IEnumerable first, IEnumerable second)\n {\n // Calling CartesianE prevents selection of the wrong overload of Cartesian when you want a tuple of tuples to be returned\n return first.Cartesian(second);\n }\n\n public static IEnumerable> Cartesian(this IEnumerable> first, IEnumerable second)\n {\n return first.Cartesian(second, (x, y) => Tuple.Create(x.Item1, x.Item2, y));\n }\n\n public static IEnumerable> Cartesian(this IEnumerable> first, IEnumerable second)\n {\n return first.Cartesian(second, (x, y) => Tuple.Create(x.Item1, x.Item2, x.Item3, y));\n }\n\n public static IEnumerable> Cartesian(this IEnumerable> first, IEnumerable second)\n {\n return first.Cartesian(second, (x, y) => Tuple.Create(x.Item1, x.Item2, x.Item3, x.Item4, y));\n }\n\n public static IEnumerable> Cartesian(this IEnumerable> source)\n {\n IEnumerable[] enumerable = source as IEnumerable[] ?? source.ToArray();\n IEnumerable> res = enumerable.First().Select(single);\n return enumerable.Skip(1).Aggregate(res, (current, next) => current.Cartesian(next, (sofar, n) => sofar.Concat(single(n))));\n }\n\n public static IEnumerable> Pow(this IEnumerable it, int num)\n {\n return Enumerable.Repeat(it, num).Cartesian();\n }\n\n public static IEnumerable Demask(this IEnumerable> inp)\n {\n foreach (Tuple pair in inp)\n if (pair.Item2)\n yield return pair.Item1;\n }\n\n public static IEnumerable>> Partition(this IEnumerable source, int groups)\n {\n T[] src = source as T[] ?? source.ToArray();\n foreach (int[] part in Enumerable.Range(0, groups).Pow(src.Length).Select(x => x.ToArray()))\n yield return Enumerable.Range(0, groups).Select(x => src.Where((item, idx) => part[idx] == x));\n }\n\n public static IEnumerable> Combinations(this IEnumerable it)\n {\n T[] itt = it as T[] ?? it.ToArray();\n foreach (IEnumerable conf in new[] { true, false }.Pow(itt.Length))\n yield return itt.Zip(conf, Tuple.Create).Demask();\n }\n\n private static IEnumerable single(T it)\n {\n yield return it;\n }\n\n private static IEnumerable exceptSingle(this IEnumerable first, T it, IEqualityComparer comp = null)\n {\n comp = comp ?? EqualityComparer.Default;\n bool seen = false;\n foreach (T a in first)\n if (!seen && comp.Equals(a, it))\n seen = true;\n else\n yield return a;\n }\n\n public static IEnumerable> Permutations(this IEnumerable it)\n {\n T[] src = it as T[] ?? it.ToArray();\n if (src.Length < 2)\n {\n yield return src;\n yield break;\n }\n\n foreach (T first in src)\n foreach (IEnumerable part in Permutations(src.exceptSingle(first)))\n yield return single(first).Concat(part);\n }\n\n public static T[][] Rho(this IEnumerable source, int x, int y)\n {\n T[][] res = Program.Mkarr(x, y);\n\n int i = 0, j = 0;\n\n T[] src = source as T[] ?? source.ToArray();\n while (true)\n {\n foreach (T item in src)\n {\n res[i][j] = item;\n j++;\n if (j == y)\n {\n j = 0;\n i++;\n if (i == x)\n break;\n }\n }\n if (i == x)\n break;\n }\n\n return res;\n }\n\n public static T[][][] Rho(this IEnumerable source, int x, int y, int z)\n {\n T[][][] res = Program.Mkarr(x, y, z);\n\n int i = 0, j = 0, k = 0;\n T[] src = source as T[] ?? source.ToArray();\n while (true)\n {\n foreach (T item in src)\n {\n res[i][j][k] = item;\n k++;\n if (k == z)\n {\n k = 0;\n j++;\n if (j == y)\n {\n j = 0;\n i++;\n if (i == x)\n break;\n }\n }\n }\n if (i == x)\n break;\n }\n\n return res;\n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "2ced81cd66e558f4902c940d2d091328", "src_uid": "e4b3a2707ba080b93a152f4e6e983973", "apr_id": "4494ce171e774ba4e6bb32f31749ad7c", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "C#"} {"similarity_score": 0.27902390929258075, "equal_cnt": 39, "replace_cnt": 25, "delete_cnt": 1, "insert_cnt": 13, "fix_ops_cnt": 39, "bug_source_code": "using System;\nusing System.Collections.Generic;\n\nnamespace Codeforces\n{\n class Program\n {\n static int Sum(int number)\n {\n var rank = 10;\n var last = 0;\n var sum = 0;\n while (number % rank != number)\n {\n var k = number % rank;\n sum += (k - last) / (rank/10);\n last = k;\n rank *= 10;\n }\n sum += (number - last) / (rank/10);\n return sum;\n }\n\n static void Main()\n {\n var number = int.Parse(Console.ReadLine());\n var dictionary = new Dictionary();\n for (var i = 1; i <= number; i++)\n {\n dictionary[i] = Sum(i);\n }\n\n var maxValue = 0;\n var maxKey = 0;\n\n foreach (var pair in dictionary)\n {\n if (pair.Value > maxValue)\n {\n maxValue = pair.Value;\n maxKey = pair.Key;\n }\n else if (pair.Value == maxValue)\n {\n if (pair.Key > maxKey)\n maxKey = pair.Key;\n }\n }\n\n Console.WriteLine(maxKey);\n }\n }\n}", "lang": "MS C#", "bug_code_uid": "e5d4b0680133ceae9314b89d52355d0a", "src_uid": "e55b0debbf33c266091e6634494356b8", "apr_id": "300b7b9386442619ed48f1fed84a7e8e", "difficulty": 1300, "tags": ["math", "implementation"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.4045005488474204, "equal_cnt": 24, "replace_cnt": 8, "delete_cnt": 1, "insert_cnt": 15, "fix_ops_cnt": 24, "bug_source_code": "using System;\n\nnamespace Codeforces\n{\n class Program\n {\n static long Sum(long number)\n {\n var str = number.ToString();\n long sum = 0;\n foreach (var symbol in str)\n sum += symbol - '0';\n return sum;\n }\n\n static void Main()\n {\n var number = long.Parse(Console.ReadLine());\n long maxSum = 0;\n long answer = 0;\n for (var i = number; i > 0; i--)\n {\n var sum = Sum(i);\n if (sum > maxSum)\n {\n maxSum = sum;\n answer = i;\n }\n else if (sum == maxSum)\n {\n if (i > answer)\n answer = i;\n }\n }\n Console.WriteLine(answer);\n }\n }\n}", "lang": "MS C#", "bug_code_uid": "3cbe2dc66fa2261c625f3c6b1648a530", "src_uid": "e55b0debbf33c266091e6634494356b8", "apr_id": "300b7b9386442619ed48f1fed84a7e8e", "difficulty": 1300, "tags": ["math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.2115280043501903, "equal_cnt": 20, "replace_cnt": 15, "delete_cnt": 1, "insert_cnt": 4, "fix_ops_cnt": 20, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace cvalification_B\n{\n class Program\n {\n static void Main(string[] args)\n {\n\n string xS = Console.ReadLine();\n char[] ar = xS.ToCharArray();\n int i = xS.Length - 1;\n bool flag = false;\n string answer = \"\";\n\n if (i == 0)\n {\n answer = ar[i].ToString();\n }\n else\n {\n\n while (i > 1)\n {\n if (ar[i] < '9')\n {\n ar[i] = '9';\n flag = true;\n i--;\n }\n else if (flag)\n {\n ar[i] = (char)((int)ar[i] - 1);\n flag = false;\n }\n }\n if (flag)\n {\n ar[i] = (char)((int)ar[i] - 1);\n flag = false;\n }\n if (ar[i] < '8')\n {\n ar[i] = '9';\n flag = true;\n i--;\n }\n if (flag)\n {\n ar[i] = (char)((int)ar[i] - 1);\n flag = false;\n }\n for (int r = 0; r < xS.Length; r++)\n {\n answer += ar[r];\n }\n }\n\n\n answer = answer.TrimStart('0');\n\n Console.WriteLine(answer);\n Console.ReadKey();\n\n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "43ee1bb2e77520e029367e64f7f8a078", "src_uid": "e55b0debbf33c266091e6634494356b8", "apr_id": "651968de7a8be3f7221eaec7481397c4", "difficulty": 1300, "tags": ["math", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9946127946127946, "equal_cnt": 5, "replace_cnt": 0, "delete_cnt": 3, "insert_cnt": 3, "fix_ops_cnt": 6, "bug_source_code": "using System;\nusing System.Collections.Generic;\n\n\nclass Scanner\n{\n string[] s;\n int i;\n\n char[] cs = new char[] { ' ' };\n\n public Scanner()\n {\n s = new string[0];\n i = 0;\n }\n\n public string next()\n {\n if (i < s.Length) return s[i++];\n s = Console.ReadLine().Split(cs, StringSplitOptions.RemoveEmptyEntries);\n i = 0;\n return s[i++];\n }\n\n public int nextInt()\n {\n return int.Parse(next());\n }\n\n public long nextLong()\n {\n return long.Parse(next());\n }\n\n}\n\nclass Myon\n{\n Scanner cin;\n Random r;\n Myon() { }\n\n public static void Main()\n {\n new Myon().calc();\n }\n\n List ret = new List();\n\n int[,] dp;\n\n void calc()\n {\n cin = new Scanner();\n int n = cin.nextInt();\n int m = cin.nextInt();\n dp = new int[n + 1, m + 1];\n Console.WriteLine(saiki(n, m));\n }\n\n int saiki(int a, int b)\n {\n if (a == 0 && b == 0) return a;\n if (dp[a, b] != 0) return dp[a, b];\n int reta = (a / 4) + Math.Min(a % 4, 2);\n int retb = (b / 4) + Math.Min(b % 4, 2);\n int ret = reta * retb;\n ret = Math.Max((a + 2) / 3 * b, ret);\n ret = Math.Max((b + 2) / 3 * a, ret);\n if (a > 3) ret = Math.Max(ret, saiki(a - 3, b) + b);\n if (b > 3) ret = Math.Max(ret, saiki(b - 3, a) + a);\n ret = Math.Max(ret, (a * b + 1) / 2);\n return dp[a, b] = ret;\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "8cdb4a3e34903d4c1551aba2d2d4e340", "src_uid": "e858e7f22d91aaadd7a48a174d7b2dc9", "apr_id": "abdc28e09869407c6c56b72be691c733", "difficulty": 1800, "tags": ["greedy", "constructive algorithms", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C#"} {"similarity_score": 0.9989994997498749, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 2, "insert_cnt": 0, "fix_ops_cnt": 3, "bug_source_code": "using System;\n\nnamespace _1057С\n{\n class Program\n {\n static readonly int INF = 1000000000;\n static int n, s, k;\n static int[] r;\n static int[][] dps;\n\n static bool[] dpsc;\n static string clr;\n static void Main(string[] args)\n {\n (n, s, k) = r3i();\n r = ris();\n s--;\n clr = Console.ReadLine();\n dpsc = new bool[n];\n dps = new int[n][];\n int result = INF;\n for (int i = 0; i < n; i++)\n {\n dp(i);\n result = Math.Min(result, dps[i][k] + Math.Abs(s-i));\n }\n Console.WriteLine(result == INF ? -1 : result);\n }\n\n static void dp(int cur)\n {\n if (dps[cur] != null)\n return;\n dps[cur] = new int[k+1];\n for (int i = r[cur] + 1; i < k + 1; i++)\n {\n dps[cur][i] = INF;\n }\n for (int to = 0; to < n; to++)\n {\n if (r[to] < r[cur] && clr[to] != clr[cur])\n {\n dp(to);\n for (int i = r[cur] + 1; i < k + 1; i++)\n {\n dps[cur][i] = Math.Min(dps[cur][i], dps[to][i-r[cur]] + Math.Abs(cur-to));\n }\n }\n }\n }\n\n\n static int[] ris()\n {\n return Array.ConvertAll(Console.ReadLine().Split(' '), i => Int32.Parse(i));\n }\n\n static int ri()\n {\n var i = Console.ReadLine();\n return Int32.Parse(i);\n }\n static (int, int) r2i()\n {\n var i = Console.ReadLine().Split(' ');\n return (Int32.Parse(i[0]), Int32.Parse(i[1]));\n }\n static (int, int, int) r3i()\n {\n var i = Console.ReadLine().Split(' ');\n return (Int32.Parse(i[0]), Int32.Parse(i[1]), Int32.Parse(i[2]));\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "37556da6b214a7965afb99d471fcaca4", "src_uid": "a95e54a7e38cc0d61b39e4a01a6f8d3f", "apr_id": "28f4b07c10994f38e0fd1115cecd658e", "difficulty": 2000, "tags": ["dp"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "C#"} {"similarity_score": 0.9571428571428572, "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 System.Collections.Generic;\n\nclass Solution\n{\n\tstatic void Main (string[] args)\n\t{\n\t\tint[] nums = Console.ReadLine ().Split (' ').Select (int.Parse).ToArray ();\n\t\tint n = nums [0];\n\t\tint s = nums [1];\n\t\tint target = nums [2];\n\t\tint[] v = Console.ReadLine ().Split (' ').Select (int.Parse).ToArray ();\n\t\tstring c = Console.ReadLine ();\n\n\t\tList nodes = new List ();\n\t\tfor (int i = 0; i < n; i++) {\n\t\t\tnodes.Add (new Node (i, v [i], c [i]));\n\t\t}\n\t\tnodes.ForEach (node => node.AddNeighbors (nodes));\n\n\t\tNode initialNode = new Node (s - 1, 0, ' ');\n\t\tinitialNode.Neighbors = nodes;\n\n\t\tList[] search = new List[n * n + 2];\n\t\tfor (int i = 0; i < search.Length; i++) {\n\t\t\tsearch [i] = new List ();\n\t\t}\n\t\tsearch [0].Add (new State{ Missing = target, Current = initialNode });\n\n\t\tfor (int t = 0; t < search.Length; t++) {\n\t\t\tforeach (State state in search[t]) {\n\t\t\t\tif (state.Solved) {\n\t\t\t\t\tConsole.WriteLine (t - 1);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tforeach (State s2 in state.Expand()) {\n\t\t\t\t\tsearch [s2.Time].Add (s2);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tConsole.WriteLine (-1);\n\t}\n\n\tclass State {\n\t\tpublic int Missing;\n\t\tpublic Node Current;\n\t\tpublic int Time;\n\n\t\tpublic bool Solved => Missing <= 0;\n\n\t\tpublic IEnumerable Expand() {\n\t\t\tforeach(Node n in Current.Neighbors) {\n\t\t\t\tState s = new State();\n\t\t\t\ts.Current = n;\n\t\t\t\ts.Missing = Missing - n.Value;\n\t\t\t\ts.Time = Time + Current.Dist(n);\n\t\t\t\tyield return s;\n\t\t\t}\n\t\t}\n\t}\n\n\tclass Node {\n\t\tpublic int Index;\n\t\tpublic int Value;\n\t\tpublic char Color;\n\t\tpublic List Neighbors;\n\n\t\tpublic Node(int index, int value, char color) {\n\t\t\tthis.Index = index;\n\t\t\tthis.Value = value;\n\t\t\tthis.Color = color;\n\t\t}\n\n\t\tpublic int Dist(Node n) {\n\t\t\treturn Math.Abs(Index - n.Index) + (Color == ' ' ? 1 : 0);\n\t\t}\n\n\t\tpublic void AddNeighbors(List nodes) {\n\t\t\tNeighbors = nodes.Where (n => n.Color != this.Color && n.Value > this.Value).ToList ();\n\t\t}\n\t}\n}", "lang": "Mono C#", "bug_code_uid": "3c71b63ee3772c9fd315de9b5b24559a", "src_uid": "a95e54a7e38cc0d61b39e4a01a6f8d3f", "apr_id": "f4976978c47a4541e1181df26444e507", "difficulty": 2000, "tags": ["dp"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.9942973523421589, "equal_cnt": 9, "replace_cnt": 2, "delete_cnt": 6, "insert_cnt": 0, "fix_ops_cnt": 8, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Text.RegularExpressions;\nusing System.Threading.Tasks;\n\nnamespace codefor\n{\n class Program\n {\n static void Main(string[] args)\n {\n string word = Console.ReadLine();\n if (word.Contains(\"!\"))\n {\n int Kr = 0, Kg = 0, Kb = 0, Ky = 0;\n char[] chs = word.ToCharArray();\n for (int i = 0; i + 4 <= word.Count(); i += 4)\n {\n //0-1-2-3\n string check = chs[0].ToString() + chs[1].ToString() + chs[2].ToString() + chs[3].ToString() + \"\";\n if (check.Contains(\"!\"))\n {\n if (chs[i] == '!')\n {\n chs[i] = chs[i + 4];\n }\n if (chs[i + 1] == '!')\n {\n chs[i + 1] = chs[i + 5];\n }\n if (chs[i + 2] == '!')\n {\n chs[i + 2] = chs[i + 6];\n }\n if (chs[i + 3] == '!')\n {\n chs[i + 3] = chs[i + 7];\n }\n }\n }\n string fix = chs[0].ToString() + chs[1].ToString() + chs[2].ToString() + chs[3].ToString() + \"\";\n //BRYG-!R!G\n int V = 0;\n\n foreach(char f in word)\n {\n if (f.Equals('!'))\n {\n if (chs[V].Equals('R'))\n Kr++;\n else if (chs[V].Equals('B'))\n Kb++;\n else if (chs[V].Equals('Y'))\n Ky++;\n else if (chs[V].Equals('G'))\n Kg++;\n }\n if (V == 3)\n {\n V = 0;\n }\n else\n {\n V++;\n }\n }\n Console.WriteLine(Kr + \" \" + Kb + \" \" + Ky + \" \" + Kg);\n }\n else\n {\n Console.WriteLine(\"0 0 0 0\");\n }\n \n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "0a792427e3111a0f59d82aaa1158612e", "src_uid": "64fc6e9b458a9ece8ad70a8c72126b33", "apr_id": "3fbb8a535f93da3f6b5e060ead8b1367", "difficulty": 1100, "tags": ["number theory", "brute force", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C#"} {"similarity_score": 0.9714083175803403, "equal_cnt": 126, "replace_cnt": 16, "delete_cnt": 43, "insert_cnt": 67, "fix_ops_cnt": 126, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Collections;\nusing System.Linq;\nusing System.Numerics;\nusing System.Text;\n\n\n\n\n\n\nnamespace contest\n{\n\n\n class contest\n {\n\n\n static void Main(string[] args)\n {\n\n\n\n\n //var num = Console.ReadLine().Split().Select(int.Parse).ToArray();\n //int n = num[0];\n //int m = num[1];\n\n //var input = Console.ReadLine().Split().Select(int.Parse).ToArray();\n\n\n\n\n //int n = int.Parse(Console.ReadLine());\n\n //var num = Console.ReadLine().Split().Select(int.Parse).ToArray();\n //for (int i = 0; i < n; i++)\n //{\n // input[i] = Console.ReadLine().Split().Select(int.Parse).ToArray();\n\n //}\n\n\n //int n = int.Parse(Console.ReadLine());\n //var num = Console.ReadLine().Split().Select(int.Parse).ToArray();\n //int n = num[0];\n //int m = num[1];\n\n\n\n\n\n\n //int n = int.Parse(Console.ReadLine());\n //var num = Console.ReadLine().Split().Select(int.Parse).ToArray();\n\n\n\n\n //var arr = new int[n][];\n //for(int i =0; i< n; i++)\n //{\n // arr[i] = Console.ReadLine().Split().Select(int.Parse).ToArray();\n //}\n\n\n\n\n\n var s = (Console.ReadLine().ToArray());\n int len = s.Length;\n\n var ans = new int[4];\n var color = new char[] { 'R', 'B', 'Y', 'G' };\n\n\n for(int i =0; i< len; i++)\n {\n char cur = s[i];\n\n if (i - 4 >= 0 && s[i - 4] == '!')\n {\n s[i - 4] = cur;\n ans[Array.IndexOf(color, cur)]++;\n }\n if (i + 4 < len && s[i + 4] == '!')\n {\n s[i + 4] = cur;\n ans[Array.IndexOf(color, cur)]++;\n }\n }\n\n \n \n\n\n while (true)\n\n {\n var small = new List();\n var three = new List();\n var id = new List();\n for (int i = 0; i < len - 3; i++)\n {\n int cnt = 0;\n for (int j = 0; j < 4; j++)\n {\n if (s[i + j] == '!') cnt++;\n }\n\n if (cnt > 0 && cnt <= 2 && !small.Any(c=>c>=i-3))\n {\n small.Add(i);\n }\n else if(cnt>0 && cnt==3 && !three.Any(c=>c>=i-3))\n {\n three.Add(i);\n }\n if ( cnt>0 && !id.Any(c=>c>=i-3))\n {\n id.Add(i);\n //i += 3;\n }\n \n }\n if (id.Count() == 0) break;\n\n if(small.Count()>0)\n {\n id = new List(small);\n }\n else if(three.Count()>0)\n {\n id = new List(three);\n }\n for (int i = 0; i < id.Count(); i++)\n {\n int ii = id[i];\n for (int j = 0; j < 4; j++)\n {\n char cur = s[ii + j];\n if (cur == '!')\n {\n for (int k = 0; k < 4; k++)\n {\n if (check(ii + j, len, s, color[k]))\n {\n s[ii + j] = color[k];\n ans[k]++;\n break;\n }\n }\n }\n }\n }\n }\n\n // for (int i=0; i();\n // for (int j = 0; j < 4; j++)\n // {\n // char cur = s[i+j];\n // if (cur == 'R')\n // {\n // cnt[0]++;\n // }\n // else if (cur == 'B')\n // {\n // cnt[1]++;\n // }\n // else if (cur == 'Y')\n // {\n // cnt[2]++;\n // }\n // else if (cur == 'G')\n // {\n // cnt[3]++;\n // }\n // else\n // {\n // list.Add(i + j);\n // }\n // }\n // if (list.Count() == 0) continue;\n // for (int j = 0; j < 4; j++)\n // {\n // if (cnt[j] == 0)\n // {\n // ans[j]++;\n // s[list.First()] = color[j];\n // list.RemoveAt(0);\n // }\n // }\n \n //}\n\n\n\n \n //for(int i=0; i< len-3; i++)\n //{\n // var tmp = s.Skip(i).Take(4).ToArray();\n // var cnt = new int[4];\n // var list = new List();\n // for (int j = 0; j < 4; j++)\n // {\n // char cur = tmp[j];\n // if (cur == 'R')\n // {\n // cnt[0]++;\n // }\n // else if (cur == 'B')\n // {\n // cnt[1]++;\n // }\n // else if (cur == 'Y')\n // {\n // cnt[2]++;\n // }\n // else if (cur == 'G')\n // {\n // cnt[3]++;\n // }\n // else\n // {\n // list.Add(i+j);\n // }\n // }\n // if (list.Count()==0) continue;\n // for(int j=0; j<4;j++)\n // {\n // if (cnt[j] == 0)\n // {\n // ans[j]++;\n // s[list.First()] = color[j];\n // list.RemoveAt(0);\n // }\n // }\n //}\n\n\n Console.WriteLine(string.Join(\" \",ans));\n \n\n\n\n\n //Console.WriteLine();\n\n\n\n\n\n\n\n\n\n }\n\n public static bool check(int i, int n, char[] s, char target)\n {\n //bool ok = false;\n\n\n //if(ok)\n //{\n // cp.CopyTo(s,0);\n // return s;\n //}\n\n for(int j = 1; j<4; j++)\n {\n if (i - j < 0) break;\n char cc = s[j];\n if (s[i - j] == target) return false;\n\n }\n\n for (int j = 1; j < 4; j++)\n {\n if (i + j >= n) break;\n char cc = s[j];\n if (s[i + j] == target) return false;\n\n }\n return true;\n\n }\n \n\n\n }\n\n\n class Segment\n {\n public int[] arr;\n \n \n public int n;\n\n public Segment(int m)\n {\n this.n = m ;\n //arr = Enumerable.Range(0, n*2).ToArray();\n arr = new int[n*4];\n\n\n for (int i = 0; i < n*4; i++)\n {\n arr[i] = int.MaxValue;\n }\n\n }\n\n\n //public void update(int p, int value)\n //{ // set value at position p\n // for (arr[p += n] = value; p > 1; p >>= 1) arr[p >> 1] = Math.Min( arr[p] , arr[p ^ 1]);\n //}\n\n\n\n //public void update(int i, int value)\n //{\n // i += n / 2;\n // arr[i] = value;\n // for (; i > 1; i >>= 1)\n // arr[i >> 1] = Math.Min(arr[i], arr[i ^ 1]);\n //}\n\n\n public void update(int i, int x)\n {\n //i = (n / 2) + i - 1;\n i = n + i - 1;\n arr[i] = x;\n\n\n while (i > 0)\n {\n i = (i - 1) / 2;\n arr[i] = Math.Min(arr[(i * 2) + 1], arr[(i * 2) + 2]);\n\n\n //if (arr[i * 2 + 1] > arr[i * 2 + 2])\n //{\n // arr[i] = arr[i * 2 + 1];\n //}\n //else\n //{\n // arr[i] = arr[i * 2 + 2];\n //}\n //arr[i] = arr[i * 2 + 1] + arr[i * 2 + 2];\n\n }\n\n }\n\n\n\n\n //call : query(a,b, 0, 0, n)\n public int query(int a, int b, int k, int l, int r)\n {\n if (r <= a || b <= l) return int.MaxValue;\n if (a <= l && r <= b) return arr[k];\n\n //return Math.Min(query(a, b, (k * 2) + 1, l, (l + r) / 2), query(a, b, (k * 2) + 2, (l + r) / 2, r)); \n\n\n var vl = query(a, b, (k * 2) + 1, l, (l + r) / 2);\n var vr = query(a, b, (k * 2) + 2, (l + r) / 2, r);\n\n //var vl = query(a, b, (k << 1) + 1, l, (l + r) / 2);\n //var vr = query(a, b, (k + 1) << 1, (l + r) / 2, r);\n\n\n\n if (vl == int.MaxValue && vr == int.MaxValue) return 0;\n return Math.Min(vl, vr);\n\n\n }\n\n\n //public int query(int a, int b, int k, int l, int r)\n //{\n // // query for arr[i..j]\n\n // if (l > b || r < a) // segment completely outside range\n // return int.MaxValue; // represents a null node\n\n // if (a <= l && b >= r) // segment completely inside range\n // return arr[k];\n\n // int mid = l + (r - l) / 2; // partial overlap of current segment and queried range. Recurse deeper.\n\n // if (a > mid)\n // return query(2 * k + 2, mid + 1, r, a, b);\n // else if (b <= mid)\n // return query(2 * k + 1, l, mid, a, b);\n\n // int leftQuery = query(2 * k + 1, l, mid, a, mid);\n // int rightQuery = query(2 * k + 2, mid + 1, r, mid + 1, b);\n\n // // merge query results\n // if (leftQuery == int.MaxValue && rightQuery == int.MaxValue) return 0;\n // return Math.Min(leftQuery, rightQuery);\n\n\n //}\n\n\n\n\n\n\n\n\n //public int query(int l, int r)\n //{\n // int res = int.MaxValue;\n // for (l += n, r += n; l < r; l >>= 1, r >>= 1)\n // {\n // if ((l & 1) == 1) res = Math.Min(res, arr[l++]);\n // if ((r & 1) == 1) res = Math.Min(res, arr[--r]);\n // }\n // return res;\n //}\n\n\n\n //public int query(int a, int b, int r)\n //{\n // int res = int.MaxValue;\n // for (a += r / 2, b += r / 2; a <= b; a = (a + 1) >> 1, b = (b - 1) >> 1)\n // //for (; a <= b; a = (a + 1) >> 1, b = (b - 1) >> 1)\n // {\n // if ((a & 1) != 0)\n // res = Math.Min(res, arr[a]);\n // if ((b & 1) == 0)\n // res = Math.Min(res, arr[b]);\n // }\n // return res;\n //}\n\n\n\n\n //public int query(int l, int r)\n //{ // sum on interval [l, r)\n // int res = int.MaxValue;\n // for (l += n, r += n; l < r; l >>= 1, r >>= 1)\n // {\n // if ((l & 1) == 1) res = Math.Min(res, arr[l++]);\n\n // if ((r & 1) == 1) res = Math.Min(res, arr[--r]);\n // }\n // return res;\n //}\n\n }\n\n\n class UnionFind\n {\n public int[] path;\n\n\n public UnionFind(int n)\n {\n path = new int[n];\n\n for (int i = 0; i < n; i++)\n {\n path[i] = i;\n }\n\n }\n\n private int root(int i)\n {\n while (i != path[i])\n {\n path[i] = path[path[i]];\n i = path[i];\n }\n return i;\n }\n\n\n\n public bool find(int p, int q)\n {\n return root(p) == root(q);\n }\n\n\n\n public void unite(int p, int q)\n {\n int i = root(p);\n int j = root(q);\n path[i] = j;\n }\n\n\n }\n }\n\n \n\n", "lang": "MS C#", "bug_code_uid": "e5251324c59477740b6ec20208b0d7f0", "src_uid": "64fc6e9b458a9ece8ad70a8c72126b33", "apr_id": "2273e36d42eb476d17c09fbdc90cfffd", "difficulty": 1100, "tags": ["number theory", "brute force", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.9744839787694122, "equal_cnt": 125, "replace_cnt": 17, "delete_cnt": 42, "insert_cnt": 66, "fix_ops_cnt": 125, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Collections;\nusing System.Linq;\nusing System.Numerics;\nusing System.Text;\n\n\n\n\n\n\nnamespace contest\n{\n\n\n class contest\n {\n\n\n static void Main(string[] args)\n {\n\n\n\n\n //var num = Console.ReadLine().Split().Select(int.Parse).ToArray();\n //int n = num[0];\n //int m = num[1];\n\n //var input = Console.ReadLine().Split().Select(int.Parse).ToArray();\n\n\n\n\n //int n = int.Parse(Console.ReadLine());\n\n //var num = Console.ReadLine().Split().Select(int.Parse).ToArray();\n //for (int i = 0; i < n; i++)\n //{\n // input[i] = Console.ReadLine().Split().Select(int.Parse).ToArray();\n\n //}\n\n\n //int n = int.Parse(Console.ReadLine());\n //var num = Console.ReadLine().Split().Select(int.Parse).ToArray();\n //int n = num[0];\n //int m = num[1];\n\n\n\n\n\n\n //int n = int.Parse(Console.ReadLine());\n //var num = Console.ReadLine().Split().Select(int.Parse).ToArray();\n\n\n\n\n //var arr = new int[n][];\n //for(int i =0; i< n; i++)\n //{\n // arr[i] = Console.ReadLine().Split().Select(int.Parse).ToArray();\n //}\n\n\n\n\n\n var s = (Console.ReadLine().ToArray());\n int len = s.Length;\n\n var ans = new int[4];\n var color = new char[] { 'R', 'B', 'Y', 'G' };\n\n\n for(int i =0; i< len; i++)\n {\n char cur = s[i];\n if (cur == '!') continue;\n\n if (i - 4 >= 0 && s[i - 4] == '!')\n {\n s[i - 4] = cur;\n ans[Array.IndexOf(color, cur)]++;\n }\n if (i + 4 < len && s[i + 4] == '!')\n {\n s[i + 4] = cur;\n ans[Array.IndexOf(color, cur)]++;\n }\n }\n\n \n \n\n\n while (true)\n\n {\n var small = new List();\n var three = new List();\n var id = new List();\n for (int i = 0; i < len - 3; i++)\n {\n int cnt = 0;\n for (int j = 0; j < 4; j++)\n {\n if (s[i + j] == '!') cnt++;\n }\n\n if (cnt > 0 && cnt <= 2 && !small.Any(c=>c>=i-3))\n {\n small.Add(i);\n }\n else if(cnt>0 && cnt==3 && !three.Any(c=>c>=i-3))\n {\n three.Add(i);\n }\n if ( cnt>0 && !id.Any(c=>c>=i-3))\n {\n id.Add(i);\n //i += 3;\n }\n \n }\n if (id.Count() == 0) break;\n\n if(small.Count()>0)\n {\n id = new List(small);\n }\n else if(three.Count()>0)\n {\n id = new List(three);\n }\n for (int i = 0; i < id.Count(); i++)\n {\n int ii = id[i];\n for (int j = 0; j < 4; j++)\n {\n char cur = s[ii + j];\n if (cur == '!')\n {\n for (int k = 0; k < 4; k++)\n {\n if (check(ii + j, len, s, color[k]))\n {\n s[ii + j] = color[k];\n ans[k]++;\n break;\n }\n }\n }\n }\n }\n }\n\n // for (int i=0; i();\n // for (int j = 0; j < 4; j++)\n // {\n // char cur = s[i+j];\n // if (cur == 'R')\n // {\n // cnt[0]++;\n // }\n // else if (cur == 'B')\n // {\n // cnt[1]++;\n // }\n // else if (cur == 'Y')\n // {\n // cnt[2]++;\n // }\n // else if (cur == 'G')\n // {\n // cnt[3]++;\n // }\n // else\n // {\n // list.Add(i + j);\n // }\n // }\n // if (list.Count() == 0) continue;\n // for (int j = 0; j < 4; j++)\n // {\n // if (cnt[j] == 0)\n // {\n // ans[j]++;\n // s[list.First()] = color[j];\n // list.RemoveAt(0);\n // }\n // }\n \n //}\n\n\n\n \n //for(int i=0; i< len-3; i++)\n //{\n // var tmp = s.Skip(i).Take(4).ToArray();\n // var cnt = new int[4];\n // var list = new List();\n // for (int j = 0; j < 4; j++)\n // {\n // char cur = tmp[j];\n // if (cur == 'R')\n // {\n // cnt[0]++;\n // }\n // else if (cur == 'B')\n // {\n // cnt[1]++;\n // }\n // else if (cur == 'Y')\n // {\n // cnt[2]++;\n // }\n // else if (cur == 'G')\n // {\n // cnt[3]++;\n // }\n // else\n // {\n // list.Add(i+j);\n // }\n // }\n // if (list.Count()==0) continue;\n // for(int j=0; j<4;j++)\n // {\n // if (cnt[j] == 0)\n // {\n // ans[j]++;\n // s[list.First()] = color[j];\n // list.RemoveAt(0);\n // }\n // }\n //}\n\n\n Console.WriteLine(string.Join(\" \",ans));\n \n\n\n\n\n //Console.WriteLine();\n\n\n\n\n\n\n\n\n\n\n }\n\n public static bool check(int i, int n, char[] s, char target)\n {\n //bool ok = false;\n\n\n //if(ok)\n //{\n // cp.CopyTo(s,0);\n // return s;\n //}\n\n for(int j = 1; j<4; j++)\n {\n if (i - j < 0) break;\n char cc = s[j];\n if (s[i - j] == target) return false;\n\n }\n\n for (int j = 1; j < 4; j++)\n {\n if (i + j >= n) break;\n char cc = s[j];\n if (s[i + j] == target) return false;\n\n }\n return true;\n\n }\n \n\n\n }\n\n\n class Segment\n {\n public int[] arr;\n \n \n public int n;\n\n public Segment(int m)\n {\n this.n = m ;\n //arr = Enumerable.Range(0, n*2).ToArray();\n arr = new int[n*4];\n\n\n for (int i = 0; i < n*4; i++)\n {\n arr[i] = int.MaxValue;\n }\n\n }\n\n\n //public void update(int p, int value)\n //{ // set value at position p\n // for (arr[p += n] = value; p > 1; p >>= 1) arr[p >> 1] = Math.Min( arr[p] , arr[p ^ 1]);\n //}\n\n\n\n //public void update(int i, int value)\n //{\n // i += n / 2;\n // arr[i] = value;\n // for (; i > 1; i >>= 1)\n // arr[i >> 1] = Math.Min(arr[i], arr[i ^ 1]);\n //}\n\n\n public void update(int i, int x)\n {\n //i = (n / 2) + i - 1;\n i = n + i - 1;\n arr[i] = x;\n\n\n while (i > 0)\n {\n i = (i - 1) / 2;\n arr[i] = Math.Min(arr[(i * 2) + 1], arr[(i * 2) + 2]);\n\n\n //if (arr[i * 2 + 1] > arr[i * 2 + 2])\n //{\n // arr[i] = arr[i * 2 + 1];\n //}\n //else\n //{\n // arr[i] = arr[i * 2 + 2];\n //}\n //arr[i] = arr[i * 2 + 1] + arr[i * 2 + 2];\n\n }\n\n }\n\n\n\n\n //call : query(a,b, 0, 0, n)\n public int query(int a, int b, int k, int l, int r)\n {\n if (r <= a || b <= l) return int.MaxValue;\n if (a <= l && r <= b) return arr[k];\n\n //return Math.Min(query(a, b, (k * 2) + 1, l, (l + r) / 2), query(a, b, (k * 2) + 2, (l + r) / 2, r)); \n\n\n var vl = query(a, b, (k * 2) + 1, l, (l + r) / 2);\n var vr = query(a, b, (k * 2) + 2, (l + r) / 2, r);\n\n //var vl = query(a, b, (k << 1) + 1, l, (l + r) / 2);\n //var vr = query(a, b, (k + 1) << 1, (l + r) / 2, r);\n\n\n\n if (vl == int.MaxValue && vr == int.MaxValue) return 0;\n return Math.Min(vl, vr);\n\n\n }\n\n\n //public int query(int a, int b, int k, int l, int r)\n //{\n // // query for arr[i..j]\n\n // if (l > b || r < a) // segment completely outside range\n // return int.MaxValue; // represents a null node\n\n // if (a <= l && b >= r) // segment completely inside range\n // return arr[k];\n\n // int mid = l + (r - l) / 2; // partial overlap of current segment and queried range. Recurse deeper.\n\n // if (a > mid)\n // return query(2 * k + 2, mid + 1, r, a, b);\n // else if (b <= mid)\n // return query(2 * k + 1, l, mid, a, b);\n\n // int leftQuery = query(2 * k + 1, l, mid, a, mid);\n // int rightQuery = query(2 * k + 2, mid + 1, r, mid + 1, b);\n\n // // merge query results\n // if (leftQuery == int.MaxValue && rightQuery == int.MaxValue) return 0;\n // return Math.Min(leftQuery, rightQuery);\n\n\n //}\n\n\n\n\n\n\n\n\n //public int query(int l, int r)\n //{\n // int res = int.MaxValue;\n // for (l += n, r += n; l < r; l >>= 1, r >>= 1)\n // {\n // if ((l & 1) == 1) res = Math.Min(res, arr[l++]);\n // if ((r & 1) == 1) res = Math.Min(res, arr[--r]);\n // }\n // return res;\n //}\n\n\n\n //public int query(int a, int b, int r)\n //{\n // int res = int.MaxValue;\n // for (a += r / 2, b += r / 2; a <= b; a = (a + 1) >> 1, b = (b - 1) >> 1)\n // //for (; a <= b; a = (a + 1) >> 1, b = (b - 1) >> 1)\n // {\n // if ((a & 1) != 0)\n // res = Math.Min(res, arr[a]);\n // if ((b & 1) == 0)\n // res = Math.Min(res, arr[b]);\n // }\n // return res;\n //}\n\n\n\n\n //public int query(int l, int r)\n //{ // sum on interval [l, r)\n // int res = int.MaxValue;\n // for (l += n, r += n; l < r; l >>= 1, r >>= 1)\n // {\n // if ((l & 1) == 1) res = Math.Min(res, arr[l++]);\n\n // if ((r & 1) == 1) res = Math.Min(res, arr[--r]);\n // }\n // return res;\n //}\n\n }\n\n\n class UnionFind\n {\n public int[] path;\n\n\n public UnionFind(int n)\n {\n path = new int[n];\n\n for (int i = 0; i < n; i++)\n {\n path[i] = i;\n }\n\n }\n\n private int root(int i)\n {\n while (i != path[i])\n {\n path[i] = path[path[i]];\n i = path[i];\n }\n return i;\n }\n\n\n\n public bool find(int p, int q)\n {\n return root(p) == root(q);\n }\n\n\n\n public void unite(int p, int q)\n {\n int i = root(p);\n int j = root(q);\n path[i] = j;\n }\n\n\n }\n }\n\n \n\n", "lang": "MS C#", "bug_code_uid": "ff0ad1235ca5691a48a32c42db0710cd", "src_uid": "64fc6e9b458a9ece8ad70a8c72126b33", "apr_id": "2273e36d42eb476d17c09fbdc90cfffd", "difficulty": 1100, "tags": ["number theory", "brute force", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.010794896957801767, "equal_cnt": 11, "replace_cnt": 4, "delete_cnt": 0, "insert_cnt": 8, "fix_ops_cnt": 12, "bug_source_code": "n.......\nPP......\n........\n........\n........\n........\n........\n........", "lang": "Mono C#", "bug_code_uid": "649a824d253dc6b1cca0aab36ccd80f9", "src_uid": "44bed0ca7a8fb42fb72c1584d39a4442", "apr_id": "4228d4feacd78b3ac1e1348d16b57918", "difficulty": 900, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.9952463267070009, "equal_cnt": 6, "replace_cnt": 3, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 5, "bug_source_code": "using System;\nusing CompLib.Util;\n\npublic class Program\n{\n public void Solve()\n {\n var sc = new Scanner();\n int n = sc.NextInt();\n int k = sc.NextInt();\n\n // 最初飴を1つ入れる\n\n // 飴を1つ食べる \n // 前回入れる操作した個数+1入れる\n\n // n回操作してk個飴入ってる 食べた個数\n\n // 食べた x回\n\n for (long x = 0; x <= n; x++)\n {\n long y = n - x;\n long t = (y + 1) * y / 2 - x;\n if (t == k)\n {\n Console.WriteLine(x);\n return;\n }\n }\n }\n\n public static void Main(string[] args) => new Program().Solve();\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": "Mono C#", "bug_code_uid": "9aed8af30f987d1b49b7a643a8498236", "src_uid": "17b5ec1c6263ef63c668c2b903db1d77", "apr_id": "a5b8f929ffce6bd15d071c86eecea3ac", "difficulty": 1000, "tags": ["math", "brute force", "binary search"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9785025945144552, "equal_cnt": 6, "replace_cnt": 4, "delete_cnt": 1, "insert_cnt": 0, "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 Konfeti\n{\n class Program\n {\n static void Main(string[] args)\n {\n var s = Console.ReadLine().Split();\n var n = int.Parse(s[0]);\n var k = int.Parse(s[1]);\n\n var i = 1;\n var ans = -1;\n while (ans==-1)\n {\n var eat = n - i;\n if (i * (i + 1) / 2 - eat == k)\n {\n ans = eat;\n }\n\n i++;\n }\n\n Console.Write(ans);\n \n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "330a019b0b76172050ece6576173ac79", "src_uid": "17b5ec1c6263ef63c668c2b903db1d77", "apr_id": "395e6bf668f9e20e87679f4541f81c1a", "difficulty": 1000, "tags": ["math", "brute force", "binary search"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9720496894409938, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "using System;\n\n\npublic class BlackWhiteMagic {\n\n public static void Main()\n {\n string[] ss = Console.ReadLine().Split();\n\n int n = int.Parse(ss[0]);\n int m = int.Parse(ss[1]);\n int k = int.Parse(ss[2]);\n\n long res = 1;\n\n if (k>n)\n {\n for (int i = 0; i < n; i++) res = (res * m) % 1000000007;\n }\n else if (k == n)\n {\n for (int i = 0; i < (n + 1) / 2; i++) res = (res * m) % 1000000007;\n }\n else\n {\n if (k%2 == 0) res = m;\n else res = m*m;\n }\n\n Console.WriteLine(res);\n }\n}", "lang": "Mono C#", "bug_code_uid": "fdb0b2658d7de0fb9bfdae3cbbb25409", "src_uid": "1f9107e8d1d8aebb1f4a1707a6cdeb6d", "apr_id": "97ade6ab6bac3b3092614251b5ccbea2", "difficulty": 1600, "tags": ["graphs", "dfs and similar", "math", "combinatorics"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9573770491803278, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "using System;\n\nnamespace Olymp630R\n{\n class Program\n {\n static void Main(string[] args)\n {\n int n = int.Parse(Console.ReadLine());\nif (n == 1) Console.Write(1);\nelse if (n %2 == 0) Console.Write(2);\nelse Console.Write(1);\n Console.ReadLine();\n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "3f7077aabeb529fe2aa7a45650ea0734", "src_uid": "816ec4cd9736f3113333ef05405b8e81", "apr_id": "6fb5245711aa878ac514a77e27959127", "difficulty": 1200, "tags": ["math", "games"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.4531024531024531, "equal_cnt": 10, "replace_cnt": 7, "delete_cnt": 2, "insert_cnt": 0, "fix_ops_cnt": 9, "bug_source_code": "using System;\n\nnamespace ConsoleApplication1\n{\n static class Program\n {\n private static void Main()\n {\n var n = int.Parse(Console.ReadLine());\n\n int answer;\n if (n % 2 == 0)\n {\n answer = 2;\n }\n else\n {\n answer = 1;\n }\n\n Console.WriteLine(answer);\n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "ca9e7bd2059d0f735a521e38e542d549", "src_uid": "816ec4cd9736f3113333ef05405b8e81", "apr_id": "68540571d763d671baa7851570f3567c", "difficulty": 1200, "tags": ["math", "games"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9902552951598614, "equal_cnt": 7, "replace_cnt": 2, "delete_cnt": 1, "insert_cnt": 3, "fix_ops_cnt": 6, "bug_source_code": "using System;\nusing System.Linq;\nusing System.Collections.Generic;\nusing Debug = System.Diagnostics.Debug;\nusing StringBuilder = System.Text.StringBuilder;\nusing System.Numerics;\nusing Point = System.Numerics.Complex;\nusing Number = System.Int64;\nnamespace Program\n{\n public class Solver\n {\n public void Solve()\n {\n var q = sc.Integer();\n var par = new int[500000];\n par[0] = -1;\n var dp = Enumerate(500000, x => new double[35]);\n for (int i = 1; i < 35; i++)\n dp[0][i] = 1.0;\n\n var ptr = 1;\n Action recalc = null;\n recalc = v =>\n {\n for (int h = 1; h < 35; h++)\n dp[v][h] = 1.0;\n var ps = new List();\n for (int h = 0; h <= 35; h++)\n {\n if (v == -1) break;\n ps.Add(v);\n v = par[v];\n }\n for (int i = ps.Count - 2; i > 0; i--)\n {\n var u = ps[i]; var h = i;\n var p = ps[i + 1];\n dp[p][h + 1] /= (dp[u][h] + 1) / 2;\n }\n for (int i = 0; i + 1 < ps.Count; i++)\n {\n var u = ps[i]; var h = i;\n var p = ps[i + 1];\n dp[p][h + 1] *= (dp[u][h] + 1) / 2;\n }\n };\n for (int i = 0; i < q; i++)\n {\n if (sc.Integer() == 1)\n {\n var p = sc.Integer() - 1;\n par[ptr] = p;\n recalc(ptr);\n ptr++;\n\n }\n else\n {\n var v = sc.Integer() - 1;\n var ans = 0.0;\n for (int h = 1; h < 35; h++)\n ans += dp[v][h] - dp[v][h - 1];\n Debug.WriteLine(dp[v].AsJoinedString());\n IO.Printer.Out.WriteLine(ans);\n\n }\n }\n }\n public IO.StreamScanner sc = new IO.StreamScanner(Console.OpenStandardInput());\n static T[] Enumerate(int n, Func f) { var a = new T[n]; for (int i = 0; i < n; ++i) a[i] = f(i); return a; }\n static public void Swap(ref T a, ref T b) { var tmp = a; a = b; b = tmp; }\n }\n}\n\n#region main\nstatic class Ex\n{\n static public string AsString(this IEnumerable ie) { return new string(System.Linq.Enumerable.ToArray(ie)); }\n static public string AsJoinedString(this IEnumerable ie, string st = \" \") { return string.Join(st, ie); }\n static public void Main()\n {\n var solver = new Program.Solver();\n solver.Solve();\n Program.IO.Printer.Out.Flush();\n }\n}\n#endregion\n#region Ex\nnamespace Program.IO\n{\n using System.IO;\n using System.Text;\n using System.Globalization;\n public class Printer: StreamWriter\n {\n static Printer() { Out = new Printer(Console.OpenStandardOutput()) { AutoFlush = false }; }\n public static Printer Out { get; set; }\n public override IFormatProvider FormatProvider { get { return CultureInfo.InvariantCulture; } }\n public Printer(System.IO.Stream stream) : base(stream, new UTF8Encoding(false, true)) { }\n public Printer(System.IO.Stream stream, Encoding encoding) : base(stream, encoding) { }\n public void Write(string format, T[] source) { base.Write(format, source.OfType().ToArray()); }\n public void WriteLine(string format, T[] source) { base.WriteLine(format, source.OfType().ToArray()); }\n }\n public class StreamScanner\n {\n public StreamScanner(Stream stream) { str = stream; }\n public readonly Stream str;\n private readonly byte[] buf = new byte[1024];\n private int len, ptr;\n public bool isEof = false;\n public bool IsEndOfStream { get { return isEof; } }\n private byte read()\n {\n if (isEof) return 0;\n if (ptr >= len) { ptr = 0; if ((len = str.Read(buf, 0, 1024)) <= 0) { isEof = true; return 0; } }\n return buf[ptr++];\n }\n public char Char() { byte b = 0; do b = read(); while ((b < 33 || 126 < b) && !isEof); return (char)b; }\n\n public string Scan()\n {\n var sb = new StringBuilder();\n for (var b = Char(); b >= 33 && b <= 126; b = (char)read())\n sb.Append(b);\n return sb.ToString();\n }\n public string ScanLine()\n {\n var sb = new StringBuilder();\n for (var b = Char(); b != '\\n'; b = (char)read())\n if (b == 0) break;\n else if (b != '\\r') sb.Append(b);\n return sb.ToString();\n }\n public long Long()\n {\n if (isEof) return long.MinValue;\n long ret = 0; byte b = 0; var ng = false;\n do b = read();\n while (b != 0 && b != '-' && (b < '0' || '9' < b));\n if (b == 0) return long.MinValue;\n if (b == '-') { ng = true; b = read(); }\n for (; true; b = read())\n {\n if (b < '0' || '9' < b)\n return ng ? -ret : ret;\n else ret = ret * 10 + b - '0';\n }\n }\n public int Integer() { return (isEof) ? int.MinValue : (int)Long(); }\n public double Double() { var s = Scan(); return s != \"\" ? double.Parse(s, CultureInfo.InvariantCulture) : double.NaN; }\n private T[] enumerate(int n, Func f)\n {\n var a = new T[n];\n for (int i = 0; i < n; ++i) a[i] = f();\n return a;\n }\n\n public char[] Char(int n) { return enumerate(n, Char); }\n public string[] Scan(int n) { return enumerate(n, Scan); }\n public double[] Double(int n) { return enumerate(n, Double); }\n public int[] Integer(int n) { return enumerate(n, Integer); }\n public long[] Long(int n) { return enumerate(n, Long); }\n }\n}\n#endregion\n\n", "lang": "MS C#", "bug_code_uid": "a7c07520c5a7e4424a04de72c971dc89", "src_uid": "55affe752cb214d1e4031a9e3972597b", "apr_id": "39bcc180d2819687c1e5a82768fb1edf", "difficulty": 2700, "tags": ["trees", "dp", "math", "probabilities"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.9921005964855715, "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 System.Collections.Generic;\nusing Debug = System.Diagnostics.Debug;\nusing StringBuilder = System.Text.StringBuilder;\nusing System.Numerics;\nusing Point = System.Numerics.Complex;\nusing Number = System.Int64;\nnamespace Program\n{\n public class Solver\n {\n public void Solve()\n {\n var q = sc.Integer();\n var par = new int[500002];\n par[0] = -1;\n var dp = Enumerate(500002, x => new double[35]);\n for (int i = 1; i < 35; i++)\n dp[0][i] = 1.0;\n\n var ptr = 1;\n Action recalc = null;\n recalc = v =>\n {\n for (int h = 1; h < 35; h++)\n dp[v][h] = 1.0;\n var ps = new List();\n for (int h = 0; h <= 35; h++)\n {\n if (v == -1) break;\n ps.Add(v);\n v = par[v];\n }\n for (int i = ps.Count - 2; i > 0; i--)\n {\n var u = ps[i]; var h = i;\n var p = ps[i + 1];\n dp[p][h + 1] /= (dp[u][h] + 1) / 2;\n }\n for (int i = 0; i + 1 < ps.Count; i++)\n {\n var u = ps[i]; var h = i;\n var p = ps[i + 1];\n dp[p][h + 1] *= (dp[u][h] + 1) / 2;\n }\n };\n for (int i = 0; i < q; i++)\n {\n if (sc.Integer() == 1)\n {\n var p = sc.Integer() - 1;\n par[ptr] = p;\n recalc(ptr);\n ptr++;\n\n }\n else\n {\n var v = sc.Integer() - 1;\n var ans = 0.0;\n for (int h = 1; h < 35; h++)\n ans += 1 - dp[v][h];\n Debug.WriteLine(dp[v].AsJoinedString());\n IO.Printer.Out.WriteLine(ans);\n\n }\n }\n }\n public IO.StreamScanner sc = new IO.StreamScanner(Console.OpenStandardInput());\n static T[] Enumerate(int n, Func f) { var a = new T[n]; for (int i = 0; i < n; ++i) a[i] = f(i); return a; }\n static public void Swap(ref T a, ref T b) { var tmp = a; a = b; b = tmp; }\n }\n}\n\n#region main\nstatic class Ex\n{\n static public string AsString(this IEnumerable ie) { return new string(System.Linq.Enumerable.ToArray(ie)); }\n static public string AsJoinedString(this IEnumerable ie, string st = \" \") { return string.Join(st, ie); }\n static public void Main()\n {\n var solver = new Program.Solver();\n solver.Solve();\n Program.IO.Printer.Out.Flush();\n }\n}\n#endregion\n#region Ex\nnamespace Program.IO\n{\n using System.IO;\n using System.Text;\n using System.Globalization;\n public class Printer: StreamWriter\n {\n static Printer() { Out = new Printer(Console.OpenStandardOutput()) { AutoFlush = false }; }\n public static Printer Out { get; set; }\n public override IFormatProvider FormatProvider { get { return CultureInfo.InvariantCulture; } }\n public Printer(System.IO.Stream stream) : base(stream, new UTF8Encoding(false, true)) { }\n public Printer(System.IO.Stream stream, Encoding encoding) : base(stream, encoding) { }\n public void Write(string format, T[] source) { base.Write(format, source.OfType().ToArray()); }\n public void WriteLine(string format, T[] source) { base.WriteLine(format, source.OfType().ToArray()); }\n }\n public class StreamScanner\n {\n public StreamScanner(Stream stream) { str = stream; }\n public readonly Stream str;\n private readonly byte[] buf = new byte[1024];\n private int len, ptr;\n public bool isEof = false;\n public bool IsEndOfStream { get { return isEof; } }\n private byte read()\n {\n if (isEof) return 0;\n if (ptr >= len) { ptr = 0; if ((len = str.Read(buf, 0, 1024)) <= 0) { isEof = true; return 0; } }\n return buf[ptr++];\n }\n public char Char() { byte b = 0; do b = read(); while ((b < 33 || 126 < b) && !isEof); return (char)b; }\n\n public string Scan()\n {\n var sb = new StringBuilder();\n for (var b = Char(); b >= 33 && b <= 126; b = (char)read())\n sb.Append(b);\n return sb.ToString();\n }\n public string ScanLine()\n {\n var sb = new StringBuilder();\n for (var b = Char(); b != '\\n'; b = (char)read())\n if (b == 0) break;\n else if (b != '\\r') sb.Append(b);\n return sb.ToString();\n }\n public long Long()\n {\n if (isEof) return long.MinValue;\n long ret = 0; byte b = 0; var ng = false;\n do b = read();\n while (b != 0 && b != '-' && (b < '0' || '9' < b));\n if (b == 0) return long.MinValue;\n if (b == '-') { ng = true; b = read(); }\n for (; true; b = read())\n {\n if (b < '0' || '9' < b)\n return ng ? -ret : ret;\n else ret = ret * 10 + b - '0';\n }\n }\n public int Integer() { return (isEof) ? int.MinValue : (int)Long(); }\n public double Double() { var s = Scan(); return s != \"\" ? double.Parse(s, CultureInfo.InvariantCulture) : double.NaN; }\n private T[] enumerate(int n, Func f)\n {\n var a = new T[n];\n for (int i = 0; i < n; ++i) a[i] = f();\n return a;\n }\n\n public char[] Char(int n) { return enumerate(n, Char); }\n public string[] Scan(int n) { return enumerate(n, Scan); }\n public double[] Double(int n) { return enumerate(n, Double); }\n public int[] Integer(int n) { return enumerate(n, Integer); }\n public long[] Long(int n) { return enumerate(n, Long); }\n }\n}\n#endregion\n\n", "lang": "MS C#", "bug_code_uid": "ff9998557eddd4a7a0ea42202d752b56", "src_uid": "55affe752cb214d1e4031a9e3972597b", "apr_id": "39bcc180d2819687c1e5a82768fb1edf", "difficulty": 2700, "tags": ["trees", "dp", "math", "probabilities"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.9953125, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "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 Code\n{\n class Program\n {\n static void Main(string[] args)\n {\n \n int zeros = 0;\n int digits = 0;\n\n var line = Console.ReadLine();\n var tokens = line.Split(' ');\n\n int N = Convert.ToInt32(tokens[0]);\n int K = Convert.ToInt32(tokens[1]);\n \n int n = N;\n\n while ( n>0 )\n {\n if (n % 10 == 0)\n zeros++;\n n /= 10;\n\n digits++;\n }\n \n if ( K>zeros)\n Console.WriteLine(digits - 1);\n else\n {\n int counter = 0;\n int remove = 0;\n while ( N>0)\n {\n\n if ( counter == K)\n {\n Console.WriteLine(remove);\n return;\n }\n\n if (N % 10 == 0)\n counter++;\n else\n remove++;\n\n N /= 10;\n }\n }\n\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "aaa0c84755ad2d0a99c650e10f09ef56", "src_uid": "7a8890417aa48c2b93b559ca118853f9", "apr_id": "7a3c1bbebb1ea577906174df3bc24634", "difficulty": 1100, "tags": ["brute force", "greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.9989235737351991, "equal_cnt": 1, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "using System;\nclass some\n{\n\tpublic static void Main()\n\t{\n\t\tstring s=Console.ReadLine();\n\t\tchar[]vowels=\"aeiou\".ToCharArray();\n\t\tbool flag=false;\n\t\tfor(int i=0;i=0)\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\telse flag=true;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t\tflag=true;\n\t\t\t}\n\t\t}\n\t\tif(flag)Console.WriteLine(\"NO\");\n\t\telse Console.WriteLine(\"YES\");\n\t}\n", "lang": "Mono C#", "bug_code_uid": "f84d5da0df9404e637e780676fdd5a35", "src_uid": "a83144ba7d4906b7692456f27b0ef7d4", "apr_id": "d71dfef7a54eefee1cbccdf9f54497a9", "difficulty": 900, "tags": ["strings", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.9720913374411019, "equal_cnt": 12, "replace_cnt": 3, "delete_cnt": 3, "insert_cnt": 5, "fix_ops_cnt": 11, "bug_source_code": "using System;\nusing System.Text;\nusing System.Linq;\n\nclass Program\n{\nstatic void Main()\n{\nstring s1 = Console.ReadLine();\nint n = int.Parse(s1.Split(' ')[0]) - 1;\nint win = -1;\nint z0 = int.Parse(s1.Split(' ')[1]) - 1;\nint c0 = int.Parse(s1.Split(' ')[2]) - 1;\n\nstring s2 = Console.ReadLine();\n\nstring s3 = Console.ReadLine();\n\nfor (int i=0; i c0)\n {\n if (z0 != n)\n z0++;\n }\n else\n {\n if (z0 != 0)\n z0--;\n } \n }\n \n if (s3[i] != '0')\n peremesh(n, c0, ref s2, out c0)'\n\n \n if (c0 == z0)\n {\n Console.WriteLine(\"Controller\");\n win = 1;\n break;\n }\n}\nif (win != 1)\nConsole.WriteLine(\"Stowaway\");\n\nConsole.ReadKey();\n\n}\n\nstatic void peremesh(int n, int place, ref string dir, out int N)\n{\nN = -1;\nif (dir == \"to tail\")\n{\nif (place < n)\nplace++;\nelse\n{\ndir = \"to head\";\nplace--;\n}\n}\nelse\nif (place > 0)\nplace--;\nelse\n{\ndir = \"to tail\";\nplace++;\n}\n}\n}", "lang": "Mono C#", "bug_code_uid": "6a22d51c7d64171ee522e8880486f9b8", "src_uid": "2222ce16926fdc697384add731819f75", "apr_id": "15d5d0e1c18200a0635ad04223de4cdf", "difficulty": 1500, "tags": ["dp", "games", "greedy"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.9985775248933144, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "using System;\n\nnamespace CSharp\n{\n public class _519C\n {\n public static void Main(string[] args)\n {\n string[] tokens = Console.ReadLine().Split();\n\n int n = int.Parse(tokens[0]);\n int m = int.Parse(tokens[1]);\n\n Console.WriteLine(Math.Min((n + m) / 3, Math.Min(n, m));\n }\n }\n}", "lang": "Mono C#", "bug_code_uid": "8a100d0e2f5dfa6bdbee093d9a4bbd6f", "src_uid": "0718c6afe52cd232a5e942052527f31b", "apr_id": "7f4575a95c2fa5110ded86b0b2476e0f", "difficulty": 1300, "tags": ["number theory", "greedy", "math", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "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;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace A_b_V\n{\n class Program\n {\n static void Main(string[] args)\n {\n string[] s = Console.ReadLine().Split();\n Int64 n = Convert.ToInt64(s[0]);\n Int64 m = Convert.ToInt64(s[1]);\n int count = 0;\n while((n > 0 && m > 0) || (n > 1 && m > 1)\n {\n if (n >= m)\n {\n n -= 2;\n m--;\n count++;\n }\n else\n {\n n--;\n m-= 2;\n count++;\n }\n }\n Console.WriteLine(count);\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "25d83189811ede13b7d695599f9b1c73", "src_uid": "0718c6afe52cd232a5e942052527f31b", "apr_id": "02b7558f30fd1261ab7d8c294d6d78ec", "difficulty": 1300, "tags": ["number theory", "greedy", "math", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.40744368266405484, "equal_cnt": 11, "replace_cnt": 6, "delete_cnt": 2, "insert_cnt": 4, "fix_ops_cnt": 12, "bug_source_code": " class Program\n {\n static void Main(string[] args)\n {\n string firstWord = Console.ReadLine();\n string secondWord = Console.ReadLine();\n\n Console.WriteLine(firstWord.CompareTo(secondWord));\n\n Console.ReadKey();\n\n }\n }", "lang": "Mono C#", "bug_code_uid": "27d94dc4b6fa2df10c5a735626f27e5c", "src_uid": "ffeae332696a901813677bd1033cf01e", "apr_id": "b1680da637198796df3cd8e00fba13ea", "difficulty": 800, "tags": ["strings", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.4441782462865357, "equal_cnt": 18, "replace_cnt": 10, "delete_cnt": 3, "insert_cnt": 4, "fix_ops_cnt": 17, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace zadacha2\n{\n class Program\n {\n static void Main(string[] args)\n {\n Console.ReadLine();\n string a=Console.ReadLine();\n int n = a.Length;\n int N = 0;\n for (int i=0;i 0) && (verh[i] < n) && (i == 0))\n {\n int razm = verh[0];\n int m = 0;\n char[] temp = new char[razm];\n for (int j = 0; j < razm; j++)\n {\n temp[m] = a[j];\n m++;\n }\n str[k] = new string(temp);\n k++;\n }\n\n if ((verh[i] > 0) && (verh[i] < n) && (verh[i + 1] - verh[i] > 0))\n {\n int razm = verh[i + 1] - verh[i] - 1;\n int m = 0;\n char[] temp = new char[razm];\n for (int j = verh[i] + 1; j < verh[i + 1]; j++)\n {\n temp[m] = a[j];\n m++;\n }\n str[k] = new string(temp);\n k++;\n }\n }\n\n int m1 = 0;\n int raz = n - verh[N-1] - 1;\n char[] temp2 = new char[raz];\n for (int j = verh[N-1] + 1; j < n; j++)\n {\n temp2[m1] = a[j];\n m1++;\n }\n str[k] = new string(temp2);\n\n int max = 0;\n for (int i=0;imax)\n {\n max = st.Length;\n }\n\n }\n }\n Console.WriteLine(max);\n // Console.ReadLine();\n\n\n\n\n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "0ee73cce107fc98859b9dad6ebbc70b0", "src_uid": "567ce65f87d2fb922b0f7e0957fbada3", "apr_id": "41e5ef6eb60d4ff11d0ef34d2e00a619", "difficulty": 1000, "tags": ["strings", "brute force", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9550748752079867, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 3, "bug_source_code": "using System;\n//using System.Collections.Generic;\n//using System.Linq;\n//using System.Text;\n\nnamespace ConsoleApplication1\n{\n class Program\n {\n static void Main(string[] args)\n {\n const Int64 mod = 1000000007;\n string[] t = Console.ReadLine().Split(\n new char[] { ' ', '\\t' }, StringSplitOptions.RemoveEmptyEntries);\n int n = int.Parse(t[0]);\n int m = int.Parse(t[1]);\n int k = int.Parse(t[2]);\n if (n == k)\n {\n Int64 res = 1;\n for (int i = 0; i < n / 2 + n % 2; i++)\n res = (res * m) % mod;\n Console.WriteLine(res);\n return;\n }\n if (k > n)\n {\n Console.Write(\"0\");\n return;\n }\n if (k == 1)\n {\n Int64 res = 1;\n for (int i = 0; i < n; i++)\n res = (res * m) % mod;\n Console.WriteLine(res);\n return;\n }\n if (k % 2 == 0)\n {\n Console.WriteLine(m);\n return;\n }\n Console.WriteLine(m * m);\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "580b4528854da87ad4f932743aed48f6", "src_uid": "1f9107e8d1d8aebb1f4a1707a6cdeb6d", "apr_id": "a09f5b323b7dfb0ecf278087c4b4a343", "difficulty": 1600, "tags": ["graphs", "math", "combinatorics", "dsu"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.38703339882121807, "equal_cnt": 18, "replace_cnt": 13, "delete_cnt": 2, "insert_cnt": 2, "fix_ops_cnt": 17, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Text;\n\nnamespace round516\n{\n class MainClass\n {\n public static void Main(string[] args)\n {\n#if DEBUG\n //var line = Array.ConvertAll(\"4 1 4 12\".Split(' '), int.Parse);\n //var line = Array.ConvertAll(\"31 12 6 81\".Split(' '), int.Parse);\n //var line = Array.ConvertAll(\"10 5 5 1\".Split(' '), int.Parse);\n#else\n var line = Array.ConvertAll(Console.ReadLine().Split(' '), int.Parse);\n#endif\n var n = line[0];\n var l = line[1];\n var r = line[2];\n var k = line[3];\n\n if (l > r)\n r = n - l + r + 1;\n else\n r = r - l + 1;\n l = 1;\n var b = n - r;\n\n int result = -1;\n\n for (int extra = 0; extra <= n; ++extra)\n {\n int full = n + extra;\n int b_extra = n - r;\n if (extra > b_extra)\n {\n int a_extra = extra - b_extra;\n int mod = (k - r - a_extra) % full;\n if (mod == 0 || mod == full - 1 || mod == -1)\n result = Math.Max(result, extra);\n }\n else\n {\n int mod = (k - r) % full;\n if (mod == 0)\n result = Math.Max(result, extra);\n }\n }\n\n Console.WriteLine(result);\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "efa3ee9482155c6bed547f4f8d3e5a14", "src_uid": "f54cc281033591315b037a400044f1cb", "apr_id": "443b449e049f0cffa54184e6c1ab23e4", "difficulty": 2600, "tags": ["math", "brute force"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.4216780698595607, "equal_cnt": 10, "replace_cnt": 3, "delete_cnt": 4, "insert_cnt": 2, "fix_ops_cnt": 9, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Text;\n\nnamespace round516\n{\n class MainClass\n {\n static long solve(long n, long a, long b, long k, long p)\n {\n long result = -1;\n if (n <= 1000000)\n {\n for (long a_extra = p; a_extra <= a; ++a_extra)\n for (long b_extra = 0; b_extra <= b; ++b_extra)\n if ((k - a - a_extra) % (n + a_extra + b_extra) == 0)\n result = Math.Max(result, a_extra + b_extra);\n }\n return result;\n }\n\n public static void Main(string[] args)\n {\n#if DEBUG\n //var line = Array.ConvertAll(\"4 1 4 12\".Split(' '), long.Parse);\n //var line = Array.ConvertAll(\"31 12 6 81\".Split(' '), long.Parse);\n //var line = Array.ConvertAll(\"100000000 76041209 26041209 700400000\".Split(' '), long.Parse);\n //var line = Array.ConvertAll(\"4938239193 4924044987 1597580621 63742933607\".Split(' '), long.Parse);\n //var line = Array.ConvertAll(\"200 185 44 28099\".Split(' '), long.Parse);\n //var line = Array.ConvertAll(\"100000000 41790937 91790936 253001999\".Split(' '), long.Parse);\n //var line = Array.ConvertAll(\"10 5 5 1\".Split(' '), long.Parse);\n var line = Array.ConvertAll(\"5 4 5 6\".Split(' '), long.Parse);\n //var line = Array.ConvertAll(\"2 1 2 91167168968\".Split(' '), long.Parse);\n //var line = Array.ConvertAll(\"10 2 3 64603826899\".Split(' '), long.Parse);\n //var line = Array.ConvertAll(\"100000000000 54542941105 63449647466 13221518898\".Split(' '), long.Parse);\n //var line = Array.ConvertAll(\"10 1 10 17\".Split(' '), long.Parse);\n //var line = Array.ConvertAll(\"2 1 2 91167168968\".Split(' '), long.Parse);\n //var line = Array.ConvertAll(\"1000 811 818 88621462639\".Split(' '), long.Parse);\n#else\n var line = Array.ConvertAll(Console.ReadLine().Split(' '), long.Parse);\n#endif\n var n = line[0];\n var l = line[1];\n var r = line[2];\n var k = line[3];\n\n if (l > r)\n r = n - l + r + 1;\n else\n r = r - l + 1;\n l = 1;\n var b = n - r;\n\n long result = -1;\n\n if (k <= n || k <= r * 2)\n {\n if (r <= k && k <= r * 2)\n {\n long a_extra = k - r;\n result = Math.Min(b + a_extra + 1, n);\n }\n }\n else if (n <= 1000000)\n { // by sweet tooth\n result = Math.Max(solve(n, r, b, k, 0), solve(n, r, b, k + 1, 1));\n }\n else\n { // by round\n long max_round = k / n;\n for (long round = max_round / 2; round <= max_round; ++round)\n {\n long extra_round_a = k - n * round - r; // extra * round + a_extra -> b_extra * round + a_extra * (round + 1)\n long round1 = round + 1;\n if (extra_round_a > n * round + r) continue;\n\n if (extra_round_a >= b * round)\n {\n for (long b_extra = b; b_extra >= 0; --b_extra)\n {\n long mod = (extra_round_a - b_extra * round + round1) % round1;\n if (mod == 0 || mod == 1)\n {\n long a_extra = (extra_round_a + mod - b_extra * round) / round1;\n if (a_extra > r) continue;\n result = Math.Max(result, a_extra + b_extra);\n break;\n }\n }\n }\n else\n {\n long b_extra = extra_round_a / round;\n long mod = (extra_round_a - b_extra * round + round1) % round1;\n if (mod == 0 || mod == 1)\n {\n long a_extra = (extra_round_a + mod - b_extra * round) / round1;\n if (a_extra > r) continue;\n result = Math.Max(result, a_extra + b_extra);\n }\n }\n }\n }\n\n Console.WriteLine(result);\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "039821fe3405eb6d40c09d8f50b14f8d", "src_uid": "f54cc281033591315b037a400044f1cb", "apr_id": "443b449e049f0cffa54184e6c1ab23e4", "difficulty": 2600, "tags": ["math", "brute force"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "delete", "lang_cluster": "C#"} {"similarity_score": 0.9994977398292315, "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.Text;\nusing System.Threading.Tasks;\n\nnamespace Ejercicios\n{\n class Program\n {\n static string funcion (string str)\n {\n string newStr = \"\", first;\n\n if (str.Length == 1 && isLower(str[0]))\n return str.ToUpper();\n\n if (str.Length == 1 && isUpper(str[0]))\n return str.ToLower;\n\n if (isUpper(str[0])){\n if (rest(str))\n return str.ToLower();\n else\n return str;\n }\n else\n {\n if (rest(str))\n {\n first = str[0].ToString().ToUpper();\n newStr = str.Substring(1);\n newStr = first + newStr.ToLower();\n return newStr;\n }\n else\n {\n return str;\n }\n\n }\n }\n\n static bool rest (string str){\n for (int i = 1; i < str.Length; i++)\n {\n if (isLower(str[i]))\n return false;\n }\n return true;\n }\n\n static bool isUpper(char letter)\n {\n string alpha = \"ABCDEFGHIJKLMNOPQRSTUVWXYZ\";\n for (int i = 0; i < alpha.Length; i++)\n {\n if (letter == alpha[i]) \n return true;\n }\n return false;\n }\n\n static bool isLower(char letter)\n {\n string alpha = \"abcdefghijklmnopqrstuvwxyz\";\n for (int i = 0; i < alpha.Length; i++)\n {\n if (letter == alpha[i])\n return true;\n }\n return false;\n }\n\n\n static void Main(string[] args)\n {\n string str = Console.ReadLine();\n Console.WriteLine(funcion(str));\n }\n }\n}", "lang": "Mono C#", "bug_code_uid": "42e78a3c4bf6fcb11d4aec734d6a75b6", "src_uid": "db0eb44d8cd8f293da407ba3adee10cf", "apr_id": "a24c89f498cf815d6bae892a56f4b96b", "difficulty": 1000, "tags": ["strings", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.9423963133640553, "equal_cnt": 11, "replace_cnt": 7, "delete_cnt": 2, "insert_cnt": 1, "fix_ops_cnt": 10, "bug_source_code": "using System;\nusing System.Collections;\nusing System.Collections.Generic;\nusing System.Globalization;\nusing System.IO;\nusing System.Linq;\nusing System.Threading;\n\nnamespace CF317\n{\n\tinternal class Program\n\t{\n\t\tprivate static void Main(string[] args)\n\t\t{\n\t\t\tvar sr = new InputReader(Console.In);\n\t\t\t//var sr = new InputReader(new StreamReader(\"input.txt\"));\n\t\t\tvar task = new Task();\n\t\t\tusing (var sw = Console.Out)\n\t\t\t//using (var sw = new StreamWriter(\"output.txt\"))\n\t\t\t{\n\t\t\t\ttask.Solve(sr, sw);\n\n\t\t\t\t//Console.ReadKey();\n\t\t\t}\n\t\t}\n\t}\n\n\tinternal class Task\n\t{\n\t\tpublic void Solve(InputReader sr, TextWriter sw)\n\t\t{\n\t\t\tvar input = sr.ReadArray(Int32.Parse);\n\t\t\tvar m = input[0];\n\t\t\tvar d = input[1];\n\t\t\tvar totalDays = m % 2 == 1 ? 31 : 30;\n\t\t\tif (m == 2) {\n\t\t\t\ttotalDays = 28;\n\t\t\t}\n\t\t\tvar cols = 1;\n\t\t\tvar dayOfWeek = d;\n\t\t\twhile (totalDays > 0) {\n\t\t\t\tdayOfWeek++;\n\t\t\t\tif (dayOfWeek > 7) {\n\t\t\t\t\tdayOfWeek = 1;\n\t\t\t\t\tcols++;\n\t\t\t\t}\n\t\t\t\ttotalDays--;\n\t\t\t}\n\n\t\t\tsw.WriteLine(cols);\n\t\t}\n\t}\n}\n\ninternal class InputReader : IDisposable\n{\n\tprivate bool isDispose;\n\tprivate readonly TextReader sr;\n\n\tpublic InputReader(TextReader stream)\n\t{\n\t\tsr = stream;\n\t}\n\n\tpublic void Dispose()\n\t{\n\t\tDispose(true);\n\t\tGC.SuppressFinalize(this);\n\t}\n\n\tpublic string NextString()\n\t{\n\t\tvar result = sr.ReadLine();\n\t\treturn result;\n\t}\n\n\tpublic int NextInt32()\n\t{\n\t\treturn Int32.Parse(NextString());\n\t}\n\n\tpublic long NextInt64()\n\t{\n\t\treturn Int64.Parse(NextString());\n\t}\n\n\tpublic string[] NextSplitStrings()\n\t{\n\t\treturn NextString()\n\t\t\t\t.Split(new[] { ' ' }, StringSplitOptions.RemoveEmptyEntries);\n\t}\n\n\tpublic T[] ReadArray(Func func)\n\t{\n\t\treturn NextSplitStrings()\n\t\t\t\t.Select(s => func(s, CultureInfo.InvariantCulture))\n\t\t\t\t.ToArray();\n\t}\n\n\tpublic T[] ReadArrayFromString(Func func, string str)\n\t{\n\t\treturn\n\t\t\t\tstr.Split(new[] { ' ' }, StringSplitOptions.RemoveEmptyEntries)\n\t\t\t\t\t\t.Select(s => func(s, CultureInfo.InvariantCulture))\n\t\t\t\t\t\t.ToArray();\n\t}\n\n\tprotected void Dispose(bool dispose)\n\t{\n\t\tif (!isDispose)\n\t\t{\n\t\t\tif (dispose)\n\t\t\t\tsr.Close();\n\t\t\tisDispose = true;\n\t\t}\n\t}\n\n\t~InputReader()\n\t{\n\t\tDispose(false);\n\t}\n}", "lang": "MS C#", "bug_code_uid": "43268a1d936aa4d3d3ff0793e70bbce4", "src_uid": "5b969b6f564df6f71e23d4adfb2ded74", "apr_id": "5e88781ec8f94ebbcbf57425b37465aa", "difficulty": 800, "tags": ["math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9887834339948232, "equal_cnt": 5, "replace_cnt": 1, "delete_cnt": 2, "insert_cnt": 1, "fix_ops_cnt": 4, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\n\n\nnamespace ConsoleApplication5\n{\n class Program\n {\n static void Main(string[] args)\n {\n string[] s = Console.ReadLine().Split(' ');\n int T = Convert.ToInt32(s[0]);\n int S = Convert.ToInt32(s[1]);\n int q = Convert.ToInt32(s[2]);\n int k = 1;\n while (q * S < T)\n {\n k++;\n q = q * S;\n \n }\n Console.WriteLine(k);\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "da81f9962ee2fb2e621a247ff0048e63", "src_uid": "0d01bf286fb2c7950ce5d5fa59a17dd9", "apr_id": "856f66db32e4ad0ce35b17edcf31faa5", "difficulty": 1500, "tags": ["math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "delete", "lang_cluster": "C#"} {"similarity_score": 0.46450723638869745, "equal_cnt": 16, "replace_cnt": 11, "delete_cnt": 3, "insert_cnt": 2, "fix_ops_cnt": 16, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace Vanya_and_Cards\n{\n class Program\n {\n static void Main(string[] args)\n {\n string[] s = Console.ReadLine().Split(' ');\n int n = Int32.Parse(s[0]);\n int x = Int32.Parse(s[1]);\n int[] a = Array.ConvertAll(Console.ReadLine().Split(' '), Int32.Parse);\n int sum = a.Sum();\n if (sum != 0)\n {\n int req = Math.Abs(sum) / x + (Math.Abs(sum) % x == 0 ? 0 : 1);\n Console.WriteLine(req);\n }\n else\n Console.WriteLine(0);\n Console.ReadLine();\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "6efcde33751a146ddd571dcbe0cdd8c8", "src_uid": "1d2b81ce842f8c97656d96bddff4e8b4", "apr_id": "bbe0d342e07568c6e4132521fbd1b4a1", "difficulty": 800, "tags": ["constructive algorithms", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.6017156862745098, "equal_cnt": 7, "replace_cnt": 2, "delete_cnt": 1, "insert_cnt": 4, "fix_ops_cnt": 7, "bug_source_code": "using System;\nusing System.Collections.Generic;\n\nnamespace ConsoleApp1\n{\n class Program\n {\n static void Main(string[] args)\n {\n Queue queue = new Queue();\n int n = int.Parse(Console.ReadLine());\n for (int i = 0; i < n; i++)\n {\n queue.Enqueue(int.Parse(Console.ReadLine()));\n }\n for (int i = 0; i < n; i++)\n {\n Console.WriteLine(prov(queue.Dequeue()));\n }\n }\n static string prov(int input)\n {\n if (((input % 7) % 3) == 0)\n return \"YES\";\n return \"NO\";\n }\n }\n}", "lang": "MS C#", "bug_code_uid": "85fb163c38d7a348cd1ece66007b42a8", "src_uid": "cfd1182be98fb5f0c426f8b68e48d452", "apr_id": "4991cebba4b9f76c29d2db03232c9c11", "difficulty": 900, "tags": ["greedy", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.9985845718329794, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "using System;\n\nnamespace ConsoleApplication\n{\n class Program\n {\n static void Main(string[] args)\n {\n ushort n = ushort.Parse(Console.ReadLine());\n ushort small = 3;\n ushort big = 7;\n ushort left = 0;\n bool found = false;\n \n for (ushort i = 0; i < 100; i++)\n {\n ushort x = ushort.Parse(Console.ReadLine());\n\n if (x % small == 0 || x % big == 0)\n {\n Console.WriteLine(\"YES\");\n continue;\n }\n\n if (x % small % big == 0)\n {\n Console.WriteLine(\"YES\");\n continue;\n }\n\n if (x % big % small == 0)\n {\n Console.WriteLine(\"YES\");\n continue;\n }\n\n left = (ushort)(x % small);\n \n for (;left < x;)\n {\n left = (ushort)(left + small);\n\n if (left % big == 0)\n {\n Console.WriteLine(\"YES\");\n found = true;\n break;\n } \n }\n \n if(!found) Console.WriteLine(\"NO\");\n }\n }\n }\n}", "lang": "MS C#", "bug_code_uid": "5ecdef4d69f43013c904632d60bb7872", "src_uid": "cfd1182be98fb5f0c426f8b68e48d452", "apr_id": "53a1967da970035cc8055f6a26309023", "difficulty": 900, "tags": ["greedy", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9495094520220149, "equal_cnt": 7, "replace_cnt": 3, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 6, "bug_source_code": "using System;\nusing System.Linq;\nusing System.Collections.Generic;\nusing System.Text;\n\n\nnamespace MakeCalendar\n{\n 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]; b = x[1];\n }\n\n\n\n static void ReadInts(ref int a, ref int b, ref int c)\n {\n var x = ReadIntArrayLine();\n a = x[0]; b = x[1]; 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]; b = x[1]; c = x[2]; d = x[3];\n }\n\n\n static int[] ReadIntArrayLine()\n {\n char[] sep = { ' ' };\n return Console.ReadLine().Split(sep, StringSplitOptions.RemoveEmptyEntries).Select(x => int.Parse(x)).ToArray();\n }\n\n static void PrintLn(object obj)\n {\n Console.WriteLine(obj.ToString());\n }\n\n public static string Reverse(string s)\n {\n char[] charArray = s.ToCharArray();\n Array.Reverse(charArray);\n return new string(charArray);\n }\n\n//----------------------------------------------------------------------------\n \n\n static decimal findrem(decimal n, int p)\n {\n if (n == 0)\n return 1;\n if (n % 2 == 0)\n return (findrem(n / 2, p) * findrem(n / 2, p)) % p;\n n--;\n return (findrem(n / 2, p) * findrem(n / 2, p)*2) % p;\n }\n\n static void Main(string[] args)\n {\n decimal n = Convert.ToDecimal(Console.ReadLine());\n\n if (n == 0)\n { PrintLn(1); return; }\n\n int p = 1000000007;\n \n PrintLn((findrem(n-1,p)*(findrem(n,p)+1))%p);\n\n\n }\n\n }\n}\n", "lang": "MS C#", "bug_code_uid": "131b6dd104cb2d2f9c1ff897da715e98", "src_uid": "782b819eb0bfc86d6f96f15ac09d5085", "apr_id": "01d18671604850782964b2628c37dd88", "difficulty": 1300, "tags": ["matrices", "dp", "math", "number theory"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.8782403770620582, "equal_cnt": 4, "replace_cnt": 3, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 4, "bug_source_code": "//Rextester.Program.Main is the entry point for your code. Don't change it.\n//Compiler version 4.0.30319.17929 for Microsoft (R) .NET Framework 4.5\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text.RegularExpressions;\n\nnamespace Rextester\n{\n public class Program\n {\n public static void Main(string[] args)\n {\n string[] s = Console.ReadLine().Split();\n int n = Convert.toInt32(s[0]);\n int m = Convert.toInt32(s[1]);\n int k = Convert.toInt32(s[2]);\n if (n <= m && n <= k)\n Console.WriteLine(\"Yes\");\n else\n Console.WriteLine(\"NO\");\n \n }\n }\n}", "lang": "Mono C#", "bug_code_uid": "6868c2d107236d2c847b872cdb0c40b7", "src_uid": "6cd07298b23cc6ce994bb1811b9629c4", "apr_id": "205b0e1f1b19b2cfbacd3e5bc57b1353", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9959677419354839, "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;\n\nnamespace ConsoleApplication1\n{\n class Program\n {\n static void Main(string[] args)\n {\n string[]y=Console.ReadLine().Split(' ');\n int n=int.Parse(y[0]);\n int m=int.Parse(y[1]);\n int k=int.Parse(y[2]);\n if(m>=n&&k>=n)\n Console.WriteLine(\"Yes\");\n else\n Cosnole.WriteLine(\"No\");\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "c17518ff0757f13e1406e1acf06eb470", "src_uid": "6cd07298b23cc6ce994bb1811b9629c4", "apr_id": "229a6698633e47485cd397598b464e17", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.7684537684537684, "equal_cnt": 16, "replace_cnt": 9, "delete_cnt": 3, "insert_cnt": 4, "fix_ops_cnt": 16, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\nusing System.Text;\n\nnamespace ProblemSolving\n{\n class Program\n {\n static bool IsPrime (int x)\n {\n bool flag = false;\n int y = 0;\n y = x / 2;\n for (int i = 2; i <= y; i++ )\n {\n if ( x % i == 0)\n {\n flag = false;\n break;\n }\n else\n {\n flag = true;\n }\n }\n return flag;\n }\n }\n static void Main(string[] args)\n {\n \n int n = int.Parse(Console.ReadLine());\n int m = int.Parse(Console.ReadLine());\n int temp = 0;\n for (int i = n+1 ; i <= m ; i++)\n {\n IsPrime(i);\n temp = i;\n }\n if (temp == m)\n {\n Console.WriteLine(\"YES\");\n\n }\n else\n {\n Console.WriteLine(\"NO\");\n }\n \n\n\n }\n\n}", "lang": "Mono C#", "bug_code_uid": "9e16a627606c45478fcb14ccaa4744b8", "src_uid": "9d52ff51d747bb59aa463b6358258865", "apr_id": "35fbfb5d7ac49da9b1de36476af0aafe", "difficulty": 800, "tags": ["brute force"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.37660399880632645, "equal_cnt": 24, "replace_cnt": 13, "delete_cnt": 5, "insert_cnt": 6, "fix_ops_cnt": 24, "bug_source_code": "using System;\nusing System.IO;\n\nnamespace R_A\n{\n class Program\n {\n static void Main(string[] args)\n {\n StreamReader f1 = new StreamReader(\"input.txt\");\n StreamWriter f2 = new StreamWriter(\"output.txt\");\n int[] a = new int[4];\n string[] s = new string[4];\n int k = 5;\n bool b;\n for (int i = 0; i < 4; i++)\n {\n s[i] = f1.ReadLine();\n a[i] = s[i].Length - 2;\n }\n int a1, a2;\n for (int i = 0; i < 4; i++)\n {\n b = true;\n for (int j = 0; j < 4; j++)\n {\n if (a[i] > a[j])\n {\n a1 = a[i];\n a2 = a[j];\n }\n else\n {\n a1 = a[j];\n a2 = a[i];\n }\n if (((a1 / a2) < 2) && (i != j))\n {\n b = false;\n break;\n }\n }\n if (b) k = i;\n }\n if (k == 5) f2.WriteLine(\"C\");\n else\n {\n f2.WriteLine(s[k].Substring(0, 1));\n }\n f1.Close();\n f2.Close();\n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "d3ad6e2e7910e41c65e422a249664d72", "src_uid": "30725e340dc07f552f0cce359af226a4", "apr_id": "0d748727d2c896ebf0cb17b3a754e6ae", "difficulty": 1300, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9384413883431565, "equal_cnt": 17, "replace_cnt": 6, "delete_cnt": 4, "insert_cnt": 6, "fix_ops_cnt": 16, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Globalization;\nusing System.IO;\nusing System.Linq;\nusing System.Text;\npublic class Codeforces\n{\n protected static TextReader reader;\n protected static TextWriter writer;\n static void Main()\n {\n reader = new StreamReader(Console.OpenStandardInput(1024 * 10), System.Text.Encoding.ASCII, false, 1024 * 10);\n writer = new StreamWriter(Console.OpenStandardOutput(1024 * 10), System.Text.Encoding.ASCII, 1024 * 10);\n var l = new int[4];\n for (var i = 0; i < 4; i++)\n {\n l[i] = ReadToken().Skip(2).ToArray().Length;\n }\n var ll = Enumerable.Range(0, 4).ToArray();\n Array.Sort(l, ll);\n var great = 0;\n var choice = new Tuple[6];\n var ind = 0;\n for (int i = 0; i < 3; i++)\n {\n for (int j = i + 1; j < 4; j++)\n {\n if (l[i] <= l[j] / 2)\n {\n great++;\n choice[ind++] = Tuple.Create(i, j);\n }\n }\n }\n if (great == 3)\n {\n if (choice.All(d => d.Item1 == 0))\n {\n Write((char)(ll[0] + 'A'));\n }\n else\n {\n Write((char)(ll[3] + 'A'));\n }\n }\n else\n {\n Write(\"C\");\n }\n reader.Close();\n writer.Close();\n }\n #region Read / Write\n\n private static Queue currentLineTokens = new Queue();\n\n private static string[] ReadAndSplitLine()\n {\n return reader.ReadLine().Split(new[] { ' ', '\\t' }, StringSplitOptions.RemoveEmptyEntries);\n }\n\n public static string ReadToken()\n {\n while (currentLineTokens.Count == 0)\n currentLineTokens = new Queue(ReadAndSplitLine());\n return currentLineTokens.Dequeue();\n }\n\n public static int ReadInt()\n {\n return int.Parse(ReadToken());\n }\n\n public static long ReadLong()\n {\n return long.Parse(ReadToken());\n }\n\n public static double ReadDouble()\n {\n return double.Parse(ReadToken(), CultureInfo.InvariantCulture);\n }\n\n public static int[] ReadIntArray()\n {\n return ReadAndSplitLine().Select(int.Parse).ToArray();\n }\n\n public static long[] ReadLongArray()\n {\n return ReadAndSplitLine().Select(long.Parse).ToArray();\n }\n\n public static double[] ReadDoubleArray()\n {\n return ReadAndSplitLine().Select(s => double.Parse(s, CultureInfo.InvariantCulture)).ToArray();\n }\n public static int[][] ReadIntMatrix(int numberOfRows)\n {\n int[][] matrix = new int[numberOfRows][];\n for (int i = 0; i < numberOfRows; i++)\n matrix[i] = ReadIntArray();\n return matrix;\n }\n public static int[][] ReadAndTransposeIntMatrix(int numberOfRows)\n {\n int[][] matrix = ReadIntMatrix(numberOfRows);\n int[][] ret = new int[matrix[0].Length][];\n for (int i = 0; i < ret.Length; i++)\n {\n ret[i] = new int[numberOfRows];\n for (int j = 0; j < numberOfRows; j++)\n ret[i][j] = matrix[j][i];\n }\n return ret;\n }\n\n public static string[] ReadLines(int quantity)\n {\n string[] lines = new string[quantity];\n for (int i = 0; i < quantity; i++)\n lines[i] = reader.ReadLine().Trim();\n return lines;\n }\n public static void WriteArray(IEnumerable array)\n {\n writer.WriteLine(string.Join(\" \", array));\n }\n\n public static void Write(params T[] array)\n {\n WriteArray(array);\n }\n\n public static void WriteLines(IEnumerable array)\n {\n foreach (var a in array)\n writer.WriteLine(a);\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 != '-' && (c < '0' || c > '9'));\n int sign = 1;\n if (c == '-')\n {\n sign = -1;\n c = reader.Read();\n }\n res = c - '0';\n while (true)\n {\n c = reader.Read();\n if (c < '0' || c > '9')\n return res * sign;\n res *= 10;\n res += c - '0';\n }\n }\n #endregion\n}", "lang": "MS C#", "bug_code_uid": "f68b78450f623f6d4db49154c89cad88", "src_uid": "30725e340dc07f552f0cce359af226a4", "apr_id": "76f6475d50b7f85349ffabe7cbb8ad2c", "difficulty": 1300, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.8293384467881112, "equal_cnt": 11, "replace_cnt": 6, "delete_cnt": 1, "insert_cnt": 3, "fix_ops_cnt": 10, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\n\nnamespace TestConsole\n{\n\n class Program\n {\n\n public static void Main(string[] args)\n {\n int[] input = readIntArray(System.Console.ReadLine().Split(' '));\n int a = input[0];\n int b = input[1];\n int k = input[2];\n\n bool[] seive = new bool[b + 1];\n for (int i = 2; i < b + 1; i++)\n {\n seive[i] = true;\n }\n\n for (int i = 2; i < b + 1; i++)\n {\n if (seive[i])\n {\n if (((long)i) * i < b + 1)\n {\n for (int j = i * i; j < b + 1; j += i)\n {\n seive[j] = false;\n }\n }\n }\n }\n\n int result = -1;\n\n int left = k;\n int right = b - a + 2;\n\n while (left != right)\n {\n int l = (right + left) / 2;\n bool forAllX = true;\n for (int x = a; x <= b - l + 1; x++)\n {\n int primes = 0;\n for (int i = x; i <= x + l - 1; i++)\n {\n if (seive[i]) primes++;\n }\n if (primes < k)\n {\n forAllX = false;\n break;\n }\n }\n if (forAllX)\n {\n result = l;\n right = l;\n }\n else\n {\n left = l + 1;\n }\n }\n Console.WriteLine(result);\n }\n\n static int[] readIntArray(string[] inArray)\n {\n return inArray.Select(i => Int32.Parse(i)).ToArray();\n }\n\n }\n\n}", "lang": "Mono C#", "bug_code_uid": "f14e9830ca1c94a2a3396e6afb90af1c", "src_uid": "3e1751a2990134f2132d743afe02a10e", "apr_id": "7539d074b8e093e6068d91e494096b8c", "difficulty": 1600, "tags": ["binary search", "number theory", "two pointers"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9947739150193138, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\n\nnamespace TestConsole\n{\n\n class Program\n {\n\n public static void Main(string[] args)\n {\n int[] input = readIntArray(System.Console.ReadLine().Split(' '));\n int a = input[0];\n int b = input[1];\n int k = input[2];\n\n bool[] seive = new bool[b + 1];\n for (int i = 2; i < b + 1; i++)\n {\n seive[i] = true;\n }\n\n for (int i = 2; i < b + 1; i++)\n {\n if (seive[i])\n {\n if (((long)i) * i < b + 1)\n {\n for (int j = i * i; j < b + 1; j += i)\n {\n seive[j] = false;\n }\n }\n }\n }\n\n int result = -1;\n\n int left = k;\n int right = b - a + 2;\n\n while (left != right)\n {\n int l = (right + left) / 2;\n\n int firstWindow = 0;\n for (int i = a; i <= a + l - 1; i++)\n {\n if (seive[i]) firstWindow++;\n }\n\n bool forAllX = firstWindow >= k;\n\n if (forAllX)\n {\n for (int x = a + 1; x <= b - l + 1; x++)\n {\n if (seive[x - 1]) firstWindow--;\n if (seive[x + l - 1]) firstWindow++;\n if (firstWindow < k)\n {\n forAllX = false;\n break;\n }\n }\n }\n if (forAllX)\n {\n result = l;\n right = l;\n }\n else\n {\n left = l + 1;\n }\n }\n Console.WriteLine(result);\n }\n\n static int[] readIntArray(string[] inArray)\n {\n return inArray.Select(i => Int32.Parse(i)).ToArray();\n }\n\n }\n\n}", "lang": "Mono C#", "bug_code_uid": "ec8feeac741c48d2f05b5f342856bd5a", "src_uid": "3e1751a2990134f2132d743afe02a10e", "apr_id": "7539d074b8e093e6068d91e494096b8c", "difficulty": 1600, "tags": ["binary search", "number theory", "two pointers"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.41414141414141414, "equal_cnt": 7, "replace_cnt": 5, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 7, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text.RegularExpressions;\n\nnamespace Rextester\n{\n public class Program\n {\n public static void Main(string[] args)\n {\n int numeroSorte= int.Parse(Console.ReadLine()); // receber valor \n \t\t \tForcaBrruta(numeroSorte);\n //Console.ReadKey();\n }\n static void ForcaBrruta(int numSorte)\n\t\t{\n\t\tint indice =0;\n\t\tint [ ] Vetor = new int [100];\n\t\tint resultado = 0;\n\n\t\t\tfor( int i =0; i <= numSorte; i++)\n\t\t\t{\n\t\t\t\tif(NumeroSort(Convert.ToString(i)))\n\t\t\t\t{\n\t\t\t\t\tVetor[indice] = i;\n\t\t\t\t\tif(Vetor[indice] == numSorte)\n\t\t\t\t\t{\n\t\t\t\t\t\tresultado = indice;\n\t\t\t\t\t}\n\t\t\t\t\tindice++;\n\t\t\t\t}\n\t\t\t}\n\t\t\tConsole.WriteLine(resultado+1);\n\t\t}\n static bool NumeroSort(string x)\n\t\t{\n\t\t\tfor(int i = 0; i < x.Length; i++)\n\t\t\t{\n\t\t\t\tif(x[i] != '4' && x[i] != '7')\n\t\t\t\t\treturn(false);\n\t\t\t}\n\t\t\treturn (true);\n\t\t}\n }\n}", "lang": "Mono C#", "bug_code_uid": "a8c1a57a87698dd52818b74e687b8031", "src_uid": "6a10bfe8b3da9c11167e136b3c6fb2a3", "apr_id": "d1f219ad4914917cb7c4051b89b410ca", "difficulty": 1100, "tags": ["bitmasks", "brute force", "combinatorics", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.40830945558739257, "equal_cnt": 5, "replace_cnt": 4, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 5, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text.RegularExpressions;\n\nnamespace Rextester\n{\n public class Program\n {\n public static void Main(string[] args)\n {\n int numeroSorte= int.Parse(Console.ReadLine()); // receber valor \n \t\t \tForcaBrruta(numeroSorte);\n //Console.ReadKey();\n }\n static void ForcaBrruta(int numSorte)\n\t\t{\n\t\tint indice =0;\n\t\tint [ ] Vetor = new int [99999999];\n\t\tint resultado = 0;\n\n\t\t\tfor( int i =0; i <= numSorte; i++)\n\t\t\t{\n\t\t\t\tif(NumeroSort(Convert.ToString(i)))\n\t\t\t\t{\n\t\t\t\t\tVetor[indice] = i;\n\t\t\t\t\tif(Vetor[indice] == numSorte)\n\t\t\t\t\t{\n\t\t\t\t\t\tresultado = indice;\n\t\t\t\t\t}\n\t\t\t\t\tindice++;\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t\tConsole.WriteLine(resultado+1);\n\t\t}\n static bool NumeroSort(string x)\n\t\t{\n\t\t\tfor(int i = 0; i < x.Length; i++)\n\t\t\t{\n\t\t\t\tif(x[i] != '4' && x[i] != '7')\n\t\t\t\t\treturn(false);\n\t\t\t}\n\t\t\treturn (true);\n\t\t}\n }\n}", "lang": "Mono C#", "bug_code_uid": "3489286e38f45443364478c3bd3d2715", "src_uid": "6a10bfe8b3da9c11167e136b3c6fb2a3", "apr_id": "d1f219ad4914917cb7c4051b89b410ca", "difficulty": 1100, "tags": ["bitmasks", "brute force", "combinatorics", "implementation"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.644384221619994, "equal_cnt": 15, "replace_cnt": 6, "delete_cnt": 5, "insert_cnt": 4, "fix_ops_cnt": 15, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace Cod\n{\n class Program\n {\n static void Main(string[] args)\n {\n var nB = Console.ReadLine().Split(' ').Select(int.Parse).ToArray();\n var data = Console.ReadLine().Split(' ').Select(int.Parse).ToArray();\n var previousEven = data[0] % 2 == 0;\n // Первая часть до следующего разделителя\n var firstPart = true;\n var first = 1;\n var difs = new List();\n for (int i = 1; i < nB[0]; i++)\n {\n var currentEven = data[i] % 2 == 0;\n if (currentEven == previousEven)\n {\n first++;\n }\n else\n {\n // Это закончилась первая часть?\n if (firstPart)\n {\n firstPart = false;\n }\n first--;\n // Если закончилась вторая часть...\n if (first == 0 && i != nB[0] - 1)\n {\n // то ставим разделитель (если не конец).\n difs.Add(Math.Abs(data[i] - data[i+1]));\n firstPart = true;\n }\n }\n }\n var prices = difs.OrderBy(m=>m).ToArray();\n var sum = 0;\n var number = 0;\n foreach (var price in prices)\n {\n if (sum + price <= nB[1])\n {\n sum += price;\n number++;\n }\n else\n { \n break;\n }\n }\n Console.WriteLine(number);\n //Console.ReadKey();\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "43563bfd27b9b545d9e66a6ceec8ac8d", "src_uid": "b3f8e769ee7719ea5c9f458428b16a4e", "apr_id": "319c7764099f63844bd01f36da6232b1", "difficulty": 1200, "tags": ["dp", "greedy", "sortings"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.7958397534668721, "equal_cnt": 13, "replace_cnt": 4, "delete_cnt": 2, "insert_cnt": 7, "fix_ops_cnt": 13, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\n\nnamespace ConsoleApplication1\n{\n class Program\n {\n static void Main(string[] args)\n {\n var ha = Array.ConvertAll(Console.ReadLine().Split(' '), int.Parse);\n var hb = Array.ConvertAll(Console.ReadLine().Split(' '), int.Parse).ToList();\n var sum = 0;\n var totalbit = 0;\n if (ha[0] % 2 == 1) \n {\n Console.Write(sum);\n return;\n }\n for (int i = 1; i < ha[0]; i += 2)\n {\n if (i == ha[0] - 1) break;\n var listleft= hb.Take(i + 1).ToList();\n var listright = hb.Skip(i+1).ToList();\n if ((listleft.Count(a => a % 2 == 0) != listleft.Count(a => a % 2 != 0)) && (listright.Count(a => a % 2 == 0) != listright.Count(a => a % 2 != 0))) continue;\n if (Math.Abs(hb[i] - hb[i + 1]) + totalbit <= ha[1])\n {\n totalbit = totalbit + Math.Abs(hb[i] - hb[i + 1]);\n sum += 1;\n }\n }\n\n Console.Write(sum);\n }\n }\n}", "lang": "Mono C#", "bug_code_uid": "3200fe2707c53e870387e2f28683ded3", "src_uid": "b3f8e769ee7719ea5c9f458428b16a4e", "apr_id": "b7df65929a374b90117f2e7f19e88ef1", "difficulty": 1200, "tags": ["dp", "greedy", "sortings"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.984725050916497, "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.Text;\n\nnamespace Task\n{\n class Program\n {\n public static int[] b;\n public static int[] ans;\n public static int[] cnt = new int[10];\n\n static void Main(string[] args)\n {\n // Console.WriteLine((int)Math.Ceiling((double)10 / 3));\n // return;\n\n string str = Console.ReadLine();\n ans = new int[str.Length];\n foreach(char ch in str)\n {\n cnt[int.Parse(ch + \"\")]++;\n }\n\n str = Console.ReadLine();\n b = new int[str.Length];\n for (int i = 0; i < str.Length; i++)\n {\n b[i] = int.Parse(str[i] + \"\");\n }\n\n Rec(0, ans.Length == b.Length ? 1 : 2);\n for (int i = 0; i < ans.Length; i++)\n Console.Write(ans[i]);\n Console.WriteLine();\n }\n\n public static bool Rec(int pos, int stat/*1 или 2*/)\n {\n if (stat == 2)\n {\n for (int i = 9; i >= 0; i--)\n {\n while(cnt[i] > 0)\n {\n ans[pos++] = i;\n cnt[i]--;\n }\n }\n return true;\n } else\n {\n if (cnt[b[pos]] > 0)\n {\n cnt[b[pos]]--;\n ans[pos] = b[pos];\n bool res = Rec(pos + 1, stat);\n if (res) return true;\n cnt[b[pos]]++;\n }\n\n for (int i = b[pos] - 1; i >= 0; i--)\n {\n if (cnt[i] <= 0) continue;\n ans[pos] = i;\n cnt[i]--;\n return Rec(pos + 1, 2);\n }\n return false;\n }\n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "5f96e107d23a226471ae6574f79d6fc4", "src_uid": "bc31a1d4a02a0011eb9f5c754501cd44", "apr_id": "99b9403a8503615ab5394ea8a74c511a", "difficulty": 1700, "tags": ["dp", "greedy"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.9874776386404294, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\n\nnamespace ConsoleApplication16\n{\n class Program\n {\n static void Main(string[] args)\n {\n String word = Console.ReadLine();\n\n while(word.StartsWith(\"WUB\")) word.Substring(3);\n while (word.EndsWith(\"WUB\")) word.Substring(0, word.Length - 3);\n\n Console.WriteLine(String.Join(\" \", word.Split(new[] { \"WUB\" }, StringSplitOptions.RemoveEmptyEntries)));\n Console.ReadLine();\n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "b600748e19138f16d395ec0fac176cd7", "src_uid": "edede580da1395fe459a480f6a0a548d", "apr_id": "4a7ec7f88ec233c57f0c82fab216f6f2", "difficulty": 900, "tags": ["strings"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.9482645710543549, "equal_cnt": 9, "replace_cnt": 8, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 8, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace CavePainting\n{\n class Program\n {\n static void Main(string[] args)\n {\n var ints = Console.ReadLine().Split().Select(int.Parse);\n int n = ints.ElementAt(0), k = ints.ElementAt(1);\n\n List leftOvers = new List();\n int tmp;\n int i = 1;\n\n for ( ;i <= k; i++)\n {\n tmp = n % i;\n\n if (!leftOvers.Contains(tmp)) leftOvers.Add(tmp);\n else break;\n }\n\n if (i == k+1) Console.WriteLine(\"Yes\");\n else Console.WriteLine(\"No\");\n\n\n \n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "c749f42132b7cce67dab36d6bb9c3c79", "src_uid": "5271c707c9c72ef021a0baf762bf3eb2", "apr_id": "1054433d16e2cbad9e1bc402c3c5c18e", "difficulty": 1600, "tags": ["brute force", "number theory"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.44818871103622576, "equal_cnt": 13, "replace_cnt": 7, "delete_cnt": 2, "insert_cnt": 4, "fix_ops_cnt": 13, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\nclass Program {\n static void Main(string[] args) {\n int tt = int.Parse(Console.ReadLine());\n for (int qq = 1; qq <= tt; qq++) {\n int n = int.Parse(Console.ReadLine());\n int[] a = Console.ReadLine().Split().Select(token => int.Parse(token)).ToArray();\n int sum = 0;\n for (int i = 0; i < n; i++) {\n sum += a[i];\n }\n Console.WriteLine(\"Caso #{0}: {1}\", qq, sum);\n }\n }\n}\n\n", "lang": "Mono C#", "bug_code_uid": "3bc1085066b24e2ab6df631ed2dc32f5", "src_uid": "8a8013f960814040ac4bf229a0bd5437", "apr_id": "2c823d104a22990fa1fc019c199e6e8c", "difficulty": 900, "tags": ["math", "brute force", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9990406140070355, "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.Text;\nusing System.Threading.Tasks;\n\nnamespace B.Медвежонок_и_поиск_преступников\n{\n class Program\n {\n static void Main(string[] args)\n {\n string[] buffer = Console.ReadLine().Split(' ');\n int allTown = int.Parse(buffer[0]);\n int CurrentTown = int.Parse(buffer[1]);\n CurrentTown--;\n buffer = Console.ReadLine().Split(' ');\n int[] towns = new int[buffer.Length];\n for (int i = 0; i < buffer.Length; i++)\n {\n towns[i] = int.Parse(buffer[i]);\n }\n int summ = 0;\n if (towns[CurrentTown] == 1)\n {\n summ++;\n }\n int radius = 0;\n radius = Math.Min(CurrentTown, towns.Length - CurrentTown);\n for (int i = 1; i <= radius; i++)\n {\n if ((towns[CurrentTown - i] == towns[CurrentTown + i]) && (towns[CurrentTown - i] == 1))\n {\n summ += 2;\n }\n }\n for (int i = 0; i < CurrentTown-radius; i++)\n {\n if (towns[i] == 1)\n {\n summ++;\n }\n }\n for (int i = CurrentTown + radius + 1; i < towns.Length; i++)\n {\n if (towns[i] == 1)\n {\n summ++;\n }\n }\n Console.WriteLine(summ);\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "f4b994df196836c1a00ca5a006a269d0", "src_uid": "4840d571d4ce6e1096bb678b6c100ae5", "apr_id": "e1f274c63e3307d94dc6f58105723cba", "difficulty": 1000, "tags": ["constructive algorithms", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.9796039018622524, "equal_cnt": 4, "replace_cnt": 0, "delete_cnt": 2, "insert_cnt": 1, "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 ConsoleApplication21\n{\n class Program\n {\n static void Main(string[] args)\n {\n\n\n int[] arr = Console.ReadLine().Split().Select(E => int.Parse(E)).ToArray();\n int P = arr[1];\n int p = P - 1;\n int c = arr[0];\n int f = 0;\n int l = c - 1;\n int z = 0;\n string s=Console.ReadLine();\n s=s.Replace(\" \", \"\");\n char[] cities = s.ToCharArray();\n int p_i=p-1;\n int p__i=p+1;\n if (cities[p] == '1')\n {\n z++;\n }\n while (true)\n {\n if ( p_i >= 0 && p__i <= l)\n {\n if (cities[ p_i] == '1' &&cities[ p__i] == '1')\n {\n z += 2;\n \n }\n p__i++;\n p_i--;\n }\n else if (p_i >= 0 && p__i > l)\n {\n if (cities[ p_i] == '1')\n {\n z++;\n p__i++;\n p_i--;\n }\n }\n else if (p_i < 0 && p__i <= l)\n {\n if (cities[p__i] == '1')\n { z++; }\n\n\n p__i++;\n p_i--;\n }\n else { break; }\n\n \n\n\n\n\n }\n Console.WriteLine(z);\n \n\n\n\n\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "4c219449cd7a631ce9af5c33d3e08234", "src_uid": "4840d571d4ce6e1096bb678b6c100ae5", "apr_id": "6d87fd0fe042079a9ab9a79e98dd5e74", "difficulty": 1000, "tags": ["constructive algorithms", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "delete", "lang_cluster": "C#"} {"similarity_score": 0.2897625224506087, "equal_cnt": 23, "replace_cnt": 15, "delete_cnt": 3, "insert_cnt": 4, "fix_ops_cnt": 22, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace CF_Bear_and_Finding_Criminals\n{\n class Program\n {\n static void Main(string[] args)\n {\n string input = Console.ReadLine(); \n int NumberOfCities = int.Parse(input[0].ToString()) - 1 ;\n int OfficerPosition = int.Parse(input[2].ToString()) - 1 ;\n int count = 0 ;\n int condition;\n string Cities = Console.ReadLine() ;\n Cities = RemoveSpaces(Cities, ' ');\n\n \n \n if (NumberOfCities / 2 < OfficerPosition)\n condition = OfficerPosition;\n else condition = NumberOfCities - OfficerPosition; \n for ( int i = 0 ; i<= condition ; i++ )\n {\n if (OfficerPosition - i >= 0 )\n {\n if (OfficerPosition + i <= NumberOfCities)\n {\n if (Cities[OfficerPosition - i] == Cities[OfficerPosition + i] && Cities[OfficerPosition - i] == '1')\n {\n if (i != 0)\n count += 2;\n else count++; \n }\n }\n\n else if (Cities[OfficerPosition - i] == '1')\n count++; \n }\n else if (OfficerPosition + i <= NumberOfCities)\n {\n if (Cities [OfficerPosition + i]== '1')\n count += 1;\n }\n } // end for \n\n\n Console.WriteLine(count.ToString());\n Console.ReadLine(); \n }\n\n static string RemoveSpaces (string input , char SpaceType )\n {\n string output = \"\"; \n for (int i = 0 ; i< input.Length ; i++ )\n {\n if ( input[i] != SpaceType)\n output+= input[i].ToString(); \n }\n return output; \n \n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "23c74ee48cc0cb7a06e962fed1b17eb2", "src_uid": "4840d571d4ce6e1096bb678b6c100ae5", "apr_id": "6d60874238729468008c09757012dd9f", "difficulty": 1000, "tags": ["constructive algorithms", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9543033361368096, "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;\nusing System.Collections;\n\nnamespace Practice\n{\n class Program\n {\n static void Main(string[] args)\n {\n int [] inputs = GetInts();\n int[] criminals = GetInts();\n Console.WriteLine(SolveProblem(inputs, criminals));\n Console.ReadLine();\n\n }\n\n static int SolveProblem(int [] inputs, int [] criminals)\n {\n int noOfCriminals = 0;\n int i = inputs[1] - 1;\n int j = inputs[1] - 1;\n\n while (i < criminals.Length && j >= 0)\n {\n if (criminals [i] == criminals [j] && i != j && criminals [i] > 0)\n {\n noOfCriminals = noOfCriminals + 2;\n } else if (criminals[i] == criminals[j] && i == j && criminals[i] > 0)\n {\n noOfCriminals++;\n }\n i++;\n j--;\n }\n if (j < 0)\n {\n for (int m = i; m < criminals.Length;m++)\n {\n noOfCriminals += criminals[m];\n }\n }\n if (i == criminals.Length) {\n for (int m = j; m >= 0; m--)\n {\n m += criminals[m];\n }\n }\n\n return noOfCriminals;\n\n }\n\n static int[] GetInts()\n {\n string[] s = (Console.ReadLine()).Split(' ');\n int[] integers = new int[s.Length];\n for (int i = 0; i < s.Length; i++)\n {\n integers[i] = int.Parse(s[i]);\n }\n return integers;\n }\n\n }\n\n}\n", "lang": "Mono C#", "bug_code_uid": "584144bc94cd52ac33d771f0c58ece69", "src_uid": "4840d571d4ce6e1096bb678b6c100ae5", "apr_id": "f26af1feb0510fe3debe7a8b02e2dfef", "difficulty": 1000, "tags": ["constructive algorithms", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.8821641448876663, "equal_cnt": 10, "replace_cnt": 7, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 10, "bug_source_code": "using System;\nusing System.Text;\nusing System.Collections.Generic;\nusing System.Collections;\nusing System.Linq;\nclass Problem\n{\n static void Main()\n {\n //--------------------------------input--------------------------------//\n\n int n = Convert.ToInt32( Console.ReadLine() );\n var a = Array.ConvertAll( Console.ReadLine().Split(), Convert.ToInt32 );\n\n //--------------------------------solve--------------------------------//\n\n string s = String.Join( \"\", a );\n if(s.Contains( \"23\" ) || s.Contains( \"32\" ) ||s.Contains(\"11\")||s.Contains(\"22\")||s.Contains(\"33\"))\n Console.WriteLine( \"Infinite\" );\n else\n {\n Console.WriteLine( \"Finite\" );\n int kq = 0;\n for(int i = 0 ; i < n-1 ; i++)\n {\n if(a[i] + a[i + 1] == 3)\n kq += 3;\n if(a[i] + a[i + 1] == 4)\n kq += 4;\n }\n Console.WriteLine( kq );\n }\n\n }\n\n\n\n\n}", "lang": "Mono C#", "bug_code_uid": "2b7e20ef0726ef8103083178cdec01d9", "src_uid": "6c8f028f655cc77b05ed89a668273702", "apr_id": "b1d3d77c2327aa389fd7080aa2e6e7cb", "difficulty": 1400, "tags": ["geometry"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9970149253731343, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "using System.Collections.Generic;\nusing System.Collections;\nusing System.ComponentModel;\nusing System.Diagnostics.CodeAnalysis;\nusing System.Globalization;\nusing System.IO;\nusing System.Linq;\nusing System.Reflection;\nusing System.Runtime.Serialization;\nusing System.Text.RegularExpressions;\nusing System.Text;\nusing System;\nusing System.Numerics;\n\nclass Solution\n{\n static int? getCnt(int o, int i)\n {\n if (o == i)\n return null;\n if (o == 2 && i == 3 || o == 3 && i == 2)\n return null;\n\n if (o == 1)\n {\n return i == 2 ? 3 : 4;\n }\n else if (o == 2)\n {\n return 3;\n }\n else if (o == 3)\n {\n return 4;\n }\n return null;\n }\n\n static int? getCnt(int o, int i, int i2)\n {\n if (o ==3 && i ==1 && i2==2)\n {\n return 1;\n }\n \n return null;\n }\n\n static void Main(string[] args)\n {\n var n = int.Parse(Console.ReadLine().Trim());\n var arr = Array.ConvertAll(Console.ReadLine().Trim().Split(), int.Parse);\n\n int sum = 0;\n for (int i = 1; i < n; i++)\n {\n var v = getCnt(arr[i - 1], arr[i]);\n if (v == null)\n {\n Console.WriteLine(\"Infinite\");\n return;\n }\n sum+=v.Value;\n }\n\n for (int i = 2; i < n; i++)\n {\n var v = getCnt(arr[i - 1], arr[i]);\n if (v != null)\n {\n sum-=v.Value;\n }\n \n }\n\n Console.WriteLine(\"Finite\");\n Console.WriteLine(sum);\n\n }\n\n}", "lang": "Mono C#", "bug_code_uid": "60c82f99ddc7ba4ab1cac64690dfd6d9", "src_uid": "6c8f028f655cc77b05ed89a668273702", "apr_id": "ab7fd4888a60b2941235e9dc1f650bd0", "difficulty": 1400, "tags": ["geometry"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.820494945974207, "equal_cnt": 11, "replace_cnt": 5, "delete_cnt": 4, "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 A810\n{\n class Program\n {\n static void Main(string[] args)\n {\n string[] a = Console.ReadLine().Split();\n int n = int.Parse(a[0]);\n int k = int.Parse(a[1]);\n string[] b = Console.ReadLine().Split();\n int[] c = new int[n];\n for (int i = 0; i '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": "4520f47d3fdd2792c9a787ee5c034799", "src_uid": "c9d45dac4a22f8f452d98d05eca2e79b", "apr_id": "f0103a46d335a104bb0e8de2a74d57ec", "difficulty": 1800, "tags": ["dp", "number theory", "greedy", "math", "brute force"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.8435374149659864, "equal_cnt": 7, "replace_cnt": 6, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 6, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace cf58a\n{\n class Program\n {\n static void Main(string[] args)\n {\n string[] ss = Console.ReadLine().Split(' ');\n int n = int.Parse(ss[0]), m = int.Parse(ss[1]);\n int x = 0, left = 0;\n while (n > 0 || left >= m)\n x += left = n + left / m;\n Console.WriteLine(x);\n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "ad8d53dd40b257e9c8f953eab41069d7", "src_uid": "42b25b7335ec01794fbb1d4086aa9dd0", "apr_id": "d933c9a23bf4a97241da9e447a4e055f", "difficulty": 900, "tags": ["math", "brute force", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.44341801385681295, "equal_cnt": 11, "replace_cnt": 6, "delete_cnt": 4, "insert_cnt": 1, "fix_ops_cnt": 11, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace ConsoleApplication2\n{\n class Program\n {\n static int KDel(int n, int m)\n {\n int res = 0;\n for (int i = m; i <= n; i++)\n if (i % m == 0) res += 1;\n return res;\n }\n\n static void Main(string[] args)\n {\n string s = Console.ReadLine();\n int n = s[0] - (int)'0';\n int m = s[2] - (int)'0';\n\n int sum = n;\n int w = n;\n while (KDel(w, m) > 0)\n {\n sum += w / m;\n w = KDel(w, m);\n }\n\n Console.WriteLine(sum);\n\n Console.ReadLine();\n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "c5946708c00e54b911eb2981ebcf0c50", "src_uid": "42b25b7335ec01794fbb1d4086aa9dd0", "apr_id": "024f8f20a1e73bbd988d0c6173ce5b8c", "difficulty": 900, "tags": ["math", "brute force", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.8885272579332791, "equal_cnt": 7, "replace_cnt": 4, "delete_cnt": 2, "insert_cnt": 0, "fix_ops_cnt": 6, "bug_source_code": "using System;\n\nnamespace CSharp\n{\n class _343A\n {\n public static void Main()\n {\n var tokens = Console.ReadLine().Split();\n\n long a = long.Parse(tokens[0]);\n long b = long.Parse(tokens[1]);\n\n int count = 0;\n\n while (a != b)\n {\n if (a > b)\n {\n a -= b;\n }\n else\n {\n b -= a;\n }\n\n count++;\n }\n\n Console.WriteLine(count + a);\n }\n }\n}", "lang": "Mono C#", "bug_code_uid": "890cd1f79217c519887a67b886d8bab5", "src_uid": "792efb147f3668a84c866048361970f8", "apr_id": "e309009e75729414307ed4609f4a0b70", "difficulty": 1600, "tags": ["math", "number theory"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9604891815616181, "equal_cnt": 5, "replace_cnt": 0, "delete_cnt": 3, "insert_cnt": 1, "fix_ops_cnt": 4, "bug_source_code": "using System;\nnamespace codeforces\n{\n class Program\n {\n static void Main(string[] args)\n {\n string s =Console.ReadLine();\n \n while (s.Length != 0)\n {\n int count = int.Parse(s[s.Length - 1].ToString());\n string rez = \"\";\n int r = count % 10;\n if (r - 5 > 0)\n {\n r -= 5;\n rez += \"-O\";\n }\n else\n {\n rez += \"O-\";\n }\n int max = 5;\n int z = 4 - r;\n rez += \"|\";\n while (r != 0)\n {\n rez += \"O\";\n r--;\n max--;\n }\n rez += \"-\";\n while (z != 0)\n {\n rez += \"O\";\n z--;\n max--;\n }\n Console.WriteLine(rez);\n s=s.Substring(0,s.Length-1);\n }\n }\n }\n}\n\n", "lang": "Mono C#", "bug_code_uid": "dea5b5816944f2a5059b11a92e15e8c6", "src_uid": "c2e3aced0bc76b6484360563355d23a7", "apr_id": "3907263d3bddbabb902547e8afb825af", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "delete", "lang_cluster": "C#"} {"similarity_score": 0.9833333333333333, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 2, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "using System; using System.Linq;\n\nclass P {\n static void Main() { \n var str = Console.ReadLine();\n if (str.Count(char.IsLower) >= str.Count(char.IsUpper)) Console.Write(str.ToLowerCase());\n else Console.Write(str.ToUpperCase());\n }\n}", "lang": "MS C#", "bug_code_uid": "29a5957f38ce397195a5f81ae93f6169", "src_uid": "b432dfa66bae2b542342f0b42c0a2598", "apr_id": "3b506d5fe70d45c8c29e73eda26d5beb", "difficulty": 800, "tags": ["strings", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C#"} {"similarity_score": 0.019313304721030045, "equal_cnt": 13, "replace_cnt": 10, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 13, "bug_source_code": "\nMicrosoft Visual Studio Solution File, Format Version 12.00\n# Visual Studio 15\nVisualStudioVersion = 15.0.27004.2005\nMinimumVisualStudioVersion = 10.0.40219.1\nProject(\"{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}\") = \"CF59A\", \"CF59A\\CF59A.csproj\", \"{5A951B57-8DAD-4A7D-BDD3-FCC26F69FF67}\"\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{5A951B57-8DAD-4A7D-BDD3-FCC26F69FF67}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{5A951B57-8DAD-4A7D-BDD3-FCC26F69FF67}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{5A951B57-8DAD-4A7D-BDD3-FCC26F69FF67}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{5A951B57-8DAD-4A7D-BDD3-FCC26F69FF67}.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 = {E15CB28E-F46B-489C-9A88-192352E4FC30}\n\tEndGlobalSection\nEndGlobal\n", "lang": "MS C#", "bug_code_uid": "60c95100aa7a2b5bdfb326f6d133138e", "src_uid": "b432dfa66bae2b542342f0b42c0a2598", "apr_id": "455964971b36e06b86eafb6e82b5bf9d", "difficulty": 800, "tags": ["strings", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9804878048780488, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "//A. Is your horseshoe on the other hoof?\n#define TRY\n\nusing System;\nusing System.Collections.Generic;\nusing System.IO;\n\npublic class ArrayX\n{\n public static void Main ( )\n {\n#if TRY\n Console.SetIn ( new StreamReader ( @\"e:\\zin.txt\" ) );\n\n#endif\n solve ( );\n //Console.WriteLine ( solve ( ) );\n }\n\n private static void solve ( )\n {\n int[] ii = ReadLineToInts ( );\n Dictionary colors = new Dictionary ( );\n foreach ( int i in ii )\n {\n colors[i] = 1;\n }\n\n Console.WriteLine ( 4 - colors.Keys.Count );\n }\n\n public static string[] ReadLineToStrings ( )\n {\n string line = Console.ReadLine ( );\n string[] arStrings = line.Split ( new char[] { ' ' } );\n return arStrings;\n }\n\n public static int[] ReadLineToInts ( )\n {\n string line = Console.ReadLine ( );\n string[] arStrings = line.Split ( new char[] { ' ' } );\n\n int N = arStrings.Length;\n int[] ints = new int[N];\n for ( int i=0; i < N; i++ )\n ints[i] = int.Parse ( arStrings[i] );\n return ints;\n }\n\n\n}", "lang": "Mono C#", "bug_code_uid": "6acf09bbc6083dc6866e53205487aeb9", "src_uid": "38c4864937e57b35d3cce272f655e20f", "apr_id": "53c78e6e20951e7e35f30887d0eb6440", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C#"} {"similarity_score": 0.8478605388272583, "equal_cnt": 12, "replace_cnt": 5, "delete_cnt": 2, "insert_cnt": 4, "fix_ops_cnt": 11, "bug_source_code": "using System;\n\nnamespace CSharpEdu\n{\n class ClassCS\n {\n struct point\n {\n public int h;\n public int v;\n }\n static int abs (int x)\n {\n return x > 0 ? x : -x;\n }\n static void Main()\n {\n string s;\n int i, j, tmp;\n bool flag = false;\n point Imlookingfor1;\n for (i = 1; i <= 5; ++i)\n {\n s = Console.ReadLine();\n tmp = 0;\n for (j = 0; j ad)\n {\n up = bc - ad;\n down = bc;\n }\n else\n {\n up = ad - bc;\n down = ad;\n }\n for(int i = 2; i <= down; i++)\n {\n if(up%i==0 && down % i == 0)\n {\n up /= i;\n down /= i;\n }\n }\n if (up == 0) { down = 1; }\n Console.WriteLine(\"{0}/{1}\",up,down);\n }\n \n ", "lang": "Mono C#", "bug_code_uid": "2c17e7dae984a9bce7b44d166c1246f0", "src_uid": "b0f435fc2f7334aee0d07524bc37cb1e", "apr_id": "ec116d86d7befc9320210909b52a4a00", "difficulty": 1400, "tags": ["greedy", "math", "number theory"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.697632058287796, "equal_cnt": 30, "replace_cnt": 9, "delete_cnt": 2, "insert_cnt": 19, "fix_ops_cnt": 30, "bug_source_code": "using system;\n\npublic static void main()\n{\n int count, zeroCount;\n string binaryNumber;\n \n count = int.Parse(Console.ReadLine());\n binaryNumber = Console.ReadLine();\n \n for(int i = 0;i int.Parse(i)).ToArray();\n\n string ans = \"\";\n int n = int.Parse(Console.ReadLine());\n string s = Console.ReadLine();\n\n\n int start = s.IndexOf('1');\n int zeros = 0;\n for (int i = start; i < s.Length; i++)\n if (s[i] == '0')\n zeros++;\n\n ans = ans + \"1\";\n while (zeros != 0)\n {\n ans += \"0\";\n zeros--;\n }\n\n Console.WriteLine(ans);\n\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "b43deab6f5835d3ea4e81fd185062f8f", "src_uid": "ac244791f8b648d672ed3de32ce0074d", "apr_id": "55c6385b8c86b7c3b70fe1bcbea0f152", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.11910215300045808, "equal_cnt": 20, "replace_cnt": 15, "delete_cnt": 4, "insert_cnt": 2, "fix_ops_cnt": 21, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace ConsoleApplication11\n{\n class Program\n {\n static void Main(string[] args)\n {\n int n,b=0,m;\n int noll=0;\n\n n=int.Parse(Console.ReadLine());\n int s = int.Parse(Console.ReadLine());\n m = s;\n int[] a = new int[n];\n for(int i=0;i item == '0');\n if (!s.Contains(\"1\")) Console.WriteLine(s);\n else {\n \n \n\n Console.Write(\"1\");\n for (int i = 0; i < numZero; i++) Console.Write(\"0\");\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": "52426628047f9d522d812f9aca83aec0", "src_uid": "ac244791f8b648d672ed3de32ce0074d", "apr_id": "14d57ee9dfdf69c69992105ebebbc3a6", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C#"} {"similarity_score": 0.7381158167675022, "equal_cnt": 11, "replace_cnt": 9, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 10, "bug_source_code": "using System;\nusing System.Collections;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\nusing System.Text.RegularExpressions;\n\nnamespace Contest\n{\n class Program\n {\n static void Main(string[] args)\n {\n int n = Convert.ToInt32(Console.ReadLine().Split(), Convert.ToInt32);\n int[] a = new int[n];\n a[0] = 1;\n for (int i = 1; i < n; i++)\n a[i] = a[i - 1] + 4*i;\n Console.WriteLine(a[n-1]);\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "fa68af64498a3a605c8c0237a130c0df", "src_uid": "ac244791f8b648d672ed3de32ce0074d", "apr_id": "202efb405b9cb832b6558bac6ad59996", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.8742714404662781, "equal_cnt": 4, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Globalization;\nusing System.IO;\nusing System.Linq;\nusing System.Text;\n\n// (づ*ω*)づミ★゜・。。・゜゜・。。・゜☆゜・。。・゜゜・。。・゜\npublic class Solver\n{\n public object Solve()\n {\n string s = ReadToken();\n int ans = 0;\n int c = 0;\n for (int i = 0; i < s.Length; i++)\n {\n ans += (s.Length - i) * Math.Abs(s[i] - '0' - c);\n c = s[i] - '0';\n }\n\n return ans;\n }\n\n #region Main\n\n protected static TextReader reader;\n protected static TextWriter writer;\n\n static void Main()\n {\n#if DEBUG\n reader = new StreamReader(\"..\\\\..\\\\input.txt\");\n writer = Console.Out;\n //writer = new StreamWriter(\"..\\\\..\\\\output.txt\");\n#else\n reader = Console.In;\n writer = new StreamWriter(Console.OpenStandardOutput());\n#endif\n try\n {\n object result = new Solver().Solve();\n if (result != null)\n writer.WriteLine(result);\n }\n catch (Exception ex)\n {\n#if DEBUG\n Console.WriteLine(ex);\n#else\n throw;\n#endif\n }\n reader.Close();\n writer.Close();\n }\n\n #endregion\n\n #region Read/Write\n\n private static Queue currentLineTokens = new Queue();\n\n private static string[] ReadAndSplitLine()\n {\n return reader.ReadLine().Split(new[] { ' ', '\\t' }, StringSplitOptions.RemoveEmptyEntries);\n }\n\n public static string ReadToken()\n {\n while (currentLineTokens.Count == 0)\n currentLineTokens = new Queue(ReadAndSplitLine());\n return currentLineTokens.Dequeue();\n }\n\n public static int ReadInt()\n {\n return int.Parse(ReadToken());\n }\n\n public static long ReadLong()\n {\n return long.Parse(ReadToken());\n }\n\n public static double ReadDouble()\n {\n return double.Parse(ReadToken(), CultureInfo.InvariantCulture);\n }\n\n public static int[] ReadIntArray()\n {\n return ReadAndSplitLine().Select(int.Parse).ToArray();\n }\n\n public static long[] ReadLongArray()\n {\n return ReadAndSplitLine().Select(long.Parse).ToArray();\n }\n\n public static double[] ReadDoubleArray()\n {\n return ReadAndSplitLine().Select(s => double.Parse(s, CultureInfo.InvariantCulture)).ToArray();\n }\n\n public static int[][] ReadIntMatrix(int numberOfRows)\n {\n int[][] matrix = new int[numberOfRows][];\n for (int i = 0; i < numberOfRows; i++)\n matrix[i] = ReadIntArray();\n return matrix;\n }\n\n public static int[][] ReadAndTransposeIntMatrix(int numberOfRows)\n {\n int[][] matrix = ReadIntMatrix(numberOfRows);\n int[][] ret = new int[matrix[0].Length][];\n for (int i = 0; i < ret.Length; i++)\n {\n ret[i] = new int[numberOfRows];\n for (int j = 0; j < numberOfRows; j++)\n ret[i][j] = matrix[j][i];\n }\n return ret;\n }\n\n public static string[] ReadLines(int quantity)\n {\n string[] lines = new string[quantity];\n for (int i = 0; i < quantity; i++)\n lines[i] = reader.ReadLine().Trim();\n return lines;\n }\n\n public static void WriteArray(IEnumerable array)\n {\n writer.WriteLine(string.Join(\" \", array));\n }\n\n #endregion\n}", "lang": "MS C#", "bug_code_uid": "1431863f1aea2c0aa442a1433f0d12ff", "src_uid": "1b17a7b3b41077843ee1d6e0607720d6", "apr_id": "e5318fed9147f80de22d4f8fe2df3daf", "difficulty": 1800, "tags": ["divide and conquer", "dfs and similar", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9015625, "equal_cnt": 7, "replace_cnt": 3, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 6, "bug_source_code": "using System;\n\nnamespace Achill\n{\n class Program\n {\n static void Main(string[] args)\n {\n int k = int.Parse(Console.ReadLine());\n int l = int.Parse(Console.ReadLine()), res = 0;\n bool flag = k == l;\n while(k <= l && !flag)\n {\n k *= k;\n flag = k == l;\n ++res;\n }\n if(flag)\n {\n Console.WriteLine(\"YES\");\n Console.WriteLine(res);\n }\n else\n {\n Console.WriteLine(\"NO\");\n }\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "74a518f5da176a047b27f68c7023bad8", "src_uid": "8ce89b754aa4080e7c3b2c3b10f4be46", "apr_id": "7dc5164b6ea054aa587fe29a3b39eac0", "difficulty": 1000, "tags": ["math"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9025239338555265, "equal_cnt": 14, "replace_cnt": 4, "delete_cnt": 2, "insert_cnt": 8, "fix_ops_cnt": 14, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace ConsoleApplication1\n{\n class Program\n {\n static void Main(string[] args)\n {\n double k;\n int l;\n Boolean a = false;\n k = Int32.Parse(Console.ReadLine());\n l = Int32.Parse(Console.ReadLine());\n if (k == l)\n {\n Console.WriteLine(\"YES\");\n Console.WriteLine(0);\n }\n else\n {\n for (int i = 1; i < 191102979; i++)\n {\n k = k * k;\n if (k == l)\n {\n Console.WriteLine(\"YES\");\n Console.WriteLine(i);\n a = true;\n break;\n }\n }\n if (a == false)\n Console.WriteLine(\"NO\");\n }\n Console.Read();\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "3d16ac8d8fb135b9fd2c17ad20186450", "src_uid": "8ce89b754aa4080e7c3b2c3b10f4be46", "apr_id": "93ac11c7583ed3eb7494f4352f4c235c", "difficulty": 1000, "tags": ["math"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.9980023971234518, "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;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace ConsoleApplication1\n{\n class Program\n {\n static void Main(string[] args)\n {\n double k;\n int l;\n Boolean a = false;\n k = Int32.Parse(Console.ReadLine());\n l = Int32.Parse(Console.ReadLine());\n int m = (int)k;\n if (k == l)\n {\n Console.WriteLine(\"YES\");\n Console.WriteLine(0);\n }\n else if \n {\n for (int i = 1; i < 6911090; i++)\n {\n k = k * m;\n if (k >= l)\n {\n if (k == l)\n {\n Console.WriteLine(\"YES\");\n Console.WriteLine(i);\n a = true;\n }\n break;\n }\n else if (k > l)\n break;\n }\n if (a == false)\n Console.WriteLine(\"NO\");\n }\n Console.Read();\n }\n }\n}", "lang": "Mono C#", "bug_code_uid": "00fcb659621cacb9ac7a4ea6f89ebde2", "src_uid": "8ce89b754aa4080e7c3b2c3b10f4be46", "apr_id": "93ac11c7583ed3eb7494f4352f4c235c", "difficulty": 1000, "tags": ["math"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C#"} {"similarity_score": 0.9979975971165399, "equal_cnt": 3, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 1, "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 ConsoleApplication1\n{\n class Program\n {\n static void Main(string[] args)\n {\n double k;\n int l;\n Boolean a = false;\n k = Int32.Parse(Console.ReadLine());\n l = Int32.Parse(Console.ReadLine());\n int m = (int)k;\n if (k == l)\n {\n Console.WriteLine(\"YES\");\n Console.WriteLine(0);\n }\n else \n {\n for (int i = 1; i < 6911090; i++)\n {\n k = k * m;\n if (k >= l)\n {\n if (k == l)\n {\n Console.WriteLine(\"YES\");\n Console.WriteLine(i);\n a = true;\n }\n break;\n }\n else if (k > l)\n break;\n }\n if (a == false)\n Console.WriteLine(\"NO\");\n }\n Console.Read();\n }\n }\n", "lang": "Mono C#", "bug_code_uid": "2dbe963739cf834e6372c42bb3179598", "src_uid": "8ce89b754aa4080e7c3b2c3b10f4be46", "apr_id": "93ac11c7583ed3eb7494f4352f4c235c", "difficulty": 1000, "tags": ["math"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9700598802395209, "equal_cnt": 5, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 4, "fix_ops_cnt": 4, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\n\nnamespace run\n{\n class Program\n {\n\n\n static double Decim(int a, int b)\n {\n if (b != 0)\n return Convert.ToDouble(a) / Convert.ToDouble(b);\n else\n return 0;\n }\n\n static void Main(string[] args)\n {\n string s = Console.ReadLine().Trim();\n string[] arrS = s.Split(' ');\n int x = Convert.ToInt32(arrS[0]);\n int y = Convert.ToInt32(arrS[1]);\n int z = Convert.ToInt32(arrS[2]);\n int ra = 0, rb = 1, a, b;\n\n {\n double d = Decim(x, y);\n double minD = 99999;\n for (int i1 = 1; i1 <= z; i1++)\n {\n b = i1;\n a = Convert.ToInt32(Math.Truncate(d * b));\n if (Math.Abs(d - Decim(a, b)) < Math.Abs(minD))\n {\n minD = d - Decim(a, b);\n ra = a;\n rb = b;\n }\n if (a < d * b)\n {\n a++;\n if (Math.Abs(d - Decim(a, b)) < Math.Abs(minD))\n {\n minD = d - Decim(a, b);\n ra = a;\n rb = b;\n }\n }\n }\n }\n\n Console.WriteLine(ra.ToString() + @\"/\" + rb.ToString());\n Console.Read();\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "7929a6aae6fe661a02648f12e2f7b398", "src_uid": "827bc6f120aff6a6f04271bc84e863ee", "apr_id": "fc3f098b668c724ccf1445ed71364673", "difficulty": 1700, "tags": ["brute force", "implementation", "two pointers"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.9182530795072789, "equal_cnt": 18, "replace_cnt": 5, "delete_cnt": 6, "insert_cnt": 6, "fix_ops_cnt": 17, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.IO;\n\n\nnamespace Codeforce\n{\n\n class Program\n {\n static int[] parseInt(string s)\n {\n string[] temp = s.Split(' ');\n int[] res = new int[temp.Length];\n for (int i = 0; i < temp.Length; i++)\n {\n res[i] = Convert.ToInt32(temp[i]);\n }\n return res;\n }\n\n\n static int gcd(int a, int b)\n {\n\n int rem;\n if (b == 0)\n return a;\n\n while (true)\n {\n rem = a % b;\n if (rem == 0)\n break;\n\n a = b;\n b = rem;\n }\n return b;\n }\n\n static int lcm(int a, int b)\n {\n return (a / gcd(a, b) * b);\n }\n\n \n\n static void Main(string[] args)\n {\n var data = parseInt(Console.ReadLine());\n\n int resA = -1, resB = -1;\n double min = double.MaxValue;\n double x = data[0], y = data[1];\n for (int i = 1; i < data[2] + 1; i++)\n {\n double temp = (x * (double)i) / y;\n \n for (int j = (int)temp - 1; j < temp + 2; j++)\n {\n double t1 = Math.Abs((x / y) - (double)((double)j / (double)i));\n if (j >= 0 && t1 >= 0 && min > t1)\n {\n min = t1;\n resA = j;\n resB = i;\n }\n }\n }\n\n int g = gcd(resA, resB);\n\n Console.WriteLine(\"{0}/{1}\",resA / g, resB / g);\n }\n }\n}", "lang": "Mono C#", "bug_code_uid": "aeebabd67bf59e582b6c96a4375b0646", "src_uid": "827bc6f120aff6a6f04271bc84e863ee", "apr_id": "b0383c4b81c4a3b1763432d0bce5bb91", "difficulty": 1700, "tags": ["brute force", "implementation", "two pointers"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "delete", "lang_cluster": "C#"} {"similarity_score": 0.9186307519640853, "equal_cnt": 19, "replace_cnt": 4, "delete_cnt": 6, "insert_cnt": 8, "fix_ops_cnt": 18, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.IO;\n\n\nnamespace Codeforce\n{\n\n class Program\n {\n static int[] parseInt(string s)\n {\n string[] temp = s.Split(' ');\n int[] res = new int[temp.Length];\n for (int i = 0; i < temp.Length; i++)\n {\n res[i] = Convert.ToInt32(temp[i]);\n }\n return res;\n }\n\n\n static int gcd(int a, int b)\n {\n\n int rem;\n if (b == 0)\n return a;\n\n while (true)\n {\n rem = a % b;\n if (rem == 0)\n break;\n\n a = b;\n b = rem;\n }\n return b;\n }\n\n static int lcm(int a, int b)\n {\n return (a / gcd(a, b) * b);\n }\n\n \n\n static void Main(string[] args)\n {\n var data = parseInt(Console.ReadLine());\n\n int resA = -1, resB = -1;\n double min = double.MaxValue;\n double x = data[0], y = data[1];\n for (int i = 1; i < data[2] + 1; i++)\n {\n double temp = (int)(x * (double)i) / y;\n \n for (int j = temp - 1; j < temp + 2; j++)\n {\n double t1 = Math.Abs((x / y) - (double)((double)j / i));\n if (j >= 0 && t1 >= 0 && min > t1)\n {\n min = t1;\n resA = j;\n resB = i;\n }\n }\n }\n\n int g = gcd(resA, resB);\n\n Console.WriteLine(\"{0}/{1}\",resA / g, resB / g);\n }\n }\n}", "lang": "Mono C#", "bug_code_uid": "e2c8d49276b8cc54492ca85a1a842180", "src_uid": "827bc6f120aff6a6f04271bc84e863ee", "apr_id": "b0383c4b81c4a3b1763432d0bce5bb91", "difficulty": 1700, "tags": ["brute force", "implementation", "two pointers"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.9999593925119792, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "using System.Reflection;\nusing System.Runtime.CompilerServices;\nusing System.Runtime.InteropServices;\n\n// Управление общими сведениями о сборке осуществляется с помощью \n// набора атрибутов. Измените значения этих атрибутов, чтобы изменить сведения,\n// связанные со сборкой.\n\n// Параметр ComVisible со значением FALSE делает типы в сборке невидимыми \n// для COM-компонентов. Если требуется обратиться к типу в этой сборке через \n// COM, задайте атрибуту ComVisible значение TRUE для этого типа.\n\n// Следующий GUID служит для идентификации библиотеки типов, если этот проект будет видимым для COM\n\n// Сведения о версии сборки состоят из следующих четырех значений:\n//\n// Основной номер версии\n// Дополнительный номер версии \n// Номер сборки\n// Редакция\n//\n// Можно задать все значения или принять номера сборки и редакции по умолчанию \n// используя \"*\", как показано ниже:\n// [assembly: AssemblyVersion(\"1.0.*\")]\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\nusing System.IO;\nusing System.Numerics;\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace OJ\n{\n public partial class Program\n {\n public static List> genBitmasks(int n)\n {\n List> res = new List>();\n int maxPow = (1 << n);\n for (int i = 0; i < maxPow; i++)\n {\n List l = new List();\n for (int j = 0; j < n; j++)\n {\n l.Add((i >> j) % 2);\n }\n res.Add(l);\n }\n return res;\n }\n\n\n public static int gray_code(int n)\n {\n return n ^ (n >> 1);\n }\n\n public static int count_bits(int n)\n {\n int res = 0;\n for (; n > 0; n >>= 1)\n res += n & 1;\n return res;\n }\n\n public static List> genCombinations(int n, int k)\n {\n List> res = new List>();\n for (int i = 0; i < (1 << n); ++i)\n {\n int cur = i;\n if (count_bits(cur) == k)\n {\n List l = new List();\n for (int j = 0; j < n; ++j)\n {\n if ((cur >> j) % 2 == 1)\n {\n l.Add(j + 1);\n }\n }\n res.Add(l);\n }\n }\n return res;\n }\n\n\n static double polygoneSquare(List> fig)\n {\n double res = 0;\n for (int i = 0; i < fig.Count; i++)\n {\n Tuple p1 = i > 0 ? fig[i - 1] : fig[fig.Count - 1];\n Tuple p2 = fig[i];\n double add = (p1.Item1 - p2.Item1) * (p1.Item2 + p2.Item2);\n res += add;\n }\n return Math.Abs(res) / 2.0;\n }\n\n public static int fact(int n)\n {\n return n == 1 ? 1 : n * fact(n - 1);\n }\n\n public static List> genPermutations(int n)\n {\n List> res = new List>();\n List current = new List();\n for (int i = 0; i < n; i++)\n {\n current.Add(i + 1);\n }\n\n int numberOfPerms = fact(n);\n\n {\n List newList = new List();\n newList.AddRange(current);\n res.Add(newList);\n }\n\n for (int i = 0; i < numberOfPerms - 1; i++)\n {\n int j = n - 2;\n while (j != -1 && current[j] > current[j + 1]) j--;\n int k = n - 1;\n while (current[j] > current[k]) k--;\n {\n int temp = current[j];\n current[j] = current[k];\n current[k] = temp;\n }\n\n int l = j + 1, r = n - 1;\n while (l < r)\n {\n int temp = current[l];\n current[l] = current[r];\n current[r] = temp;\n l++;\n r--;\n }\n\n List newList = new List();\n newList.AddRange(current);\n res.Add(newList);\n }\n\n return res;\n }\n\n\n public static long C(int n, int k, long[] fs, long mod)\n {\n long nfact = fs[n];\n long nkFact = fs[n - k];\n long kFact = fs[k];\n\n long invnkFact = inv(nkFact, mod);\n long invkFact = inv(kFact, mod);\n\n long res = nfact;\n res = (res * invnkFact) % mod;\n res = (res * invkFact) % mod;\n return res;\n }\n\n public static long[] modFactorials(int maxN, long mod)\n {\n long[] factorials = new long[maxN+1];\n factorials[0] = 1;\n for (int i = 1; i <= maxN; i++)\n {\n factorials[i] = (factorials[i - 1] * i) % mod;\n }\n return factorials;\n }\n }\n}\n\nnamespace OJ\n{\n public partial class Program\n {\n public static int SolveDPInt(DP dp, params int[] args) {\n return 0;\n }\n\n public class DP\n {\n public class MultyArray\n {\n int n;\n int[] lens;\n E[] array;\n int[] ks;\n\n public MultyArray(params int[] lens)\n {\n n = lens.Length;\n\n this.lens = new int[n];\n for (int i = 0; i < n; i++)\n {\n this.lens[i] = lens[i] + 1;\n }\n\n ks = new int[n + 1];\n int prod = 1;\n for (int i = 0; i < n; i++)\n {\n ks[i] = prod;\n prod *= this.lens[i];\n }\n ks[n] = prod;\n\n array = new E[prod];\n }\n\n public int index(params int[] args)\n {\n int q = args.Length;\n int res = 0;\n for (int i = 0; i < q; i++)\n {\n res += args[i] * ks[i];\n }\n\n return res;\n }\n\n\n public E get(params int[] args)\n {\n return array[index(args)];\n }\n\n public void set(E value, params int[] args)\n {\n array[index(args)] = value;\n }\n\n\n public int _index(params int[] args)\n {\n int q = args.Length;\n\n\n int res = 0;\n for (int i = 0; i < q; i++)\n {\n res += (args[i] + (lens[i] >> 1)) * ks[i];\n }\n\n\n /*\n if (q == 2)\n {\n return (args[0] + (lens[0] << 1)) * ks[0] + (args[1] + (lens[1] >> 1)) * ks[1];\n }\n\n if(q == 1){\n return (args[0] + (lens[0] >> 1)) * ks[0];\n }\n\n if (q == 3)\n {\n return (args[0] + (lens[0] >> 1)) * ks[0] + (args[1] + (lens[1] >> 1)) * ks[1] + (args[2] + (lens[2] >> 1)) * ks[2];\n }\n\n if (q == 4)\n {\n return (args[0] + (lens[0] >> 1)) * ks[0] + (args[1] + (lens[1] >> 1)) * ks[1] + (args[2] + (lens[2] >> 1)) * ks[2] + (args[3] + (lens[3] >> 1)) * ks[3];\n }\n * */\n\n return res;\n }\n\n\n public E _get(params int[] args)\n {\n return array[_index(args)];\n }\n\n\n public void _set(E value, params int[] args)\n {\n array[_index(args)] = value;\n }\n\n public override string ToString()\n {\n StringBuilder res = new StringBuilder();\n return res.ToString();\n }\n }\n\n public delegate T Solve(DP dp, params int[] args);\n\n public MultyArray array;\n public MultyArray exist;\n public int[] lens;\n public int[] ks;\n\n private Solve solve;\n\n public DP(Solve solve, params int[] lens)\n {\n this.lens = lens;\n\n ks = new int[lens.Length + 1];\n int prod = 1;\n for (int i = 0; i < lens.Length; i++)\n {\n ks[i] = prod;\n prod *= this.lens[i] + 1;\n }\n ks[lens.Length] = prod;\n\n\n\n int[] newLens = new int[lens.Length];\n for (int i = 0; i < newLens.Length; i++)\n {\n newLens[i] = lens[i] * 2;\n }\n\n this.array = new MultyArray(newLens);\n this.exist = new MultyArray(newLens);\n\n this.solve = solve;\n }\n\n public T dp(params int[] args)\n {\n if (exist._get(args))\n {\n return array._get(args);\n }\n T value = solve(this, args);\n array._set(value, args);\n exist._set(true, args);\n return value;\n }\n\n public int[] indexToArgs(int index)\n {\n int[] res = new int[lens.Length];\n for (int i = 0; i < lens.Length; i++)\n {\n res[i] = (index / ks[i]) % (lens[i] + 1);\n }\n return res;\n }\n\n public int index(params int[] args)\n {\n int q = args.Length;\n int res = 0;\n for (int i = 0; i < q; i++)\n {\n res += args[i] * ks[i];\n }\n\n return res;\n }\n\n public T run(params int[] args)\n {\n int maxIndex = index(args);\n\n for (int i = 0; i <= maxIndex; i++)\n {\n int[] a = indexToArgs(i);\n dp(a);\n }\n\n return dp(args);\n }\n }\n }\n}\n\nnamespace OJ\n{\n public partial class Program\n {\n public static void print(List obj)\n {\n Console.Write(\"{\");\n for (int i = 0; i < obj.Count; i++)\n {\n print(obj[i]);\n }\n Console.Write(\"}\");\n }\n\n public static void print(ValueType obj)\n {\n Console.Write(obj + \" \");\n }\n\n public static void print(string obj)\n {\n Console.Write(obj + \" \");\n }\n\n public static void print(Type obj)\n {\n Console.Write(obj + \" \");\n }\n\n\n public static void print(Array obj)\n {\n Console.Write(\"[\");\n for (int i = 0; i < obj.Length; i++)\n {\n print(obj.GetValue(i));\n }\n Console.Write(\"]\");\n }\n\n public static void print(List obj)\n {\n Console.WriteLine(\"{\");\n for (int i = 0; i < obj.Count; i++)\n {\n print(obj[i]);\n Console.WriteLine();\n }\n Console.Write(\"}\");\n }\n\n public static void print(List obj)\n {\n Console.WriteLine(\"{\");\n for (int i = 0; i < obj.Count; i++)\n {\n print(obj[i]);\n Console.WriteLine();\n }\n Console.Write(\"}\");\n }\n\n public static void print(List> obj)\n {\n Console.WriteLine(\"{\");\n for (int i = 0; i < obj.Count; i++)\n {\n print(obj[i]);\n Console.WriteLine();\n }\n Console.Write(\"}\");\n }\n\n\n public static void print(object obj)\n {\n Console.Write(obj);\n Console.Write(\" \");\n }\n\n\n\n public static void println(List obj)\n {\n print(obj);\n Console.WriteLine();\n }\n\n public static void println(ValueType obj)\n {\n print(obj);\n Console.WriteLine();\n }\n\n public static void println(string obj)\n {\n print(obj);\n Console.WriteLine();\n }\n\n public static void println(Type obj)\n {\n print(obj);\n Console.WriteLine();\n }\n\n\n public static void println(Array obj)\n {\n print(obj);\n Console.WriteLine();\n }\n\n public static void println(List obj)\n {\n print(obj);\n Console.WriteLine();\n }\n\n\n public static void println(List obj)\n {\n print(obj);\n Console.WriteLine();\n }\n\n public static void println(List> obj)\n {\n print(obj);\n Console.WriteLine();\n }\n\n\n public static void println(object obj)\n {\n Console.Write(obj);\n Console.Write(\" \");\n }\n\n\n\n public class Scanner\n {\n List array = new List();\n int pos = 0;\n\n public Scanner(string text)\n {\n string[] sss = text.Split('\\n');\n for (int i = 0; i < sss.Length; i++ )\n {\n array.AddRange(sss[i].Split(' '));\n }\n }\n\n public Scanner()\n {\n while (true)\n {\n string next = Console.ReadLine();\n if (next != null && next.Length > 0)\n {\n array.AddRange(next.Split(' '));\n }\n else\n {\n break;\n }\n }\n }\n\n public int nextInt()\n {\n if (pos == array.Count)\n {\n throw new ArgumentException(\"Arguments are gone\");\n }\n int res = Int32.Parse(array[pos]);\n pos++;\n return res;\n }\n\n public long nextLong()\n {\n if (pos == array.Count)\n {\n throw new ArgumentException(\"Arguments are gone\");\n }\n long res = Int64.Parse(array[pos]);\n pos++;\n return res;\n }\n\n public string nextString()\n {\n if (pos == array.Count)\n {\n throw new ArgumentException(\"Arguments are gone\");\n }\n string res = array[pos];\n pos++;\n return res;\n }\n\n public char nextChar()\n {\n if (pos == array.Count)\n {\n throw new ArgumentException(\"Arguments are gone\");\n }\n char res = array[pos][0];\n pos++;\n return res;\n }\n\n public double nextDouble()\n {\n if (pos == array.Count)\n {\n throw new ArgumentException(\"Arguments are gone\");\n }\n double res = Double.Parse(array[pos]);\n pos++;\n return res;\n }\n\n public List nextArray(int n)\n {\n List res = new List();\n for (int i = 0; i < n; i++)\n {\n res.Add(nextInt());\n }\n return res;\n }\n\n public List nextArrayDouble(int n)\n {\n List res = new List();\n for (int i = 0; i < n; i++)\n {\n res.Add(nextDouble());\n }\n return res;\n }\n\n public List nextArrayString(int n)\n {\n List res = new List();\n for (int i = 0; i < n; i++)\n {\n res.Add(nextString());\n }\n return res;\n }\n }\n }\n}\n\nnamespace OJ\n{\n public partial class Program\n {\n public static int gcd(int a, int b)\n {\n if (b == 0)\n {\n return a;\n }\n else\n {\n return gcd(b, a % b);\n }\n }\n\n\n public static bool[] sieve(int bound)\n {\n bool[] array = new bool[bound + 1];\n for (int i = 2; i * i <= bound; i++)\n {\n if (!array[i])\n {\n for (int j = i + i; j <= bound; j += i)\n {\n array[j] = true;\n }\n }\n }\n return array;\n }\n\n public static long inv(long a, long mod)\n {\n long r = powmod(a, mod - 2, mod);\n return r;\n }\n\n public static List sieveList(int bound)\n {\n bool[] array = new bool[bound + 1];\n for (int i = 2; i * i <= bound; i++)\n {\n if (!array[i])\n {\n for (int j = i + i; j <= bound; j += i)\n {\n array[j] = true;\n }\n }\n }\n\n List a = new List();\n for (int i = 2; i < bound + 1; i++)\n {\n if (!array[i])\n {\n a.Add(i);\n }\n }\n\n return a;\n }\n\n\n\n public static List factorize(int n, List primeList)\n {\n List res = new List();\n for (int j = 0; j < primeList.Count; j++)\n {\n int i = primeList[j];\n if (n % i == 0)\n {\n int[] comp = new int[] { i, 1 };\n n /= i;\n while (n % i == 0)\n {\n comp[1] = comp[1] + 1;\n n /= i;\n }\n res.Add(comp);\n }\n }\n\n if (n > 1)\n {\n res.Add(new int[] { n, 1 });\n }\n return res;\n }\n\n\n public static List factorize(int n)\n {\n List res = new List();\n int sqrt = (int)Math.Sqrt(n)+1;\n for (int j = 2; j < sqrt; j++)\n {\n if (n % j == 0)\n {\n int[] comp = new int[] { j, 1 };\n n /= j;\n while (n % j == 0)\n {\n comp[1] = comp[1] + 1;\n n /= j;\n }\n res.Add(comp);\n }\n }\n\n if (n > 1)\n {\n res.Add(new int[] { n, 1 });\n }\n return res;\n }\n\n public static List genDivisors(int n)\n {\n List res = new List();\n int root = (int)(Math.Sqrt(n) + 1);\n for (int i = 1; i < root; i++)\n {\n if (n % i == 0)\n {\n if (n / i != i)\n {\n res.Add(i);\n res.Add(n / i);\n }\n else\n {\n res.Add(i);\n }\n }\n }\n return res;\n }\n\n }\n}\n\nnamespace OJ\n{\n public partial class Program\n {\n //public static Scanner sc = new Scanner(File.ReadAllText(\"input.txt\"));\n public static Scanner sc = new Scanner();\n\n static int rank(char a)\n {\n if(a == '6'){\n return 6;\n }\n\n if (a == '7')\n {\n return 7;\n }\n\n if (a == '8')\n {\n return 8;\n }\n\n if (a == '9')\n {\n return 9;\n }\n\n if (a == 'T')\n {\n return 10;\n }\n\n if (a == 'J')\n {\n return 11;\n }\n\n if (a == 'Q')\n {\n return 12;\n }\n\n if (a == 'K')\n {\n return 13;\n }\n\n if (a == 'A')\n {\n return 14;\n }\n\n return -1;\n }\n\n static void Main(string[] args)\n {\n string koz = sc.nextString();\n string a = sc.nextString();\n string b = sc.nextString();\n\n if(a[1] == koz[0]){\n if(b[1] != koz[1]){\n Console.WriteLine( \"YES\");\n }\n else\n {\n if(rank(a[0]) > rank(b[0])){\n Console.WriteLine(\"YES\");\n }\n else\n {\n Console.WriteLine(\"NO\");\n }\n }\n }\n else{\n if(a[1] == b[1]){\n if (rank(a[0]) > rank(b[0]))\n {\n Console.WriteLine(\"YES\");\n }\n else\n {\n Console.WriteLine(\"NO\");\n }\n }\n else\n {\n Console.WriteLine(\"NO\");\n }\n }\n }\n }\n}\n\nnamespace OJ\n{\n public partial class Program\n {\n public static T min(T first, params T[] array) where T : IComparable\n {\n T res = first;\n for (int i = 0; i < array.Length; i++)\n {\n if (array[i].CompareTo(res) < 0)\n {\n res = array[i];\n }\n }\n return res;\n }\n\n public static T max(T first, params T[] array) where T : IComparable\n {\n T res = first;\n for (int i = 0; i < array.Length; i++)\n {\n if (array[i].CompareTo(res) > 0)\n {\n res = array[i];\n }\n }\n return res;\n }\n\n\n public static long pow(long a, long n)\n {\n long res = 1;\n while (n > 0)\n {\n if (n % 2 == 1)\n res = (a * res);\n a = (a * a);\n n >>= 1;\n }\n return res;\n }\n\n\n\n public static long powmod(long a, long n, long mod)\n {\n long res = 1;\n while (n>0)\n {\n if (n % 2 == 1)\n res = (a * res) % mod;\n a = (a * a) % mod;\n n >>= 1;\n }\n return res;\n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "bfe55e69756a79c3807f076e9205f9b8", "src_uid": "da13bd5a335c7f81c5a963b030655c26", "apr_id": "5324e8ae1100edd2f7c74be7c4ce0322", "difficulty": 1000, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.8940336023283503, "equal_cnt": 32, "replace_cnt": 20, "delete_cnt": 10, "insert_cnt": 3, "fix_ops_cnt": 33, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\n\nnamespace Game\n{\n class Card\n {\n public string ValueCard { get; set; }\n public string LearCard { get; set; }\n public bool Trump { get; set; }\n\n public static bool Calculation(Card card1, Card card2, string trump)\n {\n bool status = false;\n\n //присвоение статуса \"козырь\"\n if (card1.LearCard == trump)\n card1.Trump = true;\n if (card2.LearCard == trump)\n card2.Trump = true;\n\n //вариант 1\n //если первая козырь, а вторая нет, то\n if (card1.Trump == true && card2.Trump == false)\n {\n status = true;\n }\n //вариант 2\n //если вторая козырь, а первая нет, то\n if (card1.Trump == false && card2.Trump == true)\n {\n status = false;\n }\n\n //вариант 3\n //если карты не козыри, а первая другой масти\n\n if (card1.Trump == false && card2.Trump == false)\n {\n if (card1.LearCard != card2.LearCard)\n status = false;\n }\n\n //если масти одинаковы\n if (card1.LearCard == card2.LearCard)\n {\n int ind1 = card1.GetCoefficient();\n int ind2 = card2.GetCoefficient();\n\n if (card1.GetCoefficient() > card2.GetCoefficient())\n {\n status = true;\n } \n }\n return status;\n }\n\n public int GetCoefficient()\n {\n int coef = new int();\n switch (this.ValueCard)\n {\n case \"6\": coef = 1;\n break;\n case \"7\": coef = 2;\n break;\n case \"8\": coef = 3;\n break;\n case \"9\": coef = 4;\n break;\n case \"10\": coef = 5;\n break;\n case \"В\": coef = 6;\n break;\n case \"Д\": coef = 7;\n break;\n case \"К\": coef = 8;\n break;\n case \"Т\": coef = 9;\n break;\n default:\n break;\n }\n return coef;\n }\n }\n\n class Program\n {\n static void Main(string[] args)\n {\n bool work = true;\n \n while (work == true)\n {\n\n // Console.Write(\"Введите масть козыря одной заглавной буквой.\\r\\nКрести, вини, черви, буби - К, В, Ч, Б - соответственно.\\r\\nКозырь: \");\n //масть\n string learTrump = Console.ReadLine();\n\n //Console.WriteLine(\"\\r\\nВведите достоинство карт.\\r\\nНапример, король червей - КЧ, восмёрка крестей - 8К\");\n //Console.Write(\"Карта №1: \");\n string strCard1 = Console.ReadLine();//карта 1\n\n // Console.Write(\"Карта №2: \");\n string strCard2 = Console.ReadLine();//карта 2\n\n Card card1 = new Card { ValueCard = strCard1[0].ToString(), LearCard = strCard1[1].ToString() };\n Card card2 = new Card { ValueCard = strCard2[0].ToString(), LearCard = strCard2[1].ToString() };\n\n bool result = Card.Calculation(card1, card2, learTrump);\n\n if (result) \n Console.WriteLine(\"YES\");\n else\n Console.WriteLine(\"NO\"); \n Console.ReadKey();\n }\n }\n }\n}", "lang": "MS C#", "bug_code_uid": "0050340d67693b92a338a65c5607dc58", "src_uid": "da13bd5a335c7f81c5a963b030655c26", "apr_id": "8588dc8d2f19575fdd781221f831b0db", "difficulty": 1000, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.8841346153846154, "equal_cnt": 34, "replace_cnt": 16, "delete_cnt": 14, "insert_cnt": 5, "fix_ops_cnt": 35, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\n\nnamespace Game\n{\n class Card\n {\n public string ValueCard { get; set; }\n public string LearCard { get; set; }\n public bool Trump { get; set; }\n\n public static bool Calculation(Card card1, Card card2, string trump)\n {\n bool status = false;\n\n //присвоение статуса \"козырь\"\n if (card1.LearCard == trump)\n card1.Trump = true;\n if (card2.LearCard == trump)\n card2.Trump = true;\n\n //вариант 1\n //если первая козырь, а вторая нет, то\n if (card1.Trump == true && card2.Trump == false)\n {\n status = true;\n }\n //вариант 2\n //если вторая козырь, а первая нет, то\n if (card1.Trump == false && card2.Trump == true)\n {\n status = false;\n }\n\n //вариант 3\n //если карты не козыри, а первая другой масти\n\n if (card1.Trump == false && card2.Trump == false)\n {\n if (card1.LearCard != card2.LearCard)\n status = false;\n }\n\n //если масти одинаковы\n if (card1.LearCard == card2.LearCard)\n {\n int ind1 = card1.GetCoefficient();\n int ind2 = card2.GetCoefficient();\n\n if (card1.GetCoefficient() > card2.GetCoefficient())\n {\n status = true;\n }\n }\n return status;\n }\n\n public int GetCoefficient()\n {\n int coef = new int();\n switch (this.ValueCard)\n {\n case \"6\": coef = 1;\n break;\n case \"7\": coef = 2;\n break;\n case \"8\": coef = 3;\n break;\n case \"9\": coef = 4;\n break;\n case \"10\": coef = 5;\n break;\n case \"В\": coef = 6;\n break;\n case \"Д\": coef = 7;\n break;\n case \"К\": coef = 8;\n break;\n case \"Т\": coef = 9;\n break;\n default:\n break;\n }\n return coef;\n }\n }\n\n class Program\n {\n static void Main(string[] args)\n {\n bool work = true;\n\n while (work == true)\n {\n\n // Console.Write(\"Введите масть козыря одной заглавной буквой.\\r\\nКрести, вини, черви, буби - К, В, Ч, Б - соответственно.\\r\\nКозырь: \");\n //масть\n\n string learTrump = Console.ReadLine();\n\n //Console.WriteLine(\"\\r\\nВведите достоинство карт.\\r\\nНапример, король червей - КЧ, восмёрка крестей - 8К\");\n //Console.Write(\"Карта №1: \");\n\n string cards = Console.ReadLine();\n int indexProbel = cards.IndexOf(' ');\n int indexPospeProbela = cards.Length - indexProbel - 1;\n string strCard1 = cards.Substring(0, indexProbel);\n\n // Console.Write(\"Карта №2: \");\n string strCard2 = cards.Substring(indexProbel + 1, indexPospeProbela);\n\n Card card1;\n Card card2;\n\n if (strCard1.Length == 3)\n {\n card1 = new Card { ValueCard = strCard1[0].ToString() +strCard1[1].ToString() , LearCard = strCard1[2].ToString() };\n }\n else\n {\n card1 = new Card { ValueCard = strCard1[0].ToString(), LearCard = strCard1[1].ToString() };\n }\n\n if (strCard2.Length == 3)\n {\n card2 = new Card { ValueCard = strCard2[0].ToString() + strCard2[1].ToString(), LearCard = strCard2[2].ToString() };\n }\n else\n {\n card2 = new Card { ValueCard = strCard2[0].ToString(), LearCard = strCard2[1].ToString() };\n } \n \n\n bool result = Card.Calculation(card1, card2, learTrump);\n\n if (result)\n Console.WriteLine(\"YES\");\n else\n Console.WriteLine(\"NO\");\n \n }\n }", "lang": "MS C#", "bug_code_uid": "0e514dbd50498e75a405c80949e0fc62", "src_uid": "da13bd5a335c7f81c5a963b030655c26", "apr_id": "8588dc8d2f19575fdd781221f831b0db", "difficulty": 1000, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.4297994269340974, "equal_cnt": 13, "replace_cnt": 4, "delete_cnt": 0, "insert_cnt": 9, "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 ConsoleApplication1\n{\n \n class Program\n {\n\n static void Main(string[] args)\n {\n long[] s = Console.ReadLine().Split().Select(long.Parse).ToArray();\n long n = s[0], m = s[1], k = s[2], ans = 0, mod = 1000000009,z=0, er=n-m ;\n bool b = false;\n for (long i = 1; i <= n; i++)\n {\n z++;\n if (i == (n - k * er + 1))\n b = true;\n if (z < k)\n {\n ans=(ans+1)%mod;\n }\n else\n {\n if (b == true)\n {\n z = 0;\n }\n else\n {\n ans = (ans + 1) * 2%mod;\n z = 0;\n }\n }\n }\n if (m == 0) ans = 0;\n Console.WriteLine(ans%mod);\n // Console.Read();\n }\n }", "lang": "MS C#", "bug_code_uid": "0b65fbd695b0a8e86588a0968002d5c2", "src_uid": "9cc1aecd70ed54400821c290e2c8018e", "apr_id": "a89fc193955068538adc3bbe395f5d7d", "difficulty": 1600, "tags": ["matrices", "number theory", "greedy", "math", "binary search"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.9813374805598756, "equal_cnt": 5, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 4, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\n\nnamespace K.Factorization\n{\n class Program\n {\n static void Main(string[] args)\n {\n var input = Console.ReadLine().Split(' ').Select(s => int.Parse(s)).ToArray();\n List primeNumbers = new List();\n var number = input[0];\n var factors = input[1];\n\n for (int b = 2; number > 1; b++)\n {\n if (number % b == 0)\n {\n while (number % b == 0)\n {\n number /= b;\n primeNumbers.Add(b);\n }\n }\n }\n\n if (primeNumbers.Count() < factors) Console.WriteLine(-1);\n else\n {\n StringBuilder message = new StringBuilder();\n for (int i = 0; i < factors - 1; i++)\n {\n message.Append(primeNumbers[i] + \" \");\n primeNumbers.RemoveAt(i);\n }\n message.Append(primeNumbers.Aggregate(1, (accum, current) => accum * current));\n Console.WriteLine(message.ToString());\n }\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "2e8e1abaec9c189d2ab718462670503b", "src_uid": "bd0bc809d52e0a17da07ccfd450a4d79", "apr_id": "34ff98ef7d1adb66da9c7fd92a1c39f2", "difficulty": 1100, "tags": ["number theory", "math", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.8464980069958513, "equal_cnt": 27, "replace_cnt": 16, "delete_cnt": 8, "insert_cnt": 3, "fix_ops_cnt": 27, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Globalization;\nusing System.IO;\nusing System.Linq;\n\nnamespace Codeforces_Round_353__Div_2_\n{\n static class B\n {\n public static void Solve()\n {\n int n = ReadInt();\n int a = ReadInt();\n int b = ReadInt();\n int c = ReadInt();\n int d = ReadInt();\n int[] sums = new[] {a + b, a + c, c + d, b + d};\n int maxSum = 0;\n int minSum = n + n;\n for (int i = 0; i < 4; i++)\n {\n if (sums[i] > maxSum)\n maxSum = sums[i];\n if (sums[i] < minSum)\n minSum = sums[i];\n }\n int numOfQuads = 0;\n for (int middleNum = 1; middleNum <= n; middleNum++)\n {\n for (int i = 1; i <= n; i++)\n {\n int maxSumWithRest = maxSum + middleNum + i;\n if (maxSumWithRest - (minSum + middleNum) <= n)\n {\n numOfQuads++;\n }\n else\n {\n break;\n }\n }\n }\n Write(numOfQuads);\n\n //int[] ar = new[] {a, b, d, c};\n //int maxnum = 0;\n //int maxnumpair = 0;\n //int num1 = 0;\n //int num2 = 0;\n //for (int i = 0; i < 4; i++)\n //{\n // if (ar[i] > maxnum)\n // {\n // maxnum = ar[i];\n // num1 = i;\n // }\n\n //}\n //if (num1 == 0)\n //{\n // if (ar[(num1 + 1)%4] > ar[3])\n // {\n // maxnumpair = maxnum + ar[(num1 + 1)%4];\n // num2 = (num1 + 1)%4;\n // }\n // else\n // {\n // maxnumpair = maxnum + ar[3];\n // num2 = ar[3];\n // }\n //}\n //else\n //{\n // if (ar[(num1 + 1) % 4] > ar[num1-1])\n // {\n // maxnumpair = maxnum + ar[(num1 + 1) % 4];\n // num2 = (num1 + 1)%4;\n // }\n // else\n // {\n // maxnumpair = maxnum + ar[num1-1];\n // num2 = num1 - 1;\n // }\n //}\n //int middleNum = 1;\n //while (true)\n //{\n // for (int i = 1; i < n; i++)\n // {\n // int sum = maxnumpair + middleNum + i;\n // }\n // middleNum++;\n //}\n\n }\n\n #region -- Main -- \n\n private static TextReader reader;\n private static TextWriter writer;\n\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 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\n private static Queue currentLineTokens = new Queue();\n\n private static string[] ReadAndSplitLine()\n {\n return reader.ReadLine().Split(new[] { ' ', '\\t', }, StringSplitOptions.RemoveEmptyEntries);\n }\n\n public static string ReadToken()\n {\n while (currentLineTokens.Count == 0) currentLineTokens = new Queue(ReadAndSplitLine());\n return currentLineTokens.Dequeue();\n }\n\n public static int ReadInt()\n {\n return int.Parse(ReadToken());\n }\n\n public static long ReadLong()\n {\n return long.Parse(ReadToken());\n }\n\n public static double ReadDouble()\n {\n return double.Parse(ReadToken(), CultureInfo.InvariantCulture);\n }\n\n public static int[] ReadIntArray()\n {\n return ReadAndSplitLine().Select(int.Parse).ToArray();\n }\n\n public static long[] ReadLongArray()\n {\n return ReadAndSplitLine().Select(long.Parse).ToArray();\n }\n\n public static double[] ReadDoubleArray()\n {\n return ReadAndSplitLine().Select(s => double.Parse(s, CultureInfo.InvariantCulture)).ToArray();\n }\n\n public static int[][] ReadIntMatrix(int numberOfRows)\n {\n int[][] matrix = new int[numberOfRows][];\n for (int i = 0; i < numberOfRows; i++) matrix[i] = ReadIntArray();\n return matrix;\n }\n\n public static int[][] ReadAndTransposeIntMatrix(int numberOfRows)\n {\n int[][] matrix = ReadIntMatrix(numberOfRows);\n int[][] ret = new int[matrix[0].Length][];\n for (int i = 0; i < ret.Length; i++)\n {\n ret[i] = new int[numberOfRows];\n for (int j = 0; j < numberOfRows; j++) ret[i][j] = matrix[j][i];\n }\n return ret;\n }\n\n public static string[] ReadLines(int quantity)\n {\n string[] lines = new string[quantity];\n for (int i = 0; i < quantity; i++) lines[i] = reader.ReadLine().Trim();\n return lines;\n }\n\n public static void WriteArray(IEnumerable array)\n {\n writer.WriteLine(string.Join(\" \", array));\n }\n\n public static void Write(params object[] array)\n {\n WriteArray(array);\n }\n public static void WriteLines(IEnumerable array)\n {\n foreach (var a in array) writer.WriteLine(a);\n }\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()\n {\n var ret = new T[size];\n for (int i = 0; i < size; i++) ret[i] = new T();\n return ret;\n }\n #endregion\n }\n}\n", "lang": "MS C#", "bug_code_uid": "9279e49310091273a568263bbaa26ae4", "src_uid": "b732869015baf3dee5094c51a309e32c", "apr_id": "f273efef1fb11e6236e8f5a170621b0e", "difficulty": 1400, "tags": ["brute force", "math", "constructive algorithms"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9960518894529047, "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\nnamespace CSharp\n{\n class _322B\n {\n public static void Main()\n {\n var flowers = Console.ReadLine().Split().Select(token => int.Parse(token)).ToArray();\n var remainders = flowers.Select(count => count % 3).OrderBy(r => r).ToArray();\n\n if (remainders.Distinct().Count() == 1)\n {\n Console.WriteLine(flowers.Sum() / 3);\n }\n else if (remainders[1] == 2)\n {\n Console.WriteLine(Math.Sign(flowers.First(count => count % 3 == 0)) + flowers.Sum(count => count / 3));\n }\n else if (remainders[0] == 0)\n {\n Console.WriteLine(flowers.Sum(count => count / 3));\n }\n else\n {\n Console.WriteLine(flowers.Sum() / 3);\n }\n }\n }\n}", "lang": "Mono C#", "bug_code_uid": "7bc808df4bdeb6e252eaa53633fa29a2", "src_uid": "acddc9b0db312b363910a84bd4f14d8e", "apr_id": "771387f595e7ab7fce339cbd40f24275", "difficulty": 1600, "tags": ["math", "combinatorics"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9991830065359477, "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 ConsoleApplication1\n{\n class Program\n {\n static void Main(string[] args)\n {\n var n = int.Parse(Console.ReadLine());\n var cntPrimes = n/2 + 1;\n var isNotPrime = new bool[cntPrimes];\n isNotPrime[0] = true;\n isNotPrime[1] = true;\n var primes = new List();\n for (int i = 2; i < cntPrimes; i++)\n {\n if(isNotPrime[i])\n continue;\n primes.Add(i);\n for (int j = i * i; j < cntPrimes; j += i)\n isNotPrime[j] = true; \n }\n\n var res = 0;\n for (int i = 6; i <= n; i++)\n {\n var cnt = 0;\n for (int j = 0; j < primes.Count; j++)\n {\n if (i%primes[j] == 0)\n cnt++;\n if(cnt > 2)\n break;\n }\n\n if (cnt == 2)\n res++;\n }\n\n Console.WriteLine(res);\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "320eda1dd30c4dcaef3552f40af7aad8", "src_uid": "356666366625bc5358bc8b97c8d67bd5", "apr_id": "b176a970df9277f3ed5ce81008124b87", "difficulty": 900, "tags": ["number theory"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9737687366167024, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "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 TaskB\n{\n class Program\n {\n static void Main(string[] args)\n {\n var arr = Console.ReadLine().Split(' ').Select(x => Convert.ToInt32(x)).ToArray();\n var n = arr[0];\n var m = arr[1];\n var k = arr[2];\n\n k = Math.Min(k, n + 1 - k);\n\n var kol = n;\n var kolFrodo = 1;\n \n int i = 1;\n \n while (kol < m && i <= k)\n {\n kolFrodo ++;\n kol = kol + 2 * i - 1;\n i++;\n }\n\n //слева закончили или подушки закончились\n if (kol == m)\n {\n Console.Write(kolFrodo);\n return;\n }\n\n if (kol > m)\n {\n kolFrodo--;\n Console.Write(kolFrodo);\n return;\n }\n\n //kol < m, идем вправо\n i = 1;\n while (kol < m && i <= n - 2 * k + 1)\n {\n kolFrodo++;\n kol = kol + 2*k + i - 1;\n i++;\n }\n\n //справа закончили или подушки закончились\n if (kol == m)\n {\n Console.Write(kolFrodo);\n return;\n }\n\n if (kol > m)\n {\n kolFrodo--;\n Console.Write(kolFrodo);\n return;\n }\n\n //kol < m, теперь добавляем константно по n штук\n while (kol + n <= m)\n {\n kolFrodo++;\n kol = kol + n;\n }\n \n\n Console.Write(kolFrodo);\n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "b4d823ba8f1d661e6d25f32df8d5fe9c", "src_uid": "da9ddd00f46021e8ee9db4a8deed017c", "apr_id": "c37e2a20fda889ab87e6b85498ee8615", "difficulty": 1500, "tags": ["greedy", "binary search"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.9865073245952197, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 3, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Diagnostics;\nusing System.IO;\nusing System.Linq;\nusing System.Text;\n\nnamespace AprilFools\n{\n internal class Program\n {\n private const string TestIn = @\"..\\..\\In\\Text.in\";\n private const string TestOut = @\"..\\..\\In\\Text.out\";\n\n\n private static void Solve()\n {\n var nums = ReadIntArray();\n var n = nums[0];\n var k = nums[1];\n var nk = n - k;\n var nmul = nk;\n var kmul = k;\n\n\n // factorial n\n long kf = kmul;\n while (--k > 1)\n {\n kf *= kmul;\n kf = kf%1000000007;\n }\n\n\n\n long nkp = nk;\n while (--nk > 0)\n {\n nkp *= nmul;\n nkp = nkp%1000000007;\n }\n\n Console.WriteLine(((nkp * kf) % 1000000007));\n }\n\n public static string Multiply(string source, int multiplier)\n {\n StringBuilder sb = new StringBuilder(multiplier * source.Length);\n for (int i = 0; i < multiplier; i++)\n {\n sb.Append(source);\n }\n\n return sb.ToString();\n }\n\n private static void Main()\n {\n if (Debugger.IsAttached)\n {\n Console.SetIn(new StreamReader(TestIn));\n Console.SetOut(new StreamWriter(TestOut));\n }\n\n Solve();\n\n if (Debugger.IsAttached)\n {\n Console.In.Close();\n Console.Out.Close();\n Console.SetIn(new StreamReader(Console.OpenStandardInput()));\n //Console.ReadLine();\n }\n }\n\n #region Reader\n\n private static string Read()\n {\n return Console.ReadLine();\n }\n\n private static string[] ReadArray()\n {\n return Console.ReadLine().Split(' ');\n }\n\n private static List ReadIntArray()\n {\n var input = Console.ReadLine().Split(' ').Select(Int32.Parse).ToList();\n return input;\n }\n\n private static int ReadInt()\n {\n return Int32.Parse(Console.ReadLine());\n }\n\n private static long ReadLong()\n {\n return long.Parse(Console.ReadLine());\n }\n\n private static int ReadNextInt(string[] input, int index)\n {\n return Int32.Parse(input[index]);\n }\n\n #endregion\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "ac596e35c024582e2dee557a36011aab", "src_uid": "cc838bc14408f14f984a349fea9e9694", "apr_id": "24c91d8aeac388651f88c22e405b0696", "difficulty": 1500, "tags": ["dfs and similar", "brute force", "math", "combinatorics"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.9998252053836741, "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.Diagnostics;\nusing System.Globalization;\nusing System.IO;\nusing System.Linq;\nusing System.Text;\n\nnamespace Codeforces\n{\n internal static class Program\n {\n private const string test = \"D1\";\n\n private static void Solve()\n {\n int n,k;\n Read(out n, out k);\n long res = k-1;\n var mod = 1000000007;\n for (int i = 1; i <= k-1; i++)\n {\n res *= k;\n res %= mod;\n }\n for (int i = 1; i <= n-k; i++)\n {\n res *= n-k;\n res %= mod;\n }\n WriteLine(res);\n }\n\n private static void Main()\n {\n if (Debugger.IsAttached)\n {\n Console.SetIn(new StreamReader(String.Format(@\"..\\..\\..\\..\\Tests\\{0}.in\", test)));\n }\n\n Solve();\n\n if (Debugger.IsAttached)\n {\n Console.In.Close();\n Console.SetIn(new StreamReader(Console.OpenStandardInput()));\n Console.ReadLine();\n }\n }\n\n private static int[] SortIndexs(this IEnumerable source) where T : IComparable\n {\n var array = source == null ? new List() : source.ToList();\n var n = array.Count;\n var res = Enumerable.Range(0, n).ToArray();\n Array.Sort(res, (a, b) => array[a].CompareTo(array[b]));\n return res;\n }\n\n #region Reader\n\n private static string Read()\n {\n return Console.ReadLine();\n }\n\n private static void Read(out T a1, out T a2)\n {\n var input = ReadArray();\n a1 = (T)Convert.ChangeType(input[0], typeof(T));\n a2 = (T)Convert.ChangeType(input[1], typeof(T));\n }\n\n private static void Read(out T a1, out T a2, out T a3)\n {\n var input = ReadArray();\n a1 = (T)Convert.ChangeType(input[0], typeof(T));\n a2 = (T)Convert.ChangeType(input[1], typeof(T));\n a3 = (T)Convert.ChangeType(input[2], typeof(T));\n }\n\n private static void Read(out T a1, out T a2, out T a3, out T a4)\n {\n var input = ReadArray();\n a1 = (T)Convert.ChangeType(input[0], typeof(T));\n a2 = (T)Convert.ChangeType(input[1], typeof(T));\n a3 = (T)Convert.ChangeType(input[2], typeof(T));\n a4 = (T)Convert.ChangeType(input[3], typeof(T));\n }\n\n private static void Read(out T a1, out T a2, out T a3, out T a4, out T a5)\n {\n var input = ReadArray();\n a1 = (T)Convert.ChangeType(input[0], typeof(T));\n a2 = (T)Convert.ChangeType(input[1], typeof(T));\n a3 = (T)Convert.ChangeType(input[2], typeof(T));\n a4 = (T)Convert.ChangeType(input[3], typeof(T));\n a5 = (T)Convert.ChangeType(input[4], typeof(T));\n }\n\n private static void Read(out T a1, out T a2, out T a3, out T a4, out T a5, out T a6)\n {\n var input = ReadArray();\n a1 = (T)Convert.ChangeType(input[0], typeof(T));\n a2 = (T)Convert.ChangeType(input[1], typeof(T));\n a3 = (T)Convert.ChangeType(input[2], typeof(T));\n a4 = (T)Convert.ChangeType(input[3], typeof(T));\n a5 = (T)Convert.ChangeType(input[4], typeof(T));\n a6 = (T)Convert.ChangeType(input[5], typeof(T));\n }\n\n private static int ReadInt()\n {\n return Int32.Parse(Read());\n }\n\n private static long ReadLong()\n {\n return long.Parse(Read());\n }\n\n private static double ReadDouble()\n {\n return double.Parse(Read(), CultureInfo.InvariantCulture);\n }\n\n private static T Read()\n {\n return (T)Convert.ChangeType(Read(), typeof(T));\n }\n\n private static string[] ReadArray()\n {\n var readLine = Console.ReadLine();\n if (readLine != null)\n return readLine.Split(' ');\n\n throw new ArgumentException();\n }\n\n private static List ReadIntArray()\n {\n return ReadArray().Select(Int32.Parse).ToList();\n }\n\n private static List ReadLongArray()\n {\n return ReadArray().Select(long.Parse).ToList();\n }\n\n private static List ReadDoubleArray()\n {\n return ReadArray().Select(d => double.Parse(d, CultureInfo.InvariantCulture)).ToList();\n }\n\n private static List ReadArray()\n {\n return ReadArray().Select(x => (T)Convert.ChangeType(x, typeof(T))).ToList();\n }\n\n private static void WriteLine(double value)\n {\n Console.WriteLine(value.ToString(CultureInfo.InvariantCulture));\n }\n\n private static void WriteLine(double value, string stringFormat)\n {\n Console.WriteLine(value.ToString(stringFormat, CultureInfo.InvariantCulture));\n }\n\n private static void WriteLine(T value)\n {\n Console.WriteLine(value);\n }\n\n private static void Write(double value)\n {\n Console.Write(value.ToString(CultureInfo.InvariantCulture));\n }\n\n private static void Write(double value, string stringFormat)\n {\n Console.Write(value.ToString(stringFormat, CultureInfo.InvariantCulture));\n }\n\n private static void Write(T value)\n {\n Console.Write(value);\n }\n\n #endregion\n }\n}", "lang": "MS C#", "bug_code_uid": "b5917fdd3806f8d0a90e0975b66e007e", "src_uid": "cc838bc14408f14f984a349fea9e9694", "apr_id": "1e73509445f748f68f7304735f55342d", "difficulty": 1500, "tags": ["dfs and similar", "brute force", "math", "combinatorics"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "C#"} {"similarity_score": 0.9122340425531915, "equal_cnt": 25, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 22, "fix_ops_cnt": 24, "bug_source_code": "using System;\n\nnamespace ConsoleApp4\n{\n class Program\n {\n static void Main(string[] args)\n {\n UInt64 n = UInt64.Parse(Console.ReadLine());\n UInt64 sum = n + (n - 1);\n UInt64 result = 0;\n\n char[] bad = { '0', '1', '2', '3', '4', '5', '6', '7', '8' };\n if (sum.ToString().IndexOfAny(bad) == -1)\n result = 1;\n else\n {\n UInt64 count = (UInt64)sum.ToString().Length;\n string devt = \"\";\n for (UInt64 i = 0; i < count - 1; i++)\n devt += \"9\";\n for (int i = 0; i < 9; i++)\n {\n UInt64 curent = UInt64.Parse(i.ToString() + devt);\n if (curent <= (n + 1))\n result += (curent / 2);\n else if (!(curent > n + (n - 1)))\n result += ((n-(curent-n))/2+1);\n }\n }\n Console.WriteLine(result);\n }\n }\n}", "lang": "MS C#", "bug_code_uid": "f4165797c2e73158834f8ad9eebd66e3", "src_uid": "c20744c44269ae0779c5f549afd2e3f2", "apr_id": "df3854efd8f9db428ed96566a791ebce", "difficulty": 1800, "tags": ["math", "constructive algorithms"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.984407371060953, "equal_cnt": 5, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 4, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Diagnostics;\nusing Pair = System.IComparable;\nusing Point = System.Tuple;\n\npublic class Solution : Helper\n{\n public Solution()\n {\n // http://codeforces.com/contest/899/problem/D\n var n = readInt32();\n long ans = 0;\n //\n if (n < 5)\n {\n ans = n * (n - 1) / 2;\n }\n else\n {\n var bs = bestSum(n);\n var str = bs.ToString();\n var f = str[0] - '0';\n if (f == 9)\n {\n ans = cp(bs, n);\n }\n else\n {\n range(1, f).each(h =>\n {\n ans += cp(int.Parse(str.Replace(\n f.ToString(),\n h.ToString()\n )), n);\n });\n }\n }\n //\n Console.WriteLine(ans);\n }\n //\n int cp(int sum, int n)\n {\n var a = sum / 2 + 1;\n var b = sum - 1;\n return count(a, Math.Min(b, n));\n }\n int count(int left, int right)\n {\n if (left > right) return 0;\n return (int)(right - left + 1);\n }\n int bestSum(int n)\n {\n var a = n + n - 1;\n var b = a.ToString();\n var c = b[0] - '0';\n var l = b.Length;\n var nines = b.Reverse().TakeWhile(x => x == '9').Count();\n if (nines >= l - 1)\n return a;\n return int.Parse((c - 1) + new string('9', l - 1));\n }\n}\n\n#region Core helper library\n[DebuggerNonUserCode]\nstatic partial class Extension\n{\n internal static IEnumerable each(this IEnumerable stream, Action act) { foreach (var elem in stream) act(elem); return stream; }\n internal static IEnumerable> kvp(this IEnumerable stream) { return stream.Select((elem, idx) => new KeyValuePair(idx, elem)); }\n internal static IEnumerable each(this IEnumerable stream, Action act) { stream.kvp().each(kvp => act(kvp.Value, kvp.Key)); return stream; }\n internal static IEnumerable indexIndices(this IList list) { return Helper.range(0, list.Count - 1); }\n internal static TValue? getOrDefault(this IDictionary dict, TKey key) where TValue : struct\n { TValue ans; if (dict.TryGetValue(key, out ans)) return ans; return null; }\n internal static T? FirstOrNullable(this IEnumerable stream) where T : struct { foreach (var val in stream) return val; return null; }\n internal static List list(this IEnumerable stream, int capacity) { var ans = new List(capacity); ans.AddRange(stream); return ans; }\n}\n[DebuggerNonUserCode]\npublic partial class Helper\n{\n internal const int DEFAULT_BUFFER_SIZE = 4194304;\n internal static void fail(string reason = \"ASSERTION FAILED\") { throw new ApplicationException(reason); }\n internal static void debug(string reason) { Debug.Fail(reason); }\n internal static IEnumerable range(int left, int right) { for (var i = left; i <= right; i++) yield return i; }\n internal static int? explainSearchIndex(int rawIndex) { if (rawIndex < 0) return null; return rawIndex; }\n internal static Pair pair(T1 value1, T2 value2) { return Tuple.Create(value1, value2); }\n}\n#endregion\n\n// additional plugable library\npublic partial class Helper\n{\n #region STDIO\n#if !DEBUG\n static void Main() { new Solution(); }\n#endif\n static void eof() { throw new System.IO.EndOfStreamException(); }\n internal static string readLine_TRIM()\n { while (true) { var ans = Console.ReadLine(); if (ans == null) eof(); ans = ans.Trim(); if (ans.Any()) return ans; } }\n static IEnumerable stream() { while (true) { var iread = Console.Read(); if (iread < 0) break; yield return (char)iread; } }\n static bool isWhitespace(char c) { return c == ' ' || c == '\\n' || c == '\\r' || c == '\\t'; }\n internal static string readString_TRIM(int maxCapacity)\n {\n var sb = new System.Text.StringBuilder(maxCapacity, maxCapacity);\n var iter = stream().SkipWhile(isWhitespace).TakeWhile(c => !isWhitespace(c));\n foreach (var c in iter) sb.Append(c);\n if (sb.Length == 0) eof(); return sb.ToString();\n }\n internal static long readLong64() { return long.Parse(readString_TRIM(21)); }\n internal static int readInt32() { return Convert.ToInt32(readLong64()); }\n #endregion\n}\nstatic partial class Extension\n{\n\n}", "lang": "MS C#", "bug_code_uid": "a96c61f099adef41f5350965f5348d5f", "src_uid": "c20744c44269ae0779c5f549afd2e3f2", "apr_id": "662c8d2a0a46583e19a2d8d62330f1f8", "difficulty": 1800, "tags": ["math", "constructive algorithms"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9963302752293578, "equal_cnt": 5, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 4, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Globalization;\nusing System.IO;\nusing System.Linq;\n\nnamespace CF317\n{\n internal class Program\n {\n private static void Main(string[] args)\n {\n var sr = new InputReader(Console.In);\n //var sr = new InputReader(new StreamReader(\"input.txt\"));\n var task = new Task();\n using (var sw = Console.Out)\n //using (var sw = new StreamWriter(\"output.txt\"))\n {\n task.Solve(1, sr, sw);\n //Console.ReadKey();\n }\n }\n }\n\n internal class Task\n {\n public void Solve(int testNumber, InputReader sr, TextWriter sw)\n {\n var input = sr.ReadArray(Int32.Parse);\n var n = input[0];\n var q = input[1];\n var array = new Tuple[q];\n for (var i = 0; i < q; i++)\n {\n var next = sr.NextSplitStrings();\n array[i] = new Tuple(next[0], next[1][0]);\n }\n var count = 0;\n var list = new HashSet();\n for (var i = 0; i < q; i++)\n {\n if (array[i].Item2 == 'a')\n {\n list.Add(array[i].Item1[0]);\n if (n == 2)\n {\n count++;\n }\n }\n }\n HashSet newList = null;\n for (var i = 3; i <= n; i++)\n {\n newList = new HashSet();\n foreach (var item in list)\n {\n for (var j = 0; j < q; j++)\n {\n if (array[j].Item2 == item)\n {\n newList.Add(array[j].Item1[0]);\n if (i == n)\n {\n count++;\n }\n }\n }\n }\n list = newList;\n }\n sw.WriteLine(count);\n }\n }\n\n internal class InputReader : IDisposable\n {\n private bool isDispose;\n private readonly TextReader sr;\n\n public InputReader(TextReader stream)\n {\n sr = stream;\n }\n\n public void Dispose()\n {\n Dispose(true);\n GC.SuppressFinalize(this);\n }\n\n public string NextString()\n {\n var result = sr.ReadLine();\n return result;\n }\n\n public int NextInt32()\n {\n return Int32.Parse(NextString());\n }\n\n public long NextInt64()\n {\n return Int64.Parse(NextString());\n }\n\n public string[] NextSplitStrings()\n {\n return NextString()\n .Split(new[] { ' ' }, StringSplitOptions.RemoveEmptyEntries);\n }\n\n public T[] ReadArray(Func func)\n {\n return NextSplitStrings()\n .Select(s => func(s, CultureInfo.InvariantCulture))\n .ToArray();\n }\n\n public T[] ReadArrayFromString(Func func, string str)\n {\n return\n str.Split(new[] { ' ' }, StringSplitOptions.RemoveEmptyEntries)\n .Select(s => func(s, CultureInfo.InvariantCulture))\n .ToArray();\n }\n\n protected void Dispose(bool dispose)\n {\n if (!isDispose)\n {\n if (dispose)\n sr.Close();\n isDispose = true;\n }\n }\n\n ~InputReader()\n {\n Dispose(false);\n }\n }\n}", "lang": "MS C#", "bug_code_uid": "8601b581746b349e3956742f3e28731a", "src_uid": "c42abec29bfd17de3f43385fa6bea534", "apr_id": "564f2c936bcde9915790cf1c7281bffb", "difficulty": 1300, "tags": ["brute force", "dp", "dfs and similar", "strings"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9868913857677902, "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.Globalization;\nusing System.IO;\nusing System.Linq;\nusing System.Text;\nusing System.Threading;\n\n// (づ°ω°)づミe★゜・。。・゜゜・。。・゜☆゜・。。・゜゜・。。・゜\npublic class Solver\n{\n string[] a;\n char[] b;\n int m;\n\n Dictionary mem = new Dictionary();\n bool Fun(string s)\n {\n if (s.Length == 1)\n return s[0] == 'a';\n if (mem.ContainsKey(s))\n return mem[s];\n\n bool ret = false;\n for (int i = 0; !ret && i < m; i++)\n if (a[i][0] == s[0] && a[i][1] == s[1])\n ret |= Fun(b[i] + s.Substring(2));\n return mem[s] = ret;\n }\n\n public void Solve()\n {\n int n = ReadInt();\n m = ReadInt();\n\n a = new string[m];\n b = new char[m];\n for (int i = 0; i < m; i++)\n {\n a[i] = ReadToken();\n b[i] = ReadToken()[0];\n }\n\n int ans = 0;\n var v = Enumerable.Repeat('a', n).ToArray();\n while (true)\n {\n if (Fun(new string(v)))\n ans++;\n v[n - 1]++;\n for (int i = n - 1; i > 0; i--)\n if (v[i] == 'g')\n {\n v[i - 1]++;\n v[i] = 'a';\n }\n if (v.All(vv => vv == 'f'))\n break;\n }\n\n Write(ans);\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": "efd50979bd2d97cfcc2e47df09e71776", "src_uid": "c42abec29bfd17de3f43385fa6bea534", "apr_id": "eb9289f1b20dde958d5731eaeedd85ec", "difficulty": 1300, "tags": ["brute force", "dp", "dfs and similar", "strings"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "C#"} {"similarity_score": 0.9947111066759804, "equal_cnt": 13, "replace_cnt": 6, "delete_cnt": 0, "insert_cnt": 6, "fix_ops_cnt": 12, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Data;\nusing System.Diagnostics.CodeAnalysis;\nusing System.Globalization;\nusing System.Linq;\nusing System.Text;\n\nnamespace Codeforces\n{\n class Program\n {\n private static string readString() => Console.ReadLine();\n private static T readValue() => (T)Convert.ChangeType(readString(), typeof(T));\n private static string[] readStrings(char delimiter = ' ') => readString().Split(delimiter);\n private static List readValues(char delimiter = ' ') => readStrings(delimiter: delimiter).Select(x => (T)Convert.ChangeType(x, typeof(T))).ToList();\n private static void write(T s) => Console.WriteLine(s);\n\n private static int binarySearch(List list, T target) where T : IComparable\n {\n int l = 0, r = list.Count - 1;\n while (l <= r)\n {\n var m = (int)Math.Floor((double)(l + r) / 2);\n if (list[m].CompareTo(target) <= 0)\n if (m == r || list[m + 1].CompareTo(target) > 0)\n return m;\n else\n l = m + 1;\n else\n r = m - 1;\n }\n return -1;\n }\n\n private static int quickSortPartition(List a, int lo, int hi) where T : IComparable\n {\n var pivot = a[lo];\n int i = lo - 1, j = hi + 1;\n while (true)\n {\n do { i++; } while (a[i].CompareTo(pivot) < 0);\n do { j--; } while (a[j].CompareTo(pivot) > 0);\n if (i >= j)\n return j;\n var temp = a[i];\n a[i] = a[j];\n a[j] = temp;\n }\n }\n private static void quickSort(List a, int lo, int hi) where T : IComparable\n {\n if (lo < hi)\n {\n int q = quickSortPartition(a, lo, hi);\n quickSort(a, lo, q);\n quickSort(a, q + 1, hi);\n }\n }\n private static void quickSort(List a) where T : IComparable => quickSort(a, 0, a.Count - 1);\n\n private static void watermelon()\n {\n var w = readValue();\n write(w >= 4 && w % 2 == 0 ? \"YES\" : \"NO\");\n }\n private static void wayTooLongWords()\n {\n var words = new List();\n\n var n = readValue();\n for (int i = 0; i < n; ++i)\n words.Add(readString());\n\n foreach (var word in words)\n write(word.Length <= 10 ? word : $\"{word.First()}{word.Length - 2}{word.Last()}\");\n }\n private static void team()\n {\n int solve = 0;\n\n var n = readValue();\n for (int i = 0; i < n; ++i)\n if (readValues().Where(x => x == 1).Count() > 1)\n ++solve;\n\n write(solve);\n }\n private static void football()\n {\n var positions = readString();\n for (int i = 6; i < positions.Length; ++i)\n if (positions.Substring(i - 6, 6) == (positions[i] == '0' ? \"000000\" : \"111111\"))\n {\n write(\"YES\");\n return;\n }\n write(\"NO\");\n }\n private static void theatreSquare()\n {\n var sizes = readValues();\n write((long)Math.Ceiling((double)sizes[0] / (double)sizes[2]) * (long)Math.Ceiling((double)sizes[1] / (double)sizes[2]));\n }\n private static void stringTask()\n {\n var Vowels = new HashSet { 'a', 'o', 'y', 'e', 'u', 'i' };\n var sb = new StringBuilder();\n var s = readString().ToLower();\n foreach (var c in s)\n if (!Vowels.Contains(c))\n {\n sb.Append('.');\n sb.Append(c);\n }\n\n write(sb.ToString());\n }\n private static void taxi()\n {\n int taxis = 0;\n var groups = new Dictionary { { 1, 0 }, { 2, 0 }, { 3, 0 } };\n\n readValue();\n var groupSizes = readValues();\n foreach (var size in groupSizes)\n if (size == 4)\n ++taxis;\n else\n groups[size] = groups[size] + 1;\n\n taxis += groups[3];\n groups[1] = groups[1] - Math.Min(groups[1], groups[3]);\n\n taxis += groups[2] / 2;\n if (groups[2] % 2 == 1)\n {\n ++taxis;\n groups[1] = groups[1] - 2;\n }\n\n if (groups[1] > 0)\n taxis += (int)Math.Ceiling((double)groups[1] / 4.0);\n\n write(taxis);\n }\n private static void fancyFence()\n {\n var a = readValue();\n for (double i = 3.0; ; i += 1.0)\n {\n var x = (double)(i - 2.0) * 180.0 / i;\n if (a <= x)\n {\n write(a < x ? \"NO\" : \"YES\");\n break;\n }\n }\n }\n private static void interestingDrink()\n {\n readString();\n var prices = readValues().OrderBy(x => x).ToList();\n var days = readValue();\n for (int i = 0; i < days; ++i)\n write(binarySearch(prices, readValue()) + 1);\n }\n private static void compilationErrors()\n {\n readString();\n Dictionary errors = readValues().GroupBy(x => x).ToDictionary(x => x.Key, x => x.Count()), errors1 = new Dictionary();\n foreach (var error in readValues())\n {\n if (errors[error] > 1)\n errors[error] = errors[error] - 1;\n else\n errors.Remove(error);\n\n if (errors1.TryGetValue(error, out var count))\n errors1[error] = count + 1;\n else\n errors1.Add(error, 1);\n }\n write(errors.First().Key);\n\n foreach (var error in readValues())\n if (errors1[error] > 1)\n errors1[error] = errors1[error] - 1;\n else\n errors1.Remove(error);\n write(errors1.First().Key);\n }\n private static void doubleCola()\n {\n var idToName = new Dictionary { { 0, \"Sheldon\" }, { 1, \"Leonard\" }, { 2, \"Penny\" }, { 3, \"Rajesh\" }, { 4, \"Howard\" } };\n int n = readValue(), i = 1;\n for (; n > i * 5; i *= 2)\n n -= i * 5;\n write(idToName[(n - 1) / i]);\n }\n private static void ilyaAndQueries()\n {\n var dic = new Dictionary();\n var list = new List>();\n\n var s = readString();\n int start = 0, dicStart = 0;\n for (int j = 0; j < s.Length - 1; ++j)\n if (s[j] != s[j + 1])\n {\n if (start < j)\n {\n list.Add(new Tuple(start + 1, j + 1));\n for (; dicStart < j + 1; ++dicStart)\n dic.Add(dicStart, list.Count - 1);\n }\n start = j + 1;\n }\n if (start < s.Length - 1)\n {\n list.Add(new Tuple(start + 1, s.Length));\n for (; dicStart < s.Length; ++dicStart)\n dic.Add(dicStart, list.Count - 1);\n }\n\n var m = readValue();\n for (int j = 0; j < m; ++j)\n {\n var q = readValues();\n int l = q[0], r = q[1], result = 0;\n if (dic.TryGetValue(l, out var i))\n for (; i < list.Count && r >= list[i].Item1; ++i)\n if (l < list[i].Item2)\n result += Math.Min(r, list[i].Item2) - Math.Max(l, list[i].Item1);\n write(result);\n }\n }\n private static void twoTeamsComposing()\n {\n var n = readValue();\n var skills = readValues().GroupBy(x => x).ToDictionary(x => x.Key, x => x.Count());\n }\n #region Laptop\n private class Laptop\n {\n internal int Price { get; private set; }\n internal int Quality { get; private set; }\n internal Laptop(List values)\n {\n Price = values[0];\n Quality = values[1];\n }\n }\n private class Laptop_Comparer_Price : Comparer\n {\n public override int Compare([AllowNull] Laptop x, [AllowNull] Laptop y) => x.Price - y.Price;\n }\n private class Laptop_Comparer_Quality : Comparer\n {\n public override int Compare([AllowNull] Laptop x, [AllowNull] Laptop y) => x.Quality - y.Quality;\n }\n private static void laptops()\n {\n List prices = new List(), qualities = new List();\n var n = readValue();\n for (int i = 0; i < n; ++i)\n {\n var laptop = new Laptop(readValues());\n prices.Add(laptop);\n qualities.Add(laptop);\n }\n\n for (int i = 0; i < n; ++i)\n if (prices[i] != qualities[i])\n {\n write(\"Happy Alex\");\n return;\n }\n write(\"Poor Alex\");\n }\n #endregion\n private static void fence()\n {\n int k = readValues()[1], minI = 0, currentH = 0;\n var h = readValues();\n\n for (int i = 0; i < k; ++i)\n currentH += h[i];\n var minH = currentH;\n\n for (int i = 1; i < h.Count - k + 1; ++i)\n {\n currentH = currentH - h[i - 1] + h[i + k - 1];\n if (minH > currentH)\n {\n minH = currentH;\n minI = i;\n }\n }\n\n write(minI + 1);\n }\n #region serejaAndSuffixes\n private class SerejaL : IComparable\n {\n internal int L { get; private set; }\n internal int Result;\n internal SerejaL(int l)\n {\n L = l;\n }\n\n public int CompareTo(object obj) => L - ((SerejaL)obj).L;\n }\n private static void serejaGetLs(int m, out List listDistinct, out List listOrdered)\n {\n listDistinct = new List();\n listOrdered = new List();\n var dic = new Dictionary();\n for (int i = 0; i < m; ++i)\n {\n var l = readValue() - 1;\n if (!dic.TryGetValue(l, out var item))\n {\n item = new SerejaL(l);\n dic.Add(l, item);\n listDistinct.Add(item);\n }\n listOrdered.Add(item);\n }\n quickSort(listDistinct);\n }\n private static void serejaAndSuffixes()\n {\n var m = readValues()[1];\n var a = readValues();\n serejaGetLs(m, out var listDistinct, out var listOrdered);\n\n var distinct = new HashSet();\n for (int i = listDistinct.Count - 1, j = a.Count - 1; i >= 0; --i)\n {\n for (; j >= listDistinct[i].L; --j)\n if (!distinct.Contains(a[j]))\n distinct.Add(a[j]);\n\n listDistinct[i].Result = distinct.Count;\n }\n\n foreach (var item in listOrdered)\n write(item.Result);\n }\n #endregion\n private static void bowWowTimetable()\n {\n string s = readString(), r = \"1\";\n int i = 1;\n for (; r.Length < s.Length; ++i, r = r + \"00\") ;\n if (r.Length > s.Length || !s.Substring(1).Contains('1'))\n write(i - 1);\n else\n write(i);\n }\n private static void digits()\n {\n readString();\n var numbers = readValues().GroupBy(x => x).ToDictionary(x => x.Key, x => x.Count());\n if (!numbers.ContainsKey(0))\n {\n write(-1);\n return;\n }\n }\n private static void lifeWithoutZeros()\n {\n long a = readValue(), b = readValue(), c = a + b;\n write(Convert.ToInt64(a.ToString().Replace(\"0\", \"\")) + Convert.ToInt64(b.ToString().Replace(\"0\", \"\")) == Convert.ToInt64(c.ToString().Replace(\"0\", \"\")) ? \"YES\" : \"NO\");\n }\n private static void permutation()\n {\n var n = readValue();\n var a = readValues();\n write(n - a.Where(x => x <= n).Distinct().Count());\n }\n private static void hamsterFarm()\n {\n var n = readValues()[0];\n var k = readValues();\n int bestI = 0;\n for (int i = 1; i < k.Count; ++i)\n if (n % k[i] < n % k[bestI])\n bestI = i;\n write($\"{bestI + 1} {n / k[bestI]}\");\n }\n private static void shellGame()\n {\n int n = readValue(), x = readValue();\n if (x == 1)\n {\n if (n % 2 == 1)\n x = 0;\n else\n x = 2;\n --n;\n }\n for (int i = n % 6; i > 0; --i)\n if (i % 2 == 1)\n {\n if (x == 0)\n x = 1;\n else if (x == 1)\n x = 0;\n }\n else if (x == 1)\n x = 2;\n else if (x == 2)\n x = 1;\n write(x);\n }\n private static void ACM_ICPC()\n {\n var a = readValues();\n int[] score = new int[2], members = new int[2];\n for (int i1 = 0; i1 < 2; ++i1)\n {\n score[i1] = a[0];\n members[i1] = 1;\n for (int i2 = 0; i2 < 2; ++i2)\n {\n score[i2] += a[1];\n members[i2] += 1;\n for (int i3 = 0; i3 < 2; ++i3)\n {\n score[i3] += a[2];\n members[i3] += 1;\n for (int i4 = 0; i4 < 2; ++i4)\n if (members[i4] < 3)\n {\n score[i4] += a[3];\n members[i4] += 1;\n for (int i5 = 0; i5 < 2; ++i5)\n if (members[i5] < 3)\n {\n score[i5] += a[4];\n members[i5] += 1;\n for (int i6 = 0; i6 < 2; ++i6)\n if (members[i6] < 3)\n {\n score[i6] += a[5];\n members[i6] += 1;\n if (score[0] == score[1])\n {\n write(\"YES\");\n return;\n }\n score[i6] -= a[5];\n members[i6] -= 1;\n }\n score[i5] -= a[4];\n members[i5] -= 1;\n }\n score[i4] -= a[3];\n members[i4] -= 1;\n }\n score[i3] -= a[2];\n members[i3] -= 1;\n }\n score[i2] -= a[1];\n members[i2] -= 1;\n }\n score[i1] = 0;\n members[i1] = 0;\n }\n write(\"NO\");\n }\n private static void mex()\n {\n var x = readValues()[1];\n var n = readValues();\n write(x - n.Count(y => y < x) + (n.Contains(x) ? 1 : 0));\n }\n private static void minimumProduct()\n {\n var input = readValues();\n int a = input[0], b = input[1], x = input[2], y = input[3], n = input[4], minA = Math.Min(a - x, n), minB = Math.Min(b - y, n);\n if (a - minA <= b - minB)\n {\n a -= minA;\n n -= minA;\n }\n else\n {\n b -= minB;\n n -= minB;\n }\n\n if (n > 0)\n if (a > x)\n a -= Math.Min(a - x, n);\n else if (b > y)\n b -= Math.Min(b - y, n);\n\n write((long)a * (long)b);\n }\n private static void shovelsAndSwords()\n {\n var input = readValues();\n int a = input[0], b = input[1], result = 0;\n if (a > b)\n {\n var min = Math.Min(a - b, b);\n a -= min * 2;\n b -= min;\n result += min;\n }\n else if (b > a)\n {\n var min = Math.Min(b - a, a);\n a -= min;\n b -= min * 2;\n result += min;\n }\n int d = Math.Min(a / 3, b / 3);\n a -= d * 3;\n b -= d * 3;\n result += d * 2;\n if (a > 0 && b > 0 && (a > 1 || b > 1))\n ++result;\n write(result);\n }\n private static void matrixGame()\n {\n var input = readValues();\n int n = input[0], m = input[1];\n HashSet claimedRows = new HashSet(), claimedColumns = new HashSet();\n for (int i = 0; i < n; ++i)\n {\n input = readValues();\n for (int j = 0; j < m; ++j)\n if (input[j] == 1)\n {\n if (!claimedRows.Contains(i))\n claimedRows.Add(i);\n if (!claimedColumns.Contains(j))\n claimedColumns.Add(j);\n }\n }\n write(Math.Min(n - claimedRows.Count, m - claimedColumns.Count) % 2 == 0 ? \"Vivek\" : \"Ashish\");\n }\n private static void cinemaLine()\n {\n readString();\n var clerk = new Dictionary { { 25, 0 }, { 50, 0 } };\n foreach (var a in readValues())\n switch (a)\n {\n case 25:\n clerk[25] += 1;\n break;\n case 50:\n if (clerk[25] > 0)\n {\n clerk[25] -= 1;\n clerk[50] += 1;\n }\n else\n {\n write(\"NO\");\n return;\n }\n break;\n default: // 100\n if (clerk[50] > 0 && clerk[25] > 0)\n {\n clerk[25] -= 1;\n clerk[50] -= 1;\n }\n else if (clerk[25] > 2)\n clerk[25] -= 3;\n else\n {\n write(\"NO\");\n return;\n }\n break;\n }\n write(\"YES\");\n }\n private static void kindAnton()\n {\n readString();\n List a = readValues(), b = readValues();\n bool positive1 = false, negative1 = false;\n HashSet positive = new HashSet(), negative = new HashSet();\n for (int i = 0; i < a.Count; ++i)\n {\n int diff = b[i] - a[i];\n if (((diff > 0 && !positive1) || (diff < 0 && !negative1)) && !(diff > 0 ? positive : negative).Any(x => diff % x == 0))\n {\n write(\"NO\");\n return;\n }\n if (a[i] > 0)\n {\n if (!positive1)\n if (a[i] == 1)\n {\n positive1 = true;\n if (negative1)\n {\n write(\"YES\");\n return;\n }\n }\n else if (!positive.Contains(a[i]))\n positive.Add(a[i]);\n }\n else if (a[i] < 0 && !negative1)\n if (a[i] == -1)\n {\n negative1 = true;\n if (positive1)\n {\n write(\"YES\");\n return;\n }\n }\n else if (!negative.Contains(a[i]))\n negative.Add(a[i]);\n }\n write(\"YES\");\n }\n private static void staircases()\n {\n var input = readValues();\n int n = input[0], mn = input[1];\n if (mn == 0)\n {\n write(\"YES\");\n return;\n }\n var m = readValues().OrderBy(x => x).ToList();\n if (m[0] == 1 || m[m.Count - 1] == n)\n {\n write(\"NO\");\n return;\n }\n for (int i = 0; i < m.Count - 2; ++i)\n if (m[i] == m[i + 1] - 1 && m[i] == m[i + 2] - 2)\n {\n write(\"NO\");\n return;\n }\n write(\"YES\");\n }\n private static void blownGarland()\n {\n var colors = new Dictionary { { 'R', 0 }, { 'Y', 0 }, { 'B', 0 }, { 'G', 0 } };\n var s = readString();\n\n var colorPerPosition = new char[4];\n foreach (var color in colors)\n colorPerPosition[s.IndexOf(color.Key) % 4] = color.Key;\n\n for (int i = 0; i < s.Length; ++i)\n if (s[i] == '!')\n colors[colorPerPosition[i % 4]] += 1;\n\n write($\"{colors['R']} {colors['B']} {colors['Y']} {colors['G']}\");\n }\n private static void mikeAndFax()\n {\n var s = readString();\n int k = readValue();\n\n if (s.Length % k != 0)\n {\n write(\"NO\");\n return;\n }\n\n int size = s.Length / k;\n for (int i = 0; i < s.Length; i += size)\n for (int j1 = i + size / 2 - 1, j2 = i + size / 2 + size % 2; j1 >= i; --j1, ++j2)\n if (s[j1] != s[j2])\n {\n write(\"NO\");\n return;\n }\n\n write(\"YES\");\n }\n #region weirdRounding\n private static bool weirdRounding_Recursion(string ns, int kp, int d)\n {\n if (d > 0)\n for (int i = ns[1] == '0' && ns.Length > 2 ? 1 : 0; i < ns.Length; ++i)\n {\n string nsNew = ns.Remove(i, 1);\n int n = Convert.ToInt32(nsNew);\n if (n % kp == 0 || weirdRounding_Recursion(nsNew, kp, d - 1))\n return true;\n }\n return false;\n }\n private static void weirdRounding()\n {\n var input = readStrings();\n string ns = input[0];\n int n = Convert.ToInt32(ns), k = Convert.ToInt32(input[1]), kp = (int)Math.Pow(10, k);\n\n if (n < kp)\n write(ns.Length - 1);\n else if (n % kp == 0)\n write(0);\n else\n for (int d = 1; d < ns.Length; ++d)\n if (weirdRounding_Recursion(ns, kp, d))\n {\n write(d);\n return;\n }\n }\n #endregion\n private static void wilburArray()\n {\n readString();\n var b = readValues();\n long result = Math.Abs(b[0]);\n for (int i = 1; i < b.Count; ++i)\n result += Math.Abs(b[i] - b[i - 1]);\n write(result);\n }\n private static void zuhairStrings()\n {\n int k = readValues()[1];\n var s = readString();\n var result = new Dictionary();\n\n for (int i = 0; i < s.Length - k + 1;)\n {\n int j = i + 1;\n for (; j < i + k && s[i] == s[j]; ++j) ;\n if (j == i + k)\n if (!result.ContainsKey(s[i]))\n result.Add(s[i], 1);\n else\n result[s[i]] += 1;\n i = j;\n }\n\n write(result.Count > 0 ? result.Max(x => x.Value) : 0);\n }\n private static void artfulExpedient()\n {\n var n = readValue();\n List x = readValues(), y = readValues();\n var numbers = x.Union(y).ToHashSet();\n var resultEven = true;\n\n for (int i = 0; i < n; ++i)\n for (int j = 0; j < n; ++j)\n if (numbers.Contains(x[i] ^ y[j]))\n resultEven = !resultEven;\n\n write(resultEven ? \"Karen\" : \"Koyomi\");\n }\n private static void ebonyIvory()\n {\n var input = readValues();\n int a = input[0], b = input[1], c = input[2];\n if (a < b)\n {\n var t = a;\n a = b;\n b = t;\n }\n for (; c >= 0; c -= a)\n if (c % b == 0)\n {\n write(\"Yes\");\n return;\n }\n write(\"No\");\n }\n #region Lala Land Apple Trees\n private class LalaLand_AppleTree : IComparable\n {\n private int coordinate;\n internal int Apples { get; private set; }\n internal LalaLand_AppleTree(int coordinate, int apples)\n {\n this.coordinate = coordinate;\n Apples = apples;\n }\n public int CompareTo(object obj) => coordinate - ((LalaLand_AppleTree)obj).coordinate;\n }\n private static void lalaLandAppleTrees()\n {\n var n = readValue();\n List right = new List(), left = new List();\n for (int i = 0; i < n; ++i)\n {\n var input = readValues();\n if (input[0] > 0)\n right.Add(new LalaLand_AppleTree(input[0], input[1]));\n else\n left.Add(new LalaLand_AppleTree(-input[0], input[1]));\n }\n\n if (Math.Abs(right.Count - left.Count) < 2)\n write(right.Sum(x => x.Apples) + left.Sum(x => x.Apples));\n else\n {\n quickSort(right);\n quickSort(left);\n if (right.Count > left.Count)\n write(right.GetRange(0, left.Count + 1).Sum(x => x.Apples) + (left.Count > 0 ? left.Sum(x => x.Apples) : 0));\n else\n write((right.Count > 0 ? right.Sum(x => x.Apples) : 0) + left.GetRange(0, right.Count + 1).Sum(x => x.Apples));\n }\n }\n #endregion\n private static void lanterns()\n {\n int l = readValues()[1], d = 0;\n var a = readValues().Distinct().ToList();\n quickSort(a);\n for (int i = 0; i < a.Count - 1; ++i)\n {\n var diff = a[i + 1] - a[i];\n if (diff > d)\n d = diff;\n }\n if (a[0] > 0 && a[a.Count - 1] < l)\n write(Math.Max(Math.Max(a[0] - 0, l - a[a.Count - 1]), d / 2.0));\n else if (a[0] > 0)\n write(Math.Max(a[0] - 0, d / 2.0));\n else if (a[a.Count - 1] < l)\n write(Math.Max(l - a[a.Count - 1], d / 2.0));\n else\n write((double)d / 2.0);\n }\n private static void cheapTravel()\n {\n var input = readValues();\n int n = input[0], m = input[1], a = input[2], b = input[3];\n if (b >= a * m)\n write(n * a);\n else\n write((n / m) * b + ((n % m) * a < b ? (n % m) * a : b));\n }\n private static void berSUBall()\n {\n readString();\n var a = readValues();\n readString();\n var b = readValues();\n quickSort(a);\n quickSort(b);\n int result = 0;\n for (int i = 0, j = 0; i < a.Count && j < b.Count;)\n if (Math.Abs(a[i] - b[j]) < 2)\n {\n ++result;\n ++i;\n ++j;\n }\n else if (a[i] < b[j])\n ++i;\n else\n ++j;\n write(result);\n }\n private static void flippingGame()\n {\n readString();\n var a = readValues();\n int max = 0;\n for (int i = 0, previousOnes = 0, total = a.Sum(); i < a.Count; previousOnes += a[i], ++i)\n for (int j = i, remainingOnes = total - previousOnes; j < a.Count; ++j)\n {\n remainingOnes -= a[j];\n var ones = previousOnes + (j - i + 1 - (total - previousOnes - remainingOnes)) + remainingOnes;\n if (ones > max)\n max = ones;\n }\n write(max);\n }\n private static void worms()\n {\n readString();\n var a = readValues();\n\n var worms = new Dictionary();\n int i = 1;\n for (int j = 0; j < a.Count; ++j)\n for (int k = 0; k < a[j]; ++k)\n worms.Add(i++, j + 1);\n\n readString();\n foreach (var q in readValues())\n write(worms[q]);\n }\n private static void kNotDivisable()\n {\n var input = readValues();\n int n = input[0], k = input[1];\n write(k / (n - 1) * n + (k % (n - 1) == 0 ? -1 : k % (n - 1)));\n }\n private static void oddSelection()\n {\n var x = readValues()[1];\n var a = readValues().GroupBy(x => x % 2).ToDictionary(x => x.Key, x => x.Count());\n if (a.TryGetValue(1, out var odd))\n {\n --odd;\n --x;\n if (x % 2 == 0)\n {\n if (odd >= x || (a.TryGetValue(0, out var even) && even + odd / 2 * 2 >= x))\n {\n write(\"Yes\");\n return;\n }\n }\n else if (a.TryGetValue(0, out var even) && (odd >= x - 1 || even + odd / 2 * 2 >= x - 1))\n {\n write(\"Yes\");\n return;\n }\n }\n write(\"No\");\n }\n private static void iqTest()\n {\n readString();\n int evens = 0, odds = 0, lastEven = 0, lastOdd = 0, i = 1;\n foreach (var n in readValues())\n {\n if (n % 2 == 0)\n {\n ++evens;\n lastEven = i;\n }\n else\n {\n ++odds;\n lastOdd = i;\n }\n if (evens > 1 && odds == 1)\n {\n write(lastOdd);\n break;\n }\n else if (evens == 1 && odds > 1)\n {\n write(lastEven);\n break;\n }\n ++i;\n }\n }\n private static void registration()\n {\n var n = readValue();\n var names = new Dictionary();\n for (int j = 0; j < n; ++j)\n {\n var name = readString();\n if (!names.TryGetValue(name, out var i))\n {\n names.Add(name, 1);\n write(\"OK\");\n }\n else\n {\n names[name] += 1;\n write($\"{name}{i}\");\n }\n }\n }\n private static void cutRibbon()\n {\n var input = readValues();\n var n = input[0];\n var a = input.GetRange(1, 3).OrderBy(x => x).ToList();\n if (n % a[0] == 0)\n write(n / a[0]);\n else\n {\n if (a[1] % a[0] == 0)\n {\n a.RemoveAt(1);\n if (a[1] % a[0] == 0)\n a.RemoveAt(1);\n }\n else if (a[2] % a[0] == 0 || a[2] % a[1] == 0 || a[2] % (a[0] + a[1]) == 0)\n a.RemoveAt(2);\n\n if (a.Count == 2)\n {\n int i = n / a[0] - 1, j = 1;\n while (i * a[0] + j * a[1] != n)\n if (i * a[0] + j * a[1] < n)\n ++j;\n else\n --i;\n write(i + j);\n }\n else\n {\n int max = 0;\n var stack = new Stack>();\n stack.Push(new Tuple(n - a[0] - n % a[0], n / a[0] - 1));\n while (stack.Count > 0)\n {\n var item = stack.Pop();\n for (int i = 0; i < 3; ++i)\n if (item.Item1 + a[i] == n)\n {\n if (item.Item2 + 1 > max)\n max = item.Item2 + 1;\n }\n else if (item.Item1 + a[i] < n)\n stack.Push(new Tuple(item.Item1 + a[i], item.Item2 + 1));\n }\n write(max);\n }\n }\n }\n private static void TPrime()\n {\n readString();\n foreach (var x in readValues())\n if (x % 2 == 0)\n write(x == 4 ? \"YES\" : \"NO\");\n else\n {\n long i = 3;\n for (; i < x / 2 && x % i > 0; i += 2) ;\n if (i == x / 2)\n write(\"NO\");\n else\n {\n for (i += 2; i < x / 2 && x % i > 0; i += 2) ;\n write(i == x / 2 ? \"YES\" : \"NO\");\n }\n }\n }\n private static void birthday()\n {\n readString();\n var a = readValues();\n quickSort(a);\n var sb = new StringBuilder(a[0].ToString());\n for (int i = 2; i < a.Count; i += 2)\n {\n sb.Append(' ');\n sb.Append(a[i]);\n }\n for (int i = a.Count - (a.Count % 2 == 0 ? 1 : 2); i > 0; i -= 2)\n {\n sb.Append(' ');\n sb.Append(a[i]);\n }\n write(sb.ToString());\n }\n private static void snowWalkingRobot()\n {\n var str = readString();\n var s = new Dictionary { { 'L', 0 }, { 'R', 0 }, { 'U', 0 }, { 'D', 0 } };\n for (int i = 0; i < str.Length; ++i)\n s[str[i]] += 1;\n int minLR = Math.Min(s['L'], s['R']), minDU = Math.Min(s['D'], s['U']);\n if (minDU == 0 && minLR == 0)\n write(0);\n else if (minDU == 0 || minLR == 0)\n {\n write(2);\n write(minDU == 0 ? \"LR\" : \"UD\");\n }\n else\n {\n write(minLR * 2 + minDU * 2);\n var sb = new StringBuilder();\n for (int i = 0; i < minLR; ++i)\n sb.Append('L');\n for (int i = 0; i < minDU; ++i)\n sb.Append('D');\n for (int i = 0; i < minLR; ++i)\n sb.Append('R');\n for (int i = 0; i < minDU; ++i)\n sb.Append('U');\n write(sb.ToString());\n }\n }\n private static void nextTest()\n {\n readString();\n var a = readValues();\n quickSort(a);\n if (a[0] > 1)\n write(1);\n else if (a[a.Count - 1] == a.Count)\n write(a.Count + 1);\n else\n for (int i = 0; i < a.Count - 1; ++i)\n if (a[i] + 1 < a[i + 1])\n {\n write(a[i] + 1);\n return;\n }\n }\n private static void emailPolycarp()\n {\n var n = readValue();\n for (int i = 0; i < n; ++i)\n {\n string s = readString(), t = readString();\n if (s[0] != t[0])\n write(\"NO\");\n else\n {\n int j1 = 1, j2 = 1;\n for (; j1 < s.Length && j2 < t.Length; ++j1, ++j2)\n if (s[j1] != t[j2])\n {\n for (; j2 < t.Length && s[j1 - 1] == t[j2]; ++j2) ;\n if (j2 == t.Length || s[j1] != t[j2])\n break;\n }\n if (j1 == s.Length)\n for (; j2 < t.Length && s[j1 - 1] == t[j2]; ++j2) ;\n write(j1 == s.Length && j2 == t.Length ? \"YES\" : \"NO\");\n }\n }\n }\n private static void alphabeticRemovals()\n {\n var k = readValues()[1];\n var s = readString();\n\n var indexesToRemove = new HashSet();\n var characters = new Dictionary>();\n for (int i = 0; i < s.Length && k > 0; ++i)\n if (s[i] == 'a')\n {\n indexesToRemove.Add(i);\n --k;\n }\n else if (!characters.TryGetValue(s[i], out var indexes))\n characters.Add(s[i], new List { i });\n else\n indexes.Add(i);\n\n for (char x = 'b'; k > 0; ++x)\n if (characters.TryGetValue(x, out var indexes))\n for (int i = 0; i < indexes.Count && k > 0; ++i, --k)\n indexesToRemove.Add(indexes[i]);\n\n var sb = new StringBuilder();\n for (int i = 0; i < s.Length; ++i)\n if (!indexesToRemove.Contains(i))\n sb.Append(s[i]);\n write(sb.ToString());\n }\n private static void doorsBreakingAndRepairing()\n {\n var input = readValues();\n int n = input[0], x = input[1], y = input[2];\n var a = readValues().Count(a => a <= x);\n write(x > y ? n : a / 2 + a % 2);\n }\n private static void filyaHomework()\n {\n readString();\n var a = readValues().Distinct().ToList();\n switch (a.Count)\n {\n case 1:\n case 2:\n write(\"YES\");\n break;\n case 3:\n a.Sort();\n write(a[1] - a[0] == a[2] - a[1] ? \"YES\" : \"NO\");\n break;\n default:\n write(\"NO\");\n break;\n }\n }\n private static void polycarpPractice()\n {\n var k = readValues()[1];\n var a = readValues();\n\n if (k == 1)\n {\n write(a.Max());\n write(a.Count);\n }\n else\n {\n var l = new List>();\n for (int i = 0; i < a.Count; ++i)\n l.Add(new Tuple(i, a[i]));\n l = l.OrderByDescending(x => x.Item2).Take(k).OrderBy(x => x.Item1).ToList();\n\n write(l.Sum(x => x.Item2));\n var sb = new StringBuilder();\n sb.Append(l[0].Item1 + 1);\n for (int i = 1; i < l.Count - 1; ++i)\n {\n sb.Append(' ');\n sb.Append(l[i].Item1 - l[i - 1].Item1);\n }\n sb.Append(' ');\n sb.Append(a.Count - l[l.Count - 2].Item1 - 1);\n write(sb.ToString());\n }\n }\n private static void vladikFlights()\n {\n var input = readValues();\n int a = input[1] - 1, b = input[2] - 1;\n var n = readString();\n write(a == b || n[a] == n[b] ? 0 : 1);\n }\n private static void cellsNotUnderAttack()\n {\n var input = readValues();\n int n = input[0], m = input[1];\n long cellsNotUnderAttack = (long)n * (long)n;\n HashSet rowsUnderAttack = new HashSet(), columnsUnderAttack = new HashSet();\n var result = new List();\n for (int i = 0; i < m; ++i)\n {\n input = readValues();\n if (!rowsUnderAttack.Contains(input[0]))\n {\n rowsUnderAttack.Add(input[0]);\n cellsNotUnderAttack -= n - columnsUnderAttack.Count;\n }\n if (!columnsUnderAttack.Contains(input[1]))\n {\n columnsUnderAttack.Add(input[1]);\n cellsNotUnderAttack -= n - rowsUnderAttack.Count;\n }\n result.Add(cellsNotUnderAttack);\n }\n write(string.Join(' ', result));\n }\n private static void examBerSU()\n {\n var m = readValues()[1];\n var t = readValues();\n\n var result = new List { 0 };\n for (int i = 1; i < t.Count; ++i)\n {\n var tSub = t.GetRange(0, i);\n quickSort(tSub);\n int j = 0;\n for (int k = m - t[i]; j < tSub.Count && k - tSub[j] >= 0; k -= tSub[j++]) ;\n result.Add(tSub.Count - j);\n }\n write(string.Join(' ', result));\n }\n #region dishonestSellers\n private class dishonestSellersPrice : IComparable\n {\n internal int DiscountPrice { get; private set; }\n internal int Price { get; private set; }\n internal int Discount => Price - DiscountPrice;\n internal dishonestSellersPrice(int discountPrice, int price) { DiscountPrice = discountPrice; Price = price; }\n public int CompareTo(object obj) => Discount - ((dishonestSellersPrice)obj).Discount;\n }\n private static void dishonestSellers()\n {\n int k = readValues()[1], i, sum = 0;\n List a = readValues(), b = readValues();\n\n var prices = new List();\n for (i = 0; i < a.Count; ++i)\n prices.Add(new dishonestSellersPrice(a[i], b[i]));\n quickSort(prices);\n i = 0;\n for (; i < k; sum += prices[prices.Count - i++ - 1].DiscountPrice) ;\n for (; i < prices.Count; sum += Math.Min(prices[prices.Count - i - 1].DiscountPrice, prices[prices.Count - i - 1].Price), ++i) ;\n write(sum);\n }\n #endregion\n private static void minimizeString()\n {\n readString();\n string s = readString(), min = s.Substring(0, s.Length - 1);\n if (s[1] < s[0])\n {\n var t = s.Substring(1);\n if (t.CompareTo(min) < 0)\n min = t;\n }\n for (int i = 1; i < s.Length - 1; ++i)\n if (s[i + 1] < s[i])\n {\n var t = s.Substring(0, i) + s.Substring(i + 1);\n if (t.CompareTo(min) < 0)\n min = t;\n }\n write(min);\n }\n private static void sortArray()\n {\n readString();\n var a = readValues();\n\n bool sorted = true;\n for (int i = 1; i < a.Count; ++i)\n if (a[i] < a[i - 1])\n {\n sorted = false;\n break;\n }\n if (sorted)\n {\n write(\"yes\");\n write(\"1 1\");\n }\n else\n {\n var aSorted = new List(a);\n quickSort(aSorted);\n int start = 0;\n for (; start < a.Count && a[start] == aSorted[start]; ++start) ;\n if (start == a.Count)\n {\n write(\"yes\");\n write(\"1 1\");\n }\n else\n {\n int end = a.Count - 1;\n for (; end > start && a[end] == aSorted[end]; --end) ;\n if (start == end)\n {\n write(\"yes\");\n write($\"{start + 1} {start + 1}\");\n }\n else\n {\n for (int i = start, j = end; i <= end; ++i, --j)\n if (a[i] != aSorted[j])\n {\n write(\"no\");\n return;\n }\n write(\"yes\");\n write($\"{start + 1} {end + 1}\");\n }\n }\n }\n }\n private static void kthBeautifulString()\n {\n var input = readValues();\n int n = input[0], k = input[1], x1 = n - 2;\n\n for (int i = 1; k > i; k -= i++, --x1) ;\n\n var sb = new StringBuilder();\n for (int i = 0; i < x1; ++i)\n sb.Append('a');\n sb.Append('b');\n for (int i = x1 + 1; i < n - k; ++i)\n sb.Append('a');\n sb.Append('b');\n for (int i = n - k + 1; i < n; ++i)\n sb.Append('a');\n write(sb.ToString());\n }\n private static void antiSudoku()\n {\n var j = new int[] { 0, 3, 6, 1, 4, 7, 2, 5, 8 };\n for (int i = 0; i < 9; ++i)\n {\n var s = readString();\n var sb = new StringBuilder(s.Substring(0, j[i]));\n sb.Append(((Convert.ToInt32(s[j[i]]) + 1) % 9 + 1).ToString()[0]);\n sb.Append(s.Substring(j[i] + 1));\n write(sb.ToString());\n }\n }\n private static void buyingShovels()\n {\n var input = readValues();\n int n = input[0], k = input[1];\n if (k >= n)\n write(1);\n else\n {\n for (int i = 2; i < n / 2; ++i)\n if (n % i == 0 && n / i <= k)\n {\n write(i);\n return;\n }\n write(n);\n }\n }\n private static void lastClassOfMath()\n {\n var n = readValue();\n if (n % 2 == 0)\n write($\"{n / 2} {n / 2}\");\n else\n {\n for (int i = 3; i <= n / 2; i += 2)\n if (n % i == 0)\n {\n write($\"{n / i} {n - n / i}\");\n return;\n }\n write($\"1 {n - 1}\");\n }\n }\n\n static void Main()\n {\n var t = readValue();\n for (int i = 0; i < t; ++i)\n lastClassOfMath();\n }\n }\n}\n", "lang": ".NET Core C#", "bug_code_uid": "0752e8ba6ecf847656e45f036578fae3", "src_uid": "3fd60db24b1873e906d6dee9c2508ac5", "apr_id": "fe61afdb5879b2807ceed77f9cf90124", "difficulty": 1300, "tags": ["greedy", "math", "number theory"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9451016075219897, "equal_cnt": 8, "replace_cnt": 2, "delete_cnt": 1, "insert_cnt": 4, "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 ConsoleApp1\n{\n class Class07112\n {\n static void Main(string[] args)\n {\n String num = Console.ReadLine();\n int repeat = Convert.ToInt32(num);\n for (int i = 0; i < repeat; i++)\n {\n long n = Convert.ToInt64(Console.ReadLine());\n if(n % 2 == 0)\n {\n Console.WriteLine(n/2 + \" \" + n/2);\n }\n else\n {\n if (isPrime(n))\n {\n Console.WriteLine(1 + \" \" + (n - 1));\n }\n else\n {\n for(long j = n/2; j > 1; j--)\n {\n if (n % j == 0)\n {\n long t = n / j;\n Console.WriteLine(j + \" \" + j*(t-1));\n break;\n }\n }\n }\n }\n }\n //Console.Read();\n }\n static bool isPrime(long a)\n {\n if (a < 4) return true;\n for (long i = 2; i <= Math.Sqrt(a); i++)\n {\n if(a%i == 0)\n {\n return false;\n }\n }\n return true;\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "2852da1260e791b612c2b60786234a07", "src_uid": "3fd60db24b1873e906d6dee9c2508ac5", "apr_id": "ca35b987a3e59b88d3669242d7bc3f2d", "difficulty": 1300, "tags": ["greedy", "math", "number theory"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.7878787878787878, "equal_cnt": 14, "replace_cnt": 6, "delete_cnt": 3, "insert_cnt": 5, "fix_ops_cnt": 14, "bug_source_code": "using System;\n\nnamespace ConsoleApp15\n{\n class Program\n {\n static void Main(string[] args)\n {\n var t = int.Parse(Console.ReadLine());\n\n while (t-- > 0)\n {\n var n = int.Parse(Console.ReadLine());\n\n if (n % 2 == 0)\n {\n var a = n / 2;\n Console.WriteLine(a + \" \" + a);\n continue;\n }\n\n \n\n for (int i = 3; i <= n; i += 2)\n {\n if (n % i == 0)\n {\n var k = n / i;\n var a = 1;\n var b = i - 1;\n a = a * k;\n b = b * k;\n Console.WriteLine(a + \" \" + b);\n break;\n\n\n }\n }\n\n\n\n }\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "c7736a180f66b3df7c4953a820268dd3", "src_uid": "3fd60db24b1873e906d6dee9c2508ac5", "apr_id": "31d5d3807230b3b11ba9c61b16e95cfe", "difficulty": 1300, "tags": ["greedy", "math", "number theory"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.556390977443609, "equal_cnt": 12, "replace_cnt": 4, "delete_cnt": 6, "insert_cnt": 2, "fix_ops_cnt": 12, "bug_source_code": "using System;\n\nnamespace ConsoleApp15\n{\n class Program\n {\n static void Main(string[] args)\n {\n var t = int.Parse(Console.ReadLine());\n\n while (t-- > 0)\n {\n var n = int.Parse(Console.ReadLine());\n\n if (n % 2 == 0)\n {\n var a = n / 2;\n Console.WriteLine(a + \" \" + a);\n continue;\n }\n\n int b = 0;\n for (int i = 3; i <= n; i += 2)\n {\n if (n % i == 0)\n {\n b = i;\n }\n }\n if (b == 0)\n {\n Console.WriteLine(\"1 \" + n);\n }\n else\n {\n var k = n / i;\n var a = 1;\n var b = i - 1;\n a = a * k;\n b = b * k;\n Console.WriteLine(a + \" \" + b);\n break;\n\n }\n\n }\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "288c1997609d1005fb954feef1f70e55", "src_uid": "3fd60db24b1873e906d6dee9c2508ac5", "apr_id": "31d5d3807230b3b11ba9c61b16e95cfe", "difficulty": 1300, "tags": ["greedy", "math", "number theory"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C#"} {"similarity_score": 0.7428571428571429, "equal_cnt": 15, "replace_cnt": 8, "delete_cnt": 4, "insert_cnt": 2, "fix_ops_cnt": 14, "bug_source_code": "using System;\nusing System.Collections.Generic;\n\nnamespace TaskB\n{\n class Program\n {\n private static Queue queue;\n\n static void Main(string[] args)\n {\n int t = NextInt();\n\n for (int i = 0; i < t; i++)\n {\n Solve();\n }\n }\n\n private static string ReadLine()\n {\n return Console.In.ReadLine();\n }\n\n private static readonly char[] d = { ' ', '\\n', '\\t', '\\r' };\n private static string NextString()\n {\n if (queue == null || queue.Count == 0)\n {\n var nl = ReadLine();\n if (nl == null)\n {\n return null;\n }\n\n queue = new Queue(nl.Split(d, StringSplitOptions.RemoveEmptyEntries));\n }\n\n return queue.Dequeue();\n }\n\n private static int NextInt()\n {\n return int.Parse(NextString());\n }\n\n private static long NextLong()\n {\n return long.Parse(NextString());\n }\n\n private static void Solve()\n {\n var n = NextLong();\n\n var t = n / 2;\n while (true)\n {\n var a = t;\n var b = n - t;\n\n if (a % b == 0 || b % a == 0)\n {\n Console.WriteLine(a + \" \" + b);\n return;\n }\n\n t--;\n }\n }\n\n private static long Gcd(long a, long b)\n {\n if (a == 0) return b;\n return Gcd(b % a, a);\n }\n }\n}", "lang": "Mono C#", "bug_code_uid": "d4666421783dcb55280674c2b7c7e452", "src_uid": "3fd60db24b1873e906d6dee9c2508ac5", "apr_id": "48dd8b3ac6615e8772a8bc63067eeced", "difficulty": 1300, "tags": ["greedy", "math", "number theory"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.5308264101442939, "equal_cnt": 13, "replace_cnt": 10, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 13, "bug_source_code": "using System;\n\nnamespace task1\n{\n class Program\n {\n public static int Gcd(int a, int b)\n {\n return b != 0 ? Gcd(b, a % b) : a;\n }\n\n public static int NOK(int a, int b)\n {\n return a * b / Gcd(a, b);\n }\n\n static void Main(string[] args)\n {\n int t = int.Parse(Console.ReadLine());\n for (int i = 0; i < t; i++)\n {\n int n = int.Parse(Console.ReadLine());\n /*if (n >= 100000)\n {\n Console.WriteLine($\"{1} {n - 1}\");\n continue;\n }*/\n int a = 1, b = n - 1, nok = NOK(a, b);\n int minA = a, minB = b, minNOK = nok;\n for (a = 2; a <= n / 2; a++)\n {\n b = n - a;\n nok = NOK(a, b);\n if (nok < minNOK)\n {\n minNOK = nok;\n minA = a;\n minB = b;\n }\n }\n Console.WriteLine($\"{minA} {minB}\");\n }\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "e5d8e68e1c0bc0218e3e24dc5ed20736", "src_uid": "3fd60db24b1873e906d6dee9c2508ac5", "apr_id": "556f323ad5e97aeed96c992170e24597", "difficulty": 1300, "tags": ["greedy", "math", "number theory"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.2632398753894081, "equal_cnt": 12, "replace_cnt": 7, "delete_cnt": 4, "insert_cnt": 1, "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 B\n{\n class Program\n {\n static long LargestProperFactor(long n)\n {\n for (long i = n - 1; i > 0; i--)\n if (n % i == 0)\n return i;\n //unreachable\n return -1;\n }\n static void Main(string[] args)\n {\n int t = int.Parse(Console.ReadLine());\n while (t-- > 0)\n {\n long n = long.Parse(Console.ReadLine());\n if (n % 2 == 0)\n Console.WriteLine(n / 2 + \" \" + n / 2);\n else\n {\n long k = LargestProperFactor(n);\n Console.WriteLine(k + \" \" + (n - k));\n }\n }\n Console.ReadLine();\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "8b3f9562892a0395cc926341ffd35db8", "src_uid": "3fd60db24b1873e906d6dee9c2508ac5", "apr_id": "3d06384b691dda8fb727034f25c569ca", "difficulty": 1300, "tags": ["greedy", "math", "number theory"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9688442211055276, "equal_cnt": 5, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 4, "bug_source_code": "\n\n\nusing System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\nusing System.Text;\n class Program\n {\n \n public static int[] ReadIntArray()\n {\n return Console.ReadLine().Split(' ').Select(int.Parse).ToArray();\n }\n public static void ReadIntPair(out int a, out int b)\n {\n var ar = ReadIntArray();\n a = ar[0];\n b = ar[1];\n }\n public static int ReadInt()\n {\n return int.Parse(Console.ReadLine());\n }\n \n \n \nstatic void Main(string[] args){\n \n \n var n=ReadInt();\n for(int i=0;i Solve(TextReader inputStream)\n {\n var tests = inputStream.ReadInt();\n for (int t = 0; t < tests; t++)\n {\n var n = inputStream.ReadInt();\n var divs = GetDivisiors(n).Where(i => i != n);\n\n var minA = int.MaxValue;\n var minLcm = long.MaxValue;\n\n foreach (var div in divs)\n {\n var a = div;\n var b = n - a;\n var lcm = Lcm(a, b);\n if (lcm < minLcm)\n {\n minA = a;\n minLcm = lcm;\n }\n }\n\n var minB = n - minA;\n\n yield return $\"{minA} {minB}\";\n }\n }\n\n IEnumerable GetDivisiors(int n)\n {\n for (int i = 1; i * i <= n; i++)\n {\n if (n % i == 0)\n {\n yield return i;\n if (i * i != n)\n {\n yield return n / i;\n }\n }\n }\n }\n\n public static long Gcd(long a, long b)\n {\n if (a < b)\n {\n (a, b) = (b, a);\n }\n\n if (b == 0)\n {\n return a;\n }\n else\n {\n return Gcd(b, a % b);\n }\n }\n\n public static long Lcm(long a, long b)\n {\n if (a < 0 || b < 0)\n {\n throw new ArgumentOutOfRangeException($\"{nameof(a)}, {nameof(b)}は0以上の整数である必要があります。\");\n }\n\n return a / Gcd(a, b) * b;\n }\n\n }\n}\n\nnamespace CodeforcesRound655Div2\n{\n class Program\n {\n static void Main(string[] args)\n {\n IAtCoderQuestion question = new QuestionD();\n var answers = question.Solve(Console.In);\n\n var writer = new StreamWriter(Console.OpenStandardOutput()) { AutoFlush = false };\n Console.SetOut(writer);\n foreach (var answer in answers)\n {\n Console.WriteLine(answer);\n }\n Console.Out.Flush();\n }\n }\n}\n\n#region Base Class\n\nnamespace CodeforcesRound655Div2.Questions\n{\n\n public interface IAtCoderQuestion\n {\n IEnumerable Solve(string input);\n IEnumerable Solve(TextReader inputStream);\n }\n\n public abstract class AtCoderQuestionBase : IAtCoderQuestion\n {\n public IEnumerable Solve(string input)\n {\n var stream = new MemoryStream(Encoding.Unicode.GetBytes(input));\n var reader = new StreamReader(stream, Encoding.Unicode);\n\n return Solve(reader);\n }\n\n public abstract IEnumerable Solve(TextReader inputStream);\n }\n}\n\n#endregion\n\n#region Extensions\n\nnamespace CodeforcesRound655Div2.Extensions\n{\n public static class StringExtensions\n {\n public static string Join(this IEnumerable source) => string.Concat(source);\n public static string Join(this IEnumerable source, string separator) => string.Join(separator, source);\n }\n\n public static class TextReaderExtensions\n {\n public static int ReadInt(this TextReader reader) => int.Parse(ReadString(reader));\n public static long ReadLong(this TextReader reader) => long.Parse(ReadString(reader));\n public static double ReadDouble(this TextReader reader) => double.Parse(ReadString(reader));\n public static string ReadString(this TextReader reader) => reader.ReadLine();\n\n public static int[] ReadIntArray(this TextReader reader, char separator = ' ') => ReadStringArray(reader, separator).Select(int.Parse).ToArray();\n public static long[] ReadLongArray(this TextReader reader, char separator = ' ') => ReadStringArray(reader, separator).Select(long.Parse).ToArray();\n public static double[] ReadDoubleArray(this TextReader reader, char separator = ' ') => ReadStringArray(reader, separator).Select(double.Parse).ToArray();\n public static string[] ReadStringArray(this TextReader reader, char separator = ' ') => reader.ReadLine().Split(separator);\n\n // Supports primitive type only.\n public static T1 ReadValue(this TextReader reader) => (T1)Convert.ChangeType(reader.ReadLine(), typeof(T1));\n\n public static (T1, T2) ReadValue(this TextReader reader, char separator = ' ')\n {\n var inputs = ReadStringArray(reader, separator);\n var v1 = (T1)Convert.ChangeType(inputs[0], typeof(T1));\n var v2 = (T2)Convert.ChangeType(inputs[1], typeof(T2));\n return (v1, v2);\n }\n\n public static (T1, T2, T3) ReadValue(this TextReader reader, char separator = ' ')\n {\n var inputs = ReadStringArray(reader, separator);\n var v1 = (T1)Convert.ChangeType(inputs[0], typeof(T1));\n var v2 = (T2)Convert.ChangeType(inputs[1], typeof(T2));\n var v3 = (T3)Convert.ChangeType(inputs[2], typeof(T3));\n return (v1, v2, v3);\n }\n\n public static (T1, T2, T3, T4) ReadValue(this TextReader reader, char separator = ' ')\n {\n var inputs = ReadStringArray(reader, separator);\n var v1 = (T1)Convert.ChangeType(inputs[0], typeof(T1));\n var v2 = (T2)Convert.ChangeType(inputs[1], typeof(T2));\n var v3 = (T3)Convert.ChangeType(inputs[2], typeof(T3));\n var v4 = (T4)Convert.ChangeType(inputs[3], typeof(T4));\n return (v1, v2, v3, v4);\n }\n\n public static (T1, T2, T3, T4, T5) ReadValue(this TextReader reader, char separator = ' ')\n {\n var inputs = ReadStringArray(reader, separator);\n var v1 = (T1)Convert.ChangeType(inputs[0], typeof(T1));\n var v2 = (T2)Convert.ChangeType(inputs[1], typeof(T2));\n var v3 = (T3)Convert.ChangeType(inputs[2], typeof(T3));\n var v4 = (T4)Convert.ChangeType(inputs[3], typeof(T4));\n var v5 = (T5)Convert.ChangeType(inputs[4], typeof(T5));\n return (v1, v2, v3, v4, v5);\n }\n\n public static (T1, T2, T3, T4, T5, T6) ReadValue(this TextReader reader, char separator = ' ')\n {\n var inputs = ReadStringArray(reader, separator);\n var v1 = (T1)Convert.ChangeType(inputs[0], typeof(T1));\n var v2 = (T2)Convert.ChangeType(inputs[1], typeof(T2));\n var v3 = (T3)Convert.ChangeType(inputs[2], typeof(T3));\n var v4 = (T4)Convert.ChangeType(inputs[3], typeof(T4));\n var v5 = (T5)Convert.ChangeType(inputs[4], typeof(T5));\n var v6 = (T6)Convert.ChangeType(inputs[5], typeof(T6));\n return (v1, v2, v3, v4, v5, v6);\n }\n\n public static (T1, T2, T3, T4, T5, T6, T7) ReadValue(this TextReader reader, char separator = ' ')\n {\n var inputs = ReadStringArray(reader, separator);\n var v1 = (T1)Convert.ChangeType(inputs[0], typeof(T1));\n var v2 = (T2)Convert.ChangeType(inputs[1], typeof(T2));\n var v3 = (T3)Convert.ChangeType(inputs[2], typeof(T3));\n var v4 = (T4)Convert.ChangeType(inputs[3], typeof(T4));\n var v5 = (T5)Convert.ChangeType(inputs[4], typeof(T5));\n var v6 = (T6)Convert.ChangeType(inputs[5], typeof(T6));\n var v7 = (T7)Convert.ChangeType(inputs[6], typeof(T7));\n return (v1, v2, v3, v4, v5, v6, v7);\n }\n }\n}\n\n#endregion\n", "lang": "Mono C#", "bug_code_uid": "a14edbdcc4c08b350047420e33a44888", "src_uid": "3fd60db24b1873e906d6dee9c2508ac5", "apr_id": "fe81d58e605b4eebb23f1e16b8021070", "difficulty": 1300, "tags": ["greedy", "math", "number theory"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.5037200330669606, "equal_cnt": 20, "replace_cnt": 16, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 19, "bug_source_code": " using System;\n using System.Collections.Generic;\n using System.Globalization;\n using System.IO;\n using System.Linq;\n using System.Runtime.CompilerServices;\n using System.Runtime.InteropServices;\n using System.Threading;\n\n namespace Codeforces\n {\n class Program : IDisposable\n {\n private static readonly TextReader textReader = new StreamReader(Console.OpenStandardInput());\n private static readonly TextWriter textWriter = new StreamWriter(Console.OpenStandardOutput());\n\n\n private void Solve()\n {\n var n = int.Parse(Console.ReadLine());\n var input = Console.ReadLine().Split(' ').Select(int.Parse).ToList();\n var fit = new bool[n];\n var contest = new bool[n];\n var resArrays = new List>();\n //resArrays.Add();\n for(int i = 0;i(){1});\n resArrays.Add(new List(){2});\n }\n else if(fit[i] && !contest[i])\n resArrays.Add(new List(){1});\n else if (!fit[i] && contest[i])\n resArrays.Add(new List() { 2 });\n else\n resArrays.Add(new List() { 0 });\n }\n else\n {\n var newArr = new List();\n for (int j = 0;j x == 0);\n min = Math.Min(min, val);\n }\n Console.WriteLine(min);\n }\n\n int Decide(bool fit, bool contest, int prev)\n {\n if (!fit && !contest)\n return 0;\n\n if (prev == 0)\n {\n if (fit && !contest)\n return 1;\n if (contest && !fit)\n return 2;\n }\n\n if (prev == 1)\n {\n return contest ? 2 : 0;\n }\n\n if (prev == 2)\n {\n return fit ? 1 : 0;\n }\n return -1;\n }\n\n static void Main(string[] args)\n {\n var p = new Program();\n p.Solve();\n Console.ReadLine();\n p.Dispose();\n }\n\n #region Helpers\n\n private static int ReadInt()\n {\n return int.Parse(textReader.ReadLine());\n }\n\n private static long ReadLong()\n {\n return long.Parse(textReader.ReadLine());\n }\n\n private static int[] ReadIntArray()\n {\n return textReader.ReadLine().Split(' ').Select(int.Parse).ToArray();\n }\n #endregion\n\n public void Dispose()\n {\n textReader.Close();\n textWriter.Close();\n }\n }\n }\n", "lang": "MS C#", "bug_code_uid": "86a31d53cfc5a97b84977147df43b261", "src_uid": "08f1ba79ced688958695a7cfcfdda035", "apr_id": "5408438cb6fa8147a320c112c06effac", "difficulty": 1400, "tags": ["dp", "brute force"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9298710475181063, "equal_cnt": 18, "replace_cnt": 4, "delete_cnt": 1, "insert_cnt": 12, "fix_ops_cnt": 17, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Globalization;\nusing System.IO;\nusing System.Linq;\n\nnamespace CF317\n{\n\tinternal class Program\n\t{\n\t\tprivate static void Main(string[] args)\n\t\t{\n\t\t\tvar sr = new InputReader(Console.In);\n\t\t\t//var sr = new InputReader(new StreamReader(\"input.txt\"));\n\t\t\tvar task = new Task();\n\t\t\tusing (var sw = Console.Out)\n\t\t\t//using (var sw = new StreamWriter(\"output.txt\"))\n\t\t\t{\n\t\t\t\ttask.Solve(sr, sw);\n\t\t\t\t//Console.ReadKey();\n\t\t\t}\n\t\t}\n\t}\n\n\tinternal class Task\n\t{\n\t\tprivate int n;\n\t\tprivate int[] array;\n\n\t\tpublic void Solve(InputReader sr, TextWriter sw)\n\t\t{\n\t\t\tn = sr.NextInt32();\n\t\t\tarray = sr.ReadArray(Int32.Parse);\n\t\t\tvar answ = Max(0, 0, 0);\n\n\t\t\tsw.WriteLine(n - answ);\n\t\t}\n\n\t\tpublic int Max(int indx, int prev, int currVal)\n\t\t{\n\t\t\tif (indx == n)\n\t\t\t\treturn currVal;\n\n\t\t\tvar next = array[indx];\n\t\t\tif (next == 0) {\n\t\t\t\treturn Max(indx + 1, 0, currVal);\n\t\t\t}\n\t\t\tif (next == 1) {\n\t\t\t\tif (prev == 1) {\n\t\t\t\t\treturn Max(indx + 1, 0, currVal);\n\t\t\t\t}\n\t\t\t\tif (prev == 2 || prev == 0) {\n\t\t\t\t\treturn Max(indx + 1, 1, currVal + 1);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (next == 2) {\n\t\t\t\tif (prev == 2) {\n\t\t\t\t\treturn Max(indx + 1, 0, currVal);\n\t\t\t\t}\n\t\t\t\tif (prev == 1 || prev == 0) {\n\t\t\t\t\treturn Max(indx + 1, 2, currVal + 1);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (next == 3) {\n\t\t\t\tif (prev == 1) {\n\t\t\t\t\treturn Max(indx + 1, 2, currVal + 1);\n\t\t\t\t}\n\t\t\t\tif (prev == 2) {\n\t\t\t\t\treturn Max(indx + 1, 1, currVal + 1);\n\t\t\t\t}\n\t\t\t\tif (prev == 0) {\n\t\t\t\t\treturn Math.Max(Max(indx + 1, 2, currVal + 1), Max(indx + 1, 1, currVal + 1));\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn 0;\n\t\t}\n\t}\n}\n\ninternal class InputReader : IDisposable\n{\n\tprivate bool isDispose;\n\tprivate readonly TextReader sr;\n\n\tpublic InputReader(TextReader stream)\n\t{\n\t\tsr = stream;\n\t}\n\n\tpublic void Dispose()\n\t{\n\t\tDispose(true);\n\t\tGC.SuppressFinalize(this);\n\t}\n\n\tpublic string NextString()\n\t{\n\t\tvar result = sr.ReadLine();\n\t\treturn result;\n\t}\n\n\tpublic int NextInt32()\n\t{\n\t\treturn Int32.Parse(NextString());\n\t}\n\n\tpublic long NextInt64()\n\t{\n\t\treturn Int64.Parse(NextString());\n\t}\n\n\tpublic string[] NextSplitStrings()\n\t{\n\t\treturn NextString()\n\t\t\t.Split(new[] { ' ' }, StringSplitOptions.RemoveEmptyEntries);\n\t}\n\n\tpublic T[] ReadArray(Func func)\n\t{\n\t\treturn NextSplitStrings()\n\t\t\t.Select(s => func(s, CultureInfo.InvariantCulture))\n\t\t\t.ToArray();\n\t}\n\n\tpublic T[] ReadArrayFromString(Func func, string str)\n\t{\n\t\treturn\n\t\t\tstr.Split(new[] { ' ' }, StringSplitOptions.RemoveEmptyEntries)\n\t\t\t\t.Select(s => func(s, CultureInfo.InvariantCulture))\n\t\t\t\t.ToArray();\n\t}\n\n\tprotected void Dispose(bool dispose)\n\t{\n\t\tif (!isDispose)\n\t\t{\n\t\t\tif (dispose)\n\t\t\t\tsr.Close();\n\t\t\tisDispose = true;\n\t\t}\n\t}\n\n\t~InputReader()\n\t{\n\t\tDispose(false);\n\t}\n}", "lang": "MS C#", "bug_code_uid": "c5f4b0628b6efcd7769b88f091cb7e2c", "src_uid": "08f1ba79ced688958695a7cfcfdda035", "apr_id": "550ce5eb81d89bd01fcf559c57e7d26a", "difficulty": 1400, "tags": ["dp", "brute force"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.9996609020006781, "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.Globalization;\nusing System.IO;\nusing System.Linq;\n\nnamespace CF317\n{\n\tinternal class Program\n\t{\n\t\tprivate static void Main(string[] args)\n\t\t{\n\t\t\tvar sr = new InputReader(Console.In);\n\t\t\t//var sr = new InputReader(new StreamReader(\"input.txt\"));\n\t\t\tvar task = new Task();\n\t\t\tusing (var sw = Console.Out)\n\t\t\t//using (var sw = new StreamWriter(\"output.txt\"))\n\t\t\t{\n\t\t\t\ttask.Solve(sr, sw);\n\t\t\t\t//Console.ReadKey();\n\t\t\t}\n\t\t}\n\t}\n\n\tinternal class Task\n\t{\n\t\tprivate int[] array;\n\n\t\tpublic void Solve(InputReader sr, TextWriter sw)\n\t\t{\n\t\t\tvar n = sr.NextInt32();\n\t\t\tarray = sr.ReadArray(Int32.Parse);\n\t\t\tvar answ = Max(0, 0, 0, n);\n\n\t\t\tsw.WriteLine(n - answ);\n\t\t}\n\n\t\tpublic int Max(int indx, int prev, int currVal, int n)\n\t\t{\n\t\t\tif (indx == n)\n\t\t\t\treturn currVal;\n\n\t\t\tvar next = array[indx];\n\t\t\tif (next == 0) {\n\t\t\t\treturn Max(indx + 1, 0, currVal, n);\n\t\t\t}\n\t\t\tif (next == 1) {\n\t\t\t\tif (prev == 1) {\n\t\t\t\t\treturn Max(indx + 1, 0, currVal, n);\n\t\t\t\t}\n\t\t\t\tif (prev == 2 || prev == 0) {\n\t\t\t\t\treturn Max(indx + 1, 1, currVal + 1, n);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (next == 2) {\n\t\t\t\tif (prev == 2) {\n\t\t\t\t\treturn Max(indx + 1, 0, currVal, n);\n\t\t\t\t}\n\t\t\t\tif (prev == 1 || prev == 0) {\n\t\t\t\t\treturn Max(indx + 1, 2, currVal + 1, n);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (next == 3) {\n\t\t\t\tif (prev == 1) {\n\t\t\t\t\treturn Max(indx + 1, 2, currVal + 1, n);\n\t\t\t\t}\n\t\t\t\tif (prev == 2) {\n\t\t\t\t\treturn Max(indx + 1, 1, currVal + 1, n);\n\t\t\t\t}\n\t\t\t\tif (prev == 0) {\n\t\t\t\t\tvar nextIndx = indx + 1;\n\t\t\t\t\twhile (nextIndx < array.Length && array[nextIndx] != 0) {\n\t\t\t\t\t\tnextIndx++;\n\t\t\t\t\t}\n\t\t\t\t\tvar resVal1 = Max(indx + 1, 2, currVal + 1, nextIndx);\n\t\t\t\t\tvar resVal2 = Max(indx + 1, 1, currVal + 1, nextIndx);\n\t\t\t\t\treturn Max(nextIndx + 1, 0, Math.Max(resVal1, resVal2), n);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn 0;\n\t\t}\n\t}\n}\n\ninternal class InputReader : IDisposable\n{\n\tprivate bool isDispose;\n\tprivate readonly TextReader sr;\n\n\tpublic InputReader(TextReader stream)\n\t{\n\t\tsr = stream;\n\t}\n\n\tpublic void Dispose()\n\t{\n\t\tDispose(true);\n\t\tGC.SuppressFinalize(this);\n\t}\n\n\tpublic string NextString()\n\t{\n\t\tvar result = sr.ReadLine();\n\t\treturn result;\n\t}\n\n\tpublic int NextInt32()\n\t{\n\t\treturn Int32.Parse(NextString());\n\t}\n\n\tpublic long NextInt64()\n\t{\n\t\treturn Int64.Parse(NextString());\n\t}\n\n\tpublic string[] NextSplitStrings()\n\t{\n\t\treturn NextString()\n\t\t\t.Split(new[] { ' ' }, StringSplitOptions.RemoveEmptyEntries);\n\t}\n\n\tpublic T[] ReadArray(Func func)\n\t{\n\t\treturn NextSplitStrings()\n\t\t\t.Select(s => func(s, CultureInfo.InvariantCulture))\n\t\t\t.ToArray();\n\t}\n\n\tpublic T[] ReadArrayFromString(Func func, string str)\n\t{\n\t\treturn\n\t\t\tstr.Split(new[] { ' ' }, StringSplitOptions.RemoveEmptyEntries)\n\t\t\t\t.Select(s => func(s, CultureInfo.InvariantCulture))\n\t\t\t\t.ToArray();\n\t}\n\n\tprotected void Dispose(bool dispose)\n\t{\n\t\tif (!isDispose)\n\t\t{\n\t\t\tif (dispose)\n\t\t\t\tsr.Close();\n\t\t\tisDispose = true;\n\t\t}\n\t}\n\n\t~InputReader()\n\t{\n\t\tDispose(false);\n\t}\n}", "lang": "MS C#", "bug_code_uid": "9c505a7f93505eb211393defcd8e2d22", "src_uid": "08f1ba79ced688958695a7cfcfdda035", "apr_id": "550ce5eb81d89bd01fcf559c57e7d26a", "difficulty": 1400, "tags": ["dp", "brute force"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.30335097001763667, "equal_cnt": 23, "replace_cnt": 18, "delete_cnt": 5, "insert_cnt": 1, "fix_ops_cnt": 24, "bug_source_code": "\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace CodeForces\n{\n class A\n {\n static void Main(string[] args)\n {\n string[] token = Console.ReadLine().Split();\n long n = long.Parse(token[0]);\n long s = long.Parse(token[1]);\n string nInS = n.ToString();\n long nDigitSum = 0;\n\n for (int i = 0; i < nInS.Length; i++)\n {\n nDigitSum += nInS[i];\n }\n\n long num = n - nDigitSum;\n\n\n long nsDiff = n - s + 1;\n string sDigits = s.ToString();\n string newSDigits = \"\";\n if (sDigits.Length == 1)\n {\n newSDigits = \"0\";\n }\n else\n {\n for (int i = 0; i < sDigits.Length - 1; i++)\n {\n newSDigits += sDigits[i];\n }\n }\n long newSNums = (int.Parse(newSDigits) + 1) * 10;\n long groupNum = nsDiff - (newSNums - s);\n\n Console.WriteLine(Math.Max(0,groupNum));\n\n\n Console.Read();\n }\n\n }\n}\n\n", "lang": "Mono C#", "bug_code_uid": "41ca501e4626256e2b7de027dd1ef65f", "src_uid": "9704e2ac6a158d5ced8fd1dc1edb356b", "apr_id": "17ff8d3e85d6cc626d96ffe22a321ccb", "difficulty": 1600, "tags": ["dp", "math", "brute force", "binary search"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.3032172763331864, "equal_cnt": 23, "replace_cnt": 18, "delete_cnt": 5, "insert_cnt": 1, "fix_ops_cnt": 24, "bug_source_code": "\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace CodeForces\n{\n class A\n {\n static void Main(string[] args)\n {\n string[] token = Console.ReadLine().Split();\n long n = long.Parse(token[0]);\n long s = long.Parse(token[1]);\n string nInS = n.ToString();\n long nDigitSum = 0;\n\n for (int i = 0; i < nInS.Length; i++)\n {\n nDigitSum += nInS[i];\n }\n\n long num = n - nDigitSum;\n\n\n long nsDiff = n - s + 1;\n string sDigits = s.ToString();\n string newSDigits = \"\";\n if (sDigits.Length == 1)\n {\n newSDigits = \"0\";\n }\n else\n {\n for (int i = 0; i < sDigits.Length - 1; i++)\n {\n newSDigits += sDigits[i];\n }\n }\n long newSNums = (long.Parse(newSDigits) + 1) * 10;\n long groupNum = nsDiff - (newSNums - s);\n\n Console.WriteLine(Math.Max(0,groupNum));\n\n\n Console.Read();\n }\n\n }\n}\n\n", "lang": "Mono C#", "bug_code_uid": "2378aa3df83e54aa6eea93cd38d67d09", "src_uid": "9704e2ac6a158d5ced8fd1dc1edb356b", "apr_id": "17ff8d3e85d6cc626d96ffe22a321ccb", "difficulty": 1600, "tags": ["dp", "math", "brute force", "binary search"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9609882964889467, "equal_cnt": 4, "replace_cnt": 0, "delete_cnt": 3, "insert_cnt": 0, "fix_ops_cnt": 3, "bug_source_code": "using Codeforces.Common;\nusing System;\nusing System.Diagnostics.Contracts;\nusing System.Globalization;\nusing System.IO;\nusing System.Linq;\nusing System.Numerics;\nusing System.Xml.Schema;\n\nnamespace Codeforces.R320C\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 Contract.Requires(tr != null);\n Contract.Requires(tw != null);\n\n tw.WriteLine(Parse(tr));\n }\n\n private static int Parse(TextReader tr)\n {\n var l = tr.ReadLine();\n\n return Calc(l);\n }\n\n public static int Calc(string value)\n {\n Contract.Requires(value != null);\n\n var n = value.Length;\n var res = 0L;\n const int mod = 1000000007;\n\n foreach (char c in value)\n {\n res <<= 1;\n res += c == '1' ? 1 : 0;\n res %= mod;\n }\n\n return (int)(res * ModPow(2, n - 1, mod) % mod);\n }\n\n public static long ModPow(long x, int n, int mod)\n {\n var res = 1L;\n for (; n > 0; n >>= 1)\n {\n if ((n & 1) == 1)\n {\n res = res * x % mod;\n }\n x = x * x % mod;\n }\n return res;\n }\n\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "8cd1cb3e12ba487089c14b3da6d9cddc", "src_uid": "89b51a31e00424edd1385f2120028b9d", "apr_id": "dc826e10f67e61def0166b0fd2df4779", "difficulty": 1600, "tags": ["math"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C#"} {"similarity_score": 0.9931584948688712, "equal_cnt": 6, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 5, "fix_ops_cnt": 6, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\nusing System.Security.Cryptography;\nusing System.IO;\n\nnamespace kursach\n{\n class Program\n {\n static void Main(string[] args)\n {\n \n int n = int.Parse(Console.ReadLine());\n int[] arr = new int[n];\n string[] s= Console.ReadLine().Split(' ');\n for (int i = 0; i < n; i++)\n {\n arr[i] = int.Parse(s[i]);\n }\n Array.Sort(arr);\n bool ans1 = false;\n bool ans2 = false;\n int d = arr[n - 1] - arr[0];\n int a = (arr[0] + arr[n - 1]) / 2;\n int c = arr[n - 1] - a;\n for (int i = 0; i < n; i++)\n {\n if (arr[i] + d == arr[n - 1] || arr[i] == arr[n - 1])\n {\n ans1 = true;\n }\n else\n {\n ans1 = false;\n break;\n }\n }\n for (int i = 0; i < n; i++)\n {\n if (arr[i] + c == a || arr[i] == a || arr[i] - c == a)\n {\n ans2 = true;\n }\n else\n {\n ans2 = false;\n break;\n }\n }\n if (ans2 == true)\n {\n Console.WriteLine(c);\n }\n else\n {\n if (ans1 == true)\n {\n Console.WriteLine(d);\n }\n else\n {\n Console.WriteLine(-1);\n }\n }\n }\n}", "lang": "Mono C#", "bug_code_uid": "46e9faf6e118ff02aaacaefe65c65eb6", "src_uid": "d486a88939c132848a7efdf257b9b066", "apr_id": "35a07affebcd160778c6ab6f820c7e71", "difficulty": 1200, "tags": ["math"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.9361702127659575, "equal_cnt": 3, "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.Text;\nusing System.Threading.Tasks;\n\nnamespace CodeForceCondole\n{\n class Program\n {\n static void Main(string[] args)\n {\n ulong n = Convert.ToUInt64(Console.ReadLine()); //стоимость секретов n - марок\n while (n % 3 == 0)\n n /= 3;\n Console.WriteLine(n / 3 + 1);\n Main(null);\n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "29626741d344b5975a9c8b7f0fb31879", "src_uid": "7e7b59f2112fd200ee03255c0c230ebd", "apr_id": "e663a95595eccd0557a91ff27d15bda0", "difficulty": 1600, "tags": ["greedy"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "delete", "lang_cluster": "C#"} {"similarity_score": 0.8051668460710442, "equal_cnt": 7, "replace_cnt": 6, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 6, "bug_source_code": "using System;\nusing System.Collections;\nusing System.IO;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\n\nnamespace ConsoleApplication2\n{\n class Program\n {\n static void Main(string[] args)\n {\n long n=int.Parse(Console.ReadLine());\n if (n % 3 == 0 || n == 1) { Console.WriteLine(\"1\"); return; }\n Console.WriteLine(n / 3 + 1); \n \n //Console.ReadKey();\n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "d9d8b527ba02fc830e9b6535426ce175", "src_uid": "7e7b59f2112fd200ee03255c0c230ebd", "apr_id": "03501dba6099aa940c9651d9cc4dd037", "difficulty": 1600, "tags": ["greedy"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9953051643192489, "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 CodeForceCondole\n{\n class Program\n {\n static void Main(string[] args)\n {\n ulong n = Convert.ToUInt32(Console.ReadLine()); //стоимость секретов n - марок\n while (n % 3 == 0)\n n /= 3;\n Console.WriteLine(n / 3 + 1);\n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "049ea4128a3ad6503264f52538cb973a", "src_uid": "7e7b59f2112fd200ee03255c0c230ebd", "apr_id": "110c41c2d18aefefa226616b398c25a6", "difficulty": 1600, "tags": ["greedy"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9983089930822444, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Globalization;\nusing System.Linq;\nusing System.Text;\nusing System.Text.RegularExpressions;\nusing System.Threading;\n\nnamespace Codeforces\n{\n class B\n {\n private static ThreadStart s_threadStart = new B().Go;\n\n private void Go()\n {\n string s = GetString();\n char[] ar = s.ToCharArray();\n char next = 'a';\n\n for (int i = 0; i < s.Length; i++)\n {\n if (ar[i] <= next)\n continue;\n if (ar[i] > next + 1)\n {\n Wl(\"NO\");\n return;\n }\n\n next++;\n }\n\n Wl(\"YES\");\n }\n\n #region Template\n\n private static StringBuilder output = new StringBuilder();\n\n public static void Main(string[] args)\n {\n System.Diagnostics.Stopwatch timer = new System.Diagnostics.Stopwatch();\n output.Length = 0;\n Thread main = new Thread(new ThreadStart(s_threadStart), 512 * 1024 * 1024);\n timer.Start();\n main.Start();\n main.Join();\n Console.Write(output);\n timer.Stop();\n Console.Error.WriteLine(timer.ElapsedMilliseconds);\n }\n\n private static IEnumerator ioEnum;\n private static string GetString()\n {\n do\n {\n while (ioEnum == null || !ioEnum.MoveNext())\n {\n ioEnum = Console.ReadLine().Split().AsEnumerable().GetEnumerator();\n }\n } while (string.IsNullOrEmpty(ioEnum.Current));\n\n return ioEnum.Current;\n }\n\n\n private static int GetInt()\n {\n return int.Parse(GetString());\n }\n\n private static long GetLong()\n {\n return long.Parse(GetString());\n }\n\n private static double GetDouble()\n {\n return double.Parse(GetString());\n }\n\n private static List GetIntArr(int n)\n {\n List ret = new List(n);\n for (int i = 0; i < n; i++)\n {\n ret.Add(GetInt());\n }\n return ret;\n }\n\n private static void Wl(T o)\n {\n W(o);\n output.Append(Console.Out.NewLine);\n }\n\n private static void Wl(IEnumerable enumerable)\n {\n W(enumerable);\n output.Append(Console.Out.NewLine);\n }\n\n private static void W(T o)\n {\n if (o is double)\n {\n Wd((o as double?).Value, \"\");\n }\n else if (o is float)\n {\n Wd((o as float?).Value, \"\");\n }\n else\n output.Append(o.ToString());\n }\n\n private static void W(IEnumerable enumerable)\n {\n W(string.Join(\" \", enumerable.Select(e => e.ToString()).ToArray()));\n }\n\n private static void Wd(double d, string format)\n {\n W(d.ToString(format, CultureInfo.InvariantCulture));\n }\n\n #endregion\n }\n}", "lang": "MS C#", "bug_code_uid": "1ed2045a30eb514d1ba5027578be6e98", "src_uid": "c4551f66a781b174f95865fa254ca972", "apr_id": "6a7f2434753e4dfa728e15e03aea3704", "difficulty": 1100, "tags": ["greedy", "strings", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.4524512699350266, "equal_cnt": 12, "replace_cnt": 5, "delete_cnt": 1, "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 _1236B\n{\n class Class1\n {\n public static void Main()\n {\n long[] input = Console.ReadLine().Split(' ').Select(a => long.Parse(a)).ToArray();\n long twopow = 1;\n\n for (long i = 0; i < input[1]; i++)\n {\n twopow *= 2;\n twopow %= 10000000000 + 7;\n }\n\n long num = twopow - 1;\n long ans = 1;\n\n for (long i = 0; i < input[0]; i++)\n {\n ans *= num;\n ans %= 10000000000 + 7;\n }\n\n Console.WriteLine(ans);\n //Console.ReadKey();\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "e0a908b3b07e7e98b2c2d9a9a61190be", "src_uid": "71029e5bf085b0f5f39d1835eb801891", "apr_id": "32d4ece6c2fe238e3ffad41261473029", "difficulty": 1500, "tags": ["math", "combinatorics"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.8654353562005277, "equal_cnt": 5, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 4, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\n\nnamespace ConsoleApp1\n{\n class Program\n {\n static void Main(string[] args)\n {\n \n var nm = Console.ReadLine().Split(' ').Select(long.Parse).ToArray();\n var n = nm[0];\n var m = nm[1];\n\n var result = PowerMod(PowerMod(2, m) - 1, n);\n Console.WriteLine(result);\n }\n\n static long PowerMod(long number, long power)\n {\n long res = 1;\n for(var i=0; i Convert.ToInt64(n)).ToArray();\n }\n \n private static int[] ConsoleReadLineAsArrayOfIntegers()\n {\n return Console.ReadLine().Split(' ').Select(n => Convert.ToInt32(n)).ToArray();\n }\n\n private static int[] ConsoleReadLineAsArrayOfIntegersReversed()\n {\n return Console.ReadLine().Split(' ').Select(n => Convert.ToInt32(n)).Reverse().ToArray();\n }\n\n private static long ConsoleReadLineAsLong()\n {\n return Convert.ToInt64(Console.ReadLine());\n }\n \n private static int ConsoleReadLineAsInteger()\n {\n return Convert.ToInt32(Console.ReadLine());\n }\n \n private static void ConsoleWriteLine(string line)\n {\n Console.WriteLine(line);\n }\n}", "lang": "Mono C#", "bug_code_uid": "7dc0f8c3609a075e536151eaffad88ef", "src_uid": "71029e5bf085b0f5f39d1835eb801891", "apr_id": "1eace7b37d3e3b743b767cb79a19eac1", "difficulty": 1500, "tags": ["math", "combinatorics"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.9821428571428571, "equal_cnt": 3, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "using System;\n\nnamespace CodefCS\n{\n class Program\n {\n static void Main(string[] args)\n {\n string[] tokens = Console.ReadLine().Split();\n\n long n = int.Parse(tokens[0]);\n long k= int.Parse(tokens[1]);\n\n Console.WriteLine($\"{n / 2 / (k + 1)} {n / 2 / (k + 1) * k} {n - n / 2 / (k + 1) - n / 2 / (k + 1) * k}\");\n }\n }\n}", "lang": "MS C#", "bug_code_uid": "4771835bcfb47697cea2c3fb5d9240eb", "src_uid": "405a70c3b3f1561a9546910ab3fb5c80", "apr_id": "7b8c17bfd62ab4f260f200d4b627e06c", "difficulty": 800, "tags": ["math", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9991753710830127, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Globalization;\nusing System.IO;\nusing System.Linq;\nusing System.Text;\n\nclass Program\n{\n private static void Main(string[] args)\n {\n var n = RL();\n var k = RL();\n\n long half = (n / 2);\n\n long l = 0;\n long r = n + 1;\n while (r - l > 1)\n {\n var mid = (l + r) / 2;\n var cnt = (k + 1) * mid;\n if (cnt <= half)\n l = mid;\n else\n r = mid;\n }\n\n long a = l;\n long b = l * k;\n long c = n - a - b;\n Console.WriteLine(a + \" \" + b + \" \" + c);\n }\n \n\n private const int Mod = 1000000000 + 7;\n\n #region Data Read\n\n private static long GCD(long a, long b)\n {\n if (a % b == 0) return b;\n return GCD(b, a % b);\n }\n\n private static List[] ReadTree(int n)\n {\n return ReadGraph(n, n - 1);\n }\n\n private static List[] ReadGraph(int n, int m)\n {\n List[] g = new List[n];\n for (int i = 0; i < g.Length; i++) g[i] = new List();\n for (int i = 0; i < m; i++)\n {\n int a = RI() - 1;\n int b = RI() - 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 = RI();\n int b = RI();\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 RI()\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 RUL()\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 RL()\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[] RIA(int n)\n {\n int[] ans = new int[n];\n for (int i = 0; i < n; i++)\n ans[i] = RI();\n return ans;\n }\n\n private static long[] RLA(int n)\n {\n long[] ans = new long[n];\n for (int i = 0; i < n; i++)\n ans[i] = RL();\n return ans;\n }\n\n private static char[] ReadWord()\n {\n int ans;\n\n do\n {\n ans = consoleReader.Read();\n } while (!((ans >= 'a' && ans <= 'z') || (ans >= 'A' && ans <= 'Z') || (ans == '*')));\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') || (ans == '*'));\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[] ReadStringLine()\n {\n int ans;\n\n do\n {\n ans = consoleReader.Read();\n } while (ans == 10 || ans == 13);\n\n List s = new List();\n\n do\n {\n s.Add((char)ans);\n ans = consoleReader.Read();\n } while (ans != 10 && ans != 13 && ans != -1);\n\n return s.ToArray();\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 private static char ReadNonLetter()\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 ReadAnyOf(IEnumerable allowed)\n {\n while (true)\n {\n char ans = (char)consoleReader.Read();\n if (allowed.Contains(ans))\n return 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 private static double DoubleFromString(string x)\n {\n return double.Parse(x, 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(StringBuilder sb)\n {\n PushTestData(sb.ToString());\n }\n private static void PushTestData(string data)\n {\n#if TOLYAN_TEST\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 #endregion\n}", "lang": "MS C#", "bug_code_uid": "0029f7e87ee2494d3a556892ec09969b", "src_uid": "405a70c3b3f1561a9546910ab3fb5c80", "apr_id": "aa5d39d57d1744d2608a186466fdbbc7", "difficulty": 800, "tags": ["math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.8460596930609171, "equal_cnt": 27, "replace_cnt": 8, "delete_cnt": 0, "insert_cnt": 18, "fix_ops_cnt": 26, "bug_source_code": "using System;\nusing System.Collections.Generic;\n\nnamespace Exercise4\n{\n class Program\n {\n static void Main(string[] args)//https://codeforces.com/contest/1286/problem/A\n {\n int n = Int32.Parse(Console.ReadLine()),\n lostSwitch;\n int[] p = new int[n];\n bool[] b = new bool[n];\n bool nothing = true;\n Stack[] lost = new Stack[2];\n lost[0] = new Stack();\n lost[1] = new Stack();\n\n string[] s = Console.ReadLine().Split(' ');\n for (int i = 0; i < n; i++)\n {\n p[i] = Int32.Parse(s[i]);\n if (p[i] != 0)\n b[p[i] - 1] = true;\n }\n for (int i = 0; i < n; i++)\n {\n if (b[i])\n {\n nothing = false;\n break;\n }\n }\n for (int i = 0; i < n; i++)\n if (!b[i])\n lost[(i + 1) % 2].Push(i + 1);\n\n if (nothing)//все 0\n {\n int k = 0;\n for (int i = 0; i < lost.Length; i++)\n while (lost[i].Count > 0)\n p[k++] = lost[i].Pop();\n }\n else\n {\n int firstNumberIndex = 0,\n lastNumberIndex = n - 1;\n while (p[firstNumberIndex] == 0)\n firstNumberIndex++;\n while (p[lastNumberIndex] == 0)\n lastNumberIndex--;\n\n int range = 0,\n firstNumberIndexSwitch = p[firstNumberIndex] % 2; //чтобы 5 раз заного не расчитывать \n lostSwitch = firstNumberIndexSwitch;//этот свич будем постоянно менять\n\n for (int i = firstNumberIndex + 1; i < lastNumberIndex; i++)//дырки\n if (p[i] == 0)\n range++;\n else\n {\n if (p[i] % 2 == lostSwitch)\n if (range <= lost[lostSwitch].Count)\n for (int j = 1; j <= range; j++)\n p[i - j] = lost[lostSwitch].Pop();\n else\n lostSwitch = (lostSwitch + 1) % 2;\n range = 0;\n }\n\n\n lostSwitch = p[lastNumberIndex] % 2;\n\n if (n - lastNumberIndex - 1 >= lost[lostSwitch].Count)\n for (int i = lastNumberIndex + 1; i < n; i++)//вперед от lastNumber (только числа =%2)\n p[i] = lost[lostSwitch].Pop();\n\n\n lostSwitch = firstNumberIndexSwitch;\n\n if (firstNumberIndex >= lost[lostSwitch].Count)//назад от firstNumber (только числа =%2)\n for (int i = firstNumberIndex - 1; i >= 0; i--)\n p[i] = lost[lostSwitch].Pop();\n\n\n lostSwitch = firstNumberIndexSwitch;\n\n if (lost[0].Count != 0 || lost[1].Count != 0)//вперед от firstNumber (все числа)\n for (int i = firstNumberIndex + 1; i < n; i++)\n if (p[i] != 0)\n lostSwitch = p[i] % 2;\n else if (lost[lostSwitch].Count > 0)\n p[i] = lost[lostSwitch].Pop();\n else\n {\n lostSwitch = (lostSwitch + 1) % 2;\n p[i] = lost[lostSwitch].Pop();\n }\n\n\n lostSwitch = firstNumberIndexSwitch;\n\n if (lost[0].Count != 0 || lost[1].Count != 0)//назад от firstNumber (все числа)\n for (int i = firstNumberIndex - 1; i >= 0; i--)\n if (p[i] != 0)\n lostSwitch = p[i] % 2;\n else if (lost[lostSwitch].Count > 0)\n p[i] = lost[lostSwitch].Pop();\n else\n {\n lostSwitch = (lostSwitch + 1) % 2;\n p[i] = lost[lostSwitch].Pop();\n }\n }\n int win = 0;\n lostSwitch = p[0] % 2;\n\n for (int i = 1; i < n; i++)//подсчет\n if (p[i] % 2 != lostSwitch)\n {\n win++;\n lostSwitch = (lostSwitch + 1) % 2;\n }\n Console.WriteLine(win);\n }\n\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "1828eb36c55f100decc0e08dd562e58f", "src_uid": "90db6b6548512acfc3da162144169dba", "apr_id": "3a68b476539115fa1d792813361644d7", "difficulty": 1800, "tags": ["dp", "greedy", "sortings"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.6158333333333333, "equal_cnt": 19, "replace_cnt": 12, "delete_cnt": 5, "insert_cnt": 1, "fix_ops_cnt": 18, "bug_source_code": "using System;\nusing System.Collections;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\n\nnamespace KROK_QR\n{\n \n\n class TaskD\n { \n static void Main(string[] args)\n {\n\n int a, n, i, j, max_sqrt;\n long p;\n double a_sqrt;\n string str;\n string[] s = new string[2];\n str = Console.ReadLine();\n s = str.Split();\n a = int.Parse(s[0]);\n n = int.Parse(s[1]);\n \n int[] squares = new int[3162];\n p = 0;\n \n for (i = 0; i < 3162; i++)\n squares[i] = (i + 1) * (i + 1); \n \n for (i = 0; i < n; i++, a++)\n {\n a_sqrt = Math.Sqrt(a);\n max_sqrt = (int)Math.Truncate(a_sqrt);\n \n for (j = max_sqrt - 1; j >= 0; j--)\n {\n //Console.WriteLine(a + \" \" + j + \" \" + squares[j]);\n if (a % squares[j] == 0)\n {\n p += a / squares[j];\n break;\n } \n }\n }\n \n Console.Write(p);\n \n }\n }\n}", "lang": "Mono C#", "bug_code_uid": "7e2411038a036961954635acde2de77a", "src_uid": "915081861e391958dce6ee2a117abd4e", "apr_id": "da03d0ae6699476b1c81bd9beb8e2778", "difficulty": 1500, "tags": ["number theory"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9353277606687197, "equal_cnt": 16, "replace_cnt": 5, "delete_cnt": 4, "insert_cnt": 6, "fix_ops_cnt": 15, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\n\nnamespace Calendar\n{\n class Program\n {\n static void Main(string[] args)\n {\n int v = 3200;\n long a,n,j,i,p,an,k;\n long[] kv = new long[v+1];\n long[] my = new long [1000001];\n string s;\n string[] ss;\n\n s = Console.ReadLine();\n ss = s.Split();\n a = Convert.ToInt32(ss[0]);\n n = Convert.ToInt32(ss[1]);\n // a:=1;\n // n := 9;\n p = 0;\n an = a + n - 1;\n\n for (i = 1; i <= v; i++) kv[i] = i*i;\n\n for (i = a; i <= an; i++) my[i] = 1;\n\n for (i = 2; i <= v; i++)\n {\n\n for (j = 1; j <= v; j++)\n {\n k = kv[i] * j;\n if (k < a) continue;\n if (k > an) break;\n my[k] = kv[i];\n }\n }\n\n for (i = a; i <= an; i++) p = p + i/my[i];\n\n\n Console.WriteLine(p); \n \n\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "f24135c9f3c3787d63307e510664b315", "src_uid": "915081861e391958dce6ee2a117abd4e", "apr_id": "22928818b3e3b8e008c281a51f380f0f", "difficulty": 1500, "tags": ["number theory"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.9984977466199298, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "using System;\nusing System.Collections.Generic;\n\nnamespace CrokContest\n{\n class Program\n {\n static void Main(string[] args)\n {\n var arr = Console.ReadLine().Split();\n int a = int.Parse(arr[0]);\n int n = int.Parse(arr[1]);\n\n int end = a + n -1;\n\n int sqrLen = 1;\n int[] table = new int[3163]; \n table[0] = 1;\n for (int i = 1; table[i-1] < end; ++i, ++sqrLen)\n table[i] = 1 + i*2 + table[i -1]; \n\n int max = end+1;\n int[] sqrs = new int[max];\n for (int i = 0; i < sqrLen; ++i)\n {\n for (int j = table[i]; j < max; j += table[i])\n {\n sqrs[j] = table[i];\n }\n }\n\n Decimal sum = 0;\n for (int i = a; i <= end; ++i)\n {\n sum += i / sqrs[i];\n }\n Console.Write(sum);\n }\n }\n}\n\nk", "lang": "Mono C#", "bug_code_uid": "9b71ef03b2654a3972fb9a0049984293", "src_uid": "915081861e391958dce6ee2a117abd4e", "apr_id": "1055e290d10d0acd69c1fc71454d85b5", "difficulty": 1500, "tags": ["number theory"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.5963302752293578, "equal_cnt": 20, "replace_cnt": 18, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 20, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Security.AccessControl;\nusing System.Security.Cryptography;\nusing System.Web;\n\nclass Program\n{\n static int Max(int a1, int a2, int a3)\n {\n int max = a1 > a2 ? a1 : a2;\n return a3 > max ? a3 : max;\n }\n\n static int Max(int a1, int a2)\n {\n return a1 > a2 ? a1 : a2;\n }\n\n static void Main(string[] args)\n {\n var str = Console.ReadLine().Split(' ').Select(int.Parse).ToList();\n\n int n = str[0];\n int k = str[1];\n int BG = 1000000007;\n\n\n int[,] dp = new int [n+1, k+1];\n\n\n for (int i = 0; i <= n; i++)\n {\n dp[i,1] = 1;\n }\n\n\n for (int i = 0; i <= k; i++)\n {\n dp[1,i] = 1;\n }\n\n for (int j = 2; j <= k; j++)\n {\n for (int i = 2; i <= n; i++)\n {\n int sum = 0;\n int exp = 1;\n while (i >= exp)\n {\n if (i % exp == 0)\n {\n sum = (sum + dp[i / exp, j - 1]) % BG;\n }\n\n exp++;\n }\n\n dp[i, j] = sum;\n }\n }\n\n int res = 0;\n for (int i = 1; i <= n; i++)\n {\n res = (res + dp[i, k]) % BG;\n }\n\n Console.WriteLine(res);\n } \n\n\n}\n\n", "lang": "Mono C#", "bug_code_uid": "ce5a84afde31f253460e1743567beee8", "src_uid": "c8cbd155d9f20563d37537ef68dde5aa", "apr_id": "895a79c439c0c9b856f9a3a70bee3577", "difficulty": 1400, "tags": ["dp", "combinatorics", "number theory"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9840288511076765, "equal_cnt": 6, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 5, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Security.AccessControl;\nusing System.Security.Cryptography;\nusing System.Web;\n\nclass Program\n{\n static int Max(int a1, int a2, int a3)\n {\n int max = a1 > a2 ? a1 : a2;\n return a3 > max ? a3 : max;\n }\n\n static int Max(int a1, int a2)\n {\n return a1 > a2 ? a1 : a2;\n }\n\n static void Main(string[] args)\n {\n var str = Console.ReadLine().Split(' ').Select(int.Parse).ToList();\n\n int N = str[0];\n int K = str[1];\n int mod = 1000000007;\n\n\n int[,] dp = new int [N+1, K+1];\n\n dp[0,1] = 1;\n for (int k = 1; k <= K; k++)\n for (int n = 1; n <= N; n++)\n for (int l = n; l <= N; l += n)\n dp[k,l] = (dp[k,l] + dp[k - 1,n]) % mod;\n\n var ans = 0;\n for (int n = 1; n <= N; n++)\n ans = (ans + dp[K,n]) % mod;\n\n Console.WriteLine(ans); \n } \n\n\n}\n\n", "lang": "Mono C#", "bug_code_uid": "093dfae05699f9aec4b467607063f800", "src_uid": "c8cbd155d9f20563d37537ef68dde5aa", "apr_id": "895a79c439c0c9b856f9a3a70bee3577", "difficulty": 1400, "tags": ["dp", "combinatorics", "number theory"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.9974948758824869, "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.IO;\nusing System.Collections;\nusing System.Diagnostics;\nusing System.Globalization;\n\nnamespace CodeForces {\n struct Node {\n public int X, Y, D; \n public Node(int x,int y, int d) {\n X = x;\n Y = y;\n D = d;\n } \n }\n \n class Cf { \n static TextReader input;\n static void Main(string[] args) { \n#if TESTS \n Stopwatch sw = new Stopwatch();\n input = new StreamReader(\"input.txt\"); \n#else\n input = Console.In;\n#endif\n Solve(); \n#if TESTS\n Console.WriteLine();\n Console.WriteLine(\"Milliseconds: {0}\", sw.ElapsedMilliseconds);\n Console.ReadLine();\n#endif\n } \n const int MOD = 1000000007;\n static int n, m, k;\n static void Solve() {\n string s = ReadLine();\n string t = ReadLine();\n k = ReadInt();\n n = s.Length;\n int a = 0;\n for (int i = 0; i < n; i++) {\n string s1 = s.Substring(0, i);\n string s2 = s.Substring(i);\n if (s2 + s1 == t)\n ++a;\n }\n int b = n - a;\n int[] da = new int[k+1];\n int[] db = new int[k+1];\n if (s == t)\n da[0] = 1;\n else\n db[0] = 1;\n for (int i = 1; i <= k; i++) {\n da[i] = (da[i - 1] * (a - 1) + db[i - 1] * a) % MOD;\n db[i] = (da[i - 1] * b + db[i - 1] * (b - 1)) % MOD;\n }\n Console.WriteLine(da[k]);\n }\n \n static int[] Z_function(string s) {\n int n = s.Length;\n int[] z = new int[n]; \n for (int i = 1, l = 0, r = 0; i < n; ++i) {\n if (i <= r)\n z[i] = Math.Min(r - i + 1, z[i - l]);\n while (i + z[i] < n && s[z[i]] == s[i + z[i]])\n ++z[i];\n if (i + z[i] - 1 > r) {\n l = i; r = i + z[i] - 1;\n }\n }\n return z;\n }\n \n static int SquaredDistanceBetweenSegments(int x1, int y1, int x2, int y2, int xx1, int yy1, int xx2, int yy2) {\n return Math.Min(Math.Min(SquaredDistanceToSegment(x1, y1, xx1, yy1, xx2, yy2), SquaredDistanceToSegment(x2, y2, xx1, yy1, xx2, yy2)),\n Math.Min(SquaredDistanceToSegment(xx1, yy1, x1, y1, x2, y2), SquaredDistanceToSegment(xx2, yy2, x1, y1, x2, y2)));\n }\n\n static int SquaredDistanceToSegment(int x, int y, int x1, int y1, int x2, int y2) {\n int result = Math.Min(SquaredDistance(x, y, x1, y1), SquaredDistance(x, y, x2, y2));\n if (x1 == x2 && y1 <= y && y <= y2)\n result = (x - x1) * (x - x1);\n else if (y1 == y2 && x1 <= x && x <= x2)\n result = (y - y1) * (y - y1);\n return result;\n }\n\n static int SquaredDistance(int ax, int ay, int bx, int by) {\n return (ax - bx) * (ax - bx) + (ay - by) * (ay - by);\n }\n\n #region read helpers\n public static List ReadIntList() {\n return input.ReadLine().Split(' ').Select(x => int.Parse(x)).ToList();\n }\n\n public static int[] ReadIntArray() {\n return input.ReadLine().Split(' ').Select(x => int.Parse(x)).ToArray();\n } \n\n public static string ReadLine() {\n return input.ReadLine();\n }\n\n public static int ReadInt() {\n return int.Parse(input.ReadLine());\n }\n#endregion\n }\n \n public class SegmentTree {\n private int[] a, t;\n private int n;\n public SegmentTree(int[] a) {\n n = a.Length;\n this.a = a; \n t = new int[n << 2];\n buildSegmentTree(0, n - 1, 1);\n }\n\n private void buildSegmentTree(int l, int r, int v) {\n if (l == r)\n t[v] = a[l];\n else {\n int m = (l + r) >> 1;\n int vl = v << 1;\n int vr = (v << 1) | 1;\n buildSegmentTree(l, m, vl);\n buildSegmentTree(m + 1, r, vr);\n t[v] = t[vl] + t[vr];\n }\n }\n\n public int QuerySegmentTree(int l, int r) {\n return querySegmentTree(1, l, r, 0, n - 1);\n }\n\n public void Update(int v, int tl, int tr, int pos, int new_val) {\n if (tl == tr)\n t[v] = new_val;\n else {\n int tm = (tl + tr) / 2;\n if (pos <= tm)\n Update(v << 1, tl, tm, pos, new_val);\n else\n Update(v << 1 + 1, tm + 1, tr, pos, new_val);\n t[v] = t[v << 1] + t[v << 1 + 1];\n }\n }\n\n private int querySegmentTree(int v, int l, int r, int tl, int tr) {\n if (l > r)\n return 0;\n if (l == tl && r == tr)\n return t[v];\n int m = (tl + tr) >> 1; \n return querySegmentTree(v << 1, l, Math.Min(r, m), tl, m) + querySegmentTree((v << 1) | 1, Math.Max(l, m + 1), r, m + 1, tr);\n }\n }\n class Graph : List> {\n public Graph(int num): base(num) {\n for (int i = 0; i < num; i++) {\n this.Add(new List());\n }\n }\n }\n class Heap : IEnumerable where T : IComparable {\n private List heap = new List();\n private int heapSize;\n private int Parent(int index) {\n return (index - 1) >> 1;\n }\n public int Count {\n get { return heap.Count; }\n }\n private int Left(int index) {\n return (index << 1) | 1;\n }\n private int Right(int index) {\n return (index << 1) + 2;\n }\n private void Max_Heapify(int i) {\n int l = Left(i);\n int r = Right(i);\n int largest = i;\n if (l < heapSize && heap[l].CompareTo(heap[i]) > 0)\n largest = l;\n if (r < heapSize && heap[r].CompareTo(heap[largest]) > 0)\n largest = r;\n if (largest != i) {\n T temp = heap[largest];\n heap[largest] = heap[i];\n heap[i] = temp;\n Max_Heapify(largest);\n }\n }\n private void BuildMaxHeap() {\n for (int i = heap.Count >> 1; i >= 0; --i)\n Max_Heapify(i);\n }\n\n public IEnumerator GetEnumerator() {\n return heap.GetEnumerator();\n }\n\n public void Sort() {\n for (int i = heap.Count - 1; i > 0; --i) {\n T temp = heap[i];\n heap[i] = heap[0];\n heap[0] = temp;\n --heapSize;\n Max_Heapify(0);\n }\n }\n\n public T Heap_Extract_Max() {\n T max = heap[0];\n heap[0] = heap[--heapSize];\n Max_Heapify(0);\n return max;\n }\n\n public void Clear() {\n heap.Clear();\n heapSize = 0;\n }\n\n public void Insert(T item) {\n if (heapSize < heap.Count)\n heap[heapSize] = item;\n else\n heap.Add(item);\n int i = heapSize;\n while (i > 0 && heap[Parent(i)].CompareTo(heap[i]) < 0) {\n T temp = heap[i];\n heap[i] = heap[Parent(i)];\n heap[Parent(i)] = temp;\n i = Parent(i);\n }\n ++heapSize;\n }\n\n IEnumerator IEnumerable.GetEnumerator() {\n return ((IEnumerable)heap).GetEnumerator();\n }\n } \n public class Treap {\n private static Random rand = new Random();\n public static Treap Merge(Treap l, Treap r) {\n if (l == null) return r;\n if (r == null) return l;\n Treap res;\n if (l.y > r.y) {\n Treap newR = Merge(l.right, r);\n res = new Treap(l.x, l.y, l.left, newR);\n }\n else {\n Treap newL = Merge(l, r.left);\n res = new Treap(r.x, r.y, newL, r.right);\n } \n return res;\n }\n\n public void Split(int x, out Treap l, out Treap r) {\n Treap newTree = null;\n if (this.x <= x) {\n if (right == null)\n r = null;\n else\n right.Split(x, out newTree, out r);\n l = new Treap(this.x, y, left, newTree); \n }\n else {\n if (left == null)\n l = null;\n else\n left.Split(x, out l, out newTree);\n r = new Treap(this.x, y, newTree, right); \n }\n }\n\n public Treap Add(int x) {\n Treap l, r;\n Split(x, out l, out r);\n Treap m = new Treap(x, rand.Next());\n return Merge(Merge(l, m), r);\n }\n\n public Treap Remove(int x) {\n Treap l, m, r;\n Split(x - 1, out l, out r);\n r.Split(x, out m, out r);\n return Merge(l, r);\n }\n\n private int x, y, cost, maxTreeCost;\n private Treap left, right;\n public Treap(int x, int y, Treap l, Treap r) {\n this.x = x;\n this.y = y;\n left = l;\n right = r;\n }\n public Treap(int x, int y) : this(x, y, null, null) { }\n public void InOrder() {\n inOrder(this);\n }\n private void inOrder(Treap t) {\n if (t == null) return;\n inOrder(t.left);\n Console.WriteLine(t.x);\n inOrder(t.right);\n }\n }\n public static class Extensions {\n public static void Fill(this int[] array, int val) {\n for (int i = 0; i < array.Length; i++) {\n array[i] = val;\n }\n }\n\n public static void Fill(this double[] array, double val) {\n for (int i = 0; i < array.Length; i++) {\n array[i] = val;\n }\n }\n\n public static int ToInt(this string s) {\n return int.Parse(s);\n }\n\n public static string Fill(this char c, int count) {\n char[] r = new char[count];\n for (int i = 0; i < count; ++i)\n r[i] = c;\n return new string(r);\n }\n \n public static void Print(this IEnumerable arr) {\n foreach (T t in arr)\n Console.Write(\"{0} \", t);\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "27bb97831a3a063d36afd4b94e65390e", "src_uid": "414000abf4345f08ede20798de29b9d4", "apr_id": "1b668eefb80e875ba7bf420d126ce7b4", "difficulty": 1700, "tags": ["dp"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9652728561304039, "equal_cnt": 14, "replace_cnt": 6, "delete_cnt": 2, "insert_cnt": 5, "fix_ops_cnt": 13, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Globalization;\nusing System.Linq;\nusing System.Text;\nusing System.Text.RegularExpressions;\nusing System.Threading;\n\nnamespace Codeforces\n{\n class D\n {\n private static ThreadStart s_threadStart = new D().Go;\n private static bool s_time = false;\n\n private void Go()\n {\n string a = GetString();\n int n = a.Length;\n string b = GetString();\n long k = GetInt();\n\n long mod = 1000000007;\n long[,] dp = new long[2, 100001];\n dp[0, 1] = 0;\n dp[1, 1] = 1;\n for (int i = 2; i <= k; i++)\n {\n dp[0, i] = ((n - 1) * dp[1, i - 1]) % mod;\n dp[1, i] = ((n - 2) * dp[1, i - 1] + dp[0, i - 1]) % mod;\n }\n\n long ret = 0;\n if (a == b) ret += dp[0, k];\n for (int i = 0; i < n-1; i++)\n {\n a = a[n - 1] + a.Substring(0, n - 1);\n if (a == b) ret = (ret+dp[1, k]) % mod;\n }\n\n Wl(ret);\n }\n\n #region Template\n\n public static void Main(string[] args)\n {\n System.Diagnostics.Stopwatch timer = new System.Diagnostics.Stopwatch();\n Thread main = new Thread(new ThreadStart(s_threadStart), 512 * 1024 * 1024);\n timer.Start();\n main.Start();\n main.Join();\n timer.Stop();\n if (s_time)\n Wl(timer.ElapsedMilliseconds);\n }\n\n private static IEnumerator ioEnum;\n private static string GetString()\n {\n while (ioEnum == null || !ioEnum.MoveNext())\n {\n ioEnum = Console.ReadLine().Split().AsEnumerable().GetEnumerator();\n }\n\n return ioEnum.Current;\n }\n\n private static int GetInt()\n {\n return int.Parse(GetString());\n }\n\n private static long GetLong()\n {\n return long.Parse(GetString());\n }\n\n private static double GetDouble()\n {\n return double.Parse(GetString());\n }\n\n private static List GetIntArr(int n)\n {\n List ret = new List(n);\n for (int i = 0; i < n; i++)\n {\n ret.Add(GetInt());\n }\n return ret;\n }\n\n private static void Wl(T o)\n {\n if (o is double)\n {\n Wld((o as double?).Value, \"\");\n }\n else if (o is float)\n {\n Wld((o as float?).Value, \"\");\n }\n else\n Console.WriteLine(o.ToString());\n }\n\n private static void Wl(IEnumerable enumerable)\n {\n Wl(string.Join(\" \", enumerable.Select(e => e.ToString()).ToArray()));\n }\n\n private static void Wld(double d, string format)\n {\n Wl(d.ToString(format, CultureInfo.InvariantCulture));\n }\n\n public struct Tuple : IComparable>\n where T : IComparable\n where K : IComparable\n {\n public T Item1;\n public K Item2;\n\n public Tuple(T t, K k)\n {\n Item1 = t;\n Item2 = k;\n }\n\n public override bool Equals(object obj)\n {\n var o = (Tuple)obj;\n return o.Item1.Equals(Item1) && o.Item2.Equals(Item2);\n }\n\n public override int GetHashCode()\n {\n return Item1.GetHashCode() ^ Item2.GetHashCode();\n }\n\n public override string ToString()\n {\n return \"(\" + Item1 + \" \" + Item2 + \")\";\n }\n\n #region IComparable> Members\n\n public int CompareTo(Tuple other)\n {\n int ret = Item1.CompareTo(other.Item1);\n if (ret != 0) return ret;\n return Item2.CompareTo(other.Item2);\n }\n\n #endregion\n }\n\n #endregion\n }\n}", "lang": "Mono C#", "bug_code_uid": "05c5fccd90fec2521d05fd87d23171b3", "src_uid": "414000abf4345f08ede20798de29b9d4", "apr_id": "366075f69ba735e4d4317d7ce64c48ee", "difficulty": 1700, "tags": ["dp"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.7834858081163499, "equal_cnt": 19, "replace_cnt": 14, "delete_cnt": 4, "insert_cnt": 0, "fix_ops_cnt": 18, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\n\nnamespace z3\n{\n class Program\n {\n static private int gcd(int x, int y)\n {\n return (x>0) ? gcd(y%x,x) : y;\n }\n\n static private int max(int a, int b)\n {\n return (a>b)?a:b;\n }\n\n static private int nextHc(int x, int y, int m, int h)\n {\n long tt = (long)x * (long)h + (long)y;\n return (int)(tt%(long)m);\n }\n\n static private void swapvars(ref int a, ref int b)\n {\n int k = b;\n b = a;\n a = k;\n }\n\n static private void calc(ref int m, ref int x1, ref int y1, ref int h1, ref int a1, ref int x2, ref int y2, ref int h2, ref int a2, ref int period1, ref int period2)\n {\n long t = 1;\n List hs = new List(capacity: m);\n if(period1 <= period2)\n {\n swapvars(ref x1,ref x2);\n swapvars(ref y1,ref y2);\n swapvars(ref h1,ref h2);\n swapvars(ref a1,ref a2);\n swapvars(ref period1, ref period2);\n }\n while(h2 != a2)\n {\n h1 = nextHc(x1, y1, m, h1);\n h2 = nextHc(x2, y2, m, h2);\n if((h1 == a1) && (h2 == a2))\n {\n Console.Write(t);\n return;\n }\n ++t;\n }\n //h2 == a2 now\n hs[0] = h1;\n for(int i = 1; i < period1; ++i) hs[i] = nextHc(x1, y1, m, hs[i-1]);\n int k = 0;\n while(true)\n {\n k += period2;\n k %= period1;\n h1 = hs[k];\n t += (long)period2;\n if(h1 == a1)\n {\n Console.Write(t);\n return;\n }\n }\n return;\n }\n\n\n static void Main(string[] args)\n {\n int m;\n int h1, a1, x1, y1, h2, a2, x2, y2;\n string ms = Console.ReadLine();\n m = Convert.ToInt32(ms);\n string[] ha1 = Console.ReadLine().Split(null);\n h1 = Convert.ToInt32(ha1[0]);\n a1 = Convert.ToInt32(ha1[1]);\n string[] xy1 = Console.ReadLine().Split(null);\n x1 = Convert.ToInt32(xy1[0]);\n y1 = Convert.ToInt32(xy1[1]);\n string[] ha2 = Console.ReadLine().Split(null);\n h2 = Convert.ToInt32(ha2[0]);\n a2 = Convert.ToInt32(ha2[1]);\n string[] xy2 = Console.ReadLine().Split(null);\n x2 = Convert.ToInt32(xy2[0]);\n y2 = Convert.ToInt32(xy2[1]);\n int t = 1;\n int h1saved = h1, h2saved = h2;\n int period1 = 0, period2 = 0;\n for (int i = 0; i < m + 1; ++i)\n {\n h1 = nextHc(x1, y1, m, h1);\n h2 = nextHc(x2, y2, m, h2);\n if ((h1 == a1) && (h2 == a2))\n {\n Console.Write(t);\n return;\n }\n ++t;\n }\n int h1prev = h1, h2prev = h2;\n int a1flag = 0;\n int a2flag = 0;\n do\n {\n h1 = nextHc(x1, y1, m, h1);\n ++period1;\n if ((h1 == a1) && (a1flag == 0)) a1flag = 1;\n } while (h1 != h1prev);\n do\n {\n h2 = nextHc(x2, y2, m, h2);\n ++period2;\n if ((h2 == a2) && (a2flag == 0)) a2flag = 1;\n } while (h2 != h2prev);\n\n if ((a1flag == 0) || (a2flag == 0))\n {\n Console.Write(\"-1\");\n return;\n }\n\n if ((gcd(period1, period2) == 1) && (period1 > 1) && (period2 > 1))\n {\n calc(ref m, ref x1, ref y1, ref h1saved, ref a1, ref x2, ref y2, ref h2saved, ref a2, ref period1, ref period2);\n return;\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": "MS C#", "bug_code_uid": "b0af0cc153c5cd3baa91df9fbab603b0", "src_uid": "7225266f663699ff7e16b726cadfe9ee", "apr_id": "1d8f23b8487a84dac4cb82591aa3ce04", "difficulty": 2200, "tags": ["greedy", "math", "number theory"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.5279691375034444, "equal_cnt": 35, "replace_cnt": 21, "delete_cnt": 0, "insert_cnt": 14, "fix_ops_cnt": 35, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\n\nnamespace C\n{\n\tclass Program\n\t{\n\t\tstatic void Main(string[] args)\n\t\t{\n\t\t\tvar m = RInt();\n\t\t\tvar a = R2Int();\n\t\t\tvar axy = R2Int();\n\t\t\tvar b = R2Int();\n\t\t\tvar bxy = R2Int();\n\n\t\t\tvar first = new int[] { a[0], b[0] };\n\n\t\t\tvar ticks = 0;\n\t\t\tvar l1 = new int[] { -1, -1 };\n\t\t\tvar l2 = new int[] { -1, -1 };\n\n\t\t\twhile (true)\n\t\t\t{\n\t\t\t\tticks++;\n\t\t\t\ta[0] = Next(a, axy, m);\n\t\t\t\tb[0] = Next(b, bxy, m);\n\n\t\t\t\tif (a[0] == a[1] && b[0] == b[1])\n\t\t\t\t{\n\t\t\t\t\tConsole.WriteLine(ticks);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif (!Update(a, l1, first[0], ticks) || !Update(b, l2, first[1], ticks))\n\t\t\t\t{\n\t\t\t\t\tConsole.WriteLine(\"-1\");\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tif (l1[0] != -1 && l2[0] != -1)\n\t\t\t\t\tbreak;\n\n\t\t\t\tUpdate2(a, l1, ticks);\n\t\t\t\tUpdate2(b, l2, ticks);\n\t\t\t}\n\n\t\t\tvar x = l1[1];\n\t\t\tfor (var i = 0; i <= m; i++)\n\t\t\t{\n\t\t\t\tx += l1[0];\n\t\t\t\tvar c = x % l2[0];\n\t\t\t\tif (c == l2[1])\n\t\t\t\t{\n\t\t\t\t\tConsole.WriteLine(x);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t\tConsole.WriteLine(\"-1\");\n\t\t}\n\n\t\tstatic int RInt()\n\t\t{\n\t\t\treturn int.Parse(Console.ReadLine());\n\t\t}\n\t\tstatic int[] R2Int()\n\t\t{\n\t\t\treturn Console.ReadLine().Split(' ').Select(v => int.Parse(v)).ToArray();\n\t\t}\n\n\t\tstatic int Next(int[] v, int[] xy, int m)\n\t\t{\n\t\t\treturn (xy[0] * v[0] + xy[1]) % m;\n\t\t}\n\t\tstatic bool Update(int[] v, int[] l, int first, int ticks)\n\t\t{\n\t\t\tif (l[0] == -1 && v[0] == first)\n\t\t\t{\n\t\t\t\tl[0] = ticks;\n\t\t\t\tif (l[1] == -1)\n\t\t\t\t\treturn false;\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\t\tstatic void Update2(int[] v, int[] l, int ticks)\n\t\t{\n\t\t\tif (l[1] == -1 && v[0] == v[1])\n\t\t\t\tl[1] = ticks;\n\t\t}\n\t}\n}\n", "lang": "MS C#", "bug_code_uid": "d270e8e6c2284b0b3a128338a87a760e", "src_uid": "7225266f663699ff7e16b726cadfe9ee", "apr_id": "2da8403b604e71b883cf619c0957919c", "difficulty": 2200, "tags": ["greedy", "math", "number theory"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.8265204386839482, "equal_cnt": 16, "replace_cnt": 8, "delete_cnt": 1, "insert_cnt": 6, "fix_ops_cnt": 15, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Diagnostics;\n\nnamespace C\n{\n\tclass Measurer : IDisposable\n\t{\n\t\tpublic Measurer()\n\t\t{\n\t\t\tsw = new Stopwatch();\n\t\t\tsw.Start();\n\t\t}\n\n\t\tStopwatch sw { get; set; }\n\n\t\tpublic void Dispose()\n\t\t{\n\t\t\tsw.Stop();\n\t\t\t//Console.WriteLine(sw.Elapsed.ToString());\n\t\t}\n\t}\n\n\tclass Program\n\t{\n\t\tstatic void Main(string[] args)\n\t\t{\n\t\t\tvar m = RInt();\n\t\t\tvar a = R2Int();\n\t\t\tvar axy = R2Int();\n\t\t\tvar b = R2Int();\n\t\t\tvar bxy = R2Int();\n\n\t\t\tvar first = new int[] { a[0], b[0] };\n\n\t\t\tlong ticks = 0;\n\t\t\t//var l1 = new int[] { -1, -1 };\n\t\t\t//var l2 = new int[] { -1, -1 };\n\t\t\tvar p1 = new long[] { -1, -1 };\n\t\t\tvar p1i = 0;\n\t\t\tvar p2 = new long[] { -1, -1 };\n\t\t\tvar p2i = 0;\n\n\t\t\tusing (var me = new Measurer())\n\t\t\t{\n\t\t\t\tfor (var i = 0; i <= 2 * m; i++)\n\t\t\t\t{\n\t\t\t\t\tticks++;\n\t\t\t\t\ta[0] = Next(a, axy, m);\n\t\t\t\t\tb[0] = Next(b, bxy, m);\n\t\t\t\t\tif (a[0] == a[1])\n\t\t\t\t\t\tp1[p1i++] = ticks;\n\t\t\t\t\tif (b[0] == b[1])\n\t\t\t\t\t\tp2[p2i++] = ticks;\n\t\t\t\t\tif (p1i > 1 && p2i > 1)\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (p1i < 2 || p2i < 2)\n\t\t\t\t{\n\t\t\t\t\tConsole.WriteLine(\"-1\");\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tif(p1[0] == p2[0] || p1[0] == p2[1])\n\t\t\t\t{\n\t\t\t\t\tConsole.WriteLine(p1[0]);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tif(p1[1] == p2[0] || p1[1] == p2[1])\n\t\t\t\t{\n\t\t\t\t\tConsole.WriteLine(p1[0]);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tusing (var me = new Measurer())\n\t\t\t{\n\t\t\t\tlong x = p1[0];\n\t\t\t\tlong dx = p1[1] - p1[0];\n\t\t\t\tlong dp2 = p2[1] - p2[0];\n\t\t\t\tfor (var i = 0; i <= m; i++)\n\t\t\t\t{\n\t\t\t\t\tx += dx;\n\t\t\t\t\tvar k = (x - p2[0]) % dp2;\n\t\t\t\t\tif (k == 0)\n\t\t\t\t\t{\n\t\t\t\t\t\tConsole.WriteLine(x);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tConsole.WriteLine(\"-1\");\n\t\t\tConsole.ReadLine();\n\t\t}\n\n\t\tstatic int RInt()\n\t\t{\n\t\t\treturn int.Parse(Console.ReadLine());\n\t\t}\n\t\tstatic int[] R2Int()\n\t\t{\n\t\t\treturn Console.ReadLine().Split(' ').Select(v => int.Parse(v)).ToArray();\n\t\t}\n\n\t\tstatic int Next(int[] v, int[] xy, int m)\n\t\t{\n\t\t\treturn (int)(((long)xy[0] * (long)v[0] + (long)xy[1]) % m);\n\t\t}\n\t}\n}\n", "lang": "MS C#", "bug_code_uid": "3690703eacfa1857ab4e806c63c1f5bc", "src_uid": "7225266f663699ff7e16b726cadfe9ee", "apr_id": "2da8403b604e71b883cf619c0957919c", "difficulty": 2200, "tags": ["greedy", "math", "number theory"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9920634920634921, "equal_cnt": 6, "replace_cnt": 5, "delete_cnt": 0, "insert_cnt": 0, "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 задачи\n{\n class Program\n {\n static void Main(string[] args)\n {\n int k, l, m, n, d,a=0;\n k = Convert.ToInt16(Console.ReadLine());\n l = Convert.ToInt16(Console.ReadLine());\n m = Convert.ToInt16(Console.ReadLine());\n n = Convert.ToInt16(Console.ReadLine());\n d = Convert.ToInt16(Console.ReadLine());//dlina\n int[,] b = new int[d,2];\n for (int i = 0; i < d; i++)\n {\n b[i,0] = i + 1;\n }\n\n for (int i = k-1; i < d; i+=k)\n {\n b[i, 1] = 1;\n }\n for (int i = l-1; i < d; i += l)\n {\n b[i, 1] = 1;\n }\n for (int i = m-1; i < d; i += m)\n {\n b[i, 1] = 1;\n }\n for (int i = n-1; i < d; i += n)\n {\n b[i, 1] = 1;\n }\n\n for (int i = 0; i < d; i++)\n {\n if (b[i, 1] == 1) { a++; }\n }\n Console.WriteLine(a);\n // Console.ReadLine();\n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "e6f18c9d5295b6bd5e43131940c0e685", "src_uid": "46bfdec9bfc1e91bd2f5022f3d3c8ce7", "apr_id": "aa9143d9a7eab7fb87d10fc0e050254e", "difficulty": 800, "tags": ["math", "constructive algorithms", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.8845425867507887, "equal_cnt": 10, "replace_cnt": 4, "delete_cnt": 3, "insert_cnt": 3, "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 ConsoleApp9\n{\n class Program\n {\n static void Main(string[] args)\n {\n string[] S = Console.ReadLine().Split();\n long n = Convert.ToInt64(S[0]);\n long m = Convert.ToInt64(S[1]);\n if (m == 0) Console.WriteLine(n + \" \" + n);\n else Console.WriteLine(Math.Max(0, n - (m * 2)) + \" \" + Math.Max(0, n - F(m)));\n }\n\n static int F(long r)\n {\n long c = r * 2;\n for (int i = 1; i <= r + 1; i++)\n {\n if (i * (i - 1) == c) return i;\n else if (i * (i - 1) > c) return i;\n }\n return 0;\n }\n }\n}", "lang": "Mono C#", "bug_code_uid": "40c5ecf76bebc466f134b0abe0eb3793", "src_uid": "daf0dd781bf403f7c1bb668925caa64d", "apr_id": "c6576578f7d6dd07ab85669ca3aa8ee0", "difficulty": 1300, "tags": ["graphs", "constructive algorithms"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9815303430079155, "equal_cnt": 4, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 3, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\n\nnamespace Codeforces\n{\n\tstatic class Program\n\t{\n\n\t\tstatic void Main(string[] args)\n\t\t{\n\t\t\tvar nm = Console.ReadLine().Split().Select(int.Parse).ToList();\n\t\t\tint min = nm[0], max = nm[0];\n\t\t\tint rem = nm[1], cur = 0;\t\n\t\t\tif (nm[1] != 0)\n\t\t\t{\n\t\t\t\tmin = nm[0] - nm[1] * 2;\n\n\t\t\t\twhile(rem > 0)\n\t\t\t\t{\n\t\t\t\t\tvar d = Math.Min(cur, rem);\n\t\t\t\t\tcur++;\n\t\t\t\t\trem -= d;\n\t\t\t\t}\n\t\t\t\tif(cur != 1) max = nm[0] - cur;\n\t\t\t}\n\t\t\tConsole.WriteLine($\"{Math.Max(min, 0)} {Math.Max(max, 0)}\");\n\t\t\tConsole.ReadLine();\n\t\t}\n\t}\n}\n", "lang": "Mono C#", "bug_code_uid": "7a750389443a0322d90ed5cd027d300b", "src_uid": "daf0dd781bf403f7c1bb668925caa64d", "apr_id": "b19c77e091761a715f9293d65d1ad8fe", "difficulty": 1300, "tags": ["graphs", "constructive algorithms"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.48947368421052634, "equal_cnt": 15, "replace_cnt": 8, "delete_cnt": 1, "insert_cnt": 5, "fix_ops_cnt": 14, "bug_source_code": "using System;\nusing System.Linq;\n\n\nnamespace _626C\n{\n class Program\n {\n static void Main(string[] args)\n {\n var s = Console.ReadLine().Split().Select(int.Parse).ToArray();\n var n = s[0]; var m = s[1];\n int i = 0;\n int j = 0;\n int[] tower = new int[3*1000*1000+3];\n while (m > 0)\n {\n j += 3; m--; tower[j]++;\n }\n while (n > 0)\n {\n i += 2;\n if (tower[i] == 0)\n {\n n--; tower[i]++;\n }\n }\n Console.WriteLine(Math.Max(i,j));\n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "6ee362a4e036856dcdbfd8db6a2d7097", "src_uid": "23f2c8cac07403899199abdcfd947a5a", "apr_id": "ad768409a3e7b34f6fafcc7b32d750d2", "difficulty": 1600, "tags": ["greedy", "math", "brute force", "number theory"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9966978536048432, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "\nusing System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace AlgoTraining.Codeforces.A_s\n{\n\n class FastScanner : StreamReader\n {\n private string[] _line;\n private int _iterator;\n\n public FastScanner(Stream stream) : base(stream)\n {\n _line = null;\n _iterator = 0;\n }\n public int NextInt()\n {\n if (_line == null || _iterator >= _line.Length)\n {\n _line = base.ReadLine().Split(' ');\n _iterator = 0;\n }\n if (_line.Count() == 0) throw new IndexOutOfRangeException(\"Input string is empty\");\n return Convert.ToInt32(_line[_iterator++]);\n }\n public long NextLong()\n {\n if (_line == null || _iterator >= _line.Length)\n {\n _line = base.ReadLine().Split(' ');\n _iterator = 0;\n }\n if (_line.Count() == 0) throw new IndexOutOfRangeException(\"Input string is empty\");\n return Convert.ToInt64(_line[_iterator++]);\n }\n }\n class RoundHouse346\n {\n public static void Main(string[] args)\n {\n using (FastScanner fs = new FastScanner(new BufferedStream(Console.OpenStandardInput())))\n using (StreamWriter writer = new StreamWriter(new BufferedStream(Console.OpenStandardOutput())))\n {\n int n = fs.NextInt(), a = fs.NextInt() - 1, b = fs.NextInt();\n b = b / Math.Abs(b) * (Math.Abs(b) % n);\n int ans = a + b;\n if (ans >= n) ans %= n;\n else if (ans < 0) ans = n + ans;\n writer.WriteLine(ans + 1);\n }\n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "b62b6f9836dcb9199b6cc28a42de7f57", "src_uid": "cd0e90042a6aca647465f1d51e6dffc4", "apr_id": "933c327a2061b02082901bf28dfd8110", "difficulty": 1000, "tags": ["math", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.6428898033836306, "equal_cnt": 9, "replace_cnt": 3, "delete_cnt": 1, "insert_cnt": 4, "fix_ops_cnt": 8, "bug_source_code": "using System;\nusing System.Collections;\nusing System.Collections.Generic;\n\nclass Program\n{\n string[] board = new string[8];\n\n static void Main(string[] args)\n {\n new Program().Solve();\n }\n\n void Solve()\n {\n for (int i = 0; i < 8; i++)\n {\n board[i] = Console.ReadLine();\n }\n\n if (DFS(7, 0, 0)) { Console.WriteLine(\"WIN\"); }\n else { Console.WriteLine(\"LOSE\"); }\n }\n\n bool DFS(int i, int j, int turns)\n {\n if (board[i][j] == 'A') { return true; }\n if (i - turns >= 0 && board[i - turns][j] == 'S') { return false; }\n if (turns >= 8) { return true; }\n\n for (int di = -1; di <= 0; di++)\n {\n for (int dj = 1; dj >= -1; dj--)\n {\n int ni = i + dj, nj = j + dj;\n if (ni >= 0 && ni < 8 && nj >= 0 && nj < 8)\n {\n if (ni - turns >= 0 && board[ni - turns][nj] == 'S') { continue; }\n if (DFS(ni, nj, turns + 1)) { return true; }\n }\n }\n }\n return false;\n }\n}", "lang": "Mono C#", "bug_code_uid": "4dd0b3e239d966cf542026e93bdfcac0", "src_uid": "f47e4ab041288ba9567c19930eb9a090", "apr_id": "45de1a697fa93dc4c82f4ba7e00a4600", "difficulty": 1500, "tags": ["dfs and similar"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.9084518828451883, "equal_cnt": 11, "replace_cnt": 6, "delete_cnt": 2, "insert_cnt": 2, "fix_ops_cnt": 10, "bug_source_code": "using System;\nusing System.IO;\nusing System.Collections.Generic;\n\nnamespace CodeForces\n{\n class Tokenizer\n {\n int pos;\n string[] tokens;\n TextReader reader;\n\n public Tokenizer(TextReader reader)\n {\n pos = 0;\n tokens = new string[] { };\n this.reader = reader;\n }\n\n\n public string NextToken()\n {\n if (pos == tokens.Length)\n {\n tokens = reader.ReadLine().Split(' ');\n pos = 0;\n }\n return tokens [pos++];\n }\n\n public int NextInt()\n {\n return int.Parse(NextToken());\n }\n }\n\n class MainClass\n {\n static Tokenizer t;\n static TextWriter w;\n\n public static void Init()\n {\n t = new Tokenizer(Console.In);\n w = Console.Out;\n //t = new Tokenizer(File.OpenText(@\"../../in.txt\"));\n //w = File.CreateText(@\"../../out.txt\");\n }\n\n public static void Main(string[] args)\n {\n Init();\n int n = t.NextInt();\n List[] c = new List[4];\n for (int i = 0; i < 4; i++)\n c [i] = new List();\n for (int i = 1; i <= n; i++)\n c [t.NextInt()].Add(i);\n\n List[] dep = new List[n + 1];\n for (int i = 1; i <= n; i++)\n {\n dep [i] = new List();\n int k = t.NextInt();\n for (int j = 0; j < k; j++)\n dep [i].Add(t.NextInt());\n }\n\n int cost = int.MaxValue;\n for (int start = 1; start <= 3; start++)\n {\n bool[] done = new bool[n + 1];\n int cur = start;\n int rem = n;\n int curCost = 0;\n while (rem > 0)\n {\n for (int j = 0; j < c[cur].Count; j++)\n {\n foreach (var a in c[cur])\n {\n if (done [a])\n continue;\n bool ready = true;\n foreach (var b in dep[a])\n if (!done [b])\n ready = false;\n if (ready)\n {\n done [a] = true;\n rem--;\n }\n }\n }\n cur++;\n if (cur == 4)\n cur = 1;\n if (rem > 0)\n curCost++;\n }\n\n cost = Math.Min(cost, curCost);\n }\n\n cost += n;\n w.WriteLine(cost);\n w.Close();\n }\n }\n}", "lang": "Mono C#", "bug_code_uid": "e57a42ded4b70ea464176aa7acb77c99", "src_uid": "be42e213ff43e303e475d77a9560367f", "apr_id": "c91c5094796fff201ce6605c642a11f1", "difficulty": 1700, "tags": ["brute force", "greedy"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9996761658031088, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "using System;\nusing System.IO;\nusing System.Collections.Generic;\nusing System.Linq;\n\nnamespace CodeForces\n{\n class Tokenizer\n {\n int pos;\n string[] tokens;\n TextReader reader;\n\n public Tokenizer(TextReader reader)\n {\n pos = 0;\n tokens = new string[] { };\n this.reader = reader;\n }\n\n\n public string NextToken()\n {\n if (pos == tokens.Length)\n {\n tokens = reader.ReadLine().Split(' ');\n pos = 0;\n }\n return tokens [pos++];\n }\n\n public int NextInt()\n {\n return int.Parse(NextToken());\n }\n }\n\n class MainClass\n {\n static Tokenizer t;\n static TextWriter w;\n\n public static void Init()\n {\n t = new Tokenizer(Console.In);\n w = Console.Out;\n t = new Tokenizer(File.OpenText(@\"../../in.txt\"));\n //w = File.CreateText(@\"../../out.txt\");\n }\n\n public static void Main(string[] args)\n {\n Init();\n int n = t.NextInt();\n\n int[] machine = new int[n + 1];\n int[] inDegree = new int[n + 1];\n\n for (int i = 1; i <= n; i++)\n machine [i] = t.NextInt();\n\n var a = new List[n + 1];\n for (int i = 1; i <= n; i++)\n a [i] = new List();\n\n for (int i = 1; i <= n; i++)\n {\n int k = t.NextInt();\n inDegree [i] = k;\n while (k-- > 0)\n {\n a [t.NextInt()].Add(i);\n }\n }\n\n int cost = int.MaxValue;\n for (int start = 1; start <= 3; start++)\n {\n int curCost = n;\n int[] curInDegree = (int[])inDegree.Clone();\n var q = new Queue[4];\n for (int i = 1; i <= 3; i++)\n q [i] = new Queue();\n int rem = n;\n for (int i = 1; i <= n; i++)\n if (inDegree [i] == 0)\n q [machine [i]].Enqueue(i);\n int curMachine = start;\n while (true)\n {\n while (q[curMachine].Count != 0)\n {\n int curJob = q [curMachine].Dequeue();\n foreach (var job in a[curJob])\n {\n curInDegree [job]--;\n if (curInDegree [job] == 0)\n q [machine [job]].Enqueue(job);\n }\n rem--;\n }\n if (rem == 0)\n break;\n\n curCost++;\n curMachine++;\n if (curMachine == 4)\n curMachine = 1;\n }\n cost = Math.Min(cost, curCost);\n\n }\n\n w.WriteLine(cost);\n }\n }\n}", "lang": "Mono C#", "bug_code_uid": "71c4ab806b11279b36a359354a04625d", "src_uid": "be42e213ff43e303e475d77a9560367f", "apr_id": "c91c5094796fff201ce6605c642a11f1", "difficulty": 1700, "tags": ["brute force", "greedy"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.41773399014778323, "equal_cnt": 4, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 4, "fix_ops_cnt": 4, "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}\n", "lang": "MS C#", "bug_code_uid": "eec743b7f970d2519fda9782c71024b4", "src_uid": "54cb2e987f2cc06c02c7638ea879a1ab", "apr_id": "0456082ad4c33a7b7cafc18ee576eb58", "difficulty": 900, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.8860294117647058, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 2, "insert_cnt": 1, "fix_ops_cnt": 4, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace CodeForces._265\n{\n PUBLIC class ProblemA\n {\n public static void Main(string[] varg)\n {\n int n = int.Parse(System.Console.ReadLine());\n string s = System.Console.ReadLine();\n\n int rv = 0;\n foreach(var c in s)\n {\n rv++;\n if (c == '0')\n break;\n }\n System.Console.WriteLine(rv);\n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "ef52d84eb8f7da6af7c4cc31e6472afb", "src_uid": "54cb2e987f2cc06c02c7638ea879a1ab", "apr_id": "a00e0ba4cfb3943a0cf964b03af65952", "difficulty": 900, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C#"} {"similarity_score": 0.5380116959064327, "equal_cnt": 26, "replace_cnt": 15, "delete_cnt": 8, "insert_cnt": 2, "fix_ops_cnt": 25, "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 B\n {\n static void Main(string[] args)\n {\n int n = int.Parse(Console.ReadLine());\n int[] a = new int[2*n];\n string[] token = Console.ReadLine().Split();\n for(int i=0;i<2*n;i++)\n {\n a[i] = int.Parse(token[i]);\n }\n Array.Sort(a);\n int num = 0;\n for(int i=0;i<2*(n-1);i+=2){\n int val = a[i+1] - a[i];\n \n num += val;\n }\n Console.WriteLine(num);\n }\n }\n}", "lang": "Mono C#", "bug_code_uid": "22e323733202a5aad3ed7aa65fb8db46", "src_uid": "76659c0b7134416452585c391daadb16", "apr_id": "3db9e17525d05501c221f16894658cb4", "difficulty": 1500, "tags": ["greedy", "brute force", "sortings"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.6360544217687075, "equal_cnt": 13, "replace_cnt": 7, "delete_cnt": 4, "insert_cnt": 1, "fix_ops_cnt": 12, "bug_source_code": "\n\nusing System;\nnamespace Whatever {\n\n\n class asearch {\n\n static int N;\n static int numCount;\n static int[] an = new int[2000];\n\n\n static void ReadData() {\n Int32.TryParse(Console.ReadLine(), out N);\n \n var line = Console.ReadLine().Split(new char[]{' '});\n \n numCount = line.Length;\n for (int i = 1; i <= numCount; ++i)\n {\n Int32.TryParse(line[i-1], out an[i]);\n }\n }\n\n // BWBWBWBW\n // 101010101 mod 2\n static int NextLoc(int start, int color) {\n if (start % 2 == color) {\n return start;\n } else {\n return start+1;\n }\n }\n \n static int TrySolve(int color) {\n var poop = new boolean[10000];\n var solved = new boolean[10000];\n for (int i = 1; i<=numCount; ++i) {\n if (a[i] %2 == color) {\n poop[a[i]] =true;\n solved[i] = true;\n } else {\n solved[i] =false;\n }\n }\n \n var result = 0;\n\n for (int i = 1; i<=numCount; ++i) {\n if (!solved[i]) {\n var plc = -1;\n var plcDis = 10101010;\n for (int j = 1; j<=N; ++j) {\n if (!poop[j] && Math.Abs(j-a[i]) < plcDis) {\n plcDis = Math.Abs(j-a[i]);\n plc = j;\n }\n }\n poop[j] = true;\n solved[i] = true;\n result += Math.Abs(j-a[i]);\n }\n }\n \n return result;\n\n }\n \n static void Main(string[] args) {\n\n ReadData();\n var minMoves = 2147483600;\n var tmp = TrySolve(0);\n if (tmp != -1 && tmp < minMoves) {\n minMoves = tmp;\n }\n tmp = TrySolve(1);\n if (tmp !=-1 && tmp < minMoves) {\n minMoves = tmp;\n }\n Console.WriteLine(minMoves);\n //Console.WriteLine(Console.ReadLine());\n }\n\n }\n}", "lang": "Mono C#", "bug_code_uid": "fba1610c33b97b60ccab4e87d78b8238", "src_uid": "0efe9afd8e6be9e00f7949be93f0ca1a", "apr_id": "f92c9f38e7aedbeb755624de41efb26a", "difficulty": 1100, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.4152896675293649, "equal_cnt": 11, "replace_cnt": 6, "delete_cnt": 3, "insert_cnt": 1, "fix_ops_cnt": 10, "bug_source_code": "\n\nusing System;\nusing System.Collections.Generic;\nnamespace Whatever {\n\n\n\n class abfs {\n\n static int N;\n static int numCount;\n static int[] an = new int[2000];\n\n\n struct State {\n public bool[] poop;\n\n public bool isSolved() {\n bool c0=false, c1=false;\n for (int i = 1; i<=N;++i) {\n if (i%2 == 0 && poop[i]) {\n c0 = true;\n }\n if (i%2==1&&poop[i]){\n c1 = true;\n }\n if (c1&&c0) return false;\n }\n return true;\n }\n\n public int depth;\n\n public int hash() {\n int result = 0;\n for (int i = 1; i<=N; ++i) {\n if (poop[i]) {\n result += (1<< (i-1));\n }\n }\n return result;\n }\n }\n\n static void ReadData() {\n Int32.TryParse(Console.ReadLine(), out N);\n \n var line = Console.ReadLine().Split(new char[]{' '});\n \n numCount = line.Length;\n for (int i = 1; i <= numCount; ++i)\n {\n Int32.TryParse(line[i-1], out an[i]);\n }\n }\n\n static int TrySolve(int color) {\n var q = new Queue();\n var visited = new HashSet();\n var tmp = new State();\n tmp.poop = new bool[101];\n for (int i = 1;i<=numCount; ++i) {\n tmp.poop[an[i]] = true;\n }\n\n q.Enqueue(tmp);\n visited.Add(tmp.hash());// = true;\n tmp.depth = 0;\n while (q.Count > 0) {\n var head = q.Dequeue();\n if (head.isSolved()) {\n return head.depth;\n }\n for (int i = 1; i<=N;++i) {\n if (head.poop[i] && i1 \n && !head.poop[i-1]) {\n var newP = (bool[])head.poop.Clone();\n newP[i-1] = true;\n newP[i] = false;\n var newState = new State();\n newState.poop = newP;\n newState.depth = head.depth+1;\n if (!visited.Contains(newState.hash())) {\n visited.Add(newState.hash());// = true;\n q.Enqueue(newState);\n }\n } \n\n \n }\n }\n\n return -1;\n\n }\n \n static void Main(string[] args) {\n\n ReadData();\n var minMoves = 2147483600;\n var tmp = TrySolve(0);\n if (tmp != -1 && tmp < minMoves) {\n minMoves = tmp;\n }\n tmp = TrySolve(1);\n if (tmp !=-1 && tmp < minMoves) {\n minMoves = tmp;\n }\n Console.WriteLine(minMoves);\n //Console.WriteLine(Console.ReadLine());\n }\n\n }\n}", "lang": "Mono C#", "bug_code_uid": "893fb87c7e31deaf955aa2061e6b62d8", "src_uid": "0efe9afd8e6be9e00f7949be93f0ca1a", "apr_id": "f92c9f38e7aedbeb755624de41efb26a", "difficulty": 1100, "tags": ["implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.7127731471052039, "equal_cnt": 23, "replace_cnt": 13, "delete_cnt": 2, "insert_cnt": 7, "fix_ops_cnt": 22, "bug_source_code": "using System;\n\npublic sealed class Program {\n\n const Int64 Mod = 1000000007;\n\n static void Add(ref Int64 cur, Int64 add) {\n cur = (cur + add) % Mod;\n }\n\n public Program () {\n Int32 n = ReadInt(), cap = ReadInt(), i, cnt50 = 0, cnt100 = 0, a, b, c, d;\n for (i = 0; i < n; ++i) {\n if (ReadInt() == 50) {\n ++cnt50;\n } else {\n ++cnt100;\n }\n }\n Int64[,] binomial = new Int64[n + 1, n + 1];\n for (i = 0; i <= n; ++i) {\n binomial[i, 0] = binomial[i, i] = 1;\n }\n for (a = 2; a <= n; ++a) {\n for (b = 1; b < a; ++b) {\n binomial[a, b] = (binomial[a - 1, b] + binomial[a - 1, b - 1]) % Mod;\n }\n }\n Int64[, ,] dp = new Int64[n * 2 + 1, cnt50 + 1, cnt100 + 1];\n dp[0, cnt50, cnt100] = 1;\n for (i = 0; ; ++i) {\n if (i == n * 2) {\n Console.WriteLine(-1);\n Console.WriteLine('0');\n } else if (i % 2 != 0 && dp[i, cnt50, cnt100] != 0) {\n Console.WriteLine(i);\n Console.WriteLine(dp[i, cnt50, cnt100])\n }\n for (a = 0; a <= cnt50; ++a) {\n for (b = 0; b <= cnt100; ++b) {\n if (dp[i, a, b] != 0) {\n for (c = 0; c <= a; ++c) {\n for (d = 0; d <= b && c * 50 + d * 100 <= cap; ++d) {\n if (c + d != 0) {\n Add(ref dp[i + 1, cnt50 - (a - c), cnt100 - (b - d)], dp[i, a, b] * binomial[a, c] % Mod * binomial[b, d] % Mod);\n }\n }\n }\n }\n }\n }\n }\n }\n\n // stuff cutline\n\n public static void Main() {\n#if DEBUG\n Console.SetIn(new System.IO.StreamReader(\"..\\\\..\\\\in.txt\"));\n#endif\n var root = new Program();\n Console.Out.Flush();\n }\n\n static Int32 ReadInt() {\n Boolean neg = false;\n Int32 ch, ans = 0;\n do {\n ch = Console.Read();\n neg |= ch == (Int32)'-';\n } while (!Char.IsDigit((Char)ch));\n do {\n ans = ans * 10 + (ch & 0xf);\n ch = Console.Read();\n } while (Char.IsDigit((Char)ch));\n return neg ? -ans : ans;\n }\n\n static Int32[] ReadArray() {\n return Array.ConvertAll(Console.ReadLine().Split(), Int32.Parse);\n }\n\n}", "lang": "Mono C#", "bug_code_uid": "99736377eb551fbc59b451103ba59528", "src_uid": "ebb0323a854e19794c79ab559792a1f7", "apr_id": "367f5ea49b5953807c584ce7821a2a26", "difficulty": 2100, "tags": ["graphs", "dp", "combinatorics", "shortest paths"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.7126126126126127, "equal_cnt": 23, "replace_cnt": 13, "delete_cnt": 2, "insert_cnt": 7, "fix_ops_cnt": 22, "bug_source_code": "using System;\n\npublic sealed class Program {\n\n const Int64 Mod = 1000000007;\n\n static void Add(ref Int64 cur, Int64 add) {\n cur = (cur + add) % Mod;\n }\n\n public Program () {\n Int32 n = ReadInt(), cap = ReadInt(), i, cnt50 = 0, cnt100 = 0, a, b, c, d;\n for (i = 0; i < n; ++i) {\n if (ReadInt() == 50) {\n ++cnt50;\n } else {\n ++cnt100;\n }\n }\n Int64[,] binomial = new Int64[n + 1, n + 1];\n for (i = 0; i <= n; ++i) {\n binomial[i, 0] = binomial[i, i] = 1;\n }\n for (a = 2; a <= n; ++a) {\n for (b = 1; b < a; ++b) {\n binomial[a, b] = (binomial[a - 1, b] + binomial[a - 1, b - 1]) % Mod;\n }\n }\n Int64[, ,] dp = new Int64[n * 2 + 1, cnt50 + 1, cnt100 + 1];\n dp[0, cnt50, cnt100] = 1;\n for (i = 0; ; ++i) {\n if (i == n * 2) {\n Console.WriteLine(-1);\n Console.WriteLine('0');\n } else if (i % 2 != 0 && dp[i, cnt50, cnt100] != 0) {\n Console.WriteLine(i);\n Console.WriteLine(dp[i, cnt50, cnt100]);\n }\n for (a = 0; a <= cnt50; ++a) {\n for (b = 0; b <= cnt100; ++b) {\n if (dp[i, a, b] != 0) {\n for (c = 0; c <= a; ++c) {\n for (d = 0; d <= b && c * 50 + d * 100 <= cap; ++d) {\n if (c + d != 0) {\n Add(ref dp[i + 1, cnt50 - (a - c), cnt100 - (b - d)], dp[i, a, b] * binomial[a, c] % Mod * binomial[b, d] % Mod);\n }\n }\n }\n }\n }\n }\n }\n }\n\n // stuff cutline\n\n public static void Main() {\n#if DEBUG\n Console.SetIn(new System.IO.StreamReader(\"..\\\\..\\\\in.txt\"));\n#endif\n var root = new Program();\n Console.Out.Flush();\n }\n\n static Int32 ReadInt() {\n Boolean neg = false;\n Int32 ch, ans = 0;\n do {\n ch = Console.Read();\n neg |= ch == (Int32)'-';\n } while (!Char.IsDigit((Char)ch));\n do {\n ans = ans * 10 + (ch & 0xf);\n ch = Console.Read();\n } while (Char.IsDigit((Char)ch));\n return neg ? -ans : ans;\n }\n\n static Int32[] ReadArray() {\n return Array.ConvertAll(Console.ReadLine().Split(), Int32.Parse);\n }\n\n}", "lang": "Mono C#", "bug_code_uid": "0ef3380d17316f59ec687e44d6bf7413", "src_uid": "ebb0323a854e19794c79ab559792a1f7", "apr_id": "367f5ea49b5953807c584ce7821a2a26", "difficulty": 2100, "tags": ["graphs", "dp", "combinatorics", "shortest paths"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.3521515988945914, "equal_cnt": 62, "replace_cnt": 42, "delete_cnt": 9, "insert_cnt": 10, "fix_ops_cnt": 61, "bug_source_code": "#if DEBUG\nusing System.Reflection;\nusing System.Threading.Tasks;\n#endif\n\nusing System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\nusing System.Text;\n\n\nnamespace _307b\n{\n class Program\n {\n const string _inputFilename = \"\";\n const string _outputFilename = \"\";\n\n static void Main(string[] args)\n {\n\n var outputWriter = new StreamWriter(Console.OpenStandardOutput(), Encoding.Default, 1024 * 1024);\n\n#if DEBUG\n Console.SetIn(getInput());\n#else\n if (!string.IsNullOrEmpty(_inputFilename))\n {\n var inputStream = new FileStream(_inputFilename, FileMode.Open);\n outputWriter = new StreamWriter(_outputFilename, true, Encoding.Default, 1024 * 1024);\n\n Console.SetIn(File.OpenText(_inputFilename));\n }\n#endif\n Console.SetOut(outputWriter);\n\n try\n {\n solution();\n }\n finally\n {\n outputWriter.Close();\n }\n }\n\n static void solution()\n {\n #region SOLUTION\n var a = Console.ReadLine();\n var b = Console.ReadLine();\n var c = Console.ReadLine();\n\n var ac = new int[26];\n var bn = new int[26];\n var cn = new int[26];\n\n for (int i = 0; i < a.Length; i++)\n {\n // 97\n var next = ((int)a[i]) - 97;\n ac[next]++;\n }\n\n for (int i = 0; i < b.Length; i++)\n {\n var next = ((int)b[i]) - 97;\n bn[next]++;\n }\n\n for (int i = 0; i < c.Length; i++)\n {\n var next = ((int)c[i]) - 97;\n cn[next]++;\n }\n\n var maxb = 0;\n var maxc = 0;\n var max = 0;\n var temp = new int[26];\n for (int i = 0; i < a.Length; i++)\n {\n var can = i * b.Length <= a.Length;\n if (!can)\n {\n break;\n }\n\n for (int j = 0; j < 26; j++)\n {\n temp[j] = ac[j] - i * bn[j];\n\n if (temp[j] < 0)\n {\n can = false;\n break;\n }\n }\n\n if (!can)\n {\n continue;\n }\n\n var cc = int.MaxValue;\n for (int j = 0; j < 26; j++)\n {\n if (cn[j] != 0)\n {\n cc = Math.Min(cc, temp[j] / cn[j]);\n }\n }\n\n if (cc + i > max)\n {\n max = cc + i;\n maxb = i;\n maxc = cc;\n }\n }\n\n if (max == 0)\n {\n Console.WriteLine(a);\n return;\n }\n else\n {\n var gcan = false;\n var bcount = maxb;\n var ccount = maxc;\n\n\n for (int j = 0; j < 26; j++)\n {\n ac[j] -= bn[j] * bcount + cn[j] * ccount;\n }\n\n\n var sb = new StringBuilder();\n for (int i = 0; i < bcount; i++)\n {\n sb.Append(b);\n }\n\n for (int i = 0; i < ccount; i++)\n {\n sb.Append(c);\n }\n\n for (int i = 0; i < 26; i++)\n {\n for (int j = 0; j < ac[i]; j++)\n {\n sb.Append(((char)(i + 97)));\n }\n }\n\n Console.WriteLine(sb.ToString());\n }\n\n //var l = 0;\n //var r = a.Length;\n //while (true)\n //{\n // if (l == r)\n // {\n // break;\n // }\n\n // var mid = l + (r - l + 1) / 2;\n\n // var gcan = false;\n // for (int i = 0; i < mid + 1; i++)\n // {\n // var bcount = i;\n // var ccount = mid - i;\n // var can = true;\n // for (int j = 0; j < 26; j++)\n // {\n // if (ac[j] - bn[j] * bcount - cn[j] * ccount < 0)\n // {\n // can = false;\n // break;\n // }\n // }\n\n // if (can)\n // {\n // gcan = true;\n // break;\n // }\n // }\n\n // if (gcan)\n // {\n // l = mid;\n // }\n // else\n // {\n // r = mid - 1;\n // }\n //}\n\n \n //var n = readInt();\n //var m = readInt();\n\n //var a = readIntArray();\n //var b = readIntArray();\n #endregion\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[] readIntArray()\n {\n return Console.ReadLine().Split(' ').Where(i => !string.IsNullOrEmpty(i)).Select(i => int.Parse(i)).ToArray();\n }\n\n static long[] readLongArray()\n {\n return Console.ReadLine().Split(' ').Where(i => !string.IsNullOrEmpty(i)).Select(i => long.Parse(i)).ToArray();\n }\n\n#if DEBUG\n\t\tstatic StreamReader getInput()\n\t\t{\n\t\t\tvar resName = Assembly.GetCallingAssembly().GetManifestResourceNames()[0];\n\t\t\tvar resource = Assembly.GetCallingAssembly().GetManifestResourceStream(resName);\n\n\t\t\treturn new StreamReader(resource);\n\t\t}\n#endif\n }\n}\n", "lang": "MS C#", "bug_code_uid": "0be76a460accc1d870c0e3d83503dc3e", "src_uid": "0d43104a0de924cdcf8e4aced5aa825d", "apr_id": "483ab9c25209c597b484753e548b7eaf", "difficulty": 1400, "tags": ["brute force", "bitmasks"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9712218385134024, "equal_cnt": 9, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 5, "fix_ops_cnt": 8, "bug_source_code": "\tusing System;\n\n\tnamespace Project_1\n\t{\n\t\tclass MainClass\n\t\t{\n\t\t\tpublic static void Main(string[] args)\n\t\t\t{\n\t\t\t\t/*\tstring s;\n\t\t\t\t\ts = Console.ReadLine();\n\t\t\t\t\tstring str = \"hello\";\n\t\t\t\t\tConsole.WriteLine(str[0]+s);\n\t\t\t\t\tConsole.WriteLine(Calc(3, 5));*/\n\t\t\t\t//Вводим начальные данные\n\t\t\t\tint el_count=0;//количество предметов\n\t\t\t\tint min_weight=0, max_weight=0;//минимальный и максимальный вес предметов\n\t\t\tint min_element=0,max_element = 0;//минимальный и максимальный вес предметов в наборе\n\t\t\t\tint diff = 0;//минимальная разница в весе между минимальным и максимальным предметами в наборе\n\t\t\t\tint count = 0;//количество возможных комбинаций\n\t\t\tString str,substr=\"1\";\n\t\t\t//\tConsole.Write(\"Введите количество предметов: \");\n\t\t\t\tel_count = Int32.Parse(Console.ReadLine());\n\t\t//\t\tConsole.Write(\"Введите минимальный общий вес: \");\n\t\t\t\tmin_weight = Int32.Parse(Console.ReadLine());\n\t\t//\t\tConsole.Write(\"Введите максимальный общий вес: \");\n\t\t\t\tmax_weight = Int32.Parse(Console.ReadLine());\n\t\t//\t\tConsole.Write(\"Введите минимальную разницу в весе м/у самым легким и самым тяжелым предметами: \");\n\t\t\t\tdiff = Int32.Parse(Console.ReadLine());\n\t\t\t\tint[] mas = new int[el_count];\n\n\n string[] lines1 = Console.ReadLine().Split(' ');\n\n\t\t//\t\tConsole.WriteLine(\"Заполните веса предметов\");\n\t\t\t\tfor (int i = 0; i < mas.Length; i++)\n\t\t\t\t{\n\t\t\t//\t\tConsole.Write(\"вес предмета № {0}: \",i+1);\n\t\t\t\t\tmas[i] = Int32.Parse(lines1[i]/*Console.ReadLine()*/);\n\t\t\t\t}\n\t\t\t\t// сортировка\n\t\t\t\tint temp=0;\n\t\t\t\tfor (int i = 0; i < mas.Length - 1; i++)\n\t\t\t\t{\n\t\t\t\t\tfor (int j = i + 1; j < mas.Length; j++)\n\t\t\t\t\t{\n\t\t\t\t\t\tif (mas[i] > mas[j])\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\ttemp = mas[i];\n\t\t\t\t\t\t\tmas[i] = mas[j];\n\t\t\t\t\t\t\tmas[j] = temp;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// вывод\n\t\t\t\t/*Console.WriteLine(\"Вывод отсортированного массива\");\n\t\t\t\tfor (int i = 0; i < mas.Length; i++)\n\t\t\t\t{\n\t\t\t\t\tConsole.WriteLine(mas[i]);\n\t\t\t\t}*/\n\t\t\t\t//Console.ReadLine();\n\t\t\ttemp = 0;\n\t\t\tfor (int i = 0; i < Math.Pow(2,mas.Length); i++)\n\t\t\t\t{\n\t\t\t\t\tstr = Convert.ToString(i, 2);\n\t\t\t\t\twhile (str.Length < mas.Length)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tstr = \"0\" + str;\n\t\t\t\t\t\t}\n\t\t\t\t//в переменной str хранятся все возможные комбинации предметов в формате 0/1\n\t\t\t\tmin_element = 0;\n\t\t\t\tmax_element = 0;\n\t\t\t\ttemp = 0;\n\t\t\t\tfor (int j = 0; j < mas.Length; j++)\n\t\t\t\t{\n\n\t\t\t\t\tif (Convert.ToString(str[j]) == \"1\")\n\t\t\t\t\t{\n\t\t\t\t\t\tif (min_element == 0)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tmin_element = mas[j];\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (max_element == 0)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tmax_element = mas[j];\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (min_element > mas[j])\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tmin_element = mas[j];\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (max_element < mas[j])\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tmax_element = mas[j];\n\t\t\t\t\t\t}\n\t\t\t\t\t\ttemp += mas[j];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif ((max_element - min_element) >= diff && temp >= min_weight && temp <= max_weight)\n\t\t\t\t{\n\t\t\t\t\tcount++;\n\t\t\t\t}\n\t\t\t\t//Console.WriteLine(str);\n\t\t\t\t}\n\n\t\t\tConsole.WriteLine(/*\"Количество возможных комбинаций: \"+*/Convert.ToString(count));\n\t\t\t}\n\t\t\tstatic int Calc(int a, int b)\n\t\t\t{\n\t\t\t\treturn a + b;\n\t\t\t}\n\t\t}\n\t}\n", "lang": "MS C#", "bug_code_uid": "302f3d2841bce09ed6ed6a47ce48d5d9", "src_uid": "0d43104a0de924cdcf8e4aced5aa825d", "apr_id": "64dbadc4edc75b9c7990135ae1ab16ba", "difficulty": 1400, "tags": ["brute force", "bitmasks"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.00977114939573155, "equal_cnt": 9, "replace_cnt": 7, "delete_cnt": 2, "insert_cnt": 1, "fix_ops_cnt": 10, "bug_source_code": "program Project3;\n\n{$APPTYPE CONSOLE}\n\nuses\n SysUtils,\n Math;\n\nvar\n inStr: string;\n n, i, ii, MaxCombinations, dv,j: Integer;\n m, k, p, TotalWeigth, MinWeigth, MaxWeigth, PacksCount: Integer;\n Goods: array of Integer;\n TempGoods:array of Integer;\n\nfunction ExtractNextNum(s: string):string;\nbegin\n Result := Copy(inStr,1,Pos(' ', inStr)-1);\n Delete(inStr,1,Pos(' ', inStr));\nend;\n\nbegin\n Readln(inStr);\n inStr := inStr + ' ';\n n := StrToInt(ExtractNextNum(inStr));\n m := StrToInt(ExtractNextNum(inStr));\n k := StrToInt(ExtractNextNum(inStr));\n p := StrToInt(ExtractNextNum(inStr));\n\n Readln(inStr);\n inStr := inStr + ' ';\n SetLength(Goods, n);\n for i:=0 to n-1 do\n begin\n Goods[i]:= StrToInt(ExtractNextNum(inStr));\n end;\n\n PacksCount:=0;\n\n MaxCombinations := Trunc(Power(2, n));// - 1; //всего вариантов получить различные наборы товаров\n\n for i:=1 to MaxCombinations do //\n begin\n SetLength(TempGoods,0);\n //заполняем массив следующей комбинацией товаров\n //используем i как двоичную маску отбора элементов в массиве товаров\n // for ii:=0 to n-1 do \n dv:=i;\n\tii:=0 ;\n\twhile (dv>0) do\n\tbegin\n\t if((dv mod 2)=1) then\n\t\n // if ( (i and Trunc(Power(2,ii))) = (Trunc(Power(2,ii))) ) then\n\t\t begin\n\t\t SetLength(TempGoods,Length(TempGoods)+1);\n TempGoods[Length(TempGoods)-1]:=Goods[ii];\n end;\n\t\t dv := dv div 2;\n\t\t\t ii:=ii+1;\n end;\n\n if Length(TempGoods)<2 then Continue;//набор из 1 товара сразу нет\n\n TotalWeigth := 0;\n MinWeigth:=TempGoods[0];\n MaxWeigth:=TempGoods[0];\n \n for ii:=0 to Length(TempGoods)-1 do\n begin\n TotalWeigth:=TotalWeigth + TempGoods[ii];\n if MinWeigth > TempGoods[ii] then MinWeigth:= TempGoods[ii];\n if MaxWeigth < TempGoods[ii] then MaxWeigth:= TempGoods[ii];\n end;\n\n if ((TotalWeigth < m) or (TotalWeigth > k)) then Continue; //условие суммарного веса\n if ((MaxWeigth - MinWeigth) < p) then Continue; //условие разницы крайних весов\n\n Inc(PacksCount);//условия подошли - берем как вариант пачки товаров\n\n end;\n\n Writeln(inttostr(PacksCount));\n // readln;\n\nend.\n ", "lang": "MS C#", "bug_code_uid": "85808ff937a7c2bdd2044798f1a9f75c", "src_uid": "0d43104a0de924cdcf8e4aced5aa825d", "apr_id": "64dbadc4edc75b9c7990135ae1ab16ba", "difficulty": 1400, "tags": ["brute force", "bitmasks"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.8086592178770949, "equal_cnt": 8, "replace_cnt": 5, "delete_cnt": 0, "insert_cnt": 2, "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 CodeforcesICPC\n{ \n class MadOver\n {\n static void Main(string[] args)\n {\n string[] token = Console.ReadLine().Split();\n string[] token2 = Console.ReadLine().Split();\n \n int x1 = int.Parse(token[0]) + 100;\n int y1 = int.Parse(token[1]) + 100;\n \n int x2 = int.Parse(token2[0]) + 100;\n int y2 = int.Parse(token2[1]) + 100;\n \n if(x1==x2){x-=1}\n if(y1==y2){y-=1}\n \n Console.WriteLine( Math.Abs(x2-x1)*2 + Math.Abs((y1+1)-x1)*2);\n }\n }\n \n}", "lang": "Mono C#", "bug_code_uid": "5f07c69ac1c619d82095044b9ef62ffc", "src_uid": "f54ce13fb92e51ebd5e82ffbdd1acbed", "apr_id": "c5c6b3b2b8ef87365a97d807c1abac0c", "difficulty": 1100, "tags": ["math", "greedy"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9988974641675854, "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 ConsoleApplication4\n{\n class Program\n {\n static void Main(string[] args)\n {\n int[] x1, x2;\n int e1;\n x1=Console.ReadLine().Split(' ').Select(int.Parse).ToArray();\n x2=Console.ReadLine().Split(' ').Select(int.Parse).ToArray();\n if (x1[0] == x2[0])\n {\n e1 = 2*(Math.Abs(x1[1] - x2[1])) + 6;\n }\n else\n {\n if (x1[1] == x2[1])\n {\n e1 = 2*(Math.Abs(x1[0] - x2[0])) + 4;\n }\n else\n {\n e1 = 2 * (Math.Abs(x1[0] - x2[0]) + Math.Abs(x1[1] - x2[1])) + 4;\n }\n }\n Console.WriteLine(e1);\n \n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "a9561f7cbf29f3e1153d87ba37e37b4a", "src_uid": "f54ce13fb92e51ebd5e82ffbdd1acbed", "apr_id": "1930bd8003c407a43eb1c050c0f39cb4", "difficulty": 1100, "tags": ["math", "greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9806284976323719, "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.Text;\nusing System.Threading.Tasks;\n\nnamespace ConsoleApplication1\n{\n class Program\n {\n static void Main(string[] args)\n {\n string st = Console.ReadLine();\n bool left, right, down, up;\n left = right = down = up = true;\n if (st.Contains(\"1\") || st.Contains(\"4\") || st.Contains(\"7\") || st.Contains(\"0\"))\n {\n left = false;\n }\n if (st.Contains(\"3\") || st.Contains(\"6\") || st.Contains(\"9\") || st.Contains(\"0\"))\n {\n right = false;\n }\n if (st.Contains(\"1\") || st.Contains(\"2\") || st.Contains(\"3\"))\n {\n up = false;\n }\n if (st.Contains(\"7\") || st.Contains(\"0\") || st.Contains(\"9\"))\n {\n down = false;\n }\n if (left || right || down || up)\n {\n Console.WriteLine(\"NO\");\n }\n else\n {\n Console.WriteLine(\"YES\");\n }\n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "6abe1995be79190cbe105f2e895142ff", "src_uid": "d0f5174bb0bcca5a486db327b492bf33", "apr_id": "e16cc310f7e632fd0580e9372a176b59", "difficulty": 1400, "tags": ["brute force", "constructive algorithms", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.9854014598540146, "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.IO;\nusing System.Linq;\nusing System.Text;\nclass Solution\n{\n\n static void Main(String[] args)\n {\n string[] valid = new string[8] {\n \"0000000\",\n \"0000000\",\n \"0011100\",\n \"0011100\",\n \"0011100\",\n \"0001000\",\n \"0000000\",\n \"0000000\"\n };\n int[] row = new int[] {5,2,2,2,3,3,3,4,4,4};\n int[] col = new int[] {3,2,3,4,2,3,4,2,3,4};\n\n int count = int.Parse(Console.ReadLine());\n string digits = Console.ReadLine();\n bool found = false;\n for (int i = 0; i < 10; ++i)\n {\n bool v = true;\n int idx = (int)digits[0]-(int)'0';\n int or = row[idx]-row[i];\n int oc = col[idx]-col[i];\n if (or == 0 && oc == 0)\n {\n continue;\n }\n for (int j = 0; j < count; ++j)\n {\n idx = (int)digits[j]-(int)'0';\n int ir = row[idx] - or;\n int ic = col[idx] - oc;\n if (valid[ir][ic] == '0')\n {\n v = false;\n break;\n }\n }\n if (v)\n {\n found = true;\n break;\n }\n }\n if (found)\n {\n Console.WriteLine(\"NO\");\n }\n else\n {\n Console.WriteLine(\"YES\");\n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "ae40966362bf3e42f2cfebb10cd75219", "src_uid": "d0f5174bb0bcca5a486db327b492bf33", "apr_id": "c84774dd5d577fa7d1a31f84327fc03f", "difficulty": 1400, "tags": ["brute force", "constructive algorithms", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.8448795180722891, "equal_cnt": 11, "replace_cnt": 3, "delete_cnt": 4, "insert_cnt": 3, "fix_ops_cnt": 10, "bug_source_code": "using System; using System.Linq;\n\nclass Program {\n static void Main() {\n var f = Enumerable.Range(0,3).Select(i => Console.ReadLine().Split(' ').Select(int.Parse).Select(x => x % 2).ToArray()).ToArray();\n var ff = new int[3,3];\n for (var y = 0 ; y < 3 ; y++) for (var x = 0 ; x < 3 ; x++)\n for (var yi = y-1 ; yi <= y+1 ; yi++) for (var xi = x-1 ; xi <= x+i ; xi++)\n if (yi >= 0 && xi >= 0 && f[y][x] == 1 && yi < 3 && xi < 3)\n ff[yi,xi] = 1 ^ ff[yi,xi];\n for (var y = 0 ; y < 3; y++) {\n for (var x = 0; x < 3 ; x++) Console.Write(\"{0} \", ff[y,x]);\n Console.WriteLine();\n }\n }\n}", "lang": "MS C#", "bug_code_uid": "aed67619083d4d7423566bc556ec408e", "src_uid": "b045abf40c75bb66a80fd6148ecc5bd6", "apr_id": "da99ab207be9183c0716f422f5ebba2a", "difficulty": 900, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C#"} {"similarity_score": 0.35657686212361334, "equal_cnt": 23, "replace_cnt": 16, "delete_cnt": 4, "insert_cnt": 2, "fix_ops_cnt": 22, "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 // Console.ReadLine();\n Console.ReadLine();\n string Data = Console.ReadLine().Replace(\"0\", \"\");\n if (Data.Length == 0) { Console.WriteLine(\"YES\"); return; }\n int[] arr = new int[Data.Length];\n int[] sign = new int[Data.Length];\n #region proccess1\n\n while (true)\n {\n arr[0]++;\n if (arr[0] >= Data.Length - 1) // refer to first counter max\n {\n for (int i = 0; i < arr.Length - 1; i++) // \n {\n if (arr[i] >= Data.Length - i & arr[i + 1] != Data.Length - i - 1)\n {\n arr[i + 1]++;\n for (int j = i; j >= 0; j--)\n {\n arr[j] = arr[j + 1] + 1;\n }\n }\n }\n } \n #endregion\n\n #region proccess2\n if (arr[arr.Length - 1] == 1) { Console.WriteLine(\"NO\"); return; }\n int C = 0;\n for (int i = arr.Length - 1; i >= 0; i--)\n {\n if (arr[i] > 0)\n {\n string S = Data.Substring(arr[i + 1], (arr[i] - arr[i + 1]));\n if (C == 0) C = ____(S);\n else if (C != ____(S))\n {\n continue;\n }\n }\n if (i == 0)\n {\n string S = Data.Substring(arr[0], (Data.Length - arr[0]));\n if (S.Length > 0) if (C == ____(S)) { Console.WriteLine(\"YES\"); return; };\n }\n }\n #endregion\n }\n \n }\n static int ____(string num)\n {\n int n = num.Length;\n int x = int.Parse(num);\n int A = 0;\n for (int i = 0; i < n; i++)\n {\n A += x % 10;\n x /= 10;\n }\n return A;\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "4da7a015b0f940566baa7b02dd1a944e", "src_uid": "410296a01b97a0a39b6683569c84d56c", "apr_id": "48739c7c729cd33ab20fb67ba6fe9071", "difficulty": 1300, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9922417313189057, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "using System;\n class Program\n {\n static void Main(string[] args)\n {\n int sum=0;\n int[] data;\n {\n string input = Console.In.ReadToEnd().Split(new char[] { '\\n', '\\r' }, StringSplitOptions.RemoveEmptyEntries)[1];\n data = new int[input.Length];\n for (int i = 0; i < input.Length;)\n sum += data[i] = input[i++]-48;\n }\n int[] dividers = { 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 101 };\n for(int i = 0, l; data.Length>=dividers[i]; i++)\n {\n if(sum%dividers[i]==0)\n {\n l = sum / dividers[i];\n int sm = 0;\n for (int j = 0; j < data.Length;)\n {\n if (sm < l) sm += data[j++];\n else if (sm > l) break;\n else { dividers[i]--; sm = 0; }\n }\n if(dividers[i]==1 && sm==l) { sum = int.MinValue; break; }\n }\n }\n Console.WriteLine(sum < 0 ? \"YES\" : \"NO\");\n }\n }", "lang": "Mono C#", "bug_code_uid": "4df5fe14ab9666a36a026964b447fdc7", "src_uid": "410296a01b97a0a39b6683569c84d56c", "apr_id": "16a8cac8fa655371c83089ae29f1aa4e", "difficulty": 1300, "tags": ["implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.01896551724137931, "equal_cnt": 25, "replace_cnt": 17, "delete_cnt": 1, "insert_cnt": 7, "fix_ops_cnt": 25, "bug_source_code": "\nMicrosoft Visual Studio Solution File, Format Version 12.00\n# Visual Studio 2012\nProject(\"{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}\") = \"CupC\", \"CupC\\CupC.csproj\", \"{DF7C8BA3-F7C7-4D00-8598-D385D38C8645}\"\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{DF7C8BA3-F7C7-4D00-8598-D385D38C8645}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{DF7C8BA3-F7C7-4D00-8598-D385D38C8645}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{DF7C8BA3-F7C7-4D00-8598-D385D38C8645}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{DF7C8BA3-F7C7-4D00-8598-D385D38C8645}.Release|Any CPU.Build.0 = Release|Any CPU\n\tEndGlobalSection\n\tGlobalSection(SolutionProperties) = preSolution\n\t\tHideSolutionNode = FALSE\n\tEndGlobalSection\nEndGlobal\n", "lang": "Mono C#", "bug_code_uid": "e5aaf84879b2c42b0a500af7b15708e1", "src_uid": "410296a01b97a0a39b6683569c84d56c", "apr_id": "471fc430db5ade5d4a3f54759d72b769", "difficulty": 1300, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9656938044034818, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 3, "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 string[]y=Console.ReadLine().Split(' ');\n string[]yq=Console.ReadLine().Split(' ');\n string[]yqq=Console.ReadLine().Split(' ');\n int a=int.Parse(y[0]);\n int b=int.Parse(y[1]);\n int c=int.Parse(yq[0]);\n int d=int.Parse(yq[1]);\n int e=int.Parse(yqq[0]);\n int f=int.Parse(yqq[1]);\n int mass=0;\n for(int i=b+1;i>0;i--)\n {\n mass+=i;\n if(i==d)\n mass-=c;\n if(i==f)\n mass-=e;\n if(mass<0)\n mass=0;\n \n \n }\n \n Console.WriteLine(mass);\n }\n }\n}", "lang": "Mono C#", "bug_code_uid": "2455822ed9d46d6dba34832f87ddfd79", "src_uid": "084a12eb3a708b43b880734f3ee51374", "apr_id": "56c54370dd3864cf5acc0309afcbe8f4", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9631919078392807, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 2, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "using Snowball;\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\nusing Trees;\n\nnamespace Runner\n{\n class Program\n {\n static void Main(string[] args)\n {\n //AVLTree avlTree = new AVLTree(97,\n // new AVLTree(49,\n // new AVLTree(37),\n // new AVLTree(81)),\n // new AVLTree(917));\n\n //avlTree.Traverse();\n\n string[] firstLineArgs = Console.ReadLine().Split(new char[] { ' ' });\n string[] secondLineArgs = Console.ReadLine().Split(new char[] { ' ' });\n string[] thirdLineArgs = Console.ReadLine().Split(new char[] { ' ' });\n\n int w = int.Parse(firstLineArgs[0]);\n int h = int.Parse(firstLineArgs[1]);\n\n int u1 = int.Parse(secondLineArgs[0]);\n int d1 = int.Parse(secondLineArgs[1]);\n\n int u2 = int.Parse(thirdLineArgs[0]);\n int d2 = int.Parse(thirdLineArgs[1]);\n\n if (d1 == d2)\n {\n throw new Exception();\n }\n\n Console.WriteLine(PushSnowball(w, h, u1, d1, u2, d2));\n\n\n }\n\n public static int PushSnowball(int w, int h, int u1, int d1, int u2, int d2)\n {\n int snowballSize = w;\n\n for (int i = h; i > 0; i--)\n {\n snowballSize += i;\n\n if (i == d1)\n {\n snowballSize -= u1;\n }\n else if (i == d2)\n {\n snowballSize -= u2;\n }\n\n if (snowballSize < 0)\n {\n snowballSize = 0;\n }\n }\n\n return snowballSize;\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "ac2e40b0e7db7a7a10744e3f160be405", "src_uid": "084a12eb3a708b43b880734f3ee51374", "apr_id": "5ce32ea9ff4f2c8e1e4ca0823c30d1a9", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C#"} {"similarity_score": 0.8900685689006856, "equal_cnt": 13, "replace_cnt": 6, "delete_cnt": 3, "insert_cnt": 3, "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 ConsoleApp3\n{\n class Program\n {\n static void Main(string[] args)\n {\n //Maior fração atual irredutível encontrada\n string fracaoAtual = \"\";\n\n //Resultado da soma dos termos da fração\n var n = Int32.Parse(Console.ReadLine());\n int a=0, b=0;\n\n //Verificar se o número é válido conforme descrito no problema\n if (n < 3 || n > 1000)\n {\n Console.WriteLine(\"Entrada Inválida\");\n return;\n }\n\n /*declaração do denominador da fração e loop de variação, o denominador deve ser maior que o numerador, \n então o máximo de verificação para saída é a metade de n*/\n for (int denominador = n - 1; denominador > n / 2; denominador--)\n {\n //Declaração do numerador da fração\n int numerador = n - denominador;\n\n //Criação da validação de valores primos entre si\n var primosEntreSi = true;\n\n /*Loop de verificação de possíveis divisores comuns entre numerador e denominador*/\n for (int i = 2; i <= numerador; i++)\n {\n /*se o resto da divisão do numerador e denominador pelo termo testado \n for igual a 0 os termos não são primos entre si*/\n if (numerador % i == 0 && denominador % i == 0)\n {\n primosEntreSi = false;\n break;\n }\n }\n\n //Se forem primos entre si, a fração atual se torna a maior fração irredutível encontrada\n if (primosEntreSi)\n fracaoAtual = numerador + \" \" + denominador;\n if (numerador == 16 && denominador == 18)\n {\n numerador--;\n denominador++;\n }\n a = numerador;\n b = denominador;\n }\n\n //Retorna o resultado\n Console.WriteLine(\"{0} {1}\",a,b);\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "c907b7c64413a6d8ffba0c1cdeb9ad9f", "src_uid": "0af3515ed98d9d01ce00546333e98e77", "apr_id": "7b755a8a26fa7108073095d4d0dbf5e1", "difficulty": 800, "tags": ["brute force", "math", "constructive algorithms"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.06628242074927954, "equal_cnt": 4, "replace_cnt": 3, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 5, "bug_source_code": "double c1 = convert.todouble(Console.ReadLine());", "lang": "MS C#", "bug_code_uid": "144028e5302ffbcecd6f453776809946", "src_uid": "af1ec6a6fc1f2360506fc8a34e3dcd20", "apr_id": "9e825f3aac47aba63ee1a9fa7d8d9889", "difficulty": 1100, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9609919917334022, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 0, "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 test2\n{\n class Program\n {\n static void Main(string[] args)\n {\n int num = Convert.ToInt32(Console.ReadLine());\n string valueStr = Console.ReadLine();\n Test(valueStr, num);\n }\n public static void Test(string valueStr, int num)\n {\n List num1 = new List();\n List num2 = new List();\n int indexOf = 0;\n string MidStr = \"\";\n do\n {\n int indexTwo = valueStr.IndexOf('(', indexOf);\n if (indexTwo == -1)\n {\n indexTwo = num;\n }\n MidStr = valueStr.Substring(indexOf, indexTwo - indexOf);\n int indexThree = MidStr.IndexOf(')', 0);\n\n if (indexThree != -1)\n {\n string MidStr2 = MidStr.Substring(0, indexThree);\n insertNum(num2, MidStr2);\n //indexOf = indexTwo + 1;\n MidStr = MidStr.Substring(indexThree + 1);\n }\n insertNum(num1, MidStr);\n indexOf = indexTwo + 1;\n if (indexOf >= num)\n {\n break;\n }\n } while (true);\n int[] nums = num1.ToArray();\n Array.Sort(nums);\n Console.WriteLine(\"{0} {1}\", nums[num1.Count - 1], num2.Count);\n }\n public static void insertNum(List num, string MidStr)\n {\n string[] value = MidStr.Split(new[] { '_' }, StringSplitOptions.RemoveEmptyEntries);\n foreach (var item in value)\n {\n num.Add(item.Length);\n }\n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "896fa3485800635aeb878c53d90aa4e7", "src_uid": "fc86df4931e787fa3a1a40e2aecf0b92", "apr_id": "b5b33c0c33684f3e49673516fe8f865e", "difficulty": 1100, "tags": ["strings", "implementation", "expression parsing"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9296551724137931, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "using System;\nusing System.Linq;\n\nclass B723 {\n public static void Main() {\n var n = int.Parse(Console.ReadLine());\n var s = Console.ReadLine();\n var ss = s.Split('(', ')');\n int answer1 = 0, answer2 = 0;\n for (int i = 0; i < ss.Length; i += 2) {\n var opts = StringSplitOptions.RemoveEmptyEntries;\n var sss = ss[i].Split(new char[] { '_' }, opts);\n foreach (var j in sss)\n if (answer1 < j.Length) answer1 = j.Length;\n }\n for (int i = 1; i < ss.Length; i += 2) {\n var sss = ss[i].Split(new char[] { '_' }, opts);\n answer2 += sss.Length;\n }\n Console.WriteLine($\"{answer1} {answer2}\");\n }\n}\n", "lang": "MS C#", "bug_code_uid": "833768175633c259995426697a86cd92", "src_uid": "fc86df4931e787fa3a1a40e2aecf0b92", "apr_id": "479d07d43ef1d28da53e37b0fd85046f", "difficulty": 1100, "tags": ["strings", "implementation", "expression parsing"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C#"} {"similarity_score": 0.9558707643814027, "equal_cnt": 5, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 4, "fix_ops_cnt": 4, "bug_source_code": "using System;\nusing System.Collections.Generic;\n\nnamespace ConsoleApplication1\n{\n class Program\n {\n static void Main()\n {\n string p = Console.ReadLine();\n string a = Console.ReadLine();\n a = a.Trim('_');\n while (a.IndexOf(\"__\") > 0) a = a.Remove(a.IndexOf(\"__\"), 1);\n\n List brakes = new List();\n while (a.IndexOf('(') > 0)\n {\n int ind = a.IndexOf('(');\n brakes.Add(a.Substring(ind+ 1, a.IndexOf(')') - ind- 1));\n a = a.Remove(ind, a.IndexOf(')') - ind + 1);\n a = a.Insert(ind, \"_\");\n }\n while (a.IndexOf(\"__\") > 0) a.Remove(a.IndexOf(\"__\"), 1);\n\n string[] b = a.Split('_');\n\n int max = 0;\n for (int i = 0; i < b.Length; i++) if (b[i].Length > max) max = b[i].Length;\n\n int count = 0;\n foreach (var s in brakes)\n {\n string s2 = s.Trim('_');\n string[] ss = s2.Split('_');\n count += ss.Length;\n }\n Console.WriteLine(max + \" \" + count);\n //Console.ReadKey();\n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "509c248a46be220a0968a8ff920fcbe9", "src_uid": "fc86df4931e787fa3a1a40e2aecf0b92", "apr_id": "685830c41b477b99929c160772f70dc5", "difficulty": 1100, "tags": ["strings", "implementation", "expression parsing"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.9489438744719373, "equal_cnt": 33, "replace_cnt": 18, "delete_cnt": 4, "insert_cnt": 10, "fix_ops_cnt": 32, "bug_source_code": "#define Online\nusing System;\nusing System.Collections.Generic;\nusing System.Globalization;\nusing System.Linq;\nusing System.Text;\nusing System.IO;\nusing System.Diagnostics;\nusing System.Threading;\n\n\nnamespace CF\n{\n delegate double F(double x);\n delegate decimal Fdec(decimal x);\n\n class Program\n {\n\n static void Main(string[] args)\n {\n\n#if FileIO\n StreamReader sr = new StreamReader(\"input.txt\");\n StreamWriter sw = new StreamWriter(\"output.txt\");\n Console.SetIn(sr);\n Console.SetOut(sw);\n#endif\n\n long n, m, x, y, a, b;\n string[] input = ReadArray();\n n = long.Parse(input[0]);\n m = long.Parse(input[1]);\n x = long.Parse(input[2]);\n y = long.Parse(input[3]);\n a = long.Parse(input[4]);\n b = long.Parse(input[5]);\n\n long gcd = MyMath.GCD(a, b);\n a /= gcd;\n b /= gcd;\n\n long left = 1;\n long right = m;\n\n long mid;\n while (left < right)\n {\n mid = left + ((right - left) >> 1);\n if (mid * a >= m || mid * b >= n)\n {\n right = mid;\n }\n else\n {\n left = mid + 1;\n }\n }\n if (!(left * a <= m && left * b <= n))\n left--;\n\n long w, h;\n w = left * a;\n h = left * b;\n long x1, y1, x2, y2;\n\n if (x - (w % 2 == 0 ? w / 2 : w / 2 + 1) >= 0)\n {\n if (x + w / 2 > m)\n {\n x1 = x - (w % 2 == 0 ? w / 2 : w / 2 + 1);\n x1 -= (x1 + w - m);\n x2 = x1 + w;\n }\n else\n {\n x1 = x - (w % 2 == 0 ? w / 2 : w / 2 + 1);\n x2 = x1 + w;\n }\n }\n else\n {\n x1 = 0;\n x2 = w;\n }\n if (y - (h % 2 == 0 ? h / 2 : h / 2 + 1) >= 0)\n {\n if (y + h / 2 > n)\n {\n y1 = y - (h % 2 == 0 ? h / 2 : h / 2 + 1);\n y1 -= (y1 + h - n);\n y2 = y1 + h;\n }\n else\n {\n y1 = y - (h % 2 == 0 ? h / 2 : h / 2 + 1);\n y2 = y1 + h;\n }\n }\n else\n {\n y1 = 0;\n y2 = h;\n }\n Console.WriteLine(x1 + \" \" + y1 + \" \" + x2 + \" \" + y2);\n#if Online\n Console.ReadLine();\n#endif\n\n#if FileIO\n sr.Close();\n sw.Close();\n#endif\n }\n\n static string[] ReadArray()\n {\n return Console.ReadLine().Split(' ');\n }\n\n static int ReadInt()\n {\n return int.Parse(Console.ReadLine());\n }\n }\n\n public static class MyMath\n {\n public static long BinPow(long a, long n, long mod)\n {\n long res = 1;\n while (n > 0)\n {\n if ((n & 1) == 1)\n {\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) b = a % (a = b);\n return a;\n }\n\n public static int GCD(int a, int b)\n {\n while (b != 0) 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 public class SegmentTree\n {\n int[] v_min;\n int[] v_max;\n int[] mas;\n public void BuildTree(int[] a)\n {\n int n = a.Length - 1;\n int z = 0;\n while (n >= 2)\n {\n z++;\n n >>= 1;\n }\n n = 1 << (z + 1);\n v_min = new int[n << 1];\n v_max = new int[n << 1];\n mas = new int[n << 1];\n for (int i = n; i < n + a.Length; i++)\n v_min[i] = a[i - n];\n for (int i = n + a.Length; i < v_min.Length; i++)\n v_min[i] = int.MaxValue;\n for (int i = n - 1; i > 0; i--)\n v_min[i] = Math.Min(v_min[(i << 1)], v_min[(i << 1) + 1]);\n\n for (int i = n; i < n + a.Length; i++)\n v_max[i] = a[i - n];\n for (int i = n + a.Length; i < v_max.Length; i++)\n v_max[i] = int.MinValue;\n for (int i = n - 1; i > 0; i--)\n v_max[i] = Math.Max(v_max[(i << 1)], v_max[(i << 1) + 1]);\n\n }\n //nil\n public int RMQ_MIN(int l, int r)\n {\n int ans = int.MaxValue;\n l += v_min.Length >> 1;\n r += v_min.Length >> 1;\n const int o = 1;\n while (l <= r)\n {\n if ((l & 1) == o)\n ans = Math.Min(ans, v_min[l]);\n if (!((r & 1) == 0))\n ans = Math.Min(ans, v_min[r]);\n l = (l + 1) >> 1;\n r = (r - 1) >> 1;\n }\n return ans;\n }\n\n public int RMQ_MAX(int l, int r)\n {\n int ans = int.MinValue;\n l += v_max.Length >> 1;\n r += v_max.Length >> 1;\n const int o = 1;\n while (l <= r)\n {\n if ((l & 1) == o)\n ans = Math.Max(ans, v_max[l]);\n if (!((r & 1) == 0))\n ans = Math.Max(ans, v_max[r]);\n l = (l + 1) >> 1;\n r = (r - 1) >> 1;\n }\n return ans;\n }\n\n public void Put(int l, int r, int op)\n {\n l += mas.Length >> 1;\n r += mas.Length >> 1;\n while (l <= r)\n {\n if (l % 2 != 0)\n mas[l] = op;\n if (r % 2 == 0)\n mas[r] = op;\n l = (l + 1) >> 1;\n r = (r - 1) >> 1;\n }\n }\n\n public int Get(int x)\n {\n x += mas.Length >> 1;\n int ans = int.MinValue;\n while (x > 0)\n {\n ans = Math.Max(mas[x], ans);\n x >>= 1;\n }\n return ans;\n }\n\n public void Update(int i, int x)\n {\n i += v_min.Length >> 1;\n v_min[i] = x;\n v_max[i] = x;\n i >>= 1;\n while (i > 0)\n {\n v_min[i] = Math.Min(v_min[(i << 1)], v_min[(i << 1) + 1]);\n v_max[i] = Math.Max(v_max[(i << 1)], v_max[(i << 1) + 1]);\n i >>= 1;\n }\n }\n }\n class Edge\n {\n public int a;\n public int b;\n public int w;\n\n public Edge(int a, int b, int w)\n {\n this.a = a;\n this.b = b;\n this.w = w;\n }\n }\n class Graph\n {\n public List> g = new List>();\n public List e = new List();\n public Stack s;\n public List u;\n public List d; //длина\n public List p; //путь\n public Queue q;\n public int n;\n public int start;\n public int finish;\n public Graph(int n)\n {\n for (int i = 0; i <= n; i++)\n g.Add(new List());\n p = new List();\n d = new List();\n for (int i = 0; i <= n; i++)\n p.Add(-1);\n for (int i = 0; i <= n; i++)\n d.Add(-1);\n u = new List();\n for (int i = 0; i <= n; i++)\n u.Add(true);\n this.n = n;\n }\n\n public bool dfs1(int v)\n {\n u[v] = false;\n for (int i = 0; i < g[v].Count; i++)\n {\n if (u[g[v][i]])\n {\n p[g[v][i]] = v;\n if (dfs1(g[v][i])) return true;\n }\n else\n {\n if (p[v] != g[v][i])\n {\n start = v;\n finish = g[v][i];\n return true;\n }\n }\n }\n return false;\n }\n\n public void dfs2(int v)\n {\n s = new Stack();\n s.Push(v);\n int cur;\n bool all;\n while (s.Count != 0)\n {\n cur = s.Peek();\n all = true;\n for (int i = 0; i < g[cur].Count; i++)\n {\n if (d[g[cur][i]] == -1)\n {\n s.Push(g[cur][i]);\n d[g[cur][i]] = d[cur] + 1;\n all = false;\n }\n }\n if (all)\n s.Pop();\n }\n }\n\n public void DFS(int v)\n {\n s = new Stack();\n\n s.Push(v);\n int cur;\n bool all;\n while (s.Count != 0)\n {\n cur = s.Peek();\n u[cur] = false;\n all = true;\n for (int i = 0; i < g[cur].Count; i++)\n {\n if (u[g[cur][i]])\n {\n all = false;\n p[g[cur][i]] = cur;\n s.Push(g[cur][i]);\n }\n else\n {\n if (p[cur] != g[cur][i])\n {\n start = cur;\n finish = g[cur][i];\n return;\n }\n }\n }\n if (all)\n s.Pop();\n }\n }\n\n public void BFS(params int[] v)\n {\n q = new Queue();\n u = new List();\n d = new List();\n p = new List();\n\n for (int i = 0; i <= n; i++)\n {\n u.Add(true);\n d.Add(0);\n p.Add(0);\n }\n\n q.Enqueue(v[0]);\n u[v[0]] = false;\n int cur;\n\n while (q.Count != 0)\n {\n cur = q.Dequeue();\n for (int i = 0; i < g[cur].Count; i++)\n if (u[g[cur][i]])\n {\n q.Enqueue(g[cur][i]);\n u[g[cur][i]] = false;\n p[g[cur][i]] = cur;\n d[g[cur][i]] = d[cur] + 1;\n }\n }\n\n int from = v[1];\n string path = from + \"\";\n while (p[from] != 0)\n {\n path = p[from] + \" \" + path;\n from = p[from];\n }\n Console.WriteLine(d[v[1]] + \" : \" + path);\n }\n\n public void FordBellman(params int[] v)\n {\n d = new List();\n p = new List();\n for (int i = 0; i <= n; i++)\n {\n d.Add(int.MaxValue);\n p.Add(0);\n }\n d[v[0]] = 0;\n\n for (int i = 0; i < n - 1; i++)\n {\n for (int j = 0; j < e.Count; j++)\n {\n if (d[e[j].a] != int.MaxValue)\n {\n if (d[e[j].a] + e[j].w < d[e[j].b])\n {\n d[e[j].b] = d[e[j].a] + e[j].w;\n p[e[j].b] = e[j].a;\n }\n }\n }\n }\n\n int from = v[1];\n\n if (d[from] == int.MaxValue)\n {\n Console.WriteLine(\"Can't find the minimal path\");\n return;\n }\n\n string ans = from + \"\";\n while (p[from] != 0)\n {\n ans = p[from] + \" \" + ans;\n from = p[from];\n }\n\n Console.WriteLine(d[v[1]] + \" : \" + ans);\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 {\n mid = left + ((right - left) >> 1);\n if (val <= a[mid])\n {\n right = mid;\n }\n else\n {\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 {\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\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 {\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 {\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) 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 {\n if (i > q)\n {\n for (; k <= r; k++, j++)\n A[k] = R[j];\n return;\n }\n if (j > r)\n {\n for (; k <= r; k++, i++)\n A[k] = L[i];\n return;\n }\n if (L[i].CompareTo(R[j]) <= 0)\n {\n A[k] = L[i];\n i++;\n }\n else\n {\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) 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 static void Shake(T[] a)\n {\n Random rnd = new Random(Environment.TickCount);\n T temp;\n int b, c;\n for (int i = 0; i < a.Length; i++)\n {\n b = rnd.Next(0, a.Length);\n c = rnd.Next(0, a.Length);\n temp = a[b];\n a[b] = a[c];\n a[c] = temp;\n }\n }\n }\n}", "lang": "MS C#", "bug_code_uid": "43e20b5b97e10e56e8d9e4863eedb0cd", "src_uid": "8f1211b995f35462ae83b2be27f54585", "apr_id": "0c3241fd6cbc5b8f2b9b315e25365093", "difficulty": 1700, "tags": ["math", "ternary search"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9996983226740678, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "#define FileIO\nusing System;\nusing System.Collections.Generic;\nusing System.Globalization;\nusing System.Linq;\nusing System.Text;\nusing System.IO;\nusing System.Diagnostics;\nusing System.Threading;\n\n\nnamespace CF\n{\n delegate double F(double x);\n delegate decimal Fdec(decimal x);\n\n class Program\n {\n\n static void Main(string[] args)\n {\n\n#if FileIO\n StreamReader sr = new StreamReader(\"input.txt\");\n StreamWriter sw = new StreamWriter(\"output.txt\");\n Console.SetIn(sr);\n Console.SetOut(sw);\n#endif\n\n long n, m, x, y, a, b;\n string[] input = ReadArray();\n n = long.Parse(input[0]);\n m = long.Parse(input[1]);\n x = long.Parse(input[2]);\n y = long.Parse(input[3]);\n a = long.Parse(input[4]);\n b = long.Parse(input[5]);\n\n long gcd = MyMath.GCD(a, b);\n a /= gcd;\n b /= gcd;\n\n long left = 1;\n long right = m;\n\n long mid;\n while (left < right)\n {\n mid = left + ((right - left) >> 1);\n if (mid * a >= n || mid * b >= m)\n {\n right = mid;\n }\n else\n {\n left = mid + 1;\n }\n }\n if (!(left * a <= n && left * b <= m))\n left--;\n\n long w, h;\n w = left * a;\n h = left * b;\n long x1, y1, x2, y2;\n x1 = x2 = y1 = y2 = 0;\n\n if (x + w / 2 > n)\n {\n x1 = x - (w % 2L == 0 ? w / 2L : w / 2L + 1L) - (x + w / 2L - n);\n x2 = x1 + w;\n }\n else\n {\n if (x - (w % 2 == 0 ? w / 2 : w / 2 + 1) < 0)\n {\n x1 = 0;\n x2 = w;\n }\n else\n {\n x1 = x - (w % 2L == 0 ? w / 2L : w / 2L + 1L);\n x2 = x1 + w;\n }\n }\n if (y + h / 2 > m)\n {\n y1 = y - (h % 2L == 0 ? h / 2L : h / 2L + 1L) - (y + h / 2L - m);\n y2 = y1 + h;\n }\n else\n {\n if (y - (h % 2 == 0 ? h / 2 : h / 2 + 1) < 0)\n {\n y1 = 0;\n y2 = h;\n }\n else\n {\n y1 = y - (h % 2L == 0 ? h / 2L : h / 2L + 1L);\n y2 = y1 + h;\n }\n }\n\n Console.WriteLine(x1 + \" \" + y1 + \" \" + x2 + \" \" + y2);\n#if Online\n Console.ReadLine();\n#endif\n\n#if FileIO\n sr.Close();\n sw.Close();\n#endif\n }\n\n static string[] ReadArray()\n {\n return Console.ReadLine().Split(' ');\n }\n\n static int ReadInt()\n {\n return int.Parse(Console.ReadLine());\n }\n }\n\n public static class MyMath\n {\n public static long BinPow(long a, long n, long mod)\n {\n long res = 1;\n while (n > 0)\n {\n if ((n & 1) == 1)\n {\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) b = a % (a = b);\n return a;\n }\n\n public static int GCD(int a, int b)\n {\n while (b != 0) 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 public class SegmentTree\n {\n int[] v_min;\n int[] v_max;\n int[] mas;\n public void BuildTree(int[] a)\n {\n int n = a.Length - 1;\n int z = 0;\n while (n >= 2)\n {\n z++;\n n >>= 1;\n }\n n = 1 << (z + 1);\n v_min = new int[n << 1];\n v_max = new int[n << 1];\n mas = new int[n << 1];\n for (int i = n; i < n + a.Length; i++)\n v_min[i] = a[i - n];\n for (int i = n + a.Length; i < v_min.Length; i++)\n v_min[i] = int.MaxValue;\n for (int i = n - 1; i > 0; i--)\n v_min[i] = Math.Min(v_min[(i << 1)], v_min[(i << 1) + 1]);\n\n for (int i = n; i < n + a.Length; i++)\n v_max[i] = a[i - n];\n for (int i = n + a.Length; i < v_max.Length; i++)\n v_max[i] = int.MinValue;\n for (int i = n - 1; i > 0; i--)\n v_max[i] = Math.Max(v_max[(i << 1)], v_max[(i << 1) + 1]);\n\n }\n //nil\n public int RMQ_MIN(int l, int r)\n {\n int ans = int.MaxValue;\n l += v_min.Length >> 1;\n r += v_min.Length >> 1;\n const int o = 1;\n while (l <= r)\n {\n if ((l & 1) == o)\n ans = Math.Min(ans, v_min[l]);\n if (!((r & 1) == 0))\n ans = Math.Min(ans, v_min[r]);\n l = (l + 1) >> 1;\n r = (r - 1) >> 1;\n }\n return ans;\n }\n\n public int RMQ_MAX(int l, int r)\n {\n int ans = int.MinValue;\n l += v_max.Length >> 1;\n r += v_max.Length >> 1;\n const int o = 1;\n while (l <= r)\n {\n if ((l & 1) == o)\n ans = Math.Max(ans, v_max[l]);\n if (!((r & 1) == 0))\n ans = Math.Max(ans, v_max[r]);\n l = (l + 1) >> 1;\n r = (r - 1) >> 1;\n }\n return ans;\n }\n\n public void Put(int l, int r, int op)\n {\n l += mas.Length >> 1;\n r += mas.Length >> 1;\n while (l <= r)\n {\n if (l % 2 != 0)\n mas[l] = op;\n if (r % 2 == 0)\n mas[r] = op;\n l = (l + 1) >> 1;\n r = (r - 1) >> 1;\n }\n }\n\n public int Get(int x)\n {\n x += mas.Length >> 1;\n int ans = int.MinValue;\n while (x > 0)\n {\n ans = Math.Max(mas[x], ans);\n x >>= 1;\n }\n return ans;\n }\n\n public void Update(int i, int x)\n {\n i += v_min.Length >> 1;\n v_min[i] = x;\n v_max[i] = x;\n i >>= 1;\n while (i > 0)\n {\n v_min[i] = Math.Min(v_min[(i << 1)], v_min[(i << 1) + 1]);\n v_max[i] = Math.Max(v_max[(i << 1)], v_max[(i << 1) + 1]);\n i >>= 1;\n }\n }\n }\n class Edge\n {\n public int a;\n public int b;\n public int w;\n\n public Edge(int a, int b, int w)\n {\n this.a = a;\n this.b = b;\n this.w = w;\n }\n }\n class Graph\n {\n public List> g = new List>();\n public List e = new List();\n public Stack s;\n public List u;\n public List d; //длина\n public List p; //путь\n public Queue q;\n public int n;\n public int start;\n public int finish;\n public Graph(int n)\n {\n for (int i = 0; i <= n; i++)\n g.Add(new List());\n p = new List();\n d = new List();\n for (int i = 0; i <= n; i++)\n p.Add(-1);\n for (int i = 0; i <= n; i++)\n d.Add(-1);\n u = new List();\n for (int i = 0; i <= n; i++)\n u.Add(true);\n this.n = n;\n }\n\n public bool dfs1(int v)\n {\n u[v] = false;\n for (int i = 0; i < g[v].Count; i++)\n {\n if (u[g[v][i]])\n {\n p[g[v][i]] = v;\n if (dfs1(g[v][i])) return true;\n }\n else\n {\n if (p[v] != g[v][i])\n {\n start = v;\n finish = g[v][i];\n return true;\n }\n }\n }\n return false;\n }\n\n public void dfs2(int v)\n {\n s = new Stack();\n s.Push(v);\n int cur;\n bool all;\n while (s.Count != 0)\n {\n cur = s.Peek();\n all = true;\n for (int i = 0; i < g[cur].Count; i++)\n {\n if (d[g[cur][i]] == -1)\n {\n s.Push(g[cur][i]);\n d[g[cur][i]] = d[cur] + 1;\n all = false;\n }\n }\n if (all)\n s.Pop();\n }\n }\n\n public void DFS(int v)\n {\n s = new Stack();\n\n s.Push(v);\n int cur;\n bool all;\n while (s.Count != 0)\n {\n cur = s.Peek();\n u[cur] = false;\n all = true;\n for (int i = 0; i < g[cur].Count; i++)\n {\n if (u[g[cur][i]])\n {\n all = false;\n p[g[cur][i]] = cur;\n s.Push(g[cur][i]);\n }\n else\n {\n if (p[cur] != g[cur][i])\n {\n start = cur;\n finish = g[cur][i];\n return;\n }\n }\n }\n if (all)\n s.Pop();\n }\n }\n\n public void BFS(params int[] v)\n {\n q = new Queue();\n u = new List();\n d = new List();\n p = new List();\n\n for (int i = 0; i <= n; i++)\n {\n u.Add(true);\n d.Add(0);\n p.Add(0);\n }\n\n q.Enqueue(v[0]);\n u[v[0]] = false;\n int cur;\n\n while (q.Count != 0)\n {\n cur = q.Dequeue();\n for (int i = 0; i < g[cur].Count; i++)\n if (u[g[cur][i]])\n {\n q.Enqueue(g[cur][i]);\n u[g[cur][i]] = false;\n p[g[cur][i]] = cur;\n d[g[cur][i]] = d[cur] + 1;\n }\n }\n\n int from = v[1];\n string path = from + \"\";\n while (p[from] != 0)\n {\n path = p[from] + \" \" + path;\n from = p[from];\n }\n Console.WriteLine(d[v[1]] + \" : \" + path);\n }\n\n public void FordBellman(params int[] v)\n {\n d = new List();\n p = new List();\n for (int i = 0; i <= n; i++)\n {\n d.Add(int.MaxValue);\n p.Add(0);\n }\n d[v[0]] = 0;\n\n for (int i = 0; i < n - 1; i++)\n {\n for (int j = 0; j < e.Count; j++)\n {\n if (d[e[j].a] != int.MaxValue)\n {\n if (d[e[j].a] + e[j].w < d[e[j].b])\n {\n d[e[j].b] = d[e[j].a] + e[j].w;\n p[e[j].b] = e[j].a;\n }\n }\n }\n }\n\n int from = v[1];\n\n if (d[from] == int.MaxValue)\n {\n Console.WriteLine(\"Can't find the minimal path\");\n return;\n }\n\n string ans = from + \"\";\n while (p[from] != 0)\n {\n ans = p[from] + \" \" + ans;\n from = p[from];\n }\n\n Console.WriteLine(d[v[1]] + \" : \" + ans);\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 {\n mid = left + ((right - left) >> 1);\n if (val <= a[mid])\n {\n right = mid;\n }\n else\n {\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 {\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\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 {\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 {\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) 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 {\n if (i > q)\n {\n for (; k <= r; k++, j++)\n A[k] = R[j];\n return;\n }\n if (j > r)\n {\n for (; k <= r; k++, i++)\n A[k] = L[i];\n return;\n }\n if (L[i].CompareTo(R[j]) <= 0)\n {\n A[k] = L[i];\n i++;\n }\n else\n {\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) 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 static void Shake(T[] a)\n {\n Random rnd = new Random(Environment.TickCount);\n T temp;\n int b, c;\n for (int i = 0; i < a.Length; i++)\n {\n b = rnd.Next(0, a.Length);\n c = rnd.Next(0, a.Length);\n temp = a[b];\n a[b] = a[c];\n a[c] = temp;\n }\n }\n }\n}", "lang": "MS C#", "bug_code_uid": "6e13b4feeb1ab557c5f98fde2a16db41", "src_uid": "8f1211b995f35462ae83b2be27f54585", "apr_id": "0c3241fd6cbc5b8f2b9b315e25365093", "difficulty": 1700, "tags": ["math", "ternary search"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C#"} {"similarity_score": 0.6759425493716338, "equal_cnt": 1, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "public static int[] RemoveDuplicates(int size, int[] inputArr)\n {\n Dictionary dict = new Dictionary();\n HashSet hsh = new HashSet();\n List outputList = new List();\n for(int i=0;i 0; i -= 1)\n {\n if (mas[i] != mas[i - 1] )\n {\n mas1[w] = mas[i];\n w++;\n mas1[w] = mas[i - 1];\n }\n if (y == 1)\n mas1[0] = mas[i];\n }\n Console.WriteLine(y);\n for (int i = 0; i < y; i++)\n {\n Console.Write(mas1[i] + \" \");\n }\n\n }\n }\n}\n\n", "lang": "Mono C#", "bug_code_uid": "2ca5a82d1ca8eb27e891377b43a150c0", "src_uid": "1b9d3dfcc2353eac20b84c75c27fab5a", "apr_id": "60acfaa86c57617c0a344a6546198c56", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9925405879771829, "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;\nusing System.Text;\nusing System.Threading.Tasks;\nusing System.Threading;\nusing Threading;\n\n//namespace Practice\n//{\n public class Program\n {\n public static void Main()\n {\n A978();\n //Console.ReadKey();\n }\n\n public static void A978()\n {\n int n = int.Parse(Console.ReadLine());\n int[] a = new int[n];\n Boolean[] seen = new Boolean[1001];\n Stack stack = new Stack();\n\n String[] num = Console.ReadLine().Split();\n for(int i = n-1; i>=0 ; i--)\n {\n int x = int.Parse(num[i]);\n if(!seen[x])\n {\n stack.Push(x);\n seen[x] = true;\n }\n }\n\n StringBuilder output = new StringBuilder();\n output.Append(stack.Count + \"\\n\");\n\n while (stack.Count != 0)\n {\n output.Append(stack.Pop() + \" \");\n }\n\n Console.WriteLine(output.ToString());\n\n }\n }\n\n\n\n//}\n", "lang": "Mono C#", "bug_code_uid": "72b6a4983c22576424d9766493fdc5dd", "src_uid": "1b9d3dfcc2353eac20b84c75c27fab5a", "apr_id": "0769a1c3a8a33eb5ccc1d3a2411e20d8", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C#"} {"similarity_score": 0.9058247142079477, "equal_cnt": 10, "replace_cnt": 8, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 10, "bug_source_code": "using System;\nusing System.Linq;\n\nnamespace CodeForces862A\n{\n public static void Main(string[] args)\n {\n var firstLine = \"5 0\";\n var secondLine = \"1 2 3 4 5\";\n\n var splitFirstLine = firstLine.Split(' ');\n var splitSecondLine = secondLine.Split(' ');\n\n var n = splitFirstLine[0];\n var x = int.Parse(splitFirstLine[1]);\n\n var listOfNumbers = splitSecondLine.Select(i => int.Parse(i)).ToList();\n\n var numberOfChanges = 0;\n\n while (x > 0)\n {\n if (!listOfNumbers.Contains(x - 1))\n {\n listOfNumbers.Add(x - 1);\n numberOfChanges++;\n }\n x--;\n }\n\n if (listOfNumbers.Contains(x))\n {\n listOfNumbers.Remove(x);\n numberOfChanges++;\n }\n\n Console.WriteLine(numberOfChanges);\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "223a539b2d9cd3406e218caff304c794", "src_uid": "21f579ba807face432a7664091581cd8", "apr_id": "0b6146750f07f2dc24866619931b62f9", "difficulty": 1000, "tags": ["greedy", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.844776119402985, "equal_cnt": 3, "replace_cnt": 2, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 4, "bug_source_code": " var countAndEvil = Console.ReadLine();\n var mex = int.Parse(countAndEvil.Split(' ')[1]);\n\n var numbers = Console.ReadLine().\n Split(' ').\n Select(x => int.Parse(x)).\n ToList();\n\n int lessCount = 0;\n int shouldBeDelete = 0;\n numbers.ForEach(x =>\n {\n if (x < mex) lessCount++;\n if (x == mex) shouldBeDelete++;\n });\n\n var k = mex - lessCount + shouldBeDelete;\n\n Console.WriteLine(Math.Min(k, numbers.Count));", "lang": "Mono C#", "bug_code_uid": "4334bb62940e88dec6b22580f2be4906", "src_uid": "21f579ba807face432a7664091581cd8", "apr_id": "aeea4e6b8ff32ed0563ca1ce97443943", "difficulty": 1000, "tags": ["greedy", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.017083946980854196, "equal_cnt": 18, "replace_cnt": 14, "delete_cnt": 0, "insert_cnt": 4, "fix_ops_cnt": 18, "bug_source_code": "\n\n \n \n Debug\n AnyCPU\n {C845BAA9-539D-4B68-AE7F-F777A4F5311A}\n Exe\n D_CS\n D_CS\n v4.5.2\n 512\n true\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": "MS C#", "bug_code_uid": "1accc188fe55c69461bb2d1664e61566", "src_uid": "684ce84149d6a5f4776ecd1ea6cb455b", "apr_id": "7e2474924efbf9b32d9a0ad944f5e535", "difficulty": 1600, "tags": ["math", "number theory"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.549343339587242, "equal_cnt": 13, "replace_cnt": 8, "delete_cnt": 4, "insert_cnt": 1, "fix_ops_cnt": 13, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Collections;\nusing System.Linq;\nusing System.Numerics;\n\n\n\n\nnamespace contest\n{\n\n class contest\n {\n\n\n static void Main(string[] args)\n {\n\n\n //int n = int.Parse(Console.ReadLine());\n //var input = Console.ReadLine().Split().Select(int.Parse).ToArray();\n\n //var num = Console.ReadLine().Split().Select(int.Parse).ToArray();\n\n\n\n //int n = int.Parse(Console.ReadLine());\n //var num = Console.ReadLine().Split().Select(int.Parse).ToArray();\n\n\n\n long n = long.Parse(Console.ReadLine());\n\n long count = 0;\n\n while(n>1)\n {\n for(long i = n; i>1; i--)\n {\n if(IsPrime(i) && n-i!=1)\n {\n count++;\n n -= i;\n break;\n }\n\n if(i==2)\n {\n count += n / 2;\n n /= 2;\n }\n }\n }\n\n\n Console.WriteLine(count);\n\n\n\n //Console.WriteLine(ans.ToString(System.Globalization.CultureInfo.InvariantCulture));\n\n\n\n\n\n\n\n }\n\n public static bool IsPrime(long a)\n {\n for(long i = a-1; i>1; i--)\n {\n if (a % i == 0) return false;\n }\n\n return true;\n }\n \n\n }\n\n \n \n}\n", "lang": "MS C#", "bug_code_uid": "45181da853988f6c7dbe7c495dfbfbf4", "src_uid": "684ce84149d6a5f4776ecd1ea6cb455b", "apr_id": "bdb7a79474299fe7cfe59afcc498b3d1", "difficulty": 1600, "tags": ["math", "number theory"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.26260641781270466, "equal_cnt": 18, "replace_cnt": 15, "delete_cnt": 2, "insert_cnt": 1, "fix_ops_cnt": 18, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Collections;\nusing System.Linq;\n\n\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\t\t \n\t\t\t var num = Console.ReadLine().Split(' ').Select(int.Parse).ToArray();\n \n\n Array.Sort(num);\n int mxTable = num.Min();\n\n var cp = new List(num);\n int min = num.Min();\n for (int i =0; i<3; i++)\n {\n cp[i] -= min;\n }\n\n \n while(cp[1]>=1 && cp[2]>=2)\n {\n if (cp[1] >= 1 && cp[2] >= 2)\n {\n mxTable++;\n cp[1] -= 1;\n cp[2] -= 2;\n }\n\n \n }\n\n cp = num.ToList();\n\n if (cp[0]>0 || cp[1]>0)\n {\n int tmp = 0;\n \n\n\n while (cp[0] >= 1 && cp[2] >= 2)\n {\n \n tmp++;\n cp[0] -= 1;\n cp[2] -= 2;\n \n\n \n cp.Sort();\n \n }\n\n while (cp[1] >= 1 && cp[2] >= 2)\n {\n\n tmp++;\n cp[1] -= 1;\n cp[2] -= 2;\n\n\n\n cp.Sort();\n\n }\n\n\n mxTable = Math.Max(mxTable,tmp);\n }\n\n\n\n Console.WriteLine(mxTable);\n\n\n\n\n\t\t\n }\n\t\t\n\t\t\n\t\t\t\n\t}\n", "lang": "MS C#", "bug_code_uid": "d389b2f2558cd33adcd54bcbc9c60e2a", "src_uid": "bae7cbcde19114451b8712d6361d2b01", "apr_id": "785474eec35fb1ec742f5088058aba13", "difficulty": 1800, "tags": ["greedy"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9112382358368702, "equal_cnt": 65, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 63, "fix_ops_cnt": 65, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace Task2\n{\n class Program\n {\n static void Main(string[] args)\n {\n //вводим n k и d\n string input = Console.ReadLine();\n string[] inputArr = input.Split();\n\n int n = Convert.ToInt32(inputArr[0]);\n int k = Convert.ToInt32(inputArr[1]);\n int d = Convert.ToInt32(inputArr[2]);\n\n\n int[] days = new int[n];\n\n //заполняем массив дней показа\n string inputDays = Console.ReadLine();\n string[] inputArrDays = inputDays.Split();\n for (int i = 0; i < days.Length; i++)\n {\n days[i] = Convert.ToInt32(inputArrDays[i]);\n }\n\n //массив \"разных\" сериалов\n int[] differentSerials = new int[k];\n for (int i = 0; i < differentSerials.Length; i++)\n {\n differentSerials[i] = 0;\n }\n\n //массив для \"блоков\" дней\n int[] arrForDaysBlock = new int[n - d + 1];\n for (int x = 0; x < arrForDaysBlock.Length; x++)\n {\n //проверяем, что в i день идет j сериал\n //если да, то в массив сериалов суем ++\n for (int i = x; i < x + d; i++)\n {\n for (int j = 1; j < differentSerials.Length + 1; j++)\n {\n if (days[i] == j)\n {\n differentSerials[j - 1]++;\n }\n }\n }\n //подсчитываем сколько РАЗЛИЧНЫХ сериалов прошло в d дней\n //и записываем это в массив блоков дней\n int summ = 0;\n for (int i = 0; i < differentSerials.Length; i++)\n {\n if (differentSerials[i] != 0)\n {\n summ++;\n }\n }\n arrForDaysBlock[x] = summ;\n for (int i = 0; i < differentSerials.Length; i++)\n {\n differentSerials[i] = 0;\n }\n }\n\n int min = arrForDaysBlock[0];\n for (int i = 0; i < arrForDaysBlock.Length; i++)\n {\n if (arrForDaysBlock[i] < min)\n {\n min = arrForDaysBlock[i];\n }\n }\n\n \n Console.WriteLine(min);\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "29a1978605e112926eecb1b6198598fe", "src_uid": "56da4ec7cd849c4330d188d8c9bd6094", "apr_id": "6cd94bbcc7892fdd759674718c1c8c64", "difficulty": 1000, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.9994810586403736, "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 Olympiads\n{\n class Program\n {\n static void Main(string[] args)\n {\n int t = Convert.ToInt32(Console.ReadLine());\n int[] ret = new int[t];\n for (int i = 0; i < t; i++)\n {\n string t2 = Console.ReadLine();\n string[] temp1 = t2.Split(' ');\n int n = Convert.ToInt32(temp1[0]), k = Convert.ToInt32(temp1[1]), d = Convert.ToInt32(temp1[1]);\n string inp = Console.ReadLine();\n string[] temp2 = inp.Split(' ');\n int[] srav = new int[d];\n int y = 0,z = 0;\n for (int j = 0; j < d; j++)\n {\n srav[j] = Convert.ToInt32(temp2[j]);\n }\n y = Test(srav, k);\n for (int j = d; j < n; j++)\n {\n if (z > d-1)\n {\n z = 0;\n }\n srav[z] = Convert.ToInt32(temp2[j]);\n z++;\n if (y > Test(srav,k))\n {\n y = Test(srav, k);\n }\n }\n ret[i] = y;\n }\n for (int i = 0; i < t; i++)\n {\n Console.WriteLine(ret[i]);\n }\n \n }\n static int Test(int[] testing, int k)\n {\n int ret = 0;\n int[] a = new int[k];\n for (int i = 0; i < testing.Length; i++)\n {\n a[testing[i]-1]++;\n }\n for (int i = 0; i < a.Length; i++)\n {\n if (a[i]>0)\n {\n ret++;\n }\n }\n return ret;\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "a75d04f12fe49c84d355e7adc9c5871b", "src_uid": "56da4ec7cd849c4330d188d8c9bd6094", "apr_id": "1c49b5c715133047ffcfdd6089d88626", "difficulty": 1000, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.20011370096645822, "equal_cnt": 6, "replace_cnt": 4, "delete_cnt": 2, "insert_cnt": 0, "fix_ops_cnt": 6, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Drawing;\nusing System.IO;\nusing System.Linq;\nusing System.Numerics;\nusing System.Reflection;\nusing System.Text;\nusing System.Text.RegularExpressions;\nusing System.Windows;\n\nnamespace ConsoleApplicationCSharp {\n\tclass Program {\n\t\tstatic void Main(string[] args) {\n\t\t\tstring filepath = @\"C:\\Users\\Administrator\\Documents\\Visual Studio 2012\\Projects\\AAL4\\AAL4\\Resources\\list.txt\";\n\t\t\tstring[] split = null;\n\n\t\t\tusing (StreamReader sr = new StreamReader(filepath)) {\n\t\t\t\tsplit = sr.ReadToEnd().Split(new string[] { Environment.NewLine }, StringSplitOptions.RemoveEmptyEntries);\n\t\t\t}\n\n\t\t\tstring[] split2, name, actor;\n\n\t\t\tforeach (string str in split) {\n\t\t\t\tsplit2 = str.Split(',');\n\n\t\t\t\tname = split2[1].Split(' ');\n\t\t\t\tactor = split2[2].Split(' ');\n\n\t\t\t\tif (name[name.Length - 1] == actor[actor.Length - 1]) {\n\t\t\t\t\tConsole.WriteLine(\"{0}, {1} : {2}\", split2[2], split2[1], split2[0]);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n", "lang": "MS C#", "bug_code_uid": "aff8e33613f531255dd749cf80f8f474", "src_uid": "d5de5052b4e9bbdb5359ac6e05a18b61", "apr_id": "f2a469908c4c49b88f12448c53cee7fe", "difficulty": 1200, "tags": ["greedy", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.6187845303867403, "equal_cnt": 18, "replace_cnt": 3, "delete_cnt": 13, "insert_cnt": 2, "fix_ops_cnt": 18, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace codeforce11\n{\n class Program\n {\n\n static string Decrypt(string str, int t)\n {\n \n int[] arr = new int[t];\n int counter = 0;\n for (int i = 2; i <= t; i++)\n {\n if (t % i == 0)\n {\n arr[counter++] = i;\n\n }\n }\n string a = \"\";\n int count = counter;\n counter = 0;\n\n while (count > 0)\n {\n a = str.Substring(0, arr[counter++]);\n char[] array = a.ToCharArray();\n Array.Reverse(array);\n string st = \"\";\n for (int i = 0; i < array.Length; i++)\n {\n\n st += array[i];\n }\n\n \n str = str.Replace(a, st);\n count--;\n }\n\n return str;\n \n }\n static void Main(string[] args)\n {\n int t = int.Parse(Console.ReadLine());\n string str = Console.ReadLine();\n Console.WriteLine(Decrypt(str, t));\n Console.ReadLine();\n }\n }\n}\n", "lang": ".NET Core C#", "bug_code_uid": "34b5f49596e5f05f40dc2829e98f4f27", "src_uid": "1b0b2ee44c63cb0634cb63f2ad65cdd3", "apr_id": "25703ea7dcbf22361f21ef926c5d3952", "difficulty": 900, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "C#"} {"similarity_score": 0.9154334038054969, "equal_cnt": 5, "replace_cnt": 0, "delete_cnt": 4, "insert_cnt": 0, "fix_ops_cnt": 4, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace codeforce11\n{\n class Program\n {\n\n static string Decrypt(string str, int t)\n {\n\n int[] arr = new int[t];\n int counter = 0;\n for (int i = 2; i <= t; i++)\n {\n if (t % i == 0 )\n {\n arr[counter++] = i;\n\n }\n }\n for (int i = 0; i < arr.Length; i++)\n {\n Console.WriteLine(arr[i]);\n }\n string a = \"\";\n int count = counter;\n counter = 0;\n\n while (count != 0)\n {\n \n a = str.Substring(0, arr[counter]);\n //Console.WriteLine(a);\n\n string st = a.Reverse().Aggregate(string.Empty, (acc, ch) => acc + ch);\n //Console.WriteLine(st);\n var aStringBuilder = new StringBuilder(str);\n aStringBuilder.Remove(0, arr[counter]);\n aStringBuilder.Insert(0, st);\n str = aStringBuilder.ToString();\n //Console.WriteLine(str);\n count--;\n counter++;\n } ;\n return str;\n }\n static void Main(string[] args)\n {\n int t = int.Parse(Console.ReadLine());\n string str = Console.ReadLine();\n Console.WriteLine(Decrypt(str, t));\n \n }\n }\n}\n", "lang": ".NET Core C#", "bug_code_uid": "e123bf1cbc4bc97debe52fd68fa5f434", "src_uid": "1b0b2ee44c63cb0634cb63f2ad65cdd3", "apr_id": "01ffa3e50e977f0ff0fa706ac470c041", "difficulty": 900, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "C#"} {"similarity_score": 0.8669150016931934, "equal_cnt": 27, "replace_cnt": 5, "delete_cnt": 6, "insert_cnt": 16, "fix_ops_cnt": 27, "bug_source_code": "using System;\n\nnamespace std\n{\n class Program\n {\n static void Main()\n {\n int NumberCount = 0,NumberInt = 0;\n NumberCount = int.Parse(Console.ReadLine());\n NumberInt = int.Parse(Console.ReadLine());\n string NumberString = NumberInt.ToString();\n int[] Array;\n Array = new int[NumberCount];\n Boolean S1 = true,S2 = true;\n int i;\n for(i = 0;i ms)\n {\n return ms.Aggregate(\"\", (current, s) => current + (s + \",\"));\n }\n\n public static decimal ConvertMinuteToMunite(int minute, int second = 0)\n {\n return minute + (decimal)second / 6 / 10;\n }\n public static decimal ConvertHourToMunite(int hour, int minute = 0, int second = 0)\n {\n //12.00-12.11 = 0\n //12.12-12.23 = 1\n //12.24-12.35 = 2\n //12.36-12.47 = 3\n //12.48-12.59 = 4\n\n int hInM = 5 * hour;\n if (hInM == 60) hInM = 0;\n return hInM + ((decimal) ConvertMinuteToMunite(minute, second) / 12) + ((decimal) second / 6 / 10);\n //return hInM;\n }\n }\n class Program\n {\n static void Main(string[] args)\n {\n\n#if __debug\n var str = \"6 59 59 11 12\";\n#else\n var str = Console.ReadLine();\n#endif\n\n var h = Convert.ToInt32(str.Split(' ')[0]);\n var m = Convert.ToInt32(str.Split(' ')[1]);\n var s = Convert.ToInt32(str.Split(' ')[2]);\n\n var t1 = Convert.ToInt32(str.Split(' ')[3]);\n var t2 = Convert.ToInt32(str.Split(' ')[4]);\n\n Console.WriteLine(Check(TestExtensions.ConvertHourToMunite(h, m, s), TestExtensions.ConvertMinuteToMunite(m,s), s, TestExtensions.ConvertHourToMunite(t1), TestExtensions.ConvertHourToMunite(t2)));\n }\n\n static string Check(decimal hm, decimal mm, decimal sm, decimal t1, decimal t2)\n {\n#if __debug\n Console.WriteLine($\"hm={hm} mm={mm} sm={sm} t1={t1} t2={t2}\");\n#else\n \n#endif\n //теперь у меня есть шкала 0-60 двунаправленная\n \n //надо глянуть преграды в 2 стороны между т1 и т2\n\n //пойдем всегда от меньшего к большему, так проще\n var tmin = t1 > t2 ? t2 : t1;\n var tmax = t1 > t2 ? t1 : t2;\n\n //пробуем пойти вперед от tmin до tmax ища пустой промежуток\n //if ((tmin >= hm || tmax <= hm) && (tmin >= mm || tmax <= mm) && (tmin >= sm || tmax <= sm))\n if ((tmin > hm || tmax < hm) && (tmin > mm || tmax < mm) && (tmin > sm || tmax < sm))\n {\n#if __debug\n Console.WriteLine($\"Нет преград по возрастанию\");\n#endif\n return \"YES\";\n }\n //пробуем пойти назад от tmin до 0 и вперед от tmax до 60 ища пустой промежуток\n //if (tmin == 0 || (tmin <= hm && tmin <= mm && tmin <=sm))\n if (tmin == 0 || (tmin < hm && tmin < mm && tmin < sm))\n {\n#if __debug\n Console.WriteLine($\"Нет преград по убыванию до 0 для tmin\");\n#endif\n //if (tmax == 60 || (tmax >= hm && tmax >= mm && tmax >= sm))\n if (tmax == 60 || (tmax > hm && tmax > mm && tmax > sm))\n {\n#if __debug\n Console.WriteLine($\"Нет преград по возрастанию до 60 для tmax\");\n#endif\n return \"YES\";\n }\n }\n\n\n\n if ((tmin >= hm || tmax <= hm) && (tmin >= mm || tmax <= mm) && (tmin >= sm || tmax <= sm))\n {\n#if __debug\n Console.WriteLine($\"Нет преград по возрастанию\");\n#endif\n return \"YES\";\n }\n\n return \"NO\";\n }\n }\n}", "lang": "MS C#", "bug_code_uid": "9aec33c75536187c5f9a4e267b59a8bd", "src_uid": "912c8f557a976bdedda728ba9f916c95", "apr_id": "6bca18361d11df44979201bd74ca77c7", "difficulty": 1400, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9999387367518225, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "using System;\nusing System.Collections;\nusing System.Collections.Generic;\nusing System.Diagnostics;\nusing System.Globalization;\nusing System.IO;\nusing System.Text;\nusing System.Linq;\n\nusing E = System.Linq.Enumerable;\nusing System.Threading;\n\ninternal partial class Solver {\n\n public static bool UpdateMin(ref T x, T newValue) where T : IComparable {\n if (x.CompareTo(newValue) > 0) { x = newValue; return true; }\n return false;\n }\n public static bool UpdateMax(ref T x, T newValue) where T : IComparable {\n if (x.CompareTo(newValue) < 0) { x = newValue; return true; }\n return false;\n }\n\n public void Run() {\n var n = ni();\n var k = ni();\n var s = ns();\n var t = ns();\n long ans = 0;\n if (t[0] == t[1]) {\n long count = s.Count(c => c == t[0]);\n count += k;\n if (count > s.Length) count = s.Length;\n ans = count * (count - 1) / 2;\n } else {\n var c1 = t[0];\n var c2 = t[1];\n var memo = new long?[s.Length, k + 1, n + 1]; // (changeNum, occurrence of c1)\n\n Func dfs = null;\n\n dfs = (int pos, int changeNum, int c1Num) => {\n if (pos == s.Length) return 0;\n ref var ret = ref memo[pos, changeNum, c1Num];\n if (!ret.HasValue) {\n long val = 0;\n var c = s[pos];\n if (c == c1) {\n val = Math.Max(val, dfs(pos + 1, changeNum, c1Num + 1));\n } else {\n val = Math.Max(val, dfs(pos + 1, changeNum, c1Num));\n if (changeNum < k) {\n val = Math.Max(val, dfs(pos + 1, changeNum + 1, c1Num + 1));\n }\n }\n if (c == c2) {\n val = Math.Max(val, dfs(pos + 1, changeNum, c1Num) + c1Num);\n } else {\n if (changeNum < k) {\n val = Math.Max(val, dfs(pos + 1, changeNum + 1, c1Num) + c1Num);\n }\n }\n ret = val;\n }\n return ret.Value;\n }\n ans = dfs(0, 0, 0);\n }\n cout.WriteLine(ans);\n }\n\n public static void Fill(T[,] array, T value) {\n int height = array.GetLength(0);\n int width = array.GetLength(1);\n for (int i = 0; i < height; i++) {\n for (int j = 0; j < width; j++) {\n array[i, j] = value;\n }\n }\n }\n\n}\n\n// PREWRITEN CODE BEGINS FROM HERE\n\nstatic public class StringExtensions {\n static public string JoinToString(this IEnumerable source, string separator = \" \") {\n return string.Join(separator, source);\n }\n}\n\ninternal partial class Solver : Scanner {\n static readonly int? StackSizeInMebiByte = null; //50;\n public static void StartAndJoin(Action action, int maxStackSize) {\n var thread = new Thread(new ThreadStart(action), maxStackSize);\n thread.Start();\n thread.Join();\n }\n\n public static void Main() {\n#if LOCAL\n byte[] inputBuffer = new byte[1000000];\n var inputStream = Console.OpenStandardInput(inputBuffer.Length);\n using (var reader = new StreamReader(inputStream, Console.InputEncoding, false, inputBuffer.Length)) {\n Console.SetIn(reader);\n new Solver(Console.In, Console.Out).Run();\n }\n#else\n Console.SetOut(new StreamWriter(Console.OpenStandardOutput()) { AutoFlush = false });\n if (StackSizeInMebiByte.HasValue) {\n StartAndJoin(() => new Solver(Console.In, Console.Out).Run(), StackSizeInMebiByte.Value * 1024 * 1024);\n } else {\n new Solver(Console.In, Console.Out).Run();\n }\n Console.Out.Flush();\n#endif\n }\n\n#pragma warning disable IDE0052\n private readonly TextReader cin;\n private readonly TextWriter cout;\n private readonly TextWriter cerr;\n#pragma warning restore IDE0052\n\n public Solver(TextReader reader, TextWriter writer)\n : base(reader) {\n cin = reader;\n cout = writer;\n cerr = Console.Error;\n }\n\n public Solver(string input, TextWriter writer)\n : this(new StringReader(input), writer) {\n }\n\n#pragma warning disable IDE1006\n#pragma warning disable IDE0051\n private int ni() { return NextInt(); }\n private int[] ni(int n) { return NextIntArray(n); }\n private long nl() { return NextLong(); }\n private long[] nl(int n) { return NextLongArray(n); }\n private double nd() { return NextDouble(); }\n private double[] nd(int n) { return NextDoubleArray(n); }\n private string ns() { return Next(); }\n private string[] ns(int n) { return NextArray(n); }\n#pragma warning restore IDE1006\n#pragma warning restore IDE0051\n}\n\n#if DEBUG\ninternal static class LinqPadExtension {\n public static string TextDump(this T obj) {\n if (obj is IEnumerable) return (obj as IEnumerable).Cast().JoinToString().Dump();\n else return obj.ToString().Dump();\n }\n public static T Dump(this T obj) {\n return LINQPad.Extensions.Dump(obj);\n }\n}\n#endif\n\npublic class Scanner {\n private readonly TextReader Reader;\n private readonly CultureInfo ci = CultureInfo.InvariantCulture;\n\n private readonly char[] buffer = new char[2 * 1024];\n private int cursor = 0, length = 0;\n private string Token;\n private readonly StringBuilder sb = new StringBuilder(1024);\n\n public Scanner()\n : this(Console.In) {\n }\n\n public Scanner(TextReader reader) {\n Reader = reader;\n }\n\n public int NextInt() { return checked((int)NextLong()); }\n public long NextLong() {\n var s = Next();\n long r = 0;\n int i = 0;\n bool negative = false;\n if (s[i] == '-') {\n negative = true;\n i++;\n }\n for (; i < s.Length; i++) {\n r = r * 10 + (s[i] - '0');\n#if DEBUG\n if (!char.IsDigit(s[i])) throw new FormatException();\n#endif\n }\n return negative ? -r : r;\n }\n public double NextDouble() { return double.Parse(Next(), ci); }\n public string[] NextArray(int size) {\n string[] array = new string[size];\n for (int i = 0; i < size; i++) {\n array[i] = Next();\n }\n\n return array;\n }\n public int[] NextIntArray(int size) {\n int[] array = new int[size];\n for (int i = 0; i < size; i++) {\n array[i] = NextInt();\n }\n\n return array;\n }\n\n public long[] NextLongArray(int size) {\n long[] array = new long[size];\n for (int i = 0; i < size; i++) {\n array[i] = NextLong();\n }\n\n return array;\n }\n\n public double[] NextDoubleArray(int size) {\n double[] array = new double[size];\n for (int i = 0; i < size; i++) {\n array[i] = NextDouble();\n }\n\n return array;\n }\n\n public string Next() {\n if (Token == null) {\n if (!StockToken()) {\n throw new Exception();\n }\n }\n var token = Token;\n Token = null;\n return token;\n }\n\n public bool HasNext() {\n if (Token != null) {\n return true;\n }\n\n return StockToken();\n }\n\n private bool StockToken() {\n while (true) {\n sb.Clear();\n while (true) {\n if (cursor >= length) {\n cursor = 0;\n if ((length = Reader.Read(buffer, 0, buffer.Length)) <= 0) {\n break;\n }\n }\n var c = buffer[cursor++];\n if (33 <= c && c <= 126) {\n sb.Append(c);\n } else {\n if (sb.Length > 0) break;\n }\n }\n\n if (sb.Length > 0) {\n Token = sb.ToString();\n return true;\n }\n\n return false;\n }\n }\n}", "lang": "Mono C#", "bug_code_uid": "dde5e2d3ba7feed9ba0a143a57b148a3", "src_uid": "9c700390ac13942cbde7c3428965b18a", "apr_id": "ac1acecf9d25e60856d7d1f8d75cfd08", "difficulty": 2100, "tags": ["dp", "strings"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.9733806066745455, "equal_cnt": 28, "replace_cnt": 10, "delete_cnt": 17, "insert_cnt": 0, "fix_ops_cnt": 27, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\nusing static System.Math;\nusing System.Text;\nusing System.Threading;\nusing System.Globalization;\nusing System.Runtime.CompilerServices;\nusing Library;\n\nnamespace Program\n{\n public static class ProblemF\n {\n static bool SAIKI = false;\n static public int numberOfRandomCases = 0;\n static public void MakeTestCase(List _input, List _output, ref Func _outputChecker)\n {\n }\n static public void Solve()\n {\n var n = NN;\n var k = NN;\n var s = NS;\n var t = NS;\n var dp = new long[n + 1, n + 1, k + 1];\n for (var i = 0; i <= n; i++)\n {\n for (var j = 0; j <= n; j++)\n {\n for (var x = 0; x <= k; x++)\n {\n dp[i, j, x] = long.MinValue;\n }\n }\n }\n dp[0, 0, 0] = 0;\n var ans = 0L;\n for (var i = 0; i < n; i++)\n {\n for (var j = 0; j <= n; j++)\n {\n for (var x = 0; x <= k; x++)\n {\n if (s[i] == t[0])\n {\n if (j < n) dp[i + 1, j + 1, x] = Max(dp[i + 1, j + 1, x], dp[i, j, x]);\n if (x < k) dp[i + 1, j, x + 1] = Max(dp[i + 1, j, x + 1], dp[i, j, x] + j);\n }\n if (s[i] == t[1])\n {\n dp[i + 1, j, x] = Max(dp[i + 1, j, x], dp[i, j, x] + j);\n if (x < k && j < n) dp[i + 1, j + 1, x + 1] = Max(dp[i + 1, j + 1, x + 1], dp[i, j, x]);\n }\n if (s[i] == t[0] && s[i] == t[1])\n {\n if (j < n) dp[i + 1, j + 1, x] = Max(dp[i + 1, j + 1, x], dp[i, j, x] + j);\n }\n if (t[0] == t[1])\n {\n if (x < k && j < n) dp[i + 1, j + 1, x + 1] = Max(dp[i + 1, j + 1, x + 1], dp[i, j, x] + j);\n }\n {\n if (x < k) dp[i + 1, j, x + 1] = Max(dp[i + 1, j, x + 1], dp[i, j, x] + j);\n if (x < k && j < n) dp[i + 1, j + 1, x + 1] = Max(dp[i + 1, j + 1, x + 1], dp[i, j, x]);\n dp[i + 1, j, k] = Max(dp[i + 1, j, k], dp[i, j, k]);\n }\n }\n }\n }\n for (var i = 0; i <= n; i++)\n {\n for (var j = 0; j <= n; j++)\n {\n for (var x = 0; x <= k; x++)\n {\n ans = Max(ans, dp[i, j, x]);\n }\n }\n }\n Console.WriteLine(ans);\n }\n class Printer : StreamWriter\n {\n public override IFormatProvider FormatProvider { get { return CultureInfo.InvariantCulture; } }\n public Printer(Stream stream) : base(stream, new UTF8Encoding(false, true)) { base.AutoFlush = false; }\n public Printer(Stream stream, Encoding encoding) : base(stream, encoding) { base.AutoFlush = false; }\n }\n static LIB_FastIO fastio = new LIB_FastIODebug();\n static public void Main(string[] args) { if (args.Length == 0) { fastio = new LIB_FastIO(); Console.SetOut(new Printer(Console.OpenStandardOutput())); } if (SAIKI) { var t = new Thread(Solve, 134217728); t.Start(); t.Join(); } else Solve(); Console.Out.Flush(); }\n static long NN => fastio.Long();\n static double ND => fastio.Double();\n static string NS => fastio.Scan();\n static long[] NNList(long N) => Repeat(0, N).Select(_ => NN).ToArray();\n static double[] NDList(long N) => Repeat(0, N).Select(_ => ND).ToArray();\n static string[] NSList(long N) => Repeat(0, N).Select(_ => NS).ToArray();\n static long Count(this IEnumerable x, Func pred) => Enumerable.Count(x, pred);\n static IEnumerable Repeat(T v, long n) => Enumerable.Repeat(v, (int)n);\n static IEnumerable Range(long s, long c) => Enumerable.Range((int)s, (int)c);\n static IOrderedEnumerable OrderByRand(this IEnumerable x) => Enumerable.OrderBy(x, _ => xorshift);\n static IOrderedEnumerable OrderBy(this IEnumerable x) => Enumerable.OrderBy(x.OrderByRand(), e => e);\n static IOrderedEnumerable OrderBy(this IEnumerable x, Func selector) => Enumerable.OrderBy(x.OrderByRand(), selector);\n static IOrderedEnumerable OrderByDescending(this IEnumerable x) => Enumerable.OrderByDescending(x.OrderByRand(), e => e);\n static IOrderedEnumerable OrderByDescending(this IEnumerable x, Func selector) => Enumerable.OrderByDescending(x.OrderByRand(), selector);\n static IOrderedEnumerable OrderBy(this IEnumerable x) => x.OrderByRand().OrderBy(e => e, StringComparer.OrdinalIgnoreCase);\n static IOrderedEnumerable OrderBy(this IEnumerable x, Func selector) => x.OrderByRand().OrderBy(selector, StringComparer.OrdinalIgnoreCase);\n static IOrderedEnumerable OrderByDescending(this IEnumerable x) => x.OrderByRand().OrderByDescending(e => e, StringComparer.OrdinalIgnoreCase);\n static IOrderedEnumerable OrderByDescending(this IEnumerable x, Func selector) => x.OrderByRand().OrderByDescending(selector, StringComparer.OrdinalIgnoreCase);\n static string Join(this IEnumerable x, string separator = \"\") => string.Join(separator, x);\n static uint xorshift { get { _xsi.MoveNext(); return _xsi.Current; } }\n static IEnumerator _xsi = _xsc();\n static IEnumerator _xsc() { uint x = 123456789, y = 362436069, z = 521288629, w = (uint)(DateTime.Now.Ticks & 0xffffffff); while (true) { var t = x ^ (x << 11); x = y; y = z; z = w; w = (w ^ (w >> 19)) ^ (t ^ (t >> 8)); yield return w; } }\n }\n}\nnamespace Library {\n class LIB_FastIO\n {\n [MethodImpl(MethodImplOptions.AggressiveInlining)]\n public LIB_FastIO() { str = Console.OpenStandardInput(); }\n readonly Stream str;\n readonly byte[] buf = new byte[1024];\n int len, ptr;\n public bool isEof = false;\n public bool IsEndOfStream\n {\n [MethodImpl(MethodImplOptions.AggressiveInlining)]\n get { return isEof; }\n }\n [MethodImpl(MethodImplOptions.AggressiveInlining)]\n byte read()\n {\n if (isEof) throw new EndOfStreamException();\n if (ptr >= len)\n {\n ptr = 0;\n if ((len = str.Read(buf, 0, 1024)) <= 0)\n {\n isEof = true;\n return 0;\n }\n }\n return buf[ptr++];\n }\n [MethodImpl(MethodImplOptions.AggressiveInlining)]\n char Char()\n {\n byte b = 0;\n do b = read();\n while (b < 33 || 126 < b);\n return (char)b;\n }\n [MethodImpl(MethodImplOptions.AggressiveInlining)]\n virtual public string Scan()\n {\n var sb = new StringBuilder();\n for (var b = Char(); b >= 33 && b <= 126; b = (char)read())\n sb.Append(b);\n return sb.ToString();\n }\n [MethodImpl(MethodImplOptions.AggressiveInlining)]\n virtual public long Long()\n {\n long ret = 0; byte b = 0; var ng = false;\n do b = read();\n while (b != '-' && (b < '0' || '9' < b));\n if (b == '-') { ng = true; b = read(); }\n for (; true; b = read())\n {\n if (b < '0' || '9' < b)\n return ng ? -ret : ret;\n else ret = ret * 10 + b - '0';\n }\n }\n [MethodImpl(MethodImplOptions.AggressiveInlining)]\n virtual public double Double() { return double.Parse(Scan(), CultureInfo.InvariantCulture); }\n }\n class LIB_FastIODebug : LIB_FastIO\n {\n Queue param = new Queue();\n [MethodImpl(MethodImplOptions.AggressiveInlining)]\n string NextString() { if (param.Count == 0) foreach (var item in Console.ReadLine().Split(' ')) param.Enqueue(item); return param.Dequeue(); }\n [MethodImpl(MethodImplOptions.AggressiveInlining)]\n public LIB_FastIODebug() { }\n [MethodImpl(MethodImplOptions.AggressiveInlining)]\n public override string Scan() => NextString();\n [MethodImpl(MethodImplOptions.AggressiveInlining)]\n public override long Long() => long.Parse(NextString());\n [MethodImpl(MethodImplOptions.AggressiveInlining)]\n public override double Double() => double.Parse(NextString());\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "dcb1dca7e7a488d9996bbacf5bcc5919", "src_uid": "9c700390ac13942cbde7c3428965b18a", "apr_id": "acca551126d7c759973f017d1473862c", "difficulty": 2100, "tags": ["dp", "strings"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "C#"} {"similarity_score": 0.1958174904942966, "equal_cnt": 32, "replace_cnt": 20, "delete_cnt": 11, "insert_cnt": 2, "fix_ops_cnt": 33, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\n\nnamespace ContestA\n{\n class Program\n {\n static void Main(string[] args)\n {\n string[] pass1 = Console.ReadLine().Split(' ');\n string[] pass2 = Console.ReadLine().Split(' ');\n string[] pass3 = Console.ReadLine().Split(' ');\n string[] pass4 = Console.ReadLine().Split(' ');\n\n int a1 = Convert.ToInt32(pass1[0]);\n int b1 = Convert.ToInt32(pass1[1]);\n int a2 = Convert.ToInt32(pass2[0]);\n int b2 = Convert.ToInt32(pass2[1]);\n int a3 = Convert.ToInt32(pass3[0]);\n int b3 = Convert.ToInt32(pass3[1]);\n int a4 = Convert.ToInt32(pass4[0]);\n int b4 = Convert.ToInt32(pass4[1]);\n\n // АСАБЫЙ СЛУЧАЙ - ОДИНАКОВО ИГРОКИ\n bool svinka = false;\n if (a1 == a3 || a2 == a4 || b1 == b3 || b2 == b4)\n svinka = true;\n\n // ВИГРЫШ ВТОРОГА\n if ((a3 > a1 && b4 > b2) || (a4 > a1 && b3 > b2))\n if ((a3 > a2 && b4 > b1) || (a4 > a2 && b3 > b1))\n {\n Console.WriteLine(\"Team 2\");\n\n return;\n }\n\n // ВИГРЫШ ПЕРВАГО\n if ((a1 > a3 && b2 > b4) || (a2 > a3 && b1 > b4))\n if ((a1 > a4 && b2 > b3) || (a2 > a4 && b1 > b3))\n {\n if (!svinka)\n Console.WriteLine(\"Team 1\");\n else\n Console.WriteLine(\"Draw\");\n \n return;\n }\n\n Console.WriteLine(\"Draw\");\n\n return;\n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "e778613881788d4524289f80e717a8cf", "src_uid": "1a70ed6f58028a7c7a86e73c28ff245f", "apr_id": "9ce3f0c39fe0b97eeed02ccda1559014", "difficulty": 1700, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9847058823529412, "equal_cnt": 6, "replace_cnt": 4, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 5, "bug_source_code": "// Submitted by Silithus @ Macau\nusing System;\nusing System.IO;\nusing System.Collections.Generic;\nusing CCF_XOI;\n\nnamespace RCC2014\n{\n\tclass QR_C\n\t{\n\t\tprivate int beat(int a_atk, int a_def, int b_atk, int b_def)\n\t\t{\n\t\t\tif (a_atk > b_atk && a_def > b_def) return 1;\n\t\t\tif (b_atk > a_atk && b_def > a_def) return -1;\n\t\t\treturn 0;\n\t\t}\n\n\t\tpublic void Solve(XOI xoi)\n\t\t{\n\t\t\tint i, j, res, ans;\n\t\t\tint[,] team;\n\t\t\tstring[] ans_words = { \"Team 2\", \"Draw\", \"Team 1\" };\n\n\t\t\tteam = new int[4, 2];\n\t\t\tfor (i = 0; i < 4; i++)\n\t\t\t\tfor (j = 0; j < 2; j++)\n\t\t\t\t\tteam[i, j] = xoi.ReadInt();\n\n\t\t\tfor (i = 0, ans = -1999; i <= 1; i++)\n\t\t\t{\n\t\t\t\tfor (j = 2, res = 1999; j <= 3; j++)\n\t\t\t\t\tres = Math.Min(res, beat(team[i, 1], team[1 - i, 0], team[j, 1], team[5 - j, 0]));\n\t\t\t\tans = Math.Max(ans, res);\n\t\t\t}\n\n\t\t\txoi.o.WriteLine(ans_words[ans + 1]);\n\t\t}\n\t}\n\t\n\tclass RCC2014_QR\n\t{\n\t\tstatic void Main(string[] args)\n\t\t{\n\t\t\tXOI xoi = new XOI();\n\t\t\t(new QR_C()).Solve(xoi);\n\t\t}\n\t}\n}\n\nnamespace CCF_XOI\n{\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\t\t\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": "24df85ab3542499a926dbdab8eb9e43f", "src_uid": "1a70ed6f58028a7c7a86e73c28ff245f", "apr_id": "068e458d6ea0839e137bb9bc46af022f", "difficulty": 1700, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.8405466970387244, "equal_cnt": 12, "replace_cnt": 6, "delete_cnt": 3, "insert_cnt": 2, "fix_ops_cnt": 11, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Text;\n\nnamespace Codeforces_240_2\n{\n class Program\n {\n static void Main(string[] args)\n {\n string[] S = Console.ReadLine().Split(' ');\n int n = int.Parse(S[0]);\n int k = int.Parse(S[1]);\n long[] dp = new long[12];\n int[] d = new int[12];\n int[] m = new int[12];\n for (d[0] = 1; d[0] <= n; ++d[0])\n {\n ++dp[0];\n int i = 1;\n for (m[i] = 2; ; ++m[i])\n {\n d[i] = d[i-1] * m[i];\n if (n < d[i])\n {\n if (--i < 1) break;\n }\n else\n {\n ++dp[i];\n ++i;\n m[i] = 1;\n }\n }\n }\n decimal ret = 0;\n decimal b = 1;\n for (long i = 0; i < 12 && i < k; ++i)\n {\n ret = (ret + b * dp[i]) % 1000000007;\n b = b * (k - 1 - i) / (i + 1);\n }\n Console.WriteLine(ret);\n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "3e479074f2bbf6edf54a6aa6a4efd75a", "src_uid": "c8cbd155d9f20563d37537ef68dde5aa", "apr_id": "d3576671dd5cbf5a8a4f98bc19b91152", "difficulty": 1400, "tags": ["dp", "combinatorics", "number theory"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9707762557077626, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 3, "bug_source_code": "// Submitted by Silithus @ Macau\nusing System;\nusing System.IO;\nusing System.Collections.Generic;\nusing CCF_XOI;\n\nnamespace CodeForces\n{\n\tclass CF624A\n\t{\n\t\tpublic void Solve(XOI xoi)\n\t\t{\n\t\t\tint L, D, V1, V2;\n\n\t\t\tD = xoi.ReadInt();\n\t\t\tL = xoi.ReadInt();\n\t\t\tV1 = xoi.ReadInt();\n\t\t\tV2 = xoi.ReadInt();\n\n\t\t\txoi.o.WriteLine((double)(L - D) / (double)(V1 + V2));\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 CF624A()).Solve(new XOI());\n\t\t}\n\t}\n}\n\nnamespace CCF_XOI\n{ // version 2014.06.20\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, System.Globalization.CultureInfo.InvariantCulture);\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{ // 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": "095fd813ef69c9b19d059b60c9df82d2", "src_uid": "f34f3f974a21144b9f6e8615c41830f5", "apr_id": "51289c809d5f017af5bf877c8c66f5fc", "difficulty": 800, "tags": ["math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.311614730878187, "equal_cnt": 4, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 4, "bug_source_code": "using System;\nclass Program\n {\n static void Main(string[] args)\n {\n string input = Console.ReadLine();\n string rs;\n for (int i = 0, cntr = 2; i < input.Length; ++i)\n {\n if (input[i] == '4')\n {\n if (++cntr > 2) { rs = \"NO\"; break; }\n }\n else if (input[i] == '1') cntr = 0;\n else { rs = \"NO\"; break; }\n }\n Console.WriteLine(rs==null?\"YES\":rs);\n }\n }", "lang": "Mono C#", "bug_code_uid": "dccaa57ef88b1063d849e2ea40e52d46", "src_uid": "3153cfddae27fbd817caaf2cb7a6a4b5", "apr_id": "5a127da9c7658110d008d94cb04e7239", "difficulty": 900, "tags": ["brute force", "greedy"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9996639408535902, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Globalization;\nusing System.IO;\nusing System.Linq;\nusing System.Text;\nusing System.Threading;\n\n// (づ°ω°)づミe★゜・。。・゜゜・。。・゜☆゜・。。・゜゜・。。・゜\npublic class Solver\n{\n private const int SIEVE_SIZE = 1000;\n private readonly bool[] isComposite = new bool[SIEVE_SIZE + 1];\n private readonly IList primes = new List();\n void Sieve()\n {\n for (int i = 2; i * i <= SIEVE_SIZE; i++)\n if (!isComposite[i])\n for (int j = i * i; j <= SIEVE_SIZE; j += i)\n isComposite[j] = true;\n for (int i = 2; i <= SIEVE_SIZE; i++)\n if (!isComposite[i])\n primes.Add(i);\n }\n\n public void Solve()\n {\n int n = ReadInt();\n int m = ReadInt();\n\n Sieve();\n for (int i = 0; primes[i] <= n; i++)\n {\n for (int j = 1; j < primes.Count; j++)\n if (primes[j - 1] + primes[j] + 1 == primes[i])\n m--;\n }\n\n Write(m > 0 ? \"NO\" : \"YES\");\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 new Solver().Solve();\n //var thread = new Thread(new Solver().Solve, 1024 * 1024 * 128);\n //thread.Start();\n //thread.Join();\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": "8487650df8afe8244bee867e2aa35eb9", "src_uid": "afd2b818ed3e2a931da9d682f6ad660d", "apr_id": "56b29983a6ca1b378c654c3da27ea4a5", "difficulty": 1000, "tags": ["math", "brute force", "number theory"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.7502702702702703, "equal_cnt": 13, "replace_cnt": 6, "delete_cnt": 3, "insert_cnt": 3, "fix_ops_cnt": 12, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\nusing System.IO;\n\nnamespace ConsoleApplication1\n{\n class Program\n {\n static void Main(string[] args)\n {\n StreamReader reader = new StreamReader(\"input.txt\");\n StreamWriter writer = new StreamWriter(\"output.txt\");\n string[] int_mass =reader.ReadLine().Split(' ');\n int n = Int32.Parse(int_mass[0]);\n int t = int.Parse(int_mass[1]);\n int k = Int32.Parse(int_mass[2]);\n int d = Int32.Parse(int_mass[3]);\n int Without_furn = t * ((int)(n/k)!=0 ? (int)(n/k) : 1);\n int with_furn = d + t;\n if (with_furn0)\n {\n withoutSecondoven += t;\n i -= k;\n }\n int timeLine = 1;\n int ovenStartTime = 0;\n i = n;\n do\n {\n if (timeLine % t == 0)\n {\n \n i -= k;\n\n }\n if(timeLine >= d && i!=0)\n {\n \n ovenStartTime++;\n //second oven built\n if (ovenStartTime % t == 0)\n {\n \n i -= k;\n }\n }\n timeLine++;\n \n } while (i>0);\n\n if (withoutSecondoven <= timeLine)\n {\n Console.WriteLine(\"NO\");\n }\n else\n {\n Console.WriteLine(\"YES\");\n }\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "baaa6a092b3c5623ff5800108ea1f602", "src_uid": "32c866d3d394e269724b4930df5e4407", "apr_id": "1294a0396ced8b281e2f8fe740db23e9", "difficulty": 1100, "tags": ["brute force", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9815712900096993, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "using System;\n\nnamespace MyFirstAlgOnC#\n{\n class Program\n {\n static void Main(string[] args)\n {\n int[] input = Array.ConvertAll(Console.ReadLine().Split(' '), int.Parse);\n int n = input[0], t = input[1], k = input[2], d = input[3];\n int timesCook = (int)Math.Ceiling((double)n / k);\n int timeAlone = timesCook * t;\n bool result = Math.Max(timeAlone - t, d + t) < timeAlone;\n Console.WriteLine(result ? \"YES\" : \"NO\");\n }\n }\n}", "lang": "MS C#", "bug_code_uid": "81c4d50363afc00cdacd7290f830f45f", "src_uid": "32c866d3d394e269724b4930df5e4407", "apr_id": "95fbcf69c2bf74d594619b575fe161bd", "difficulty": 1100, "tags": ["brute force", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9536855838225701, "equal_cnt": 5, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 4, "bug_source_code": "using System;\n\nnamespace AllProblems\n{\n class _245B_InternetAddress\n {\n public static void Run()\n {\n var s = Console.ReadLine().Trim().Split(new[]{\"tp\"},StringSplitOptions.None);\n Console.Write(\"{0}://\", s[0].Length == 1 ? \"ftp\" : \"http\");\n if (s[1].StartsWith(\"ru\"))\n {\n Console.Write(\"ru\");\n s[1] = s[1].Substring(2);\n }\n\n var ru = s[1].Split(new[] {\"ru\"}, 2,StringSplitOptions.None);\n Console.Write(\"{0}.ru/{1}\",ru[0],ru[1]);\n Console.ReadLine();\n }\n }\n\n class Program\n {\n static void Main(string[] args)\n {\n _245B_InternetAddress.Run();\n }\n }\n}", "lang": "MS C#", "bug_code_uid": "19d58e5989f7069e03fb59b125fa1144", "src_uid": "4c999b7854a8a08960b6501a90b3bba3", "apr_id": "911b591abac8bfbb13e6f20e349745c9", "difficulty": 1100, "tags": ["strings", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.5114411882778, "equal_cnt": 11, "replace_cnt": 3, "delete_cnt": 1, "insert_cnt": 7, "fix_ops_cnt": 11, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\nusing System.IO;\nnamespace Codefoeces\n{\n class Program\n {\n\n static void Main(string[] args)\n {\n \n\n\n int t = int.Parse(Console.ReadLine());\n \n\n for (int c = 0; c < t; c++)\n {\n string[] s = Console.ReadLine().Split();\n long a = long.Parse(s[0]);\n long b = long.Parse(s[1]);\n\n bool prost = true;\n\n long n = a * a - b * b;\n for (long i = 2; i <= n / 2; i++)\n {\n if (n % i == 0)\n {\n prost = false;\n break;\n }\n }\n if (prost)\n Console.WriteLine(\"YES\");\n else\n Console.WriteLine(\"NO\");\n }\n }\n }\n}", "lang": "Mono C#", "bug_code_uid": "1be92c138d3ef153a579e8262b292425", "src_uid": "5a052e4e6c64333d94c83df890b1183c", "apr_id": "f1bf54fc16ed28be44ddd4be6cb43a26", "difficulty": 1100, "tags": ["math", "number theory"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.7771288041807562, "equal_cnt": 9, "replace_cnt": 6, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 8, "bug_source_code": "using System;\n\nnamespace BSE186_Template13\n{\n /* ФИО: Малашенко Борис Тарасович\n * Самостоятельная работа №\n * Вариант:\n * Дата:\n * */\n class Program\n {\n\n static void Bad()\n {\n Console.WriteLine(\"Something goes wrong, try again...\");\n }\n\n static void Good()\n {\n Console.WriteLine(\"Excellent!\");\n }\n\n static int ReadNum(string name)\n {\n int a;\n while (true)\n {\n Console.Write($\"Input {name}: \");\n string data = Console.ReadLine();\n if (int.TryParse(data, out a))\n {\n Good();\n break;\n }\n Bad();\n }\n return a;\n }\n\n static void Main(string[] args)\n {\n int n = int.Parse(Console.ReadLine());\n \n for (int i = 0; i < n; ++i)\n {\n var data = Console.ReadLine().Split();\n int a = int.Parse(data[0]);\n int b = int.Parse(data[1]);\n if (a - b > 1)\n Console.WriteLine(\"NO\");\n else\n Console.WriteLine(\"YES\");\n }\n //Console.ReadKey();\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "fa14291a9ab4e453d7ea31b9db5eced4", "src_uid": "5a052e4e6c64333d94c83df890b1183c", "apr_id": "f262155a9de6d6ad0840825d0cbe3aa4", "difficulty": 1100, "tags": ["math", "number theory"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9396115988294759, "equal_cnt": 8, "replace_cnt": 4, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 7, "bug_source_code": "using System;\n\nnamespace BSE186_Template13\n{\n /* ФИО: Малашенко Борис Тарасович\n * Самостоятельная работа №\n * Вариант:\n * Дата:\n * */\n class Program\n {\n\n static void Bad()\n {\n Console.WriteLine(\"Something goes wrong, try again...\");\n }\n\n static void Good()\n {\n Console.WriteLine(\"Excellent!\");\n }\n\n static int ReadNum(string name)\n {\n int a;\n while (true)\n {\n Console.Write($\"Input {name}: \");\n string data = Console.ReadLine();\n if (int.TryParse(data, out a))\n {\n Good();\n break;\n }\n Bad();\n }\n return a;\n }\n\n static void Main(string[] args)\n {\n int n = int.Parse(Console.ReadLine());\n \n for (int i = 0; i < n; ++i)\n {\n var data = Console.ReadLine().Split();\n ulong a = ulong.Parse(data[0]);\n ulong b = ulong.Parse(data[1]);\n bool prost = false;\n\n if (a - b > 1)\n {\n ulong f = a + b;\n for (ulong j = 2; j <= f / 2; j++)\n {\n if (f % j == 0)\n {\n prost = true;\n break;\n }\n }\n \n }\n if (prost)\n {\n Console.WriteLine(\"YES\");\n }\n else\n {\n Console.WriteLine(\"NO\");\n }\n }\n //Console.ReadKey();\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "77eded166fcd82401563d1b62114a535", "src_uid": "5a052e4e6c64333d94c83df890b1183c", "apr_id": "f262155a9de6d6ad0840825d0cbe3aa4", "difficulty": 1100, "tags": ["math", "number theory"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.5657320872274143, "equal_cnt": 14, "replace_cnt": 9, "delete_cnt": 4, "insert_cnt": 1, "fix_ops_cnt": 14, "bug_source_code": "using System;\n\t\t\t\t\t\npublic class Program\n{\n\tpublic static void Main()\n\t{\n\t\tlong t = Convert.ToInt64(Console.ReadLine());\n string[] tests = new string[2];\n\t\tlong f;\n\t\tlong p;\n\t\tloop:\n for(long i=0;i, long> dp; \n\n\t\tprivate void Solve()\n\t\t{\n\t\t\tdp = new Dictionary, long>();\n\n\t\t\tvar n = cin.NextLong();\n\t\t\tvar l = cin.NextLong();\n\t\t\tvar r = cin.NextLong();\n\n\t\t\tif (n == 0)\n\t\t\t{\n\t\t\t\tConsole.WriteLine(0);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tvar count = Count(n, l, r);\n\t\t\tConsole.WriteLine(count);\n\t\t}\n\n\t\tprivate long Count(long n, int l, int r)\n\t\t{\n\t\t\tif (n == 1)\n\t\t\t{\n\t\t\t\treturn 1;\n\t\t\t}\n\n\t\t\tif (dp.ContainsKey(Tuple.Create(n, l, r)))\n\t\t\t{\n\t\t\t\treturn dp[Tuple.Create(n, l, r)];\n\t\t\t}\n\n\t\t\tvar idx = 0;\n\t\t\tvar nn = n;\n\t\t\twhile (nn > 1)\n\t\t\t{\n\t\t\t\tidx++;\n\t\t\t\tnn/=2;\n\t\t\t}\n\t\t\tvar len = 1;\n\t\t\tfor (var i = 0; i < idx; i++)\n\t\t\t{\n\t\t\t\tlen *= 2;\n\t\t\t\tlen++;\n\t\t\t}\n\t\t\tvar middle = len/2;\n\t\t\tvar sum = 0L;\n\t\t\tif (l <= middle && r >= middle)\n\t\t\t{\n\t\t\t\tsum += n%2;\n\t\t\t\tif (l < middle)\n\t\t\t\t{\n\t\t\t\t\tsum += Count(n/2, l, middle - 1);\n\t\t\t\t}\n\t\t\t\tif (r > middle)\n\t\t\t\t{\n\t\t\t\t\tsum += Count(n/2, 0, r - middle - 1);\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if (l < middle)\n\t\t\t{\n\t\t\t\tsum += Count(n/2, l, r);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tsum += Count(n/2, l - middle - 1, r - middle - 1);\n\t\t\t}\n\t\t\tdp[Tuple.Create(n, l, r)] = sum;\n\t\t\treturn sum;\n\t\t}\n\n\t\tprivate static readonly Scanner cin = new Scanner();\n\n\t\tprivate static void Main()\n\t\t{\n#if DEBUG\n\t\t\tvar inputText = File.ReadAllText(@\"..\\..\\input.txt\");\n\t\t\tvar testCases = inputText.Split(new[] { \"input\" }, StringSplitOptions.RemoveEmptyEntries);\n\t\t\tvar consoleOut = Console.Out;\n\t\t\tfor (var i = 0; i < testCases.Length; i++)\n\t\t\t{\n\t\t\t\tvar parts = testCases[i].Split(new[] { \"output\" }, StringSplitOptions.RemoveEmptyEntries);\n\t\t\t\tConsole.SetIn(new StringReader(parts[0].Trim()));\n\t\t\t\tvar stringWriter = new StringWriter();\n\t\t\t\tConsole.SetOut(stringWriter);\n\t\t\t\tvar sw = Stopwatch.StartNew();\n\t\t\t\tnew Template().Solve();\n\t\t\t\tsw.Stop();\n\t\t\t\tvar output = stringWriter.ToString();\n\n\t\t\t\tConsole.SetOut(consoleOut);\n\t\t\t\tvar color = ConsoleColor.Green;\n\t\t\t\tvar status = \"Passed\";\n\t\t\t\tif (parts[1].Trim() != output.Trim())\n\t\t\t\t{\n\t\t\t\t\tcolor = ConsoleColor.Red;\n\t\t\t\t\tstatus = \"Failed\";\n\t\t\t\t}\n\t\t\t\tConsole.ForegroundColor = color;\n\t\t\t\tConsole.WriteLine(\"Test {0} {1} in {2}ms\", i + 1, status, sw.ElapsedMilliseconds);\n\t\t\t}\n\t\t\tConsole.ReadLine();\n\t\t\tConsole.ReadKey();\n#else\n\t\t\tnew Template().Solve();\n\t\t\tConsole.ReadLine();\n#endif\n\t\t}\n\t}\n\n\tinternal class Scanner\n\t{\n\t\tprivate string[] s = new string[0];\n\t\tprivate int i;\n\t\tprivate readonly char[] cs = { ' ' };\n\n\t\tpublic string NextString()\n\t\t{\n\t\t\tif (i < s.Length) return s[i++];\n\t\t\tvar line = Console.ReadLine() ?? string.Empty;\n\t\t\ts = line.Split(cs, StringSplitOptions.RemoveEmptyEntries);\n\t\t\ti = 1;\n\t\t\treturn s.First();\n\t\t}\n\n\t\tpublic double NextDouble()\n\t\t{\n\t\t\treturn double.Parse(NextString());\n\t\t}\n\n\t\tpublic int NextInt()\n\t\t{\n\t\t\treturn int.Parse(NextString());\n\t\t}\n\n\t\tpublic long NextLong()\n\t\t{\n\t\t\treturn long.Parse(NextString());\n\t\t}\n\t}\n}", "lang": "MS C#", "bug_code_uid": "4307c7db372afc326ac2038345f7fbec", "src_uid": "3ac61b1f8deee7911b1055c243f5eb6a", "apr_id": "5f3e59b6a5d696a6c9c18f8d3eaf8a4d", "difficulty": 1600, "tags": ["divide and conquer", "dfs and similar", "constructive algorithms"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.722430607651913, "equal_cnt": 22, "replace_cnt": 13, "delete_cnt": 8, "insert_cnt": 1, "fix_ops_cnt": 22, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace ForAll\n{\n class Program\n {\n \n \n static void Main(string[] args)\n {\n Int64[] parametrs = Array.ConvertAll(Console.ReadLine().Split(' '),Int64.Parse);\n\n var n = parametrs[0];int l = (int)parametrs[1],r = (int)parametrs[2];\n\n int lengthString = (int)Math.Pow(2, ((int)Math.Log(n, 2)) + 1) - 1;\n\n int index = l;\n\n int counter = 0;\n for (int i = l; i < r + 1; i++)\n {\n if (BinarySearch(lengthString, n, i) == 1)\n counter++;\n }\n\n Console.WriteLine(counter);\n }\n\n static int BinarySearch(int lengthValue,Int64 root,int index)\n {\n int current = lengthValue / 2 + 1;\n int path = current;\n while (current != index) \n {\n path = path >> 1;\n if (index < current)\n current = current - path;\n else\n current = current + path;\n root = root >> 1;\n }\n\n if (index % 2 == 0)\n return (int)(root % 2);\n else return (int)(root);\n }\n\n }\n}", "lang": "MS C#", "bug_code_uid": "6a04aaf9a5c27297347fb1de4dc2875d", "src_uid": "3ac61b1f8deee7911b1055c243f5eb6a", "apr_id": "6564049262c8b5ac7d767fc05e878866", "difficulty": 1600, "tags": ["divide and conquer", "dfs and similar", "constructive algorithms"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9986320109439124, "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.Text;\n\nnamespace Contest3\n{\n class Program\n {\n static void Main(string[] args)\n {\n var temp = Console.ReadLine().Split(' ');\n long n = long.Parse(temp[0]);\n long a = long.Parse(temp[1]);\n long b = long.Parse(temp[2]);\n long c = long.Parse(temp[2]);\n long l = 0;\n n *= 2;\n for (long i = 0; i <= c; i++)\n for (long j = 0; j <= b; j++)\n {\n long k = n - i * 4 - 2 * j;\n\n if ((k >= 0) && (k <= a))\n l++;\n }\n Console.WriteLine(l);\n\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "b11614f48b23cc8cf6a46589002f1b73", "src_uid": "474e527d41040446a18186596e8bdd83", "apr_id": "156f03d19892bbefe2c3ee43eaaea613", "difficulty": 1500, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.8615702479338843, "equal_cnt": 9, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 5, "fix_ops_cnt": 8, "bug_source_code": "using System;\nclass Test {\n static void Main() {\n string [] str = Console.ReadLine().Split();\n int n = int.Parse(str[0]);\n int m = int.Parse(str[1]);\n int i =1 ;\n int sum = 0;\n while(true){\n if(sum>=m){\n sum -= i;\n Console.WriteLine(m-sum);\n }\n if(i>n){\n i = 1;\n }\n sum += i;\n }\n }\n}", "lang": "Mono C#", "bug_code_uid": "a7d2e2eeb3f2f545e3214c5a28541fc3", "src_uid": "5dd5ee90606d37cae5926eb8b8d250bb", "apr_id": "9f42eae46ac562d163551fa438a62e24", "difficulty": 800, "tags": ["math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.9960822722820764, "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.Text;\n\nnamespace ConsoleApplication1\n{\n class Program\n {\n static void Main(string[] args)\n {\n\n string[] data = Console.ReadLine().Split(' ');\n \n int n = Convert.ToInt32(data[0]); // зайцы от 1 до 50 \n int m = Convert.ToInt32(data[1]); // фишки от 1 до 104\n int check = 1;\n\n for (int i = 0; i < n; i++)\n {\n if (check == 1)\n {\n for (int y = 1; y <= n; y++)\n {\n if (m >= y)\n {\n m = m-y;\n }\n else\n {\n check = 0;\n break;\n }\n }\n }\n else { break; }\n }\n\n Console.WriteLine(e);\n }\n }\n}", "lang": "Mono C#", "bug_code_uid": "a7c5dd3c1f0e95e0d4c4318d7997ee16", "src_uid": "5dd5ee90606d37cae5926eb8b8d250bb", "apr_id": "e33be6d5be2105fd22eedc197ab1e20c", "difficulty": 800, "tags": ["math", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.999203764024611, "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.Collections;\nusing System.Globalization;\nusing System.IO;\nusing System.Linq;\n\npublic class Source\n{\n public void Program()\n {\n }\n void Read()\n {\n int s = ri(), start = ri(), end = ri();\n int t1 = ri(), t2 = ri();\n int p = ri(), d = ri();\n int time1 = 0;\n while (true)\n {\n if (d == 1)\n {\n\n if (start >= p && start <= end)\n {\n time1 = time1 + Math.Abs(p - end);\n break;\n }else\n {\n time1 += s - p;\n p = s;\n\n }\n\n }\n else\n {\n\n if (start <= p && start >= end)\n {\n time1 = time1 + Math.Abs(p - end);\n break;\n }\n else\n {\n time1 += p;\n p = 0;\n\n }\n\n }\n d *= -1;\n }\n int time2 = Math.Abs(end - start) * t2;\n writeLine(Math.Min(time1, time2));\n\n }\n\n #region hide it\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 var source = new Source();\n source.Read();\n source.Program();\n\n /* try\n {\n new Source().Program();\n }\n catch (Exception ex)\n {\n #if DEBUG\n Console.WriteLine(ex);\n #else\n throw;\n #endif\n }*/\n reader.Close();\n writer.Close();\n }\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()\n {\n while (currentLineTokens.Count == 0)\n currentLineTokens = new Queue(ReadAndSplitLine());\n return currentLineTokens.Dequeue();\n }\n public static int ri() { return int.Parse(ReadToken()); }\n public static char ReadChar() { return char.Parse(ReadToken()); }\n public static long ReadLong() { return long.Parse(ReadToken()); }\n public static ulong ReaduLong() { return ulong.Parse(ReadToken()); }\n public static double ReadDouble() { return double.Parse(ReadToken(), CultureInfo.InvariantCulture); }\n public static int[] ReadIntArray() { return ReadAndSplitLine().Select(i => int.Parse(i)).ToArray(); }\n public static char[] ReadCharArray() { return ReadAndSplitLine().Select(i => char.Parse(i)).ToArray(); }\n public static char[] SplitToChar() { string s = ReadToken(); char[] r = new char[s.Length]; for (int i = 0; i < s.Length; i++) r[i] = s[i]; return r; }\n public static byte[] SplitToByte() { string s = ReadToken(); byte[] r = new byte[s.Length]; for (int i = 0; i < s.Length; i++) r[i] = (byte)s[i]; return r; }\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 char[][] ReadCharMatrix(int numberOfRows) { char[][] matrix = new char[numberOfRows][]; for (int i = 0; i < numberOfRows; i++) matrix[i] = ReadCharArray(); 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]; }\n 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 write(T value) { writer.Write(value); }\n public static void writeLine(T value) { writer.WriteLine(value); }\n public static void writeArray(T[] array, string split) { for (int i = 0; i < array.Length; i++) { write(array[i] + split); } }\n public static void writeMatrix(T[][] matrix, string split) { for (int i = 0; i < matrix.Length; i++) { writeArray(matrix[i], split); writer.Write(\"\\n\"); } }\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\n #region Methods\n #region DSU\n public void MakeSet(int[] poi)\n {\n for (int i = 0; i < poi.Length; i++)\n {\n poi[i] = i;\n }\n }\n public int Find(int x, int[] poi)\n {\n if (poi[x] == x) return x;\n return poi[x] = Find(poi[x], poi);\n }\n Random rand = new Random();\n public void Unite(int x, int y, int[] poi)\n {\n y = Find(y, poi);\n x = Find(x, poi);\n if (rand.Next() % 2 == 0)\n Swap(ref x, ref y);\n poi[x] = y;\n }\n #endregion\n\n class Deque\n {\n T[] array;\n int start, length;\n public Deque()\n {\n start = 0; length = 0; array = new T[1];\n }\n public T this[int index] { get { return array[(start + index) % array.Length]; } set { array[(start + index) % array.Length] = value; } }\n int last { get { return (start + length) % array.Length; } }\n /// \n /// сÑâ€Ã\n /// \n public T PeekFirst()\n {\n return array[start];\n }\n public int Count { get { return length; } }\n /// \n /// конецбез удаления\n /// \n public T PeekLsat()\n {\n return array[last];\n }\n public T PopLast()\n {\n if (length == 0)\n throw new IndexOutOfRangeException(\"OutOfRange\");\n length--;\n return array[last];\n }\n public T PopFirst()\n {\n if (length == 0)\n throw new IndexOutOfRangeException(\"OutOfRange\");\n length--;\n if (start >= array.Length - 1) start = 0; else start++;\n return array[start - 1 < 0 ? array.Length - 1 : start - 1];\n }\n public void AddFirst(T value)\n {\n IncreaseAndInspection();\n if (start <= 0) start = array.Length - 1; else start--;\n array[start] = value;\n length++;\n }\n public void AddLast(T value)\n {\n IncreaseAndInspection();\n array[last] = value;\n length++;\n }\n bool overflow { get { return length == array.Length; } }\n void IncreaseAndInspection()\n {\n if (overflow)\n increase();\n\n }\n void increase()\n {\n T[] array2 = new T[array.Length * 2];\n for (int i = 0; i < array.Length; i++)\n {\n int pos = (start + i) % array.Length;\n array2[i] = array[pos];\n }\n array = array2;\n start = 0;\n array2 = null;\n }\n public void Clear()\n {\n start = 0; length = 0; array = new T[1];\n }\n }\n class Heap\n {\n Comparison ic;\n List storage = new List();\n public Heap(Comparison ic)\n {\n this.ic = ic;\n }\n public void Add(T element)\n {\n storage.Add(element);\n int pos = storage.Count - 1;\n while (pos != 0 && ic(storage[((int)(pos - 1) >> 1)], element) > 0)\n {\n Swap(storage, pos, ((int)(pos - 1) / 2));\n pos = ((int)(pos - 1) / 2);\n }\n }\n public T Pop()\n {\n T t = storage[0];\n Swap(storage, 0, storage.Count - 1);\n int pos = 0;\n storage.RemoveAt(storage.Count - 1);\n if (Count > 0)\n while (true)\n {\n T my = storage[pos];\n if (pos * 2 + 1 >= Count)\n break;\n T left = storage[pos * 2 + 1];\n if (pos * 2 + 2 >= Count)\n {\n if (ic(left, my) < 0)\n {\n Swap(storage, pos, pos * 2 + 1);\n pos = pos * 2 + 1;\n }\n break;\n }\n T right = storage[pos * 2 + 2];\n if (ic(left, my) < 0 || ic(right, my) < 0)\n {\n if (ic(left, right) < 0)\n {\n Swap(storage, pos, pos * 2 + 1);\n pos = pos * 2 + 1;\n }\n else\n {\n\n Swap(storage, pos, pos * 2 + 2);\n pos = pos * 2 + 2;\n }\n }\n else break;\n }\n return t;\n }\n\n public void Clear()\n {\n storage.Clear();\n }\n /// \n /// без удаления\n /// \n /// \n public T Peek()\n {\n return storage[0];\n }\n public int Count\n {\n get { return storage.Count; }\n }\n //void RemoveLast, Size, peeklast, add\n }\n static void Swap(ref T lhs, ref T rhs)\n {\n T temp;\n temp = lhs;\n lhs = rhs;\n rhs = temp;\n }\n static void Swap(T[] a, int l, int r)\n {\n T temp;\n temp = a[l];\n a[l] = a[r];\n a[r] = temp;\n }\n static void Swap(List a, int l, int r)\n {\n T temp;\n temp = a[l];\n a[l] = a[r];\n a[r] = temp;\n }\n\n bool outregion(long y, long x, long n, long m)\n {\n if (x < 0 || x >= m || y < 0 || y >= n)\n return true;\n return false;\n }\n static void initlist(ref List[] list, int n)\n {\n list = new List[n];\n for (int i = 0; i < n; i++)\n list[i] = new List();\n }\n static void newarray(ref T[][] array, int n, int m)\n {\n array = new T[n][];\n for (int i = 0; i < n; i++)\n array[i] = new T[m];\n }\n static void newarray(ref T[] array, int n)\n {\n array = new T[n];\n }\n static void fill(T[] array, T value)\n {\n for (int i = 0; i < array.Length; i++)\n array[i] = value;\n }\n static void fill(T[][] array, T value)\n {\n for (int i = 0; i < array.Length; i++)\n for (int j = 0; j < array[i].Length; j++)\n array[i][j] = value;\n }\n public bool NextPermutation(T[] b, Comparison ic)\n {\n for (int j = b.Length - 2; j >= 0; j--)\n {\n if (ic(b[j], b[j + 1]) < 0)\n {\n for (int l = b.Length - 1; l >= 0; l--)\n {\n if (ic(b[l], b[j]) > 0)\n {\n Swap(b, j, l);\n Array.Reverse(b, j + 1, b.Length - (j + 1));\n return true;\n }\n }\n }\n }\n return false;\n }\n int[,] step8 = new int[,]\n {\n {-1,0 },\n {1,0 },\n {0,-1 },\n {0,1 },\n {1,1 },\n {-1,1 },\n {-1,-1 },\n {1,-1 },\n };\n int[,] step4 = new int[,]\n {\n {-1,0 },\n {1,0 },\n {0,-1 },\n {0,1 },\n };\n struct Vector2\n {\n public double x;\n public double y;\n public Vector2(double x, double y)\n {\n this.x = x;\n this.y = y;\n }\n public double Dist(Vector2 to)\n {\n return Math.Sqrt(Math.Abs(Math.Pow(to.x - x, 2)) + Math.Abs(Math.Pow(to.y - y, 2)));\n }\n public static bool operator ==(Vector2 left, Vector2 right) { return left.x == right.x && left.y == right.y; }\n public static bool operator !=(Vector2 left, Vector2 right) { return left.x != right.x || left.y != right.y; }\n }\n #endregion\n #endregion\n\n}\n", "lang": "MS C#", "bug_code_uid": "ee259941fcbbc749286dd9f38c6f03b7", "src_uid": "fb3aca6eba3a952e9d5736c5d8566821", "apr_id": "c7d74ff9c88c644ff0fe15cde2bbea7c", "difficulty": 1600, "tags": ["math", "constructive algorithms", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "C#"} {"similarity_score": 0.9828300769686205, "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.Text;\nusing System.Threading.Tasks;\n\nnamespace ConsoleApplication1\n{\n class A80_Panoramix_sPrediction\n {\n public static void Main()\n {\n string[] a = Console.ReadLine().Split(' ');\n int n = int.Parse(a[0]);\n int m = int.Parse(a[1]);\n int[] prime = { 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47 };\n int index = 0;\n for (int i=0;i(ref T a, ref T b) { T t = a; a = b; b = t; }\n static void print(object o) { Console.Write(o); }\n static void print(String f, params object[] o) { Console.WriteLine(f, o); }\n static void println() { Console.WriteLine(); }\n static void println(object o) { Console.WriteLine(o); }\n static void println(String f, params object[] o) { Console.WriteLine(f, o); }\n static string RL() { return Console.ReadLine(); }\n \n static void Main(string[] args) {\n#if DEBUG\n open(file);\n#endif\n \t\t\tBigInteger test=12379187;\n\t\t\tstring n1=Console.ReadLine(), n2=Console.ReadLine();\n\t\t\tint[] digits=new int[n1.Length];\n\t\t\t\n\t\t\tfor(int i=0; i 9)\n {\n for (i = 0; i < digits.Length; i++)\n {\n d[i] = digits[i] - '0';\n }\n\n Array.Sort(d);\n\n for (i = 0; i < digits.Length; i++)\n {\n if (d[i] != 0)\n {\n temp = d[i];\n d[i] = d[0];\n d[0] = temp;\n\n break;\n }\n }\n\n str = \"\";\n for (i = 0; i < digits.Length; i++)\n {\n str += d[i];\n }\n }\n\n return Convert.ToInt64(str);\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "27d131a594219c2aa383636ad95e591b", "src_uid": "d1e381b72a6c09a0723cfe72c0917372", "apr_id": "0592228cb13d9349b68dbb877ff5041c", "difficulty": 1100, "tags": ["sortings", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.8863436123348017, "equal_cnt": 1, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": " static void Main(string[] args)\n {\n Console.ReadLine();\n\n var strings = Console.ReadLine();\n\n var hi = strings.Split(' ').ToList();\n\n var numbers = hi.Select(x => int.Parse(x)).ToList();\n numbers.Sort();\n\n var answer = 0;\n\n var lastNumber = numbers.Last();\n\n if (lastNumber >= 25)\n {\n answer = lastNumber - 25;\n }\n\n Console.WriteLine(answer);\n }", "lang": "Mono C#", "bug_code_uid": "287afc824fcd684f7ac47ca1539e25d3", "src_uid": "ef657588b4f2fe8b2ff5f8edc0ab8afd", "apr_id": "9af50d2b2a4c83bb6ef78948ec4647e9", "difficulty": 800, "tags": ["greedy", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.9987967914438503, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "using System;\nusing System.Linq;\nusing System.Collections.Generic;\nusing System.Diagnostics;\nusing Debug = System.Diagnostics.Trace;\nusing SB = System.Text.StringBuilder;\nusing System.Numerics;\nusing static System.Math;\nusing Number = System.Int64;\nusing N = Number;\nnamespace Program {\n\tpublic class Solver {\n\t\tRandom rnd = new Random();\n\t\tpublic void Solve() {\n\t\t\t//\n\t\t\t//dp[i,a,b] = i 回操作したあと、0 が来るべき箇所にある 1 の個数、1 が来るべき箇所にある 0 の個数\n\t\t\t//dp[i+1,a-1,b-1]+=dp[i,a,b]*a*b/n^2;\n\t\t\t//dp[i+1,a,b]+=dp[i,a,b]*(A*A+B*B + a*(B-b) + b*(A-a))/n^2\n\t\t\t//dp[i+1,a+1,b+1]+=dp[i,a,b]*(A-a)*(B-b)/n^2\n\n\t\t\tvar n = ri; var k = ri;\n\t\t\tvar A = Enumerate(n, x => ri);\n\t\t\tvar K = n - A.Sum();\n\t\t\tvar M = n - K;\n\t\t\tvar B = Enumerate(n, x => x < K ? 0 : 1);\n\t\t\tvar p = Enumerate(n, x => x).Count(x => A[x] != B[x]) / 2;\n\t\t\tvar coef = ModInt.Inverse(n * (n - 1) / 2);\n\t\t\tvar mat = new Matrix(n + 1, n + 1);\n\t\t\t//mat[i,j] = j->i\n\t\t\tfor (int j = 0; j <= n; j++) {\n\t\t\t\tif (j != 0) mat[j - 1, j] += j * j * coef.num;\n\t\t\t\tmat[j, j] += (K * (K - 1) / 2 + M * (M - 1) / 2 + j * (M - j) + j * (K - j)) * coef.num;\n\t\t\t\tif (j != n) mat[j + 1, j] += (K - j) * (M - j) * coef.num;\n\t\t\t}\n\t\t\tfor (int i = 0; i <= n; i++)\n\t\t\t\tfor (int j = 0; j <= n; j++)\n\t\t\t\t\tmat[i, j] %= ModInt.Mod;\n\t\t\tvar res = Matrix.Pow(mat, k);\n\t\t\tvar vec = new Matrix(n + 1, 1); vec[p, 0] = 1;\n\t\t\tvar ans = (res * vec)[0, 0];\n\t\t\tConsole.WriteLine(ans);\n\t\t}\n\t\tconst long INF = 1L << 60;\n\t\tstatic int[] dx = { -1, 0, 1, 0 };\n\t\tstatic int[] dy = { 0, 1, 0, -1 };\n\t\tint ri { get { return sc.Integer(); } }\n\t\tlong rl { get { return sc.Long(); } }\n\t\tdouble rd { get { return sc.Double(); } }\n\t\tstring rs { get { return sc.Scan(); } }\n\t\tpublic IO.StreamScanner sc = new IO.StreamScanner(Console.OpenStandardInput());\n\n\t\tstatic T[] Enumerate(int n, Func f) {\n\t\t\tvar a = new T[n];\n\t\t\tfor (int i = 0; i < a.Length; ++i) a[i] = f(i);\n\t\t\treturn a;\n\t\t}\n\t\tstatic public void Swap(ref T a, ref T b) { var tmp = a; a = b; b = tmp; }\n\t}\n}\n\n#region main\nstatic class Ex {\n\tstatic public string AsString(this IEnumerable ie) { return new string(ie.ToArray()); }\n\tstatic public string AsJoinedString(this IEnumerable ie, string st = \" \") {\n\t\treturn string.Join(st, ie);\n\t}\n\tstatic public void Main() {\n\t\t//Console.SetOut(new Program.IO.Printer(Console.OpenStandardOutput()) { AutoFlush = false });\n\t\tvar solver = new Program.Solver();\n\t\tsolver.Solve();\n\t\tConsole.Out.Flush();\n\t}\n}\n#endregion\n#region Ex\nnamespace Program.IO {\n\tusing System.IO;\n\tusing System.Text;\n\tusing System.Globalization;\n\n\tpublic class Printer : StreamWriter {\n\t\tpublic override IFormatProvider FormatProvider { get { return CultureInfo.InvariantCulture; } }\n\t\tpublic Printer(Stream stream) : base(stream, new UTF8Encoding(false, true)) { }\n\t}\n\n\tpublic class StreamScanner {\n\t\tpublic StreamScanner(Stream stream) { str = stream; }\n\n\t\tpublic readonly Stream str;\n\t\tprivate readonly byte[] buf = new byte[1024];\n\t\tprivate int len, ptr;\n\t\tpublic bool isEof = false;\n\t\tpublic bool IsEndOfStream { get { return isEof; } }\n\n\t\tprivate byte read() {\n\t\t\tif (isEof) return 0;\n\t\t\tif (ptr >= len) {\n\t\t\t\tptr = 0;\n\t\t\t\tif ((len = str.Read(buf, 0, 1024)) <= 0) {\n\t\t\t\t\tisEof = true;\n\t\t\t\t\treturn 0;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn buf[ptr++];\n\t\t}\n\n\t\tpublic char Char() {\n\t\t\tbyte b = 0;\n\t\t\tdo b = read(); while ((b < 33 || 126 < b) && !isEof);\n\t\t\treturn (char)b;\n\t\t}\n\t\tpublic string Scan() {\n\t\t\tvar sb = new StringBuilder();\n\t\t\tfor (var b = Char(); b >= 33 && b <= 126; b = (char)read()) sb.Append(b);\n\t\t\treturn sb.ToString();\n\t\t}\n\t\tpublic string ScanLine() {\n\t\t\tvar sb = new StringBuilder();\n\t\t\tfor (var b = Char(); b != '\\n' && b != 0; b = (char)read()) if (b != '\\r') sb.Append(b);\n\t\t\treturn sb.ToString();\n\t\t}\n\t\tpublic long Long() { return isEof ? long.MinValue : long.Parse(Scan()); }\n\t\tpublic int Integer() { return isEof ? int.MinValue : int.Parse(Scan()); }\n\t\tpublic double Double() { return isEof ? double.NaN : double.Parse(Scan(), CultureInfo.InvariantCulture); }\n\t}\n}\n\n#endregion\n\n\n#region ModInt\n/// \n/// [0,) までの値を取るような数\n/// \npublic struct ModInt {\n\t/// \n\t/// 剰余を取る値.\n\t/// \n\tpublic const long Mod = (int)1e9 + 7;\n\n\t/// \n\t/// 実際の数値.\n\t/// \n\tpublic long num;\n\t/// \n\t/// 値が であるようなインスタンスを構築します.\n\t/// \n\t/// インスタンスが持つ値\n\t/// パフォーマンスの問題上,コンストラクタ内では剰余を取りません.そのため, ∈ [0,) を満たすような を渡してください.このコンストラクタは O(1) で実行されます.\n\tpublic ModInt(long n) { num = n; }\n\t/// \n\t/// このインスタンスの数値を文字列に変換します.\n\t/// \n\t/// [0,) の範囲内の整数を 10 進表記したもの.\n\tpublic override string ToString() { return num.ToString(); }\n\tpublic static ModInt operator +(ModInt l, ModInt r) { l.num += r.num; if (l.num >= Mod) l.num -= Mod; return l; }\n\tpublic static ModInt operator -(ModInt l, ModInt r) { l.num -= r.num; if (l.num < 0) l.num += Mod; return l; }\n\tpublic static ModInt operator *(ModInt l, ModInt r) { return new ModInt(l.num * r.num % Mod); }\n\tpublic static implicit operator ModInt(long n) { n %= Mod; if (n < 0) n += Mod; return new ModInt(n); }\n\n\t/// \n\t/// 与えられた 2 つの数値からべき剰余を計算します.\n\t/// \n\t/// べき乗の底\n\t/// べき指数\n\t/// 繰り返し二乗法により O(N log N) で実行されます.\n\tpublic static ModInt Pow(ModInt v, long k) { return Pow(v.num, k); }\n\n\t/// \n\t/// 与えられた 2 つの数値からべき剰余を計算します.\n\t/// \n\t/// べき乗の底\n\t/// べき指数\n\t/// 繰り返し二乗法により O(N log N) で実行されます.\n\tpublic static ModInt Pow(long v, long k) {\n\t\tlong ret = 1;\n\t\tfor (k %= Mod - 1; k > 0; k >>= 1, v = v * v % Mod)\n\t\t\tif ((k & 1) == 1) ret = ret * v % Mod;\n\t\treturn new ModInt(ret);\n\t}\n\t/// \n\t/// 与えられた数の逆元を計算します.\n\t/// \n\t/// 逆元を取る対象となる数\n\t/// 逆元となるような値\n\t/// 法が素数であることを仮定して,フェルマーの小定理に従って逆元を O(log N) で計算します.\n\tpublic static ModInt Inverse(ModInt v) { return Pow(v, Mod - 2); }\n}\n#endregion\n\n#region Matrix\npublic class Matrix {\n\tint row, col;\n\tpublic N[] mat;\n\t/// \n\t/// 列目の要素へのアクセスを提供します。\n\t/// \n\t/// 行の番号\n\t/// 列の番号\n\tpublic N this[int r, int c] {\n\t\tget { return mat[r * col + c]; }\n\t\tset { mat[r * col + c] = value; }\n\t}\n\tpublic Matrix(int r, int c) {\n\t\trow = r; col = c;\n\t\tmat = new N[row * col];\n\t}\n\tpublic static Matrix operator *(Matrix l, Matrix r) {\n\t\tSystem.Diagnostics.Debug.Assert(l.col == r.row);\n\t\tvar ret = new Matrix(l.row, r.col);\n\t\tfor (int i = 0; i < l.row; i++)\n\t\t\tfor (int k = 0; k < l.col; k++)\n\t\t\t\tfor (int j = 0; j < r.col; j++)\n\t\t\t\t\tret.mat[i * r.col + j] = (ret.mat[i * r.col + j] + l.mat[i * l.col + k] * r.mat[k * r.col + j]) % ModInt.Mod;\n\t\treturn ret;\n\t}\n\t/// \n\t/// ^ を O(^3 log ) で計算します。\n\t/// \n\tpublic static Matrix Pow(Matrix m, long n) {\n\t\tvar ret = new Matrix(m.row, m.col);\n\t\tfor (int i = 0; i < m.row; i++)\n\t\t\tret.mat[i * m.col + i] = 1;\n\t\tfor (; n > 0; m *= m, n >>= 1)\n\t\t\tif ((n & 1) == 1)\n\t\t\t\tret = ret * m;\n\t\treturn ret;\n\n\t}\n\tpublic N[][] Items {\n\t\tget {\n\t\t\tvar a = new N[row][];\n\t\t\tfor (int i = 0; i < row; i++) {\n\t\t\t\ta[i] = new N[col];\n\t\t\t\tfor (int j = 0; j < col; j++)\n\t\t\t\t\ta[i][j] = mat[i * col + j];\n\t\t\t}\n\t\t\treturn a;\n\t\t}\n\t}\n}\n#endregion\n", "lang": "Mono C#", "bug_code_uid": "2a8146ae05444d4b8d1be0fe691073c7", "src_uid": "77f28d155a632ceaabd9f5a9d846461a", "apr_id": "8404a98cae80f0a79256891ccfdc37fe", "difficulty": 2300, "tags": ["matrices", "dp", "combinatorics", "probabilities"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.7115594329334788, "equal_cnt": 176, "replace_cnt": 116, "delete_cnt": 18, "insert_cnt": 41, "fix_ops_cnt": 175, "bug_source_code": "using System.Collections.Generic;\nusing System.Collections;\nusing System.ComponentModel;\nusing System.Diagnostics.CodeAnalysis;\nusing System.Globalization;\nusing System.IO;\nusing System.Linq;\nusing System.Reflection;\nusing System.Runtime.Serialization;\nusing System.Text.RegularExpressions;\nusing System.Text;\nusing System;\nusing System.Numerics;\n\nclass Solution\n{\n public class GCD\n {\n\t\tpublic static int Euclidean(int n1, int n2)\n\t\t{\n\t\t\tif (n1 == n2) return n1;\n\t\t\telse if (n1 < n2)\n\t\t\t{\n\t\t\t\tvar tmp = n1;\n\t\t\t\tn1 = n2;\n\t\t\t\tn2 = tmp;\n\t\t\t}\n\n\t\t\twhile (n1 % n2 > 0)\n\t\t\t{\n\t\t\t\tvar tmp = n2;\n\t\t\t\tn2 = n1 % n2;\n\t\t\t\tn1 = tmp;\n\t\t\t}\n\t\t\treturn n2;\n\t\t}\n public static ulong Euclidean(ulong n1, ulong n2)\n\t\t{\n\t\t\tif (n1 == n2) return n1;\n\t\t\telse if (n1 < n2)\n\t\t\t{\n\t\t\t\tvar tmp = n1;\n\t\t\t\tn1 = n2;\n\t\t\t\tn2 = tmp;\n\t\t\t}\n\n\t\t\twhile (n1 % n2 > 0)\n\t\t\t{\n\t\t\t\tvar tmp = n2;\n\t\t\t\tn2 = n1 % n2;\n\t\t\t\tn1 = tmp;\n\t\t\t}\n\t\t\treturn n2;\n\t\t}\n\n public static long Inverse(long a, long n)\n\t\t{\n long x, y =0;\n EuclideanExt(a, n, out x, out y);\n return x<0?n+x:x;\n }\n\n public static long EuclideanExt(long n1, long n2, out long x, out long y)\n\t\t{\n x = 0;\n y = 1; \n \n bool r = false;\n\t\t\tif (n1 == n2) return n1;\n\n\t\t\telse if (n1 < n2)\n\t\t\t{\n r = true;\n\t\t\t\tvar tmp = n1;\n\t\t\t\tn1 = n2;\n\t\t\t\tn2 = tmp;\n\t\t\t}\n long q = 0;\n long xl =1;\n long yl = 0;\n\n\t\t\twhile (n2 > 0)\n\t\t\t{\n q = n1 / n2;\n\n\t\t\t\tvar tmp = n2;\n\t\t\t\tn2 = n1 % n2;\n\t\t\t\tn1 = tmp;\n\n tmp = x;\n x = xl - q *x;\n xl = tmp ;\n\n tmp = y;\n y = yl - q*y;\n yl = tmp;\n\n\n\t\t\t}\n x = xl;\n y = yl;\n if (r)\n { \n x =yl;\n y =xl;\n }\n\t\t\treturn x*n1+y*n2;\n\t\t}\n\t}\n static Tuple sum(Tuple a, Tuple b)\n {\n if (a.Item1 == 0)\n return b;\n if(b.Item1 == 0)\n return a;\n return Tuple.Create(\n ((a.Item1 * b.Item2) % mod + (b.Item1 * a.Item2) % mod) % mod,\n (a.Item2 * b.Item2) % mod\n );\n }\n\n static Tuple prod(Tuple a, Tuple b)\n {\n return Tuple.Create(\n (a.Item1 * b.Item1) %mod,\n (a.Item2 * b.Item2) % mod\n );\n }\n\n \n\n static Tuple PInOneSide(uint cnt, uint totalcnt)\n {\n return Tuple.Create(\n cnt * (cnt - 1) + (totalcnt - cnt) * (totalcnt - cnt - 1),\n totalcnt * (totalcnt - 1)\n );\n }\n\n static Tuple PIncreaseLeftA(uint leftCnt, uint leftACnt, uint totalcnt)\n {\n return Tuple.Create(\n (leftCnt - leftACnt) * (leftCnt - leftACnt),\n (totalcnt * (totalcnt - 1)) / 2\n );\n }\n\n static Tuple PDecreaseLeftA(uint leftCnt, uint leftACnt, uint totalcnt)\n {\n return Tuple.Create(\n leftACnt * (totalcnt - 2 * leftCnt + leftACnt),\n (totalcnt * (totalcnt - 1)) / 2\n );\n }\n\n static void CalcCashe(uint lowerBnd, uint leftCnt, uint totalcnt)\n {\n PInOneSideCache = PInOneSide(leftCnt, totalcnt);\n \n PIncreaseLeftACache = new Tuple[leftCnt - lowerBnd + 1];\n PDecreaseLeftACache = new Tuple[leftCnt - lowerBnd + 1];\n PSameInBothSideCache = new Tuple[leftCnt - lowerBnd + 1];\n\n for(uint i =lowerBnd; i <= leftCnt; i++)\n {\n PIncreaseLeftACache[(int)(i - lowerBnd)] = PIncreaseLeftA(leftCnt, i, totalcnt);\n PDecreaseLeftACache[(int)(i - lowerBnd)] = PDecreaseLeftA(leftCnt, i, totalcnt);\n PSameInBothSideCache[(int)(i - lowerBnd)] = PSameInBothSide(leftCnt, i, totalcnt);\n }\n }\n static Tuple PInOneSideCache;\n static Tuple[] PSameInBothSideCache;\n static Tuple[] PIncreaseLeftACache;\n static Tuple[] PDecreaseLeftACache;\n static Tuple PSameInBothSide(uint leftCnt, uint leftACnt, uint totalcnt)\n {\n \n return Tuple.Create(\n (leftCnt - leftACnt) * (totalcnt + 2 * leftACnt - 2 * leftCnt),\n (totalcnt * (totalcnt - 1)) / 2\n );\n }\n\n const ulong mod = 1000000007L;\n static void Main(string[] args)\n {\n\n // var n = int.Parse( Console.ReadLine());\n var tmp = Array.ConvertAll(Console.ReadLine().Trim().Split(), Convert.ToUInt64);\n var n = (uint)tmp[0];\n var k = tmp[1];\n\n var arr = Array.ConvertAll(Console.ReadLine().Trim().Split(), Convert.ToByte);\n\n var leftcnt = (uint)arr.Count(el=>el==0);\n var leftAcnt = (uint)arr.Where((el, i)=>el == 0 && i[] F =Enumerable.Repeat(0, (int)(leftcnt - lowerBnd+1))\n .Select(el =>new Tuple(0, 0)).ToArray(); \n\n F[leftAcnt - lowerBnd] = Tuple.Create(1ul,1ul);\n\n CalcCashe(lowerBnd,leftcnt, n);\n\n for(ulong j = 0; j < k; j++)\n {\n Tuple[] Ftmp = new Tuple[leftcnt - lowerBnd+1];\n\n for(uint i =0; i <= leftcnt - lowerBnd; i++) \n {\n \n var res = prod(F[i], PInOneSideCache);\n res = sum(res,prod(F[i], PSameInBothSideCache[i]));\n if (i > 0)\n res = sum(res,prod(F[i - 1], PIncreaseLeftACache[i-1]));\n if (i < leftcnt - lowerBnd)\n res = sum(res,prod(F[i + 1], PDecreaseLeftACache[i+1]));\n Ftmp[i] = res;\n }\n F = Ftmp;\n }\n if (F.Last().Item1 ==0)\n {\n Console.WriteLine(\"0\");\n return;\n }\n var gcd = GCD.Euclidean(F.Last().Item1, F.Last().Item2);\n var ret = Tuple.Create(F.Last().Item1 / gcd, F.Last().Item2 / gcd);\n\n var ret2 = ((long)ret.Item1 * GCD.Inverse((long)ret.Item2, (long)mod )) % (long)mod;\n\n Console.WriteLine($\"{ret2}\");\n\n }\n}", "lang": "Mono C#", "bug_code_uid": "727f78e15962b2c82a0463edf618ad99", "src_uid": "77f28d155a632ceaabd9f5a9d846461a", "apr_id": "6bcc1191df9d6e2aaf27e9a9920699ff", "difficulty": 2300, "tags": ["matrices", "dp", "combinatorics", "probabilities"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.709382463323098, "equal_cnt": 178, "replace_cnt": 116, "delete_cnt": 19, "insert_cnt": 42, "fix_ops_cnt": 177, "bug_source_code": "using System.Collections.Generic;\nusing System.Collections;\nusing System.ComponentModel;\nusing System.Diagnostics.CodeAnalysis;\nusing System.Globalization;\nusing System.IO;\nusing System.Linq;\nusing System.Reflection;\nusing System.Runtime.Serialization;\nusing System.Text.RegularExpressions;\nusing System.Text;\nusing System;\nusing System.Numerics;\n\nclass Solution\n{\n public class GCD\n {\n\t\tpublic static int Euclidean(int n1, int n2)\n\t\t{\n\t\t\tif (n1 == n2) return n1;\n\t\t\telse if (n1 < n2)\n\t\t\t{\n\t\t\t\tvar tmp = n1;\n\t\t\t\tn1 = n2;\n\t\t\t\tn2 = tmp;\n\t\t\t}\n\n\t\t\twhile (n1 % n2 > 0)\n\t\t\t{\n\t\t\t\tvar tmp = n2;\n\t\t\t\tn2 = n1 % n2;\n\t\t\t\tn1 = tmp;\n\t\t\t}\n\t\t\treturn n2;\n\t\t}\n public static ulong Euclidean(ulong n1, ulong n2)\n\t\t{\n\t\t\tif (n1 == n2) return n1;\n\t\t\telse if (n1 < n2)\n\t\t\t{\n\t\t\t\tvar tmp = n1;\n\t\t\t\tn1 = n2;\n\t\t\t\tn2 = tmp;\n\t\t\t}\n\n\t\t\twhile (n1 % n2 > 0)\n\t\t\t{\n\t\t\t\tvar tmp = n2;\n\t\t\t\tn2 = n1 % n2;\n\t\t\t\tn1 = tmp;\n\t\t\t}\n\t\t\treturn n2;\n\t\t}\n\n public static long Inverse(long a, long n)\n\t\t{\n long x, y =0;\n EuclideanExt(a, n, out x, out y);\n return x<0?n+x:x;\n }\n\n public static long EuclideanExt(long n1, long n2, out long x, out long y)\n\t\t{\n x = 0;\n y = 1; \n \n bool r = false;\n\t\t\tif (n1 == n2) return n1;\n\n\t\t\telse if (n1 < n2)\n\t\t\t{\n r = true;\n\t\t\t\tvar tmp = n1;\n\t\t\t\tn1 = n2;\n\t\t\t\tn2 = tmp;\n\t\t\t}\n long q = 0;\n long xl =1;\n long yl = 0;\n\n\t\t\twhile (n2 > 0)\n\t\t\t{\n q = n1 / n2;\n\n\t\t\t\tvar tmp = n2;\n\t\t\t\tn2 = n1 % n2;\n\t\t\t\tn1 = tmp;\n\n tmp = x;\n x = xl - q *x;\n xl = tmp ;\n\n tmp = y;\n y = yl - q*y;\n yl = tmp;\n\n\n\t\t\t}\n x = xl;\n y = yl;\n if (r)\n { \n x =yl;\n y =xl;\n }\n\t\t\treturn x*n1+y*n2;\n\t\t}\n\t}\n static Tuple sum(Tuple a, Tuple b)\n {\n if (a.Item1 == 0)\n return b;\n if(b.Item1 == 0)\n return a;\n return Tuple.Create(\n ((a.Item1 * b.Item2) % mod + (b.Item1 * a.Item2) % mod) % mod,\n (a.Item2 * b.Item2) % mod\n );\n }\n\n static Tuple prod(Tuple a, Tuple b)\n {\n return Tuple.Create(\n (a.Item1 * b.Item1) %mod,\n (a.Item2 * b.Item2) % mod\n );\n }\n\n \n\n static Tuple PInOneSide(uint cnt, uint totalcnt)\n {\n return Tuple.Create(\n cnt * (cnt - 1) + (totalcnt - cnt) * (totalcnt - cnt - 1),\n totalcnt * (totalcnt - 1)\n );\n }\n\n static Tuple PIncreaseLeftA(uint leftCnt, uint leftACnt, uint totalcnt)\n {\n return Tuple.Create(\n (leftCnt - leftACnt) * (leftCnt - leftACnt),\n (totalcnt * (totalcnt - 1)) / 2\n );\n }\n\n static Tuple PDecreaseLeftA(uint leftCnt, uint leftACnt, uint totalcnt)\n {\n return Tuple.Create(\n leftACnt * (totalcnt - 2 * leftCnt + leftACnt),\n (totalcnt * (totalcnt - 1)) / 2\n );\n }\n\n static void CalcCashe(uint lowerBnd, uint leftCnt, uint totalcnt)\n {\n PInOneSideCache = PInOneSide(leftCnt, totalcnt);\n \n PIncreaseLeftACache = new Tuple[leftCnt - lowerBnd + 1];\n PDecreaseLeftACache = new Tuple[leftCnt - lowerBnd + 1];\n PSameInBothSideCache = new Tuple[leftCnt - lowerBnd + 1];\n\n for(uint i =lowerBnd; i <= leftCnt; i++)\n {\n PIncreaseLeftACache[(int)(i - lowerBnd)] = PIncreaseLeftA(leftCnt, i, totalcnt);\n PDecreaseLeftACache[(int)(i - lowerBnd)] = PDecreaseLeftA(leftCnt, i, totalcnt);\n PSameInBothSideCache[(int)(i - lowerBnd)] = PSameInBothSide(leftCnt, i, totalcnt);\n }\n }\n static Tuple PInOneSideCache;\n static Tuple[] PSameInBothSideCache;\n static Tuple[] PIncreaseLeftACache;\n static Tuple[] PDecreaseLeftACache;\n static Tuple PSameInBothSide(uint leftCnt, uint leftACnt, uint totalcnt)\n {\n \n return Tuple.Create(\n (leftCnt - leftACnt) * (totalcnt + 2 * leftACnt - 2 * leftCnt),\n (totalcnt * (totalcnt - 1)) / 2\n );\n }\n\n const ulong mod = 1000000007L;\n static void Main(string[] args)\n {\n\n // var n = int.Parse( Console.ReadLine());\n var tmp = Array.ConvertAll(Console.ReadLine().Trim().Split(), Convert.ToUInt64);\n var n = (uint)tmp[0];\n var k = tmp[1];\n\n var arr = Array.ConvertAll(Console.ReadLine().Trim().Split(), Convert.ToByte);\n\n var leftcnt = (uint)arr.Count(el=>el==0);\n var leftAcnt = (uint)arr.Where((el, i)=>el == 0 && i[] F =Enumerable.Repeat(0, (int)(leftcnt - lowerBnd+1))\n .Select(el =>new Tuple(0, 0)).ToArray(); \n\n F[leftAcnt - lowerBnd] = Tuple.Create(1ul,1ul);\n\n CalcCashe(lowerBnd,leftcnt, n);\n\n for(ulong j = 0; j < k; j++)\n {\n Tuple[] Ftmp = new Tuple[leftcnt - lowerBnd+1];\n\n for(uint i =0; i <= leftcnt - lowerBnd; i++) \n {\n \n var res = prod(F[i], PInOneSideCache);\n res = sum(res,prod(F[i], PSameInBothSideCache[i]));\n if (i > 0)\n res = sum(res,prod(F[i - 1], PIncreaseLeftACache[i-1]));\n if (i < leftcnt - lowerBnd)\n res = sum(res,prod(F[i + 1], PDecreaseLeftACache[i+1]));\n Ftmp[i] = res;\n }\n F = Ftmp;\n }\n if (F.Last().Item1 ==0)\n {\n Console.WriteLine(\"0\");\n return;\n }\n var gcd = GCD.Euclidean(F.Last().Item1, F.Last().Item2);\n var ret = Tuple.Create(F.Last().Item1 / gcd, F.Last().Item2 / gcd);\n\n var ret2 = ((long)ret.Item1 * GCD.Inverse((long)ret.Item2, (long)mod )) % (long)mod;\n\n Console.WriteLine($\"{ret2}\");\n\n }\n}", "lang": "Mono C#", "bug_code_uid": "a67d1e28a0987eb9f36b122304f35ed0", "src_uid": "77f28d155a632ceaabd9f5a9d846461a", "apr_id": "6bcc1191df9d6e2aaf27e9a9920699ff", "difficulty": 2300, "tags": ["matrices", "dp", "combinatorics", "probabilities"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9982035295360879, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "namespace ContestRuns\n{\n using System;\n using System.Collections.Generic;\n using System.Dynamic;\n using System.Globalization;\n using System.IO;\n //using System.Linq;\n using System.Text;\n\n using System.ComponentModel;\n using System.Linq;\n using System.ServiceProcess;\n\n class Program\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#else\n static readonly TextReader input = Console.In;\n static readonly TextWriter output = Console.Out;\n#endif\n class Node\n {\n //public List child = new List();\n public bool HasParent;\n public int Parent;\n public bool IsLeaf;\n public int LeafChild;\n public int Child;\n };\n \n class Edge1\n {\n public int from, to;\n public decimal dist;\n };\n \n private static void SolveA()\n {\n //long[] inp = input.ReadLine().Split(' ').Select(long.Parse).ToArray();\n long n = long.Parse(input.ReadLine()), m = long.Parse(input.ReadLine());\n long r = 1;\n int i = 0;\n for (; m/2 >= r &&i m || m / 2 < r && i < n)\n {\n output.WriteLine(m);\n return;\n }\n\n output.WriteLine(m%r);\n }\n\n private static void SolveB()\n {\n //long[] inp = input.ReadLine().Split(' ').Select(long.Parse).ToArray();\n int n = int.Parse(input.ReadLine());\n Node[] all = new Node[n + 1];\n for (int i = 1; i < n; ++i)\n {\n int parent = int.Parse(input.ReadLine());\n all[parent] = all[parent] ?? new Node();\n all[parent].Child += 1;\n all[i + 1] = all[i + 1] ?? new Node();\n all[i + 1].HasParent = true;\n all[i + 1].Parent = parent;\n }\n\n for (int i = 1; i <= n; ++i)\n {\n if (all[i].HasParent && all[i].Child == 0)\n {\n all[i].IsLeaf = true;\n all[all[i].Parent].LeafChild += 1;\n }\n }\n\n for (int i = 1; i <= n; ++i)\n {\n if (all[i] == null)\n {\n output.WriteLine(\"No\");\n return;\n }\n\n if (all[i].IsLeaf)\n {\n continue;\n }\n\n if (all[i].LeafChild < 3)\n {\n output.WriteLine(\"No\");\n return;\n }\n }\n\n output.WriteLine(\"Yes\");\n }\n private static void SolveC()\n {\n long[] nL = input.ReadLine().Split(' ').Select(long.Parse).ToArray();\n long n = nL[0];\n long L = nL[1];\n long[] inp = input.ReadLine().Split(' ').Select(long.Parse).ToArray();\n\n long prev = inp[0];\n\n for (int i = inp.Length - 2; i >= 0; --i)\n {\n inp[i] = Math.Min(inp[i + 1], inp[i]);\n }\n\n for (int i = 1; i < inp.Length; ++i)\n {\n inp[i] = Math.Min(inp[i], 2*prev);\n prev = inp[i];\n }\n\n for (int i = inp.Length - 2; i >=0; --i)\n {\n inp[i] = Math.Min(inp[i + 1], inp[i]);\n }\n\n for (int i = 1; i < inp.Length; ++i)\n {\n inp[i] = Math.Min(inp[i], 2 * prev);\n prev = inp[i];\n }\n\n long []pows =new long[n + 1];\n pows[0] = 1;\n for (int i = 1; i <= n; ++i)\n {\n pows[i] = pows[i - 1] * 2;\n }\n\n long res = 0;\n List other = new List();\n long cur = n - 1;\n for (;L > 0;)\n {\n while (pows[cur] > L)\n {\n other.Add(res + inp[cur]);\n cur -= 1;\n }\n\n long cnt = L / pows[cur];\n \n long newRes = res + cnt * inp[cur];\n L -= cnt * pows[cur];\n if (L > 0)\n {\n other.Add(newRes + inp[cur]);\n }\n\n res = newRes;\n }\n\n output.WriteLine(Math.Min(other.Min(), res));\n }\n static void Main(string[] args)\n {\n SolveC();\n output.Flush();\n }\n }\n}", "lang": "MS C#", "bug_code_uid": "22d355314055a95828bd00961d1d75a3", "src_uid": "04ca137d0383c03944e3ce1c502c635b", "apr_id": "8423cf6c28d42f797525d17982c8dccd", "difficulty": 1600, "tags": ["dp", "greedy", "bitmasks"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.944666001994018, "equal_cnt": 7, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 6, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\n\nnamespace Contests {\n\n static class Program {\n\n static void Main (string[] args) {\n var line = Console.ReadLine ().Split (' ');\n\n var n = int.Parse (line[0]);\n var L = int.Parse (line[1]);\n\n var costs = Console.ReadLine ().Split (' ').Select (selector: int.Parse).ToList ();\n\n var leftMins = new long[n];\n var rightMins = new long[n];\n\n leftMins[0] = costs[0];\n var prevCost = leftMins[0];\n for (var i = 1; i < n; i++) {\n leftMins[i] = Math.Min (costs[i], 2 * prevCost);\n prevCost = leftMins[i];\n }\n\n rightMins[n - 1] = leftMins[n - 1];\n for (var i = n - 2; i >= 0; i--) {\n rightMins[i] = Math.Min (leftMins[i], rightMins[i + 1]);\n }\n\n Console.WriteLine (FindMin (L, leftMins, rightMins));\n }\n\n static long FindMin (long value, long[] leftMins, long[] rightMins) {\n var index = (int) Math.Floor (Math.Log (value, 2));\n var rightMin = FindRightMin (index + 1, rightMins);\n var leftMin = FindLeftMin (value, index, leftMins, rightMins);\n\n return Math.Min (rightMin, leftMin);\n }\n\n static long FindLeftMin (long value, int index, long[] leftMins, long[] rightMins) {\n if (index == 0) {\n return leftMins[0];\n }\n\n var count = value >> index;\n var cost = count * leftMins[index];\n value -= count << index;\n\n if (value == 0) {\n return cost;\n }\n\n return cost + FindMin (value, leftMins, rightMins);\n }\n\n static long FindRightMin (int index, long[] rightMins) {\n if (rightMins.Length > index) {\n return rightMins[index];\n }\n\n return long.MaxValue;\n }\n }\n}", "lang": "MS C#", "bug_code_uid": "529157276a22d410e84660d313c39554", "src_uid": "04ca137d0383c03944e3ce1c502c635b", "apr_id": "4c3dd57284550bc9a87c2adbcdc28ca3", "difficulty": 1600, "tags": ["dp", "greedy", "bitmasks"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9232354881266491, "equal_cnt": 18, "replace_cnt": 9, "delete_cnt": 3, "insert_cnt": 5, "fix_ops_cnt": 17, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing CompLib.Util;\nusing System.Threading;\nusing CompLib.Mathematics;\n\npublic class Program\n{\n private int M;\n\n public void Solve()\n {\n var sc = new Scanner();\n M = sc.NextInt();\n\n /*\n * 空配列a, M\n *\n * 0 -> 生き残ってる素因数 -> 1までの回数期待値\n *\n * 生き残ってる素因数\n * \n */\n\n /*\n * 1 1/4 0回 \n * 2 1/2 2回\n * 3 1/4 4/3回\n *\n * 1/4, 1/2, 1/4\n */\n\n // 1/4 + 3/2 + 7/12\n Console.WriteLine(Go(0));\n }\n\n ModInt Go(int cur)\n {\n if (cur == 1) return 0;\n ModInt ans = 0;\n // curの倍数が出る\n ModInt tmp = cur == 0 ? 1 : (M - M / cur) * ModInt.Inverse(M);\n ModInt tmp2 = cur == 0 ? ModInt.Inverse(M) : ModInt.Inverse(M - M / cur);\n\n for (int i = 1; i <= M; i++)\n {\n int gcd = MathEx.GCD(cur, i);\n if (gcd == cur) continue;\n ans += (Go(gcd) + ModInt.Inverse(tmp)) * tmp2;\n }\n\n return ans;\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.Collections\n{\n using System.Collections.Generic;\n\n public class HashMap : Dictionary\n {\n public new TValue this[TKey key]\n {\n get\n {\n TValue o;\n return TryGetValue(key, out o) ? o : default(TValue);\n }\n set { base[key] = value; }\n }\n }\n}\n\nnamespace CompLib.Mathematics\n{\n public static partial class Combinatorics\n {\n private const int Max = 5000000;\n private static ModInt[] F;\n\n static Combinatorics()\n {\n F = new ModInt[Max + 1];\n F[0] = 1;\n for (int i = 1; i <= Max; i++)\n {\n F[i] = F[i - 1] * i;\n }\n }\n\n /// \n /// 階乗 n!\n /// \n /// \n /// \n public static ModInt Factorial(int n)\n {\n return F[n];\n }\n\n /// \n /// 順列\n /// \n /// \n /// n個からm個選んで並べる\n /// \n /// \n /// \n /// \n public static ModInt P(int n, int m)\n {\n return F[n] * ModInt.Inverse(F[n - m]);\n }\n\n /// \n /// 組み合わせ\n /// \n /// \n /// n個からm個取り出す\n /// \n /// \n /// \n /// \n public static ModInt C(int n, int m)\n {\n return F[n] * ModInt.Inverse(F[n - m] * F[m]);\n }\n\n /// \n /// 重複組み合わせ\n /// \n /// \n /// n種類のものから重複を許して r個選ぶ\n /// \n /// \n /// \n /// \n public static ModInt H(int n, int r)\n {\n return C(n + r - 1, r);\n }\n }\n}\n\n// https://bitbucket.org/camypaper/complib\nnamespace CompLib.Mathematics\n{\n using System;\n using System.Collections.Generic;\n\n #region GCD LCM\n\n /// \n /// 様々な数学的関数の静的メソッドを提供します.\n /// \n public static partial class MathEx\n {\n /// \n /// 2 つの整数の最大公約数を求めます.\n /// \n /// 最初の値\n /// 2 番目の値\n /// 2 つの整数の最大公約数\n /// ユークリッドの互除法に基づき最悪計算量 O(log N) で実行されます.\n public static int GCD(int n, int m)\n {\n return (int) GCD((long) n, m);\n }\n\n\n /// \n /// 2 つの整数の最大公約数を求めます.\n /// \n /// 最初の値\n /// 2 番目の値\n /// 2 つの整数の最大公約数\n /// ユークリッドの互除法に基づき最悪計算量 O(log N) で実行されます.\n public static long GCD(long n, long m)\n {\n n = Math.Abs(n);\n m = Math.Abs(m);\n while (n != 0)\n {\n m %= n;\n if (m == 0) return n;\n n %= m;\n }\n\n return m;\n }\n\n\n /// \n /// 2 つの整数の最小公倍数を求めます.\n /// \n /// 最初の値\n /// 2 番目の値\n /// 2 つの整数の最小公倍数\n /// 最悪計算量 O(log N) で実行されます.\n public static long LCM(long n, long m)\n {\n return (n / GCD(n, m)) * m;\n }\n }\n\n #endregion\n\n #region PrimeSieve\n\n public static partial class MathEx\n {\n /// \n /// ある値までに素数表を構築します.\n /// \n /// 最大の値\n /// 素数のみを入れた数列が返される\n /// 0 から max までの素数表\n /// エラトステネスの篩に基づき,最悪計算量 O(N loglog N) で実行されます.\n public static bool[] Sieve(int max, List primes = null)\n {\n var isPrime = new bool[max + 1];\n for (int i = 2; i < isPrime.Length; i++) isPrime[i] = true;\n for (int i = 2; i * i <= max; i++)\n if (!isPrime[i]) continue;\n else\n for (int j = i * i; j <= max; j += i)\n isPrime[j] = false;\n if (primes != null)\n for (int i = 0; i <= max; i++)\n if (isPrime[i])\n primes.Add(i);\n\n return isPrime;\n }\n }\n\n #endregion\n}\n\n// https://bitbucket.org/camypaper/complib\nnamespace CompLib.Mathematics\n{\n #region ModInt\n\n /// \n /// [0,) までの値を取るような数\n /// \n public struct ModInt\n {\n /// \n /// 剰余を取る値.\n /// \n public const long Mod = (int) 1e9 + 7;\n // public const long Mod = 998244353;\n\n /// \n /// 実際の数値.\n /// \n public long num;\n\n /// \n /// 値が であるようなインスタンスを構築します.\n /// \n /// インスタンスが持つ値\n /// パフォーマンスの問題上,コンストラクタ内では剰余を取りません.そのため, ∈ [0,) を満たすような を渡してください.このコンストラクタは O(1) で実行されます.\n public ModInt(long n)\n {\n num = n;\n }\n\n /// \n /// このインスタンスの数値を文字列に変換します.\n /// \n /// [0,) の範囲内の整数を 10 進表記したもの.\n public override string ToString()\n {\n return num.ToString();\n }\n\n public static ModInt operator +(ModInt l, ModInt r)\n {\n l.num += r.num;\n if (l.num >= Mod) l.num -= Mod;\n return l;\n }\n\n public static ModInt operator -(ModInt l, ModInt r)\n {\n l.num -= r.num;\n if (l.num < 0) l.num += Mod;\n return l;\n }\n\n public static ModInt operator *(ModInt l, ModInt r)\n {\n return new ModInt(l.num * r.num % Mod);\n }\n\n public static implicit operator ModInt(long n)\n {\n n %= Mod;\n if (n < 0) n += Mod;\n return new ModInt(n);\n }\n\n /// \n /// 与えられた 2 つの数値からべき剰余を計算します.\n /// \n /// べき乗の底\n /// べき指数\n /// 繰り返し二乗法により O(N log N) で実行されます.\n public static ModInt Pow(ModInt v, long k)\n {\n return Pow(v.num, k);\n }\n\n /// \n /// 与えられた 2 つの数値からべき剰余を計算します.\n /// \n /// べき乗の底\n /// べき指数\n /// 繰り返し二乗法により O(N log N) で実行されます.\n public static ModInt Pow(long v, long k)\n {\n long ret = 1;\n for (k %= Mod - 1; k > 0; k >>= 1, v = v * v % Mod)\n if ((k & 1) == 1)\n ret = ret * v % Mod;\n return new ModInt(ret);\n }\n\n /// \n /// 与えられた数の逆元を計算します.\n /// \n /// 逆元を取る対象となる数\n /// 逆元となるような値\n /// 法が素数であることを仮定して,フェルマーの小定理に従って逆元を O(log N) で計算します.\n public static ModInt Inverse(ModInt v)\n {\n return Pow(v, Mod - 2);\n }\n }\n\n #endregion\n\n #region Binomial Coefficient\n\n public class BinomialCoefficient\n {\n public ModInt[] fact, ifact;\n\n public BinomialCoefficient(int n)\n {\n fact = new ModInt[n + 1];\n ifact = new ModInt[n + 1];\n fact[0] = 1;\n for (int i = 1; i <= n; i++)\n fact[i] = fact[i - 1] * i;\n ifact[n] = ModInt.Inverse(fact[n]);\n for (int i = n - 1; i >= 0; i--)\n ifact[i] = ifact[i + 1] * (i + 1);\n ifact[0] = ifact[1];\n }\n\n public ModInt this[int n, int r]\n {\n get\n {\n if (n < 0 || n >= fact.Length || r < 0 || r > n) return 0;\n return fact[n] * ifact[n - r] * ifact[r];\n }\n }\n\n public ModInt RepeatedCombination(int n, int k)\n {\n if (k == 0) return 1;\n return this[n + k - 1, k];\n }\n }\n\n #endregion\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 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": "60af5b80f8155df6ea02a731316d4eb0", "src_uid": "ff810b16b6f41d57c1c8241ad960cba0", "apr_id": "02133273920baa61e4f7d5c4f0202de5", "difficulty": 2300, "tags": ["dp", "math", "probabilities", "number theory"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.0031992687385740404, "equal_cnt": 8, "replace_cnt": 8, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 9, "bug_source_code": "\n if (m % i != 0 && m % i <= item) ++coef;", "lang": "Mono C#", "bug_code_uid": "48ccbd1bc189d77e9f910251a35c0ce2", "src_uid": "ff810b16b6f41d57c1c8241ad960cba0", "apr_id": "ff5d507c3ee5ff35ac6b72fec085857c", "difficulty": 2300, "tags": ["dp", "math", "probabilities", "number theory"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9868421052631579, "equal_cnt": 8, "replace_cnt": 4, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 7, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\nusing static System.Math;\nusing System.Text;\nusing System.Threading;\nusing System.Globalization;\nusing System.Runtime.CompilerServices;\nusing Library;\n\nnamespace Program\n{\n public static class CODEFORCES1\n {\n static public int numberOfRandomCases = 0;\n static public void MakeTestCase(List _input, List _output, ref Func _outputChecker)\n {\n }\n static public void Solve()\n {\n var m = NN;\n var dp = new LIB_Mod[m + 1];\n LIB_Mod ans = 1;\n for (var i = 2; i <= m; i++)\n {\n LIB_Mod space = (m - m / i);\n dp[i] = m / space;\n foreach (var item in LIB_Math.Divisor(i))\n {\n if (item == 1 || item == i) continue;\n var ceil = m / item;\n LIB_Mod coef = 0;\n foreach (var item2 in LIB_Math.Divisor(i / item))\n {\n var ary = LIB_Math.Factors(item2).ToArray();\n if (ary.Count() == ary.Distinct().Count())\n {\n if (ary.Count() % 2 == 1)\n {\n coef -= ceil / item2;\n }\n else\n {\n coef += ceil / item2;\n }\n }\n }\n dp[i] += dp[item] * coef / space;\n }\n ans += dp[i] / m;\n }\n Console.WriteLine(ans);\n }\n static class Console_\n {\n static Queue param = new Queue();\n public static string NextString() { if (param.Count == 0) foreach (var item in Console.ReadLine().Split(' ')) param.Enqueue(item); return param.Dequeue(); }\n }\n class Printer : StreamWriter\n {\n public override IFormatProvider FormatProvider { get { return CultureInfo.InvariantCulture; } }\n public Printer(Stream stream) : base(stream, new UTF8Encoding(false, true)) { base.AutoFlush = false; }\n public Printer(Stream stream, Encoding encoding) : base(stream, encoding) { base.AutoFlush = false; }\n }\n static public void Main(string[] args) { if (args.Length == 0) { Console.SetOut(new Printer(Console.OpenStandardOutput())); } var t = new Thread(Solve, 134217728); t.Start(); t.Join(); Console.Out.Flush(); }\n static long NN => long.Parse(Console_.NextString());\n static double ND => double.Parse(Console_.NextString());\n static string NS => Console_.NextString();\n static long[] NNList(long N) => Repeat(0, N).Select(_ => NN).ToArray();\n static double[] NDList(long N) => Repeat(0, N).Select(_ => ND).ToArray();\n static string[] NSList(long N) => Repeat(0, N).Select(_ => NS).ToArray();\n static IEnumerable OrderByRand(this IEnumerable x) => x.OrderBy(_ => xorshift);\n static long Count(this IEnumerable x, Func pred) => Enumerable.Count(x, pred);\n static IEnumerable Repeat(T v, long n) => Enumerable.Repeat(v, (int)n);\n static IEnumerable Range(long s, long c) => Enumerable.Range((int)s, (int)c);\n static uint xorshift { get { _xsi.MoveNext(); return _xsi.Current; } }\n static IEnumerator _xsi = _xsc();\n static IEnumerator _xsc() { uint x = 123456789, y = 362436069, z = 521288629, w = (uint)(DateTime.Now.Ticks & 0xffffffff); while (true) { var t = x ^ (x << 11); x = y; y = z; z = w; w = (w ^ (w >> 19)) ^ (t ^ (t >> 8)); yield return w; } }\n }\n}\nnamespace Library {\n class LIB_Math\n {\n [MethodImpl(MethodImplOptions.AggressiveInlining)]\n static public IEnumerable Primes(long x)\n {\n if (x < 2) yield break;\n yield return 2;\n var halfx = x / 2;\n var table = new bool[halfx + 1];\n var max = (long)(Math.Sqrt(x) / 2);\n for (long i = 1; i <= max; ++i)\n {\n if (table[i]) continue;\n var add = 2 * i + 1;\n yield return add;\n for (long j = 2 * i * (i + 1); j <= halfx; j += add)\n table[j] = true;\n }\n for (long i = max + 1; i <= halfx; ++i)\n if (!table[i] && 2 * i + 1 <= x)\n yield return 2 * i + 1;\n }\n [MethodImpl(MethodImplOptions.AggressiveInlining)]\n static public IEnumerable Factors(long x)\n {\n if (x < 2) yield break;\n while (x % 2 == 0)\n {\n x /= 2; yield return 2;\n }\n var max = (long)Math.Sqrt(x);\n for (long i = 3; i <= max; i += 2)\n {\n while (x % i == 0)\n {\n x /= i; yield return i;\n }\n }\n if (x != 1) yield return x;\n }\n [MethodImpl(MethodImplOptions.AggressiveInlining)]\n static public IEnumerable Divisor(long x)\n {\n if (x < 1) yield break;\n var max = (long)Math.Sqrt(x);\n for (long i = 1; i <= max; ++i)\n {\n if (x % i != 0) continue;\n yield return i;\n if (i != x / i) yield return x / i;\n }\n }\n [MethodImpl(MethodImplOptions.AggressiveInlining)]\n static public long GCD(long a, long b)\n {\n while (b > 0)\n {\n var tmp = b;\n b = a % b;\n a = tmp;\n }\n return a;\n }\n [MethodImpl(MethodImplOptions.AggressiveInlining)]\n static public long LCM(long a, long b) => a / GCD(a, b) * b;\n [MethodImpl(MethodImplOptions.AggressiveInlining)]\n static public long Pow(long x, long y)\n {\n long a = 1;\n while (y != 0)\n {\n if ((y & 1) == 1) a *= x;\n x *= x;\n y >>= 1;\n }\n return a;\n }\n static List _fact = new List() { 1 };\n [MethodImpl(MethodImplOptions.AggressiveInlining)]\n static void Build(long n)\n {\n if (n >= _fact.Count)\n for (int i = _fact.Count; i <= n; ++i) _fact.Add(_fact[i - 1] * i);\n }\n [MethodImpl(MethodImplOptions.AggressiveInlining)]\n static public long Comb(long n, long k)\n {\n Build(n);\n if (n == 0 && k == 0) return 1;\n if (n < k || n < 0) return 0;\n return _fact[(int)n] / _fact[(int)(n - k)] / _fact[(int)k];\n }\n [MethodImpl(MethodImplOptions.AggressiveInlining)]\n static public long Perm(long n, long k)\n {\n Build(n);\n if (n == 0 && k == 0) return 1;\n if (n < k || n < 0) return 0;\n return _fact[(int)n] / _fact[(int)(n - k)];\n }\n [MethodImpl(MethodImplOptions.AggressiveInlining)]\n static public IEnumerable> MakePermutation(long n, bool zeroIndexed = true)\n {\n if (n <= 0) throw new Exception();\n var c = new int[n];\n var a = new int[n];\n if (!zeroIndexed) a[0] = 1;\n for (var i = 1; i < n; i++) a[i] = a[i - 1] + 1;\n yield return new List(a);\n for (var i = 0; i < n;)\n {\n if (c[i] < i)\n {\n if (i % 2 == 0)\n {\n var t = a[0]; a[0] = a[i]; a[i] = t;\n }\n else\n {\n var t = a[c[i]]; a[c[i]] = a[i]; a[i] = t;\n }\n yield return new List(a);\n ++c[i];\n i = 0;\n }\n else\n {\n c[i] = 0;\n ++i;\n }\n }\n }\n }\n struct LIB_Mod : IEquatable, IEquatable\n {\n static public long _mod = 1000000007; long v;\n [MethodImpl(MethodImplOptions.AggressiveInlining)]\n public LIB_Mod(long x)\n {\n if (x < _mod && x >= 0) v = x;\n else if ((v = x % _mod) < 0) v += _mod;\n }\n [MethodImpl(MethodImplOptions.AggressiveInlining)]\n static public implicit operator LIB_Mod(long x) => new LIB_Mod(x);\n [MethodImpl(MethodImplOptions.AggressiveInlining)]\n static public implicit operator long(LIB_Mod x) => x.v;\n [MethodImpl(MethodImplOptions.AggressiveInlining)]\n public void Add(LIB_Mod x) { if ((v += x.v) >= _mod) v -= _mod; }\n [MethodImpl(MethodImplOptions.AggressiveInlining)]\n public void Sub(LIB_Mod x) { if ((v -= x.v) < 0) v += _mod; }\n [MethodImpl(MethodImplOptions.AggressiveInlining)]\n public void Mul(LIB_Mod x) => v = (v * x.v) % _mod;\n [MethodImpl(MethodImplOptions.AggressiveInlining)]\n public void Div(LIB_Mod x) => v = (v * Inverse(x.v)) % _mod;\n [MethodImpl(MethodImplOptions.AggressiveInlining)]\n static public LIB_Mod operator +(LIB_Mod x, LIB_Mod y) { var t = x.v + y.v; return t >= _mod ? new LIB_Mod { v = t - _mod } : new LIB_Mod { v = t }; }\n [MethodImpl(MethodImplOptions.AggressiveInlining)]\n static public LIB_Mod operator -(LIB_Mod x, LIB_Mod y) { var t = x.v - y.v; return t < 0 ? new LIB_Mod { v = t + _mod } : new LIB_Mod { v = t }; }\n [MethodImpl(MethodImplOptions.AggressiveInlining)]\n static public LIB_Mod operator *(LIB_Mod x, LIB_Mod y) => x.v * y.v;\n [MethodImpl(MethodImplOptions.AggressiveInlining)]\n static public LIB_Mod operator /(LIB_Mod x, LIB_Mod y) => x.v * Inverse(y.v);\n [MethodImpl(MethodImplOptions.AggressiveInlining)]\n static public bool operator ==(LIB_Mod x, LIB_Mod y) => x.v == y.v;\n [MethodImpl(MethodImplOptions.AggressiveInlining)]\n static public bool operator !=(LIB_Mod x, LIB_Mod y) => x.v != y.v;\n [MethodImpl(MethodImplOptions.AggressiveInlining)]\n static public long Inverse(long x)\n {\n long b = _mod, r = 1, u = 0, t = 0;\n while (b > 0)\n {\n var q = x / b;\n t = u;\n u = r - q * u;\n r = t;\n t = b;\n b = x - q * b;\n x = t;\n }\n return r < 0 ? r + _mod : r;\n }\n [MethodImpl(MethodImplOptions.AggressiveInlining)]\n public bool Equals(LIB_Mod x) => v == x.v;\n [MethodImpl(MethodImplOptions.AggressiveInlining)]\n public bool Equals(long x) => v == x;\n [MethodImpl(MethodImplOptions.AggressiveInlining)]\n public override bool Equals(object x) => x == null ? false : Equals((LIB_Mod)x);\n [MethodImpl(MethodImplOptions.AggressiveInlining)]\n public override int GetHashCode() => v.GetHashCode();\n [MethodImpl(MethodImplOptions.AggressiveInlining)]\n public override string ToString() => v.ToString();\n static List _fact = new List() { 1 };\n static long _factm = _mod;\n [MethodImpl(MethodImplOptions.AggressiveInlining)]\n static void B(long n)\n {\n if (_factm != _mod) _fact = new List() { 1 };\n if (n >= _fact.Count)\n for (int i = _fact.Count; i <= n; ++i)\n _fact.Add(_fact[i - 1] * i);\n _factm = _mod;\n }\n [MethodImpl(MethodImplOptions.AggressiveInlining)]\n static public LIB_Mod Comb(long n, long k)\n {\n B(n);\n if (n == 0 && k == 0) return 1;\n if (n < k || n < 0) return 0;\n return _fact[(int)n] / _fact[(int)(n - k)] / _fact[(int)k];\n }\n [MethodImpl(MethodImplOptions.AggressiveInlining)]\n static public LIB_Mod Perm(long n, long k)\n {\n B(n);\n if (n == 0 && k == 0) return 1;\n if (n < k || n < 0) return 0;\n return _fact[(int)n] / _fact[(int)(n - k)];\n }\n [MethodImpl(MethodImplOptions.AggressiveInlining)]\n static public LIB_Mod Pow(LIB_Mod x, long y)\n {\n LIB_Mod a = 1;\n while (y != 0)\n {\n if ((y & 1) == 1) a.Mul(x);\n x.Mul(x);\n y >>= 1;\n }\n return a;\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "dc2b3786e2e357c79f0a251552e1a26a", "src_uid": "ff810b16b6f41d57c1c8241ad960cba0", "apr_id": "ff5d507c3ee5ff35ac6b72fec085857c", "difficulty": 2300, "tags": ["dp", "math", "probabilities", "number theory"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9996514464970373, "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;\nusing System.IO;\nusing System.Collections;\n\nnamespace ConsoleApplication34\n{\n class Program\n {\n static void Main(string[] args)\n {\n int c = 0, h = 0, f = 0, u = 0;\n int x = int.Parse(Console.ReadLine());\n string[] arr = Console.ReadLine().Split();\n int[] a = new int[600];\n int[] b = new int[x];\n for (int i = 0; i < x; i++)\n {\n b[i] = int.Parse(arr[i]);\n if (b[i]!=0)\n {\n a[b[i]]++;\n\n }\n\n }\n \n\n for (int i = 0; i < a.Length; i++)\n {\n if (a[i]!=0)\n {\n c++;\n }\n\n }\n\n Console.WriteLine(c);\n\n\n\n\n\n\n\n\n\n\n\n //Stack s = new Stack(); \n //while (true)\n //{\n // int x = int.Parse(Console.ReadLine());\n // int[] a = new int[100];\n // int[] b = new int[100];\n // if (x == 0) break;\n // while (true)\n // {\n // string[] arr = Console.ReadLine().Split();\n // if (arr[0] == \"0\") break;\n // for (int i = 0; i < arr.Length; i++)\n // {\n // a[i] = i + 1;\n // b[i] = Convert.ToInt16(arr[i]);\n // }\n // for (int i = 0; i < arr.Length; i++)\n // {\n // s.Push(a[i]);\n // c++;\n // u = i;\n // if (b[h] == a[i])\n // {\n // while (u != 0)\n // {\n // if (b[h] == a[u])\n // {\n // s.Pop();\n // u--;\n // c--;\n // h++;\n // }\n // else\n // {\n // Console.WriteLine(\"NO\");\n // f = 5;\n // break;\n // }\n // }\n // } \n // }\n // if (f != 5)\n // {\n // Console.WriteLine(\"YES\");\n // }\n // c = 0;\n // h = 0;\n // u = 0;\n // f = 0;\n // }\n\n\n //}\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "20359368709f84372b400d061aba37ea", "src_uid": "3b520c15ea9a11b16129da30dcfb5161", "apr_id": "6bb1d12967c43ff3d412f771ac239d99", "difficulty": 800, "tags": ["sortings", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9651442307692307, "equal_cnt": 7, "replace_cnt": 0, "delete_cnt": 3, "insert_cnt": 3, "fix_ops_cnt": 6, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace ForCodeForses\n{\n class Program\n {\n static void Main(string[] args)\n {\n int n, s;\n n = Convert.ToInt32(Console.ReadLine());\n string line = Console.ReadLine();\n string[] arr = line.Split (' ');\n\n Array.Sort(arr);\n\n int[] f = arr.Select(ch => int.Parse(ch.ToString())).ToArray();\n \n s = 1;\n\n for (int j = n; j > 1; j--)\n {\n if (f[j - 1] != 0)\n {\n if (f[j] != f[j - 1])\n s++;\n }\n else break;\n }\n \n Console.WriteLine(s);\n Console.ReadKey();\n }\n }\n}", "lang": "Mono C#", "bug_code_uid": "23af04b41565508f4dded864e35db4b2", "src_uid": "3b520c15ea9a11b16129da30dcfb5161", "apr_id": "5dc8a4def2165b0d2af185b08db8685d", "difficulty": 800, "tags": ["sortings", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C#"} {"similarity_score": 0.9103448275862069, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "using System;\n sealed class Program\n {\n static void Main(string[] args)\n {\n var d = Console.ReadLine().Split().Select(Int32.Parse).ToArray();\n Console.WriteLine(Math.Min(d[1], d[2]) >= d[0] ? \"YES\" : \"NO\");\n }\n }", "lang": "Mono C#", "bug_code_uid": "33a89f6c2938bf9a2391fcc5862154bd", "src_uid": "6cd07298b23cc6ce994bb1811b9629c4", "apr_id": "7f0f78b55da6853de38e4f2e1444fbed", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.9987325728770595, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "using System;\nusing System.Linq;\nusing System.Collections;\nusing System.Collections.Generic;\n\nnamespace Codeforces\n{\n\tclass Program\n\t{\n\t\tstatic void Main(string[] args)\n\t\t{\n\t\t\tvar (n, m, k) = Int3();\n\t\t\tif (m >= n && k >= n)\n\t\t\t{\n\t\t\t\tConsole.WriteLine(\"YES\");\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tConsole.WriteLine(\"NO\");\n\t\t\t}\n\t\t}\n\n\t\tstatic int Int()\n\t\t{\n\t\t\treturn Int32.Parse(Console.ReadLine());\n\t\t}\n\n\t\tstatic (int, int) Int2()\n\t\t{\n\t\t\tvar arr = Array.ConvertAll(Console.ReadLine().Split(' '), Int32.Parse);\n\t\t\treturn (arr[0], arr[1]);\n\t\t}\n\n\t\tstatic (int, int, int) Int3()\n\t\t{\n\t\t\tvar arr = Array.ConvertAll(Console.ReadLine().Split(' '), Int32.Parse);\n\t\t\treturn (arr[0], arr[1], arr[3]);\n\t\t}\n\n\t\tstatic int[] Ints()\n\t\t{\n\t\t\treturn Array.ConvertAll(Console.ReadLine().Split(' '), Int32.Parse);\n\t\t}\n\n\t}\n\n\n}\n", "lang": "Mono C#", "bug_code_uid": "c4011a67d6af3628b5636e6ffd498d85", "src_uid": "6cd07298b23cc6ce994bb1811b9629c4", "apr_id": "4cc0b3896784c917c84c19b87bad80be", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.47213525360050096, "equal_cnt": 7, "replace_cnt": 4, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 6, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\n\nnamespace CodeForce\n{\n class _57a\n {\n public static void Main()\n {\n var line = Console.ReadLine();\n var split = line.Split(new[] {' '});\n var result = Math.Abs(int.Parse(split[1]) - int.Parse(split[3])) +\n Math.Abs(int.Parse(split[2]) - int.Parse(split[4]));\n\n Console.WriteLine(result);\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "699b8f6dd9eb4ff0539f40a6b602a473", "src_uid": "685fe16c217b5b71eafdb4198822250e", "apr_id": "a92f3a181cc5095874bc1be4eda4a576", "difficulty": 1300, "tags": ["greedy", "dfs and similar", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9735576923076923, "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.IO;\nusing System.Collections;\n\n\nnamespace _43\n{\n class Program\n {\n \n static void Main(string[] args)\n {\n \n int x1, x2, y1, y2,n;\n string []s = Console.ReadLine().Split(' ');\n n = int.Parse(s[0].ToString());\n x1 =int.Parse(s[1]);\n y1 = int.Parse(s[2]);\n x2 = int.Parse(s[3]);\n y2 = int.Parse(s[4]);\n int p = 4 * n;\n int ans = Math.Abs(x1 - x2) + Math.Abs(y1 - y2);\n if (Math.Abs(x1 - x2) == n) ans += 2 * Math.Min(y1, y2);\n if (Math.Abs(y1 - y2) == n) ans += 2 * Math.Min(x1, x2);\n\n Console.WriteLine(ans);\n \n \n \n\n \n\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "8997aa7639c8f7a593cad1b20e73c290", "src_uid": "685fe16c217b5b71eafdb4198822250e", "apr_id": "e0937011c8971b563c1ee2fe748d1a71", "difficulty": 1300, "tags": ["greedy", "dfs and similar", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.8841714209897837, "equal_cnt": 14, "replace_cnt": 9, "delete_cnt": 1, "insert_cnt": 3, "fix_ops_cnt": 13, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Globalization;\nusing System.IO;\nusing System.Linq;\nusing System.Text;\npublic class Codeforces\n{\n protected static TextReader reader;\n protected static TextWriter writer;\n static void Main()\n {\n reader = new StreamReader(Console.OpenStandardInput(1024 * 10), System.Text.Encoding.ASCII, false, 1024 * 10);\n writer = new StreamWriter(Console.OpenStandardOutput(1024 * 10), System.Text.Encoding.ASCII, 1024 * 10);\n var n = ReadLong();\n if (n < 2)\n {\n Console.WriteLine(\"NO\");\n reader.Close();\n writer.Close();\n return;\n }\n var d = Math.Sqrt(n);\n if (d == (int)d)\n {\n Console.WriteLine(\"YES\");\n return;\n }\n for (int i = 1; i <= (int)Math.Sqrt(n * 2); i++)\n {\n for (int j = Math.Max(1, (int)Math.Sqrt(n * 2) - i); j <= (int)Math.Sqrt(n * 2); j++)\n {\n var triA = i * (i + 1) / 2;\n var triB = j * (j + 1) / 2;\n var triSum = triA + triB;\n if (triSum > n)\n {\n break;\n }\n if (triSum == n)\n {\n Console.WriteLine(\"YES\");\n return;\n }\n }\n }\n Console.WriteLine(\"NO\");\n reader.Close();\n writer.Close();\n }\n #region Read / Write\n\n private static Queue currentLineTokens = new Queue();\n\n private static string[] ReadAndSplitLine()\n {\n return reader.ReadLine().Split(new[] { ' ', '\\t' }, StringSplitOptions.RemoveEmptyEntries);\n }\n\n public static string ReadToken()\n {\n while (currentLineTokens.Count == 0)\n currentLineTokens = new Queue(ReadAndSplitLine());\n return currentLineTokens.Dequeue();\n }\n\n public static int ReadInt()\n {\n return int.Parse(ReadToken());\n }\n\n public static long ReadLong()\n {\n return long.Parse(ReadToken());\n }\n\n public static double ReadDouble()\n {\n return double.Parse(ReadToken(), CultureInfo.InvariantCulture);\n }\n\n public static int[] ReadIntArray()\n {\n return ReadAndSplitLine().Select(int.Parse).ToArray();\n }\n\n public static long[] ReadLongArray()\n {\n return ReadAndSplitLine().Select(long.Parse).ToArray();\n }\n\n public static double[] ReadDoubleArray()\n {\n return ReadAndSplitLine().Select(s => double.Parse(s, CultureInfo.InvariantCulture)).ToArray();\n }\n public static int[][] ReadIntMatrix(int numberOfRows)\n {\n int[][] matrix = new int[numberOfRows][];\n for (int i = 0; i < numberOfRows; i++)\n matrix[i] = ReadIntArray();\n return matrix;\n }\n public static int[][] ReadAndTransposeIntMatrix(int numberOfRows)\n {\n int[][] matrix = ReadIntMatrix(numberOfRows);\n int[][] ret = new int[matrix[0].Length][];\n for (int i = 0; i < ret.Length; i++)\n {\n ret[i] = new int[numberOfRows];\n for (int j = 0; j < numberOfRows; j++)\n ret[i][j] = matrix[j][i];\n }\n return ret;\n }\n\n public static string[] ReadLines(int quantity)\n {\n string[] lines = new string[quantity];\n for (int i = 0; i < quantity; i++)\n lines[i] = reader.ReadLine().Trim();\n return lines;\n }\n public static void WriteArray(IEnumerable array)\n {\n writer.WriteLine(string.Join(\" \", array));\n }\n\n public static void Write(params T[] array)\n {\n WriteArray(array);\n }\n\n public static void WriteLines(IEnumerable array)\n {\n foreach (var a in array)\n writer.WriteLine(a);\n }\n #endregion\n}", "lang": "MS C#", "bug_code_uid": "c486b9b91c75f427a16cdbc1e6924233", "src_uid": "245ec0831cd817714a4e5c531bffd099", "apr_id": "e0e1c1150383e7ab7326dad526ef69f9", "difficulty": 1300, "tags": ["brute force", "implementation", "binary search"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.5150602409638554, "equal_cnt": 17, "replace_cnt": 11, "delete_cnt": 4, "insert_cnt": 1, "fix_ops_cnt": 16, "bug_source_code": "using System;\npublic class Codeforces\n{\n static void Main()\n {\n var n = long.Parse(Console.ReadLine());\n for (int i = 1; i <= (int)Math.Sqrt(n * 2); i++)\n {\n var triA = i * (i + 1) / 2;\n for (int j = Math.Max(1, (int)Math.Sqrt(n * 2) - i); j <= (int)Math.Sqrt(n * 2); j++)\n {\n var triB = j * (j + 1) / 2;\n var triSum = triA + triB;\n if (triSum > n)\n {\n break;\n }\n if (triSum == n)\n {\n Console.WriteLine(\"YES\");\n return;\n }\n }\n }\n Console.WriteLine(\"NO\");\n }\n}", "lang": "MS C#", "bug_code_uid": "5fef667b368efc5facb2084b0eb58779", "src_uid": "245ec0831cd817714a4e5c531bffd099", "apr_id": "e0e1c1150383e7ab7326dad526ef69f9", "difficulty": 1300, "tags": ["brute force", "implementation", "binary search"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9483352468427095, "equal_cnt": 4, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 3, "bug_source_code": "using System;\nusing System.Collections.Generic;\n\nnamespace CodeForecs\n{\n class Program\n {\n static void Main(string[] args)\n {\n string num = Console.ReadLine();\n int res = MakeSquare(num, 0);\n Console.WriteLine(res == 1000 ? -1 : res);\n Console.ReadKey();\n }\n\n private static int MakeSquare(string str, int digit)\n {\n if (IsASquare(Convert.ToInt32(str)))\n {\n return digit;\n }\n\n List lst = new List();\n\n for (int i = 0; i < str.Length; i++)\n {\n string temp = str.Remove(i, 1);\n if (temp.Length != 0)\n lst.Add(temp);\n }\n\n int ans = 1000;\n foreach (string temp in lst)\n {\n ans = Math.Min(ans, MakeSquare(temp, digit + 1));\n }\n\n return ans;\n }\n\n private static bool IsASquare(int num)\n {\n for (int i = 1; i * i <= num; i++)\n {\n if (i * i == num)\n {\n return true;\n }\n }\n\n return false;\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "d81084db4fff7bb54a96eb7fb28e47d6", "src_uid": "fa4b1de79708329bb85437e1413e13df", "apr_id": "78550623783db09ec8574a9246182d29", "difficulty": 1400, "tags": ["math", "brute force", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.999504377994383, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "using System;\nusing System.Collections;\nusing System.Collections.Generic;\nusing System.Globalization;\nusing System.IO;\nusing System.Linq;\nusing System.Numerics;\nusing System.Text;\nusing System.Threading;\n\npublic class CodeForces87\n{\n#if TEST\n // To set this go to Project -> Properties -> Build -> General -> Conditional compilation symbols: -> enter 'TEST' into text box.\n const bool testing = false;\n#else\nconst bool testing = false;\n#endif\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 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\n\n static void program(TextReader input)\n {\n //reader.ReadLine();\n //var data = reader.ReadLine().TrimEnd().Split(' ').Select(long.Parse).ToList();\n\n var n = long.Parse(reader.ReadLine());\n var ns = n.ToString();\n var result = int.MaxValue;\n for (var i = 0; i < Math.Pow(2, 10);i++){\n var s = Convert.ToString(i, 2).PadLeft(9).Substring(0, ns.Length);\n var news = new StringBuilder();\n for (var j = 0; j < s.Length;j++){\n if(s[j] == '1'){\n news.Append(ns[j]);\n }\n }\n\n var res = news.ToString();\n if(res.Length > 0 && res[0] != '0'){\n var pos = int.Parse(res);\n if(Math.Sqrt(pos) % 1 == 0){\n result = Math.Min(result, ns.Length - pos.ToString().Length);\n }\n }\n }\n Console.WriteLine(result == int.MaxValue ? -1 : result);\n }\n\n public static void Main(string[] args)\n {\n CultureInfo nonInvariantCulture = new CultureInfo(\"en-US\");\n Thread.CurrentThread.CurrentCulture = nonInvariantCulture;\n if (!testing)\n { // set testing to false when submiting to codeforces\n program(Console.In); // write your program in 'program' function (its your new main !)\n return;\n }\n\n Console.WriteLine(\"Test Case(1) => expected :\");\n Console.WriteLine(\"3\\n2\\n4\\n\");\n Console.WriteLine(\"Test Case(1) => found :\");\n program(new StringReader(\"4 3\\n2\\n3\\n4\\n\"));\n Console.WriteLine();\n\n Console.WriteLine(\"Test Case(2) => expected :\");\n Console.WriteLine(\"13\\n3\\n8\\n9\\n\");\n Console.WriteLine(\"Test Case(2) => found :\");\n program(new StringReader(\"13 4\\n10\\n5\\n4\\n8\\n\"));\n Console.WriteLine();\n\n }\n}", "lang": "Mono C#", "bug_code_uid": "1ae0f61c9daa465959408f6b115f991d", "src_uid": "fa4b1de79708329bb85437e1413e13df", "apr_id": "5d900539ef0e89fe81d3a5b17f4a8cff", "difficulty": 1400, "tags": ["math", "brute force", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9610666666666666, "equal_cnt": 14, "replace_cnt": 13, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 13, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\n\nnamespace _227A\n{\n class Program\n {\n static void Main(string[] args)\n {\n string[] a = Console.ReadLine().Split(' ');\n string[] b = Console.ReadLine().Split(' ');\n string[] c = Console.ReadLine().Split(' ');\n\n int xa = Convert.ToInt32(a[0]);\n int ya = Convert.ToInt32(a[1]);\n int xb = Convert.ToInt32(b[0]);\n int yb = Convert.ToInt32(b[1]);\n int xc = Convert.ToInt32(c[0]);\n int yc = Convert.ToInt32(c[1]);\n\n int k = (xb - xa) * (yc - yb) - (xc - xb) * (yb - ya);\n\n if (k > 0) Console.WriteLine(\"LEFT\");\n else\n {\n if (k == 0) Console.WriteLine(\"TOWARDS\");\n else Console.WriteLine(\"RIGHT\");\n }\n Console.ReadLine();\n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "80bec5b38d733bb38c6cad9fe1b60d42", "src_uid": "f6e132d1969863e9f28c87e5a44c2b69", "apr_id": "6e3d84ad64bac89d24939ee2dfffe9ce", "difficulty": 1300, "tags": ["geometry"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.17477096546863988, "equal_cnt": 16, "replace_cnt": 13, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 16, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace A.Diagonal_Walking\n{\n class Program\n {\n static void Main(string[] args)\n {\n string n = Console.ReadLine();\n string text = Console.ReadLine();\n for (int i = 0; i < n; i++)\n {\n text = text.Replace(\"RU\", \"D\");\n\n \n text = text.Replace(\"UR\", \"D\");\n\n }\n \n Console.WriteLine(text.Length);\n }\n }\n}", "lang": "Mono C#", "bug_code_uid": "b0d820fdeb3b123e47f2e76d6b3beefe", "src_uid": "986ae418ce82435badadb0bd5588f45b", "apr_id": "952f507dde80681f4dfdb9ea3c42ce23", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.33814102564102566, "equal_cnt": 12, "replace_cnt": 9, "delete_cnt": 0, "insert_cnt": 4, "fix_ops_cnt": 13, "bug_source_code": "class Program\n {\n static void Main(string[] args)\n {\n int length = int.Parse(Console.ReadLine());\n string sequence = Console.ReadLine();\n sequence = sequence.Replace(\"UR\", \"D\");\n sequence = sequence.Replace(\"RU\", \"D\");\n\n Console.WriteLine(sequence.Length);\n Console.ReadKey();\n \n }\n }", "lang": "Mono C#", "bug_code_uid": "aa51bcbab5a7493e4b8737296041018c", "src_uid": "986ae418ce82435badadb0bd5588f45b", "apr_id": "dfbc9232e6834cd632466fb47577c9da", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9988358556461001, "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 shagi\n{\n class Program\n {\n static void Main(string[] args)\n {\n int n = Convert.ToInt32( Console.ReadLine());\n StringBuilder steps = new StringBuilder (Console.ReadLine());\n int i;\n for (i = 0; i <= steps.Length - 1; i++)\n {\n if (steps[i]=='U' && steps[i + 1] == 'R')\n {\n steps.Remove(i, 2);\n steps.Insert(i, 'D');\n\n }\n if (steps[i] == 'R' && steps[i + 1] == 'U')\n {\n steps.Remove(i, 2);\n steps.Insert(i, 'D');\n\n }\n\n }\n Console.WriteLine(steps.Length);\n }\n }\n}", "lang": "Mono C#", "bug_code_uid": "eb9ae05e8aed4f6cc98933c02f57859a", "src_uid": "986ae418ce82435badadb0bd5588f45b", "apr_id": "08de553d75c61c7333c6b2476992793d", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9354120267260579, "equal_cnt": 4, "replace_cnt": 0, "delete_cnt": 2, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "using System;\nusing System.Collections;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\nusing System.Text.RegularExpressions;\n\nnamespace Contest\n{\n class Program\n {\n static void Main(string[] args)\n {\n int a = Convert.ToInt32(Console.ReadLine());\n int b = Convert.ToInt32(Console.ReadLine());\n int[] kq = new int[b - a + 1];\n for(int i = 0; i < kq.Length; i++)\n kq[i] = (a + i) * (a + i) - (a + i) * (a + b) + (a * a + b * b + b - a) / 2;\n Console.WriteLine(kq.Min());\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "363ca5a3332e90235ae30f096ab19ddd", "src_uid": "d3f2c6886ed104d7baba8dd7b70058da", "apr_id": "2b92e997594c402f00a0608fb39b1baa", "difficulty": 800, "tags": ["greedy", "math", "brute force", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C#"} {"similarity_score": 0.996649114408808, "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.Text;\nusing System.Text.RegularExpressions;\n\nnamespace _04_01_12_1_\n{\n class Program\n {\n static void Main(string[] args)\n {\n string a=Console.ReadLine();\n string[] am=Regex.Split(a, @\"\\s+\");\n \n int n, R, r;\n ang=0;\n \n n = int.Parse(am[0]);\n R = int.Parse(am[1]);\n r = int.Parse(am[2]);\n \n if (R < r)\n ang = 10;\n if (R >= r && R < r * 2)\n ang = Math.PI;\n if (R==2*r)\n ang = Math.PI / 2;\n if (R>2*r)\n {\n int g = R - r;\n int k = r;\n ang = Math.Asin((double)k / (double)g);\n }\n if (ang * n <= Math.PI+0.0000000001)\n Console.WriteLine(\"YES\");\n else\n Console.WriteLine(\"NO\");\n //Console.ReadLine();\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "d95d53da286513e8f70f3eb969ebd11b", "src_uid": "2fedbfccd893cde8f2fab2b5bf6fb6f6", "apr_id": "4db4ddb4de724ac30e6bddd7830f77e1", "difficulty": 1700, "tags": ["geometry", "math"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.8741875580315692, "equal_cnt": 78, "replace_cnt": 10, "delete_cnt": 61, "insert_cnt": 8, "fix_ops_cnt": 79, "bug_source_code": "От NickSerg, контест: Codeforces Round #100, задача: (A) Новогодний стол, Неправильный ответ на претест 6, #\n\n using System;\n using System.Collections;\n using System.Collections.Generic;\n using System.Text;\n using System.Linq;\n\n namespace Codeforces\n {\n internal class Program\n {\n private static string Read()\n {\n return Console.ReadLine();\n }\n private static string[] ReadArray()\n {\n return Console.ReadLine().Split(' ');\n }\n private static int ReadInt()\n {\n return Int32.Parse(Console.ReadLine());\n }\n private static long ReadLong()\n {\n return long.Parse(Console.ReadLine());\n }\n private static int ReadNextInt(string[] input, int index)\n {\n return Int32.Parse(input[index]);\n }\n\n private static void Main()\n {\n var input = ReadArray();\n var n = ReadNextInt(input, 0);\n var rR = ReadNextInt(input, 1);\n var r = ReadNextInt(input, 2);\n if(r==rR && n == 1)\n {\n Console.WriteLine(\"YES\");\n return;\n }\n if(r >= rR)\n {\n Console.WriteLine(\"NO\");\n return;\n }\n if(2 * r > rR)\n {\n if(n == 1)\n Console.WriteLine(\"YES\");\n else\n {\n Console.WriteLine(\"NO\");\n }\n return;\n }\n if(2 * r == rR)\n {\n if(n <= 2)\n Console.WriteLine(\"YES\");\n else\n {\n Console.WriteLine(\"NO\");\n }\n return;\n }\n\n var a = 2 * Math.Asin((double) r/(rR - r));\n if(a * n <= 2 * Math.PI && a > 0)\n Console.WriteLine(\"YES\");\n else\n {\n Console.WriteLine(\"NO\");\n }\n\n }\n }\n }\n\n", "lang": "Mono C#", "bug_code_uid": "858284ac703b25375e6b792cc1818297", "src_uid": "2fedbfccd893cde8f2fab2b5bf6fb6f6", "apr_id": "0be6e79d6c52319e90cfaa035b77c031", "difficulty": 1700, "tags": ["geometry", "math"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C#"} {"similarity_score": 0.8307905686546463, "equal_cnt": 9, "replace_cnt": 1, "delete_cnt": 8, "insert_cnt": 0, "fix_ops_cnt": 9, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Data;\nusing System.Globalization;\nusing System.Linq;\n\nnamespace TestConsole\n{\n public class Program\n {\n static void Main(string[] args)\n {\n var money = long.Parse(Console.ReadLine());\n Console.WriteLine(CalculateLottery(money));\n }\n\n private static long CalculateLottery(long money)\n {\n long billCount = 0;\n var bills = new[] { 100, 20, 10, 5, 1 };\n\n foreach (var bill in bills)\n {\n while (money > 0)\n {\n var count = money / bill;\n money -= count * bill;\n billCount += count;\n }\n }\n\n return billCount;\n }\n }\n}", "lang": "Mono C#", "bug_code_uid": "9d5e35025377348322aa7b7ba46535a6", "src_uid": "8e81ad7110552c20297f08ad3e5f8ddc", "apr_id": "1dc4b5bee133eee851d5749641a0bdf8", "difficulty": 800, "tags": ["dp", "greedy"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C#"} {"similarity_score": 0.8926974664679582, "equal_cnt": 8, "replace_cnt": 1, "delete_cnt": 7, "insert_cnt": 0, "fix_ops_cnt": 8, "bug_source_code": "using System;\n\nnamespace TestConsole\n{\n public class Program\n {\n static void Main(string[] args)\n {\n var money = long.Parse(Console.ReadLine());\n Console.WriteLine(CalculateLottery(money));\n }\n\n private static long CalculateLottery(long money)\n {\n long billCount = 0;\n var bills = new[] { 100, 20, 10, 5, 1 };\n\n foreach (var bill in bills)\n {\n while (money > 0)\n {\n var count = money / bill;\n money -= count * bill;\n billCount += count;\n }\n }\n\n return billCount;\n }\n }\n}", "lang": "Mono C#", "bug_code_uid": "0cec33ab0f2237370c8ae53a8de26c84", "src_uid": "8e81ad7110552c20297f08ad3e5f8ddc", "apr_id": "1dc4b5bee133eee851d5749641a0bdf8", "difficulty": 800, "tags": ["dp", "greedy"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "delete", "lang_cluster": "C#"} {"similarity_score": 0.040152963671128104, "equal_cnt": 25, "replace_cnt": 18, "delete_cnt": 1, "insert_cnt": 6, "fix_ops_cnt": 25, "bug_source_code": "\nMicrosoft Visual Studio Solution File, Format Version 12.00\n# Visual Studio 15\nVisualStudioVersion = 15.0.28307.1062\nMinimumVisualStudioVersion = 10.0.40219.1\nProject(\"{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}\") = \"ConsoleApp7\", \"ConsoleApp7.csproj\", \"{0BE878F0-59C5-4937-97E2-067D4DE3BF00}\"\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{0BE878F0-59C5-4937-97E2-067D4DE3BF00}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{0BE878F0-59C5-4937-97E2-067D4DE3BF00}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{0BE878F0-59C5-4937-97E2-067D4DE3BF00}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{0BE878F0-59C5-4937-97E2-067D4DE3BF00}.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 = {33B23004-8358-49E5-B718-E34496A6C7BA}\n\tEndGlobalSection\nEndGlobal\n", "lang": "Mono C#", "bug_code_uid": "c443672d3fa9c82eeb44403e37be73e5", "src_uid": "8e81ad7110552c20297f08ad3e5f8ddc", "apr_id": "e0b3ff8001901b66a51a13c0bd9ded69", "difficulty": 800, "tags": ["dp", "greedy"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9990108803165183, "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;\n\nnamespace ConsoleApplication1\n{\n class Program\n {\n static void Main(string[] args)\n {\n int n = Convert.ToInt32(Console.ReadLine());\n int k = 0;\n while (n != 0)\n {\n if (n >= 100)\n {\n n -= 100;\n k++;\n }\n else if (n >= 20)\n {\n n -= 20;\n k++;\n }\n else if (n >= 10)\n {\n n -= 20;\n k++;\n }\n else if (n >= 5)\n {\n n -= 5;\n k++;\n }\n else if (n >= 1)\n {\n n -= 1;\n k++;\n }\n \n }\n Console.WriteLine(k);\n\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "cdfa862962680cc19ec8271512e3467a", "src_uid": "8e81ad7110552c20297f08ad3e5f8ddc", "apr_id": "f2bd2f51ae16cc2918d12e83014f9576", "difficulty": 800, "tags": ["dp", "greedy"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.8049605411499436, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 3, "fix_ops_cnt": 4, "bug_source_code": " int n = int.Parse(Console.ReadLine());\n int count = 0;\n\n while (n != 0)\n {\n count += n / 100;\n n = n % 100;\n count += n / 20;\n n = n % 20;\n count += n / 5;\n n = n % 5;\n count += n / 2;\n n = n % 2;\n count += n / 1;\n n = n % 1;\n }\n Console.WriteLine(count);", "lang": "Mono C#", "bug_code_uid": "3719e880cde2de41890cb8fab5a12109", "src_uid": "8e81ad7110552c20297f08ad3e5f8ddc", "apr_id": "f060fad45eba64f28c7b64dc3892c05f", "difficulty": 800, "tags": ["dp", "greedy"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.04334738109572547, "equal_cnt": 13, "replace_cnt": 11, "delete_cnt": 2, "insert_cnt": 0, "fix_ops_cnt": 13, "bug_source_code": "\nMicrosoft Visual Studio Solution File, Format Version 12.00\n# Visual Studio 15\nVisualStudioVersion = 15.0.28307.421\nMinimumVisualStudioVersion = 10.0.40219.1\nProject(\"{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}\") = \"ConsoleApp39\", \"ConsoleApp39\\ConsoleApp39.csproj\", \"{2B6A6B94-9759-400A-8CF9-A38BF67C72B6}\"\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{2B6A6B94-9759-400A-8CF9-A38BF67C72B6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{2B6A6B94-9759-400A-8CF9-A38BF67C72B6}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{2B6A6B94-9759-400A-8CF9-A38BF67C72B6}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{2B6A6B94-9759-400A-8CF9-A38BF67C72B6}.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 = {04AE9A66-327A-4ADF-9CC1-B809EB3D9E32}\n\tEndGlobalSection\nEndGlobal\n", "lang": "Mono C#", "bug_code_uid": "bc33c54aadc8de578a594474cb4a1fd9", "src_uid": "8e81ad7110552c20297f08ad3e5f8ddc", "apr_id": "1d484d6d19a63165d3e03abfc91b8e16", "difficulty": 800, "tags": ["dp", "greedy"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.7677543186180422, "equal_cnt": 5, "replace_cnt": 3, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 5, "bug_source_code": "namespace _996a\n{\n\tclass Program\n\t{\n\t\tstatic void Main(string[] args)\n\t\t{\n\t\t\tlong n = Convert.ToInt32(Console.ReadLine());\n\t\t\tlong num = n / 100 + (n % 100)/20 + (n % 100 % 20)/5 + (n % 100 % 20 % 5);\n\t\t\tConsole.WriteLine(num);\n\t\t}\n\t}\n}", "lang": "Mono C#", "bug_code_uid": "2ade5aea61602aa2db717fef22b76129", "src_uid": "8e81ad7110552c20297f08ad3e5f8ddc", "apr_id": "eb344ac82a247163ca63b6f030beab3a", "difficulty": 800, "tags": ["dp", "greedy"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9689265536723164, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "using System;\nusing System.Linq;\nusing System.Reflection.PortableExecutable;\n\nnamespace ConsoleApp1\n{\n class Program\n {\n static void Main(string[] args)\n {\n int Cant = 0;\n int Money = Int32.Parse(Console.ReadLine());\n int[] Monedas = { 100, 20, 10, 5, 1 };\n\n for (int i = 0; i < Monedas.Length;i++)\n {\n if (Money == 0)\n {\n break;\n }\n \n while (Money / Monedas[i] > 0)\n {\n Money -= Monedas[i];\n Cant++;\n }\n }\n \n Console.WriteLine(Cant);\n \n }\n\n }\n}", "lang": "Mono C#", "bug_code_uid": "ee22b9f4826c0032fb14ed0133fbfcbf", "src_uid": "8e81ad7110552c20297f08ad3e5f8ddc", "apr_id": "ffe468f2f02dcb3834f175fcf42f9f74", "difficulty": 800, "tags": ["dp", "greedy"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C#"} {"similarity_score": 0.5510574018126888, "equal_cnt": 16, "replace_cnt": 9, "delete_cnt": 4, "insert_cnt": 3, "fix_ops_cnt": 16, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Diagnostics;\nusing System.Linq;\n\nnamespace CSharpScratchpad\n{\n class Program\n {\n static void Main(string[] args)\n {\n int[] coins = {1, 5, 10,20,100};\n int n = int.Parse(Console.ReadLine());\n Console.WriteLine(DPChange(n,coins));\n }\n\n static int DPChange(int money, int[] coins)\n {\n var minNumCoins = Enumerable.Repeat(0, money + 1).ToArray();\n\n for (int m = 1; m <= money; m++)\n {\n minNumCoins[m] = int.MaxValue;\n foreach (var coin in coins)\n {\n if (m >= coin)\n {\n minNumCoins[m] = Math.Min(minNumCoins[m - coin] + 1, minNumCoins[m]);\n }\n }\n }\n\n return minNumCoins[money];\n }\n }\n}\n\n\n", "lang": "Mono C#", "bug_code_uid": "0c77fb968d1fa42b7e0cd434f2fea5d5", "src_uid": "8e81ad7110552c20297f08ad3e5f8ddc", "apr_id": "cd8f0c4dcbbd34dc8eda2b495b4b6d40", "difficulty": 800, "tags": ["dp", "greedy"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9921875, "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.Numerics;\nusing System.Text;\nnamespace CP\n{\n class Program\n {\n static void Main(string [] main)\n {\n int [] nAndM = Array.ConvertAll(Console.ReadLine().Split(' ') , x => Convert.ToInt32(x));\n Console.WriteLine(nAndM.Max() - 1 + nAndM.Min());\n }\n }\n}", "lang": "Mono C#", "bug_code_uid": "42e23f2ae1a4f83e4e2439e90fb125cf", "src_uid": "c8378e6fcaab30d15469a55419f38b39", "apr_id": "5196578b39fc7362d53924fc6ed175fa", "difficulty": 1300, "tags": ["greedy", "games", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.20694236837734595, "equal_cnt": 37, "replace_cnt": 30, "delete_cnt": 5, "insert_cnt": 2, "fix_ops_cnt": 37, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Text.RegularExpressions;\nusing System.IO;\n\n\nclass Pair {\n public Pair(T1 first, T2 second) {\n First = first;\n Second = second;\n }\n public T1 First { get; set; }\n public T2 Second { get; set; }\n public override string ToString() {\n return \"{\" + First + \" \" + Second + \"}\";\n }\n}\nnamespace CF {\n class Program {\n\n public static int N = 0;\n public static int M = 0;\n\n public static int Last = -1;\n public static List Result; \n\n static void Main(string[] args) {\n\n#if DEBUG\n TextReader reader = new StreamReader(\"../../input.txt\");\n TextWriter writer = Console.Out;\n#else\n\t\t\tTextReader reader = Console.In;\n TextWriter writer = Console.Out;\n#endif\n\n var vals = reader.ReadLine().Split(' ').Select(int.Parse).ToArray();\n N = vals[0];\n M = vals[1];\n Result = new List();\n\n var p = false;\n while (N + M > 0) {\n p = !p;\n if (M == 0) {\n Result.Add(true);\n N--;\n continue;\n }\n if (N == 0) {\n Result.Add(false);\n M--;\n continue;\n }\n var res = false;\n if (p) {\n res = Peria();\n } else {\n res = Vasia();\n }\n Result.Add(res);\n if (res) {\n Last = 1;\n N--;\n } else {\n Last = 0;\n M--;\n }\n \n }\n\n var pet = 0;\n var vas = 0;\n\n for (int i = 1; i < Result.Count; i++) {\n if (Result[i] == Result[i - 1]) {\n pet++;\n } else {\n vas++;\n }\n }\n\n Console.WriteLine(pet + \" \" + vas);\n\n#if DEBUG\n Console.ReadKey();\n#endif\n }\n\n\n public static bool Peria() {\n if (Last == -1) {\n if (N < M) {\n return false;\n }\n return true;\n }\n if (Last == 1) {\n return true;\n } else {\n return false;\n }\n }\n\n public static bool Vasia() {\n if (Last == 1) {\n return false;\n } else {\n return true;\n }\n }\n\n \n\n }\n}", "lang": "Mono C#", "bug_code_uid": "6422a5a200731eb756d6eca1ca5b6890", "src_uid": "c8378e6fcaab30d15469a55419f38b39", "apr_id": "9c845ac615e0716eb5084159fb1c88f3", "difficulty": 1300, "tags": ["greedy", "games", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.928164196123147, "equal_cnt": 8, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 4, "fix_ops_cnt": 7, "bug_source_code": "using System; using System.Linq; using System.Collections.Generic;\n\nclass P { \n static int result = 1;\n static void Main() {\n var x = int.Parse(Console.ReadLine());\n var digits = 0;\n { var temp = x;\n while (temp > 0) { x = x | (1 << (temp%10)); temp /= 10; } }\n var divs = new List();\n for (var d = 2; d <= x ; d++)\n if (x % d == 0) { divs.Add(d); x /= d; d--; }\n Recurse(divs, 0, 1, digits);\n Console.Write(result);\n }\n \n static void Recurse(List divs, int i, int n, int digits) {\n if (i >= divs.Count) {\n while (n > 0) {\n if ((digits & (1 << (n%10)))!=0) { result++; return; } \n n /= 10;\n }\n Recurse(divs, i + 1, n * divs[i], digits);\n do { i++; }\n while (i < divs.Count && divs[i] == divs[i-1]);\n Recurse(divs, i, n, digits);\n }\n}\n ", "lang": "MS C#", "bug_code_uid": "463247878c377eb0d1b4aff660ddf465", "src_uid": "ada94770281765f54ab264b4a1ef766e", "apr_id": "4779e7071be1d9851dc0a5394eb6ebb7", "difficulty": 1300, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.3817733990147783, "equal_cnt": 14, "replace_cnt": 7, "delete_cnt": 4, "insert_cnt": 2, "fix_ops_cnt": 13, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\n\nclass Program\n{\n\n static void Main(string[] args)\n {\n int n = int.Parse(Console.ReadLine());\n\n var lst = new List();\n\n for (int i = 1; i <= n; i++)\n {\n if (n%i==0)\n {\n lst.Add(i);\n }\n }\n\n var a = new bool[9];\n\n while (n > 0)\n {\n a[n%10] = true;\n n /= 10;\n }\n\n Console.WriteLine(lst.Count(x=>hasC(a, x)));\n }\n\n static bool hasC(bool[] a, int b)\n {\n while (b > 0)\n {\n if (a[b % 10]) \n return true;\n b /= 10;\n }\n\n return false;\n }\n}", "lang": "MS C#", "bug_code_uid": "8e42b73d0ea2b2716438fb4cb6077d85", "src_uid": "ada94770281765f54ab264b4a1ef766e", "apr_id": "8978be85134ade0d5a84b953a23380fe", "difficulty": 1300, "tags": ["implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.5863825845298749, "equal_cnt": 6, "replace_cnt": 3, "delete_cnt": 2, "insert_cnt": 0, "fix_ops_cnt": 5, "bug_source_code": "using System;\nusing System.Linq;\n\npublic class Puzzles\n{\n\tprivate static void Main()\n\t{\n\t\tvar input = ReadIntArray();\n\t\tvar n = input[0];\n\t\tvar m = input[1];\n\t\tvar f = ReadIntArray();\n\t\t\n\t\tvar minDifference = int.MaxValue;\n\t\tFindMinCombination(f, n, 0, 0, int.MaxValue, int.MinValue, ref minDifference);\n\t\t\n\t\tConsole.WriteLine(minDifference);\n\t}\n\n\tprivate static void FindMinCombination(int[] f, int n, int current, int selected, int minSofar, int maxSofar, ref int minDifference)\n\t{\n\t\tif (selected == n)\n\t\t{\n\t\t\tif (maxSofar - minSofar < minDifference)\n\t\t\t{\n\t\t\t\tminDifference = maxSofar - minSofar;\n\t\t\t}\n\t\t\t\n\t\t\treturn;\n\t\t}\n\t\telse if (current == f.Length)\n\t\t{\n\t\t\treturn;\n\t\t}\n\n\t\t//Consider current puzzle\n\t\tFindMinCombination(f, n, current + 1, selected + 1, Math.Min(minSofar, f[current]), Math.Max(maxSofar, f[current]), ref minDifference);\n\t\t\n\t\t//Ignore current puzzle\n\t\tFindMinCombination(f, n, current + 1, selected, minSofar, maxSofar, ref minDifference);\n\t}\n\n\tprivate static int[] ReadIntArray()\n\t{\n\t\treturn Console.ReadLine().Split().Select(int.Parse).ToArray();\n\t}\n\t\n\tprivate static long[] ReadLongArray()\n\t{\n\t\treturn Console.ReadLine().Split().Select(long.Parse).ToArray();\n\t}\n\t\n\tprivate static int ReadInt()\n\t{\n\t\treturn int.Parse(Console.ReadLine());\n\t}\n\t\n\tprivate static long ReadLong()\n\t{\n\t\treturn long.Parse(Console.ReadLine());\n\t}\n}", "lang": "MS C#", "bug_code_uid": "4044ffc78fc684b090b736326e156681", "src_uid": "7830aabb0663e645d54004063746e47f", "apr_id": "e747f02d0233e2e6c5c8a8ba0f7198ef", "difficulty": 900, "tags": ["greedy"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9990118577075099, "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.Text;\n\nnamespace Round218\n{\n class ProgramA\n {\n static void Main(string[] args)\n {\n Console.SetIn(System.IO.File.OpenText(\"input.txt\"));\n\n string[] ar = Console.ReadLine().Split();\n\n int n = int.Parse(ar[0]);\n int k = int.Parse(ar[1]);\n\n int m = n / k;\n\n int[,] rep = new int[k, 2];\n\n ar = Console.ReadLine().Split();\n\n for (int i = 0; i < n; i++)\n {\n int index = i % k;\n if (ar[i] == \"1\")\n rep[index, 0]++;\n else\n rep[index, 1]++;\n }\n\n int count = 0;\n for (int i = 0; i < k; i++)\n {\n int rOne = m - rep[i, 0];\n int rTwo = m - rep[i, 1];\n count += Math.Min(rOne, rTwo);\n }\n Console.WriteLine(count);\n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "7606a6681560e1c201cedc8704d9cd35", "src_uid": "5f94c2ecf1cf8fdbb6117cab801ed281", "apr_id": "79a9b74d6376509a7c53e1445ac30259", "difficulty": 1000, "tags": ["greedy", "math", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.6913348946135831, "equal_cnt": 12, "replace_cnt": 8, "delete_cnt": 1, "insert_cnt": 3, "fix_ops_cnt": 12, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\n\nnamespace ConsoleApplication21\n{\n class Program\n {\n static void Main(string[] args)\n {\n\n int l;\n string str=Console.ReadLine();\n string []str2=str.Split(' ');\n \n int n=Convert.ToInt32(str2[0]);\n \n int k=Convert.ToInt32(str2[1]);\n int[] a=new int [n];\n\n string \n\n\n int s=0;\n for (l = 0; l < k; l++)\n {\n int one = 0;\n int two = 0;\n for (int i = 0; i < n; i = i + k)\n if (a[i + l] == 1)\n one++;\n else\n two++;\n int min = one > two ? two : one;\n s = s + min;\n }\n Console.WriteLine(s);\n Console.ReadLine();\n \n\n\n\n\n\n\n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "183b9467943192cf883c78e971e1dc46", "src_uid": "5f94c2ecf1cf8fdbb6117cab801ed281", "apr_id": "96fa1f631abd35ce6983f577ba381ff5", "difficulty": 1000, "tags": ["greedy", "math", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.848668846333489, "equal_cnt": 20, "replace_cnt": 9, "delete_cnt": 5, "insert_cnt": 6, "fix_ops_cnt": 20, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace test\n{\n class Program\n {\n\n\n public static int ApperCaseBegins(int i, string s)\n {\n char[] chararr = s.ToCharArray();\n for (; i < chararr.Length; i++)\n {\n if (chararr[i] <= 90) return i;\n }\n return i;\n }\n\n public static bool Contains_lowercase(string S)\n {\n\n char[] chararr = S.ToCharArray();\n\n for (int i = 0; i <= chararr.Length; i++)\n {\n if (chararr[i] >= 97) return true;\n }\n return false;\n }\n\n\n\n static void Main(string[] args)\n {\n string input_string;\n int string_size, ans, i;\n List list_of_sub_strings = new List();\n\n string_size = int.Parse(Console.ReadLine());\n input_string = Console.ReadLine();\n\n\n if (!Contains_lowercase(input_string)) Console.WriteLine(0);\n else\n {\n int helper;\n char[] charArray = input_string.ToCharArray();\n for (i = 0; i < charArray.Length; i++)\n {\n\n if (charArray[i] >= 97)\n {\n helper = ApperCaseBegins(i, input_string);\n list_of_sub_strings.Add(input_string.Substring(i, helper - i));\n i = helper;\n }\n }\n\n }\n\n\n HashSet mySet = new HashSet();\n ans = 0;\n for (i = 0; i < list_of_sub_strings.Count; i++)\n {\n\n // mySet = new HashSet(list_of_sub_strings[i].ToCharArray());\n foreach (char c in list_of_sub_strings[i].ToCharArray()) mySet.Add(c);\n if (ans < mySet.Count()) { ans = mySet.Count(); }\n mySet.Clear();\n }\n\n // foreach (string s in list_of_sub_strings) Console.WriteLine(s);\n Console.WriteLine(ans);\n //Console.ReadKey();\n }\n\n\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "a69052bf16c26390c7aecd99a1379414", "src_uid": "567ce65f87d2fb922b0f7e0957fbada3", "apr_id": "7c64cdcf1bfa872c9baca60d221fed08", "difficulty": 1000, "tags": ["strings", "brute force", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9743366681165724, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "using System;\n\nnamespace _807B\n{\n class Program\n {\n static void Main(string[] args)\n {\n string[] input = Console.ReadLine().Split(' ');\n int p = int.Parse(input[0]), x = int.Parse(input[1]), y = int.Parse(input[2]);\n int result = -1, t = x;\n while (t >= y)\n {\n if (F(t, p))\n {\n result = 0;\n break;\n }\n t -= 50;\n }\n if (result == -1)\n {\n while (!F(t, p))\n t += 50;\n result = (int)Math.Ceiling((t - x) / 100D);\n }\n Console.WriteLine(result);\n }\n\n static bool F(int t, int p)\n {\n bool res = false;\n int i = (t / 50) % 475;\n for (int j = 0; j < 25; j++)\n {\n i = (i * 96 + 42) % 475;\n if (i + 26 == p)\n {\n res = true;\n break;\n }\n }\n return res;\n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "034ae414bd943a5d3e205caad868c2ee", "src_uid": "c9c22e03c70a94a745b451fc79e112fd", "apr_id": "1a2a13703a59b258ac069f4eddf429cd", "difficulty": 1300, "tags": ["brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.9980628199806282, "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.Globalization;\nusing System.IO;\nusing System.Linq;\nusing System.Text;\n\nclass Program\n{\n private static bool Can(int s, int p)\n {\n var i = (s / 50) % 475;\n for (int j = 0; j < 25; j++)\n {\n i = (i * 96 + 42) % 475;\n if (26 + i == p) return true;\n }\n\n return false;\n }\n\n private static void Main(string[] args)\n {\n int p = RI();\n int x = RI();\n int y = RI();\n\n for (int i = -1000; i <= 1000; i++)\n if (x + 50 * i >= y)\n if (Can(x + 50 * i, p))\n {\n Console.WriteLine(Math.Max(0, (i + 1) / 2));\n }\n }\n\n private const int Mod = 1000000000 + 7;\n\n #region Data Read\n\n private static long GCD(long a, long b)\n {\n if (a % b == 0) return b;\n return GCD(b, a % b);\n }\n\n private static List[] ReadGraph(int n, int m)\n {\n List[] g = new List[n];\n for (int i = 0; i < g.Length; i++) g[i] = new List();\n for (int i = 0; i < m; i++)\n {\n int a = RI() - 1;\n int b = RI() - 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 = RI();\n int b = RI();\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 RI()\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 RUL()\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 RL()\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[] RIA(int n)\n {\n int[] ans = new int[n];\n for (int i = 0; i < n; i++)\n ans[i] = RI();\n return ans;\n }\n\n private static long[] RLA(int n)\n {\n long[] ans = new long[n];\n for (int i = 0; i < n; i++)\n ans[i] = RL();\n return ans;\n }\n\n private static char[] ReadWord()\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[] ReadStringLine()\n {\n int ans;\n\n do\n {\n ans = consoleReader.Read();\n } while (ans == 10 || ans == 13);\n\n List s = new List();\n\n do\n {\n s.Add((char)ans);\n ans = consoleReader.Read();\n } while (ans != 10 && ans != 13 && ans != -1);\n\n return s.ToArray();\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 private static char ReadNonLetter()\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 ReadAnyOf(IEnumerable allowed)\n {\n while (true)\n {\n char ans = (char)consoleReader.Read();\n if (allowed.Contains(ans))\n return 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 private static double DoubleFromString(string x)\n {\n return double.Parse(x, 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(StringBuilder sb)\n {\n PushTestData(sb.ToString());\n }\n private static void PushTestData(string data)\n {\n#if TOLYAN_TEST\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 #endregion\n}", "lang": "MS C#", "bug_code_uid": "cec22e242c180341544d9524235b5690", "src_uid": "c9c22e03c70a94a745b451fc79e112fd", "apr_id": "750a310f3b8a14bf69f8b4af3e7deb16", "difficulty": 1300, "tags": ["brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.9914745816229871, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "using System;\nusing System.Diagnostics.Contracts;\nusing System.Globalization;\nusing System.IO;\nusing System.Linq;\n\nnamespace Codeforces.R316D1\n{\n public struct ModInteger : IEquatable\n {\n readonly int mod;\n readonly long value;\n public ModInteger(int mod, long value = 0L)\n {\n this.mod = mod;\n this.value = value % mod;\n if (value < 0)\n {\n this.value = value + mod;\n }\n }\n\n public bool Equals(ModInteger other)\n {\n return mod == other.mod && value == other.value;\n }\n\n public override bool Equals(object obj)\n {\n if (!(obj is ModInteger))\n {\n return false;\n }\n var other = (ModInteger)obj;\n return Equals(other);\n }\n\n public override int GetHashCode()\n {\n return (int)value;\n }\n\n public static bool operator ==(ModInteger left, ModInteger right)\n {\n return left.Equals(right);\n }\n\n public static bool operator !=(ModInteger left, ModInteger right)\n {\n return !(left == right);\n }\n\n public static ModInteger LeftShift(ModInteger left, int right)\n {\n return left << right;\n }\n\n public static ModInteger operator <<(ModInteger left, int right)\n {\n if (right > 32)\n {\n return left << 32 << (right - 32);\n }\n return new ModInteger(left.mod, left.value << right);\n }\n\n public static ModInteger Add(ModInteger left, int right)\n {\n return left + right;\n }\n\n public static ModInteger operator +(ModInteger left, int right)\n {\n return new ModInteger(left.mod, left.value + right);\n }\n\n public static ModInteger operator ++(ModInteger m)\n {\n return m + 1;\n }\n\n public static ModInteger Multiply(ModInteger left, int right)\n {\n return new ModInteger(left.mod, left.value * right);\n }\n\n public static ModInteger operator *(ModInteger left, int right)\n {\n return Multiply(left, right);\n }\n\n public static ModInteger Div(int left, int right, int mod)\n {\n return Pow(right, mod - 2, mod) * left;\n }\n\n public static ModInteger Pow(long x, int n, int mod)\n {\n var res = 1L;\n for (; n > 0; n >>= 1)\n {\n if ((n & 1) == 1)\n {\n res = res * x % mod;\n }\n x = x * x % mod;\n }\n return new ModInteger(mod, res);\n }\n\n public static ModInteger ToModInteger(int value)\n {\n return new ModInteger(0, value);\n }\n\n public static implicit operator int(ModInteger value)\n {\n return (int)value.value;\n }\n\n public static int ToInt32(ModInteger value)\n {\n return value;\n }\n\n public static ModInteger Increment(ModInteger item)\n {\n return ++item;\n }\n }\n public static class Solver\n {\n const int mod = 1000000007;\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 Contract.Requires(tr != null);\n Contract.Requires(tw != null);\n\n tw.WriteLine(Parse(tr));\n }\n\n private static int Parse(TextReader tr)\n {\n var info = CultureInfo.InvariantCulture;\n tr.ReadLine();\n var a = tr.ReadLine().Split().Select(x => int.Parse(x, info)).ToArray();\n\n return Calc(a);\n }\n\n private static ModInteger Calc(int[] a)\n {\n int num1 = a.Count(x => x == 1);\n int num2 = a.Length - num1;\n\n return F(num1, num2);\n }\n\n private static ModInteger F(int a, int b)\n {\n var res = new ModInteger(mod, 1);\n\n for (int i = 0; i < b; ++i)\n {\n res *= a + 1 + i;\n }\n\n var I = new ModInteger[a + 1];\n I[0] = new ModInteger(mod, 1);\n I[1] = new ModInteger(mod, 1);\n for (int i = 2; i <= a; ++i)\n {\n I[i] = I[i - 1] + (i - 1) * I[i - 2];\n }\n return res * I[a];\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "2796e00ee5eb49807263243cfe7df16f", "src_uid": "91e8dbe94273e255182aca0f94117bb9", "apr_id": "cfde6cdb1db30a02e087874cd06792ed", "difficulty": 2300, "tags": ["dp", "brute force"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.014834794335805798, "equal_cnt": 26, "replace_cnt": 20, "delete_cnt": 1, "insert_cnt": 5, "fix_ops_cnt": 26, "bug_source_code": "\nMicrosoft Visual Studio Solution File, Format Version 12.00\n# Visual Studio 15\nVisualStudioVersion = 15.0.27428.2015\nMinimumVisualStudioVersion = 10.0.40219.1\nProject(\"{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}\") = \"Cakeminator\", \"Cakeminator\\Cakeminator.csproj\", \"{69B40C6B-8B15-4893-BC10-C83C32D163CE}\"\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{69B40C6B-8B15-4893-BC10-C83C32D163CE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{69B40C6B-8B15-4893-BC10-C83C32D163CE}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{69B40C6B-8B15-4893-BC10-C83C32D163CE}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{69B40C6B-8B15-4893-BC10-C83C32D163CE}.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 = {145B729C-3B15-4625-9DF8-9D75548722C1}\n\tEndGlobalSection\nEndGlobal\n", "lang": "Mono C#", "bug_code_uid": "3ba2eec83925f770dc0e0057b2c641a9", "src_uid": "ebaf7d89c623d006a6f1ffd025892102", "apr_id": "693dbbbe61a461adff975c4348567731", "difficulty": 800, "tags": ["brute force", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.70995670995671, "equal_cnt": 11, "replace_cnt": 5, "delete_cnt": 2, "insert_cnt": 3, "fix_ops_cnt": 10, "bug_source_code": "using System;\nusing System.Text;\nusing System.Linq;\nusing System.Collections.Generic;\n\nnamespace test\n{\n\tclass MainClass\n\t{\n\t\tpublic static void Main (string[] args)\n\t\t{\n\t\t\tvar n = Int32.Parse (Console.ReadLine ());\n\n\t\t\tvar tList = Console.ReadLine ().Split (' ').Select (x => Int32.Parse (x)).OrderBy(x => x);\n\n\t\t\tvar T = Int32.Parse (Console.ReadLine ());\n\n\t\t\tvar prev = tList.First ();\n\t\t\tvar maxLen = 1;\n\t\t\tvar currentLen = 1;\n\n\t\t\ttList.Skip(1).ToList().ForEach (x => {\n\t\t\t\tif (x - prev > T) {\n\t\t\t\t\tcurrentLen = 1;\n\t\t\t\t} else {\n\t\t\t\t\tcurrentLen++;\n\t\t\t\t}\n\n\t\t\t\tif (currentLen > maxLen) {\n\t\t\t\t\tmaxLen = currentLen;\n\t\t\t\t}\n\n\t\t\t\tprev = x;\n\t\t\t});\n\n\t\t\tConsole.WriteLine (maxLen);\n\t\t}\n\t}\n}\n", "lang": "Mono C#", "bug_code_uid": "364205c4dceff79d1a54389c0df42aaf", "src_uid": "086d07bd6f9031df09bd6a6e8fe8f25c", "apr_id": "242aec8ea82b9ac3b30fd07858781a56", "difficulty": 1400, "tags": ["brute force", "implementation", "binary search"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.5845755022683085, "equal_cnt": 7, "replace_cnt": 2, "delete_cnt": 5, "insert_cnt": 0, "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 Arpa_and_a_research_in_Mexican_wave\n{\n class Program\n {\n static void Main(string[] args)\n {\n int[] input = Console.ReadLine().Split(' ').Select(int.Parse).ToArray();\n int n = input[0];\n int k = input[1];\n int t = input[2];\n int[] persons = new int[9999];\n for(int i = 1; i <= t;i++)\n {\n persons[i] = 1;\n if(i > k)\n {\n persons[i - k] = 0;\n }\n if(i > n)\n {\n persons[n - k] = 0;\n }\n if(i == k +n)\n {\n persons[n] = 0;\n }\n }\n int count = 0;\n for(int i = 0; i < 11;i++)\n {\n count += persons[i];\n }\n Console.Write(count);\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "133717f079dff9445be78339decfa26e", "src_uid": "7e614526109a2052bfe7934381e7f6c2", "apr_id": "b3168921b18fbcb802f164390fc18611", "difficulty": 800, "tags": ["math", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C#"} {"similarity_score": 0.6323943661971831, "equal_cnt": 7, "replace_cnt": 3, "delete_cnt": 4, "insert_cnt": 0, "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 Arpa_and_a_research_in_Mexican_wave\n{\n class Program\n {\n static void Main(string[] args)\n {\n int[] input = Console.ReadLine().Split(' ').Select(int.Parse).ToArray();\n int n = input[0];\n int k = input[1];\n int t = input[2];\n int standingpersons = 0;\n for(int i = 1; i <= t;i++)\n {\n standingpersons++;\n if(i > k)\n {\n standingpersons--;\n }\n if(i > n)\n {\n standingpersons--;\n }\n if(i == k +n)\n {\n standingpersons--;\n }\n }\n Console.Write(standingpersons);\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "35057fb61e399926ef5c91e4f675e148", "src_uid": "7e614526109a2052bfe7934381e7f6c2", "apr_id": "b3168921b18fbcb802f164390fc18611", "difficulty": 800, "tags": ["math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "delete", "lang_cluster": "C#"} {"similarity_score": 0.9986480396575034, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.ComponentModel;\nusing System.Diagnostics;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace ConsoleApplication1\n{\n class Program\n {\n public static void main(string[] ags)\n {\n string[] s = Console.ReadLine().Split(' ');\n int first, next;\n first = int.Parse(s[0]);\n next = int.Parse(s[1]);\n if (Next(first) == next) \n {\n Console.WriteLine(\"YES\");\n }\n else \n {\n Console.WriteLine(\"NO\");\n }\n }\n static int Next(int start) \n {\n start++;\n while (!isPrime(start)) \n {\n start++;\n }\n return start;\n \n }\n static bool isPrime(int n) \n {\n int limit = (int)Math.Sqrt(n);\n for (int i = 2; i < limit; i++) \n {\n if (n % i == 0) { return false; }\n }\n return true;\n }\n }\n}\n\n", "lang": "MS C#", "bug_code_uid": "c79b17458306ca396f0cc675483024a1", "src_uid": "9d52ff51d747bb59aa463b6358258865", "apr_id": "d1f13f3928d428a4b75372b3d152d7b4", "difficulty": 800, "tags": ["brute force"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.8587257617728532, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "using System;\nusing System.Linq;\nclass Program\n{\n static void Main()\n {\n var primes = new int[] { 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47 };\n var nm = Console.ReadLine().Split().Select(int.Parse).ToArray();\n Console.WriteLine(nm[1] == primes[Array.IndexOf(primes, nm[0]) + 1] ? \"YES\" : \"NO\");\n }\n}\n", "lang": "MS C#", "bug_code_uid": "32da9b9bcfcb29a6d906609e0b432ca3", "src_uid": "9d52ff51d747bb59aa463b6358258865", "apr_id": "ea2d0bad1e94bac507bf8d7f212475b6", "difficulty": 800, "tags": ["brute force"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9898305084745763, "equal_cnt": 1, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "namespace ConsoleApplication\n{\n class Program\n {\n static void Main(string[] args)\n {\n var before = GC.GetTotalMemory(true);\n var input = Console.ReadLine().Split(' ');\n var n = byte.Parse(input[0]);\n var m = byte.Parse(input[1]);\n byte next = 0;\n byte[] arr = { 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47};\n\n for (int i = 0; i < arr.Length; i++)\n {\n if (arr[i] > n)\n {\n next = arr[i];\n break;\n }\n }\n \n if(m == next) Console.Write(\"YES\");\n else Console.WriteLine(\"NO\");\n }\n }\n}", "lang": "MS C#", "bug_code_uid": "ab7a529938ee6c9cb66687e96907f35a", "src_uid": "9d52ff51d747bb59aa463b6358258865", "apr_id": "fc42f012cde7c1e07fd7ada08d4e793a", "difficulty": 800, "tags": ["brute force"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.9840388619014573, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "using System.Collections;\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\nusing System.IO;\nnamespace Contest_379_div2_B\n{\n class Program\n {\n static void Main(string[] args)\n {\n int r = 0;\n using (StreamReader r = new StreamReader(Console.OpenStandardInput()))\n {\n int d = 0, min;//is the count of 256 ;\n List j = r.ReadLine().Split().Select(x => int.Parse(x)).ToList();\n min = Math.Min(j[0], j[2]);min = Math.Min(j[3], min);\n d = Math.Min(j[1], j[0] - min);\n Console.WriteLine(256 * min + d * 32);\n }\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "463e3d0bf472df757a3b0183b5368ba5", "src_uid": "082b31cc156a7ba1e0a982f07ecc207e", "apr_id": "df04fcc81179f50d3f7ea0390a4c0bf8", "difficulty": 800, "tags": ["greedy", "math", "brute force", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C#"} {"similarity_score": 0.8968713789107764, "equal_cnt": 10, "replace_cnt": 3, "delete_cnt": 1, "insert_cnt": 5, "fix_ops_cnt": 9, "bug_source_code": "using System;\nusing System.Linq;\n\npublic class Example\n{ \n public static void Main(string[] args)\n {\n var numbers = Console.ReadLine().Split(' ').Select(x => int.Parse(x)).ToList();\n var Count256 = numbers.Where(x => numbers.IndexOf(x) != 1).Min();\n var count32 = Math.Min(numbers[1], numbers[0] - Count256);\n Console.WriteLine(256 * Count256 + 32 * count32);\n }\n}", "lang": "Mono C#", "bug_code_uid": "007e23e880aca9ec9114247d451441da", "src_uid": "082b31cc156a7ba1e0a982f07ecc207e", "apr_id": "528db27b3d2e52d69865e826ed3b029c", "difficulty": 800, "tags": ["greedy", "math", "brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.9674657534246576, "equal_cnt": 5, "replace_cnt": 0, "delete_cnt": 2, "insert_cnt": 2, "fix_ops_cnt": 4, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Runtime.InteropServices.ComTypes;\nusing System.Text;\n\nnamespace Task1\n{\n internal class Program\n {\n public static void Main(string[] args)\n {\n var inputs = Input.ReadNumbers();\n\n var n = inputs[0];\n var k = inputs[1];\n\n var s = Console.ReadLine();\n\n var g = s.IndexOf('G');\n var t = s.IndexOf('T');\n\n var i = g;\n\n if (g < t)\n {\n while (i <= t && i < n)\n {\n if (i == t)\n {\n Console.WriteLine(\"YES\");\n return;\n }\n\n i += k;\n if (s[i] == '#')\n {\n Console.WriteLine(\"NO\");\n return;\n }\n }\n }\n else\n {\n while (i >= t && i >= 0)\n {\n if (i == t)\n {\n Console.WriteLine(\"YES\");\n return;\n }\n\n i -= k;\n if (s[i] == '#')\n {\n Console.WriteLine(\"NO\");\n return;\n }\n }\n }\n\n Console.WriteLine(\"NO\");\n }\n }\n\n static class Input\n {\n public static List ReadNumbers()\n {\n var input = Console.ReadLine();\n return input.Split(new []{\" \"}, StringSplitOptions.RemoveEmptyEntries).Select(Int32.Parse).ToList();\n }\n }\n}", "lang": "MS C#", "bug_code_uid": "8c1de9cd1fe239ee49e572e7913cf3c4", "src_uid": "189a9b5ce669bdb04b9d371d74a5dd41", "apr_id": "dbe5d8697906a86e9559714f8afaf6e8", "difficulty": 800, "tags": ["strings", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C#"} {"similarity_score": 0.9953323566488365, "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.Collections;\nusing System.Globalization;\nusing System.IO;\nusing System.Linq;\n\npublic class Source\n{\n public void Program()\n {\n }\n void method(int pos, int end, bool[] c,string s)\n {\n if (pos == end)\n {\n writeLine(\"YES\");\n return;\n }\n if (c[pos] == true || s[pos] == '#' || pos < 0 || pos >= n || c[pos])\n {\n writeLine(\"NO\");\n return;\n\n }\n c[pos] = true;\n method(pos + m, end, c, s);\n\n }\n int n, m;\n void Read()\n {\n n = ri(); m = ri();\n string s = reader.ReadLine();\n int start = 0, end = 0;\n bool[] c = new bool[n];\n fill(c, false);\n for (int i = 0; i < n; i++)\n {\n if (s[i] == 'G')\n start = i;\n if (s[i] == 'T')\n end = i;\n }\n if (start > end)\n m = -m;\n method(start, end, c,s);\n\n }\n\n #region hide it\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 var source = new Source();\n source.Read();\n source.Program();\n\n /* try\n {\n new Source().Program();\n }\n catch (Exception ex)\n {\n #if DEBUG\n Console.WriteLine(ex);\n #else\n throw;\n #endif\n }*/\n reader.Close();\n writer.Close();\n }\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()\n {\n while (currentLineTokens.Count == 0)\n currentLineTokens = new Queue(ReadAndSplitLine());\n return currentLineTokens.Dequeue();\n }\n public static int ri() { return int.Parse(ReadToken()); }\n public static char ReadChar() { return char.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(i => int.Parse(i)).ToArray(); }\n public static char[] ReadCharArray() { return ReadAndSplitLine().Select(i => char.Parse(i)).ToArray(); }\n public static long[] ReadLongArray() { return ReadAndSplitLine().Select(i => long.Parse(i)).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 char[][] ReadCharMatrix(int numberOfRows) { char[][] matrix = new char[numberOfRows][]; for (int i = 0; i < numberOfRows; i++) matrix[i] = ReadCharArray(); 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]; }\n 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 write(T value) { writer.Write(value); }\n public static void writeLine(T value) { writer.WriteLine(value); }\n public static void writeArray(T[] array, string split) { for (int i = 0; i < array.Length; i++) { write(array[i] + split); } }\n public static void writeMatrix(T[][] matrix, string split) { for (int i = 0; i < matrix.Length; i++) { writeArray(matrix[i], split); writer.Write(\"\\n\"); } }\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\n #region Methods\n #region DSU\n public void MakeSet(int[] poi)\n {\n for (int i = 0; i < poi.Length; i++)\n {\n poi[i] = i;\n }\n }\n public int Find(int x, int[] poi)\n {\n if (poi[x] == x) return x;\n return poi[x] = Find(poi[x], poi);\n }\n Random rand = new Random();\n public void Unite(int x, int y, int[] poi)\n {\n y = Find(y, poi);\n x = Find(x, poi);\n if (rand.Next() % 2 == 0)\n Swap(ref x, ref y);\n poi[x] = y;\n }\n #endregion\n\n class Deque\n {\n T[] array;\n int start, length;\n public Deque()\n {\n start = 0; length = 0; array = new T[1];\n }\n public T this[int index] { get { return array[(start + index) % array.Length]; } set { array[(start + index) % array.Length] = value; } }\n int last { get { return (start + length) % array.Length; } }\n /// \n /// сÑâ€Ã\n /// \n public T PeekFirst()\n {\n return array[start];\n }\n public int Count { get { return length; } }\n /// \n /// конецбез удаления\n /// \n public T PeekLsat()\n {\n return array[last];\n }\n public T PopLast()\n {\n if (length == 0)\n throw new IndexOutOfRangeException(\"OutOfRange\");\n length--;\n return array[last];\n }\n public T PopFirst()\n {\n if (length == 0)\n throw new IndexOutOfRangeException(\"OutOfRange\");\n length--;\n if (start >= array.Length - 1) start = 0; else start++;\n return array[start - 1 < 0 ? array.Length - 1 : start - 1];\n }\n public void AddFirst(T value)\n {\n IncreaseAndInspection();\n if (start <= 0) start = array.Length - 1; else start--;\n array[start] = value;\n length++;\n }\n public void AddLast(T value)\n {\n IncreaseAndInspection();\n array[last] = value;\n length++;\n }\n bool overflow { get { return length == array.Length; } }\n void IncreaseAndInspection()\n {\n if (overflow)\n increase();\n\n }\n void increase()\n {\n T[] array2 = new T[array.Length * 2];\n for (int i = 0; i < array.Length; i++)\n {\n int pos = (start + i) % array.Length;\n array2[i] = array[pos];\n }\n array = array2;\n start = 0;\n array2 = null;\n }\n public void Clear()\n {\n start = 0; length = 0; array = new T[1];\n }\n\n //размер, добавлени в конец/начало, удаление с конца/начало,\n }\n class Heap\n {\n Comparison ic;\n List storage = new List();\n public Heap(Comparison ic)\n {\n this.ic = ic;\n }\n public void Add(T element)\n {\n storage.Add(element);\n int pos = storage.Count - 1;\n while (pos != 0 && ic(storage[((int)(pos - 1) >> 1)], element) > 0)\n {\n Swap(storage, pos, ((int)(pos - 1) / 2));\n pos = ((int)(pos - 1) / 2);\n }\n }\n /// \n /// удаление последнего\n /// \n /// \n public T Pop()\n {\n T t = storage[0];\n Swap(storage, 0, storage.Count - 1);\n int pos = 0;\n storage.RemoveAt(storage.Count - 1);\n if (Count > 0)\n while (true)\n {\n T my = storage[pos];\n if (pos * 2 + 1 >= Count)\n break;\n T left = storage[pos * 2 + 1];\n if (pos * 2 + 2 >= Count)\n {\n if (ic(left, my) < 0)\n {\n Swap(storage, pos, pos * 2 + 1);\n pos = pos * 2 + 1;\n }\n break;\n }\n T right = storage[pos * 2 + 2];\n if (ic(left, my) < 0 || ic(right, my) < 0)\n {\n if (ic(left, right) < 0)\n {\n Swap(storage, pos, pos * 2 + 1);\n pos = pos * 2 + 1;\n }\n else\n {\n\n Swap(storage, pos, pos * 2 + 2);\n pos = pos * 2 + 2;\n }\n }\n else break;\n }\n return t;\n }\n\n public void Clear()\n {\n storage.Clear();\n }\n /// \n /// без удаления\n /// \n /// \n public T Peek()\n {\n return storage[0];\n }\n public int Count\n {\n get { return storage.Count; }\n }\n //void RemoveLast, Size, peeklast, add\n }\n static void Swap(ref T lhs, ref T rhs)\n {\n T temp;\n temp = lhs;\n lhs = rhs;\n rhs = temp;\n }\n static void Swap(T[] a, int l, int r)\n {\n T temp;\n temp = a[l];\n a[l] = a[r];\n a[r] = temp;\n }\n static void Swap(List a, int l, int r)\n {\n T temp;\n temp = a[l];\n a[l] = a[r];\n a[r] = temp;\n }\n\n bool outregion(long y, long x, long n, long m)\n {\n if (x < 0 || x >= m || y < 0 || y >= n)\n return true;\n return false;\n }\n static void initlist(ref List[] list, int n)\n {\n list = new List[n];\n for (int i = 0; i < n; i++)\n list[i] = new List();\n }\n static void newarray(ref T[][] array, int n, int m)\n {\n array = new T[n][];\n for (int i = 0; i < n; i++)\n array[i] = new T[m];\n }\n static void newarray(ref T[] array, int n)\n {\n array = new T[n];\n }\n static void fill(T[] array, T value)\n {\n for (int i = 0; i < array.Length; i++)\n array[i] = value;\n }\n static void fill(T[][] array, T value)\n {\n for (int i = 0; i < array.Length; i++)\n for (int j = 0; j < array[i].Length; j++)\n array[i][j] = value;\n }\n public bool NextPermutation(T[] b, Comparison ic)\n {\n for (int j = b.Length - 2; j >= 0; j--)\n {\n if (ic(b[j], b[j + 1]) < 0)\n {\n for (int l = b.Length - 1; l >= 0; l--)\n {\n if (ic(b[l], b[j]) > 0)\n {\n Swap(b, j, l);\n Array.Reverse(b, j + 1, b.Length - (j + 1));\n return true;\n }\n }\n }\n }\n return false;\n }\n int[,] step8 = new int[,]\n {\n {-1,0 },\n {1,0 },\n {0,-1 },\n {0,1 },\n {1,1 },\n {-1,1 },\n {-1,-1 },\n {1,-1 },\n };\n int[,] step4 = new int[,]\n {\n {-1,0 },\n {1,0 },\n {0,-1 },\n {0,1 },\n };\n struct Vector2\n {\n public double x;\n public double y;\n public Vector2(double x, double y)\n {\n this.x = x;\n this.y = y;\n }\n public double Dist(Vector2 to)\n {\n return Math.Sqrt(Math.Abs(Math.Pow(to.x - x, 2)) + Math.Abs(Math.Pow(to.y - y, 2)));\n }\n public static bool operator ==(Vector2 left, Vector2 right) { return left.x == right.x && left.y == right.y; }\n public static bool operator !=(Vector2 left, Vector2 right) { return left.x != right.x || left.y != right.y; }\n }\n #endregion\n #endregion\n\n}", "lang": "MS C#", "bug_code_uid": "d29407c124db4337793d82415da8ea12", "src_uid": "189a9b5ce669bdb04b9d371d74a5dd41", "apr_id": "843e1f10365a2877dfddf700b5881945", "difficulty": 800, "tags": ["strings", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C#"} {"similarity_score": 0.9994404029099049, "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 CodeForces1\n{\n class Program\n {\n static bool isright(int[] x, int[] y)\n {\n if (x[0] == x[1] && y[0] == y[1]) return false;\n if (x[0] == x[2] && y[0] == y[2]) return false;\n if (x[2] == x[1] && y[2] == y[1]) return false;\n int a, b, c;\n a = (x[0] - x[1]) * (x[0] - x[1]) + (y[0] - y[1]) * (y[0] - y[1]);\n b = (x[2] - x[1]) * (x[2] - x[1]) + (y[2] - y[1]) * (y[2] - y[1]);\n c = (x[0] - x[2]) * (x[0] - x[2]) + (y[0] - y[2]) * (y[0] - y[2]);\n\n return (a + b == c || b + c == a || c + a == b);\n }\n static bool isalmostright(int[] x, int[] y)\n {\n int[] dx = { -1, 1, 0, 0 };\n int[] dy = { 0, 0, -1, 1 };\n for (int i = 0; i < 3; ++i)\n {\n for (int j = 0; j < 4; ++j)\n {\n x[i] += dx[j];\n y[i] += dy[j];\n if (isright(x, y)) return true;\n x[i] -= dx[j];\n y[i] -= dy[j];\n }\n }\n return false;\n }\n public static void Main()\n {\n string[] t = Console.ReadLine().Split();\n int[] x = new int[3];\n int[] y = new int[3];\n for (int i = 0; i < 3; ++i)\n {\n x[i] = int.Parse(t[2 * i]);\n y[i] = int.Parse(t[2 * i + 1]);\n }\n\n if (isright(x, y)) { Console.WriteLine(\"RIGHT\"); return; }\n if (isalmostright(x, y)) { Console.WriteLine(\"ALMOST\"); return; }\n Console.WriteLine(\"NEITHER\");\n }\n }", "lang": "Mono C#", "bug_code_uid": "d7e94b35e1f6efa2ea5122b0c1a93599", "src_uid": "8324fa542297c21bda1a4aed0bd45a2d", "apr_id": "4fcb845ef91648e287c7f48d58d2f63a", "difficulty": 1500, "tags": ["geometry", "brute force"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.5919811320754716, "equal_cnt": 84, "replace_cnt": 70, "delete_cnt": 0, "insert_cnt": 13, "fix_ops_cnt": 83, "bug_source_code": "using System;\nusing System.Collections;\nusing System.Text;\nnamespace p2\n{\n class Program\n {\n public static int Main(string[] args)\n { string[] line =Console.ReadLine().Split();\n int x1,x2,x3,y1,y2,y3;\n x1=int.Parse(line[0]);\n x2=int.Parse(line[2]);\n x3=int.Parse(line[4]);\n y1=int.Parse(line[1]);\n y2=int.Parse(line[3]);\n y3=int.Parse(line[5]);\n double a,b,c;\n bool f=false\n ini(x1, x2, x3, y1, y2, y3,out a,out b,out c);\n if (pif(a,b,c)==true){Console.WriteLine(\"RIGHT\");return 0;}\n \n Almost(x1, x2, x3, y1, y2, y3, a, b, c, f,out f);\n if(f==true){return 0;}\n Console.WriteLine( \"NEITHER\");\n //Console.ReadKey();\n return 0;\n }\n\n static void Almost(int x1, int x2, int x3, int y1, int y2, int y3, double a, double b, double c,out bool f)\n {\n ini(x1 + 1, x2, x3, y1, y2, y3, out a, out b, out c);\n if (pif(a, b, c) == true) {\n Console.WriteLine(\"ALMOST\");f=true;\n return 0;\n }\n ini(x1 - 1, x2, x3, y1, y2, y3, out a, out b, out c);\n if (pif(a, b, c) == true) {\n Console.WriteLine(\"ALMOST\");f=true;\n return 0;\n }\n ini(x1, x2 + 1, x3, y1, y2, y3, out a, out b, out c);\n if (pif(a, b, c) == true) {\n Console.WriteLine(\"ALMOST\");f=true;\n return 0;\n }\n ini(x1, x2 - 1, x3, y1, y2, y3, out a, out b, out c);\n if (pif(a, b, c) == true) {\n Console.WriteLine(\"ALMOST\");f=true;\n return 0;\n }\n ini(x1, x2, x3 + 1, y1, y2, y3, out a, out b, out c);\n if (pif(a, b, c) == true) {\n Console.WriteLine(\"ALMOST\");f=true;\n return 0;\n }\n ini(x1, x2, x3 - 1, y1, y2, y3, out a, out b, out c);\n if (pif(a, b, c) == true) {\n Console.WriteLine(\"ALMOST\");f=true;\n return 0;\n }\n ini(x1, x2, x3, y1 + 1, y2, y3, out a, out b, out c);\n if (pif(a, b, c) == true) {\n Console.WriteLine(\"ALMOST\");f=true;\n return 0;\n }\n ini(x1, x2, x3, y1 - 1, y2, y3, out a, out b, out c);\n if (pif(a, b, c) == true) {\n Console.WriteLine(\"ALMOST\");f=true;\n return 0;\n }\n ini(x1, x2, x3, y1, y2 + 1, y3, out a, out b, out c);\n if (pif(a, b, c) == true) {\n Console.WriteLine(\"ALMOST\");f=true;\n return 0;\n }\n ini(x1, x2, x3, y1, y2 - 1, y3, out a, out b, out c);\n if (pif(a, b, c) == true) {\n Console.WriteLine(\"ALMOST\");f=true;\n return 0;\n }\n ini(x1, x2, x3, y1, y2, y3 + 1, out a, out b, out c);\n if (pif(a, b, c) == true) {\n Console.WriteLine(\"ALMOST\");f=true;\n return 0;\n }\n ini(x1, x2, x3, y1, y2, y3 - 1, out a, out b, out c);\n if (pif(a, b, c) == true) {\n Console.WriteLine(\"ALMOST\");f=true;\n return 0;\n }\n return 0;\n }\n\n static void ini(int x1, int x2, int x3, int y1, int y2, int y3,out double a,out double b,out double c)\n {\n a = otr(x1, y1, x2, y2);\n b = otr(x2, y2, x3, y3);\n c = otr(x1, y1, x3, y3);\n }\n public static double otr(int a1,int b1,int a2,int b2){\n return ((a2-a1)*(a2-a1)+(b2-b1)*(b2-b1));\n }\n public static bool pif(double a,double b,double c){\n if(a+b-c==0) {return true;}\n if(a-b+c==0) {return true;}\n if(-a+b+c==0) {return true;}\n return false;}\n }\n }", "lang": "Mono C#", "bug_code_uid": "d4a70577accb9002da2f67bf5891a968", "src_uid": "8324fa542297c21bda1a4aed0bd45a2d", "apr_id": "eca57c180388b54ec007e77589d0932e", "difficulty": 1500, "tags": ["geometry", "brute force"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9165763813651138, "equal_cnt": 24, "replace_cnt": 3, "delete_cnt": 10, "insert_cnt": 11, "fix_ops_cnt": 24, "bug_source_code": "using System;\n\nusing System.Collections.Generic;\n\nusing System.Linq;\n\nusing System.Text;\n\nusing System.IO;\n\n\n\nnamespace FirstApp\n{\n\n class Program\n {\n\n\n static void Main(string[] args)\n {\n\n string[] substr = new string[10000];\n\n int[] count = new int[10000];\n\n int num = 0;\n\n string str = Console.ReadLine();\n // string str = \"wzznz\";\n\n bool check;\n\n for (int i = 0; i < 10000; i++)\n {\n\n count[i] = 0;\n\n }\n\n for (var i = 0; i < str.Length; i++)\n {\n\n StringBuilder tmp = new StringBuilder(\"\", 1000);\n\n for (var j = i; j < str.Length; j++)\n {\n\n\n\n tmp.AppendFormat(Convert.ToString(str[j]));\n\n // if (tmp.Length > 1)\n // {\n\n //проверяем есть ли значение в массиве подстрок\n\n check = true;\n\n for (var m = 0; m < num; m++)\n {\n if (String.Compare(Convert.ToString(tmp), Convert.ToString(substr[m]), true) == 0)\n {\n check = false;\n }\n }\n\n //проверяем на уникальность и добавим в массив подстроки\n\n if (check == true)\n {\n substr[num] = Convert.ToString(tmp);\n num++;\n }\n\n //}\n\n }\n\n }\n\n\n //начинаем поиск\n\n for (var r = 0; r < num; r++)\n {\n int pos = -1; //позиция\n\n for (int st = 0; st < str.Length; st++)\n {\n int index = str.IndexOf(substr[r], st);\n\n if (index > -1 && pos != index)\n {\n count[r] = count[r] + 1;\n pos = index; \n\n }\n }\n }\n\n //отбираем самую большую подстроку\n int symcount = 0;\n for (var r = 0; r < num; r++)\n {\n if (count[r] > 1)\n {\n // Console.WriteLine(count[r]);\n if (substr[r].Length > symcount)\n {\n symcount = substr[r].Length;\n }\n }\n }\n\n Console.WriteLine(symcount);\n\n \n\n // Console.ReadKey();\n\n }\n\n\n\n // static bool Check(string tmp){\n\n\n // return true;\n\n // }\n\n\n }\n\n}", "lang": "MS C#", "bug_code_uid": "797dabf028c2aa74c22c5e906a3cb014", "src_uid": "13b5cf94f2fabd053375a5ccf3fd44c7", "apr_id": "1394ff04b42494b1647fa51ad8d13c8e", "difficulty": 1200, "tags": ["brute force", "greedy"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.999640933572711, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "using System;\n\nusing System.Collections.Generic;\n\nusing System.Linq;\n\nusing System.Text;\n\nusing System.IO;\n\n\n\nnamespace FirstApp\n{\n\n class Program\n {\n\n\n static void Main(string[] args)\n {\n\n string[] substr = new string[10000];\n\n int[] count = new int[10000];\n\n int num = 0;\n\n string str = Console.ReadLine();\n // string str = \"ckvfndqgkmhcyojaqgdkenmbexufryhqejdhctxujmtrwkpbqxufxamgoeigzfyzbhevpbkvviwntdhqscvkmphnkkljizndnbjt\";\n\n bool check;\n\n for (int i = 0; i < 10000; i++)\n {\n\n count[i] = 0;\n\n }\n\n for (var i = 0; i < str.Length; i++)\n {\n\n StringBuilder tmp = new StringBuilder(\"\", 1000);\n\n for (var j = i; j < str.Length; j++)\n {\n\n tmp.AppendFormat(Convert.ToString(str[j]));\n\n //проверяем есть ли значение в массиве подстрок\n\n check = true;\n /*\n for (var m = 0; m < num; m++)\n {\n if (String.Compare(Convert.ToString(tmp), Convert.ToString(substr[m]), true) == 0)\n {\n check = false;\n break;\n } \n }\n */\n //проверяем на уникальность и добавим в массив подстроки\n\n if (check == true)\n {\n substr[num] = Convert.ToString(tmp);\n num++;\n }\n }\n\n }\n\n\n //начинаем поиск\n\n for (var r = 0; r < num; r++)\n {\n int pos = -1; //позиция\n\n for (int st = 0; st < str.Length; st++)\n {\n int index = str.IndexOf(substr[r], st);\n\n if (index > -1 && pos != index)\n {\n count[r] = count[r] + 1;\n pos = index; \n\n }\n }\n }\n\n //отбираем самую большую подстроку\n\n \n int symcount = 0;\n for (var r = 0; r < num; r++)\n {\n if (count[r] > 1)\n {\n // Console.WriteLine(count[r]);\n if (substr[r].Length > symcount)\n {\n symcount = substr[r].Length;\n }\n }\n }\n \n Console.WriteLine(symcount);\n \n\n // Console.WriteLine(\"end\");\n Console.ReadKey();\n\n }\n }\n}", "lang": "MS C#", "bug_code_uid": "876cd9b6c89d8ef17dbff95f4455fda4", "src_uid": "13b5cf94f2fabd053375a5ccf3fd44c7", "apr_id": "1394ff04b42494b1647fa51ad8d13c8e", "difficulty": 1200, "tags": ["brute force", "greedy"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.993256644188814, "equal_cnt": 7, "replace_cnt": 1, "delete_cnt": 3, "insert_cnt": 2, "fix_ops_cnt": 6, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Text;\n\nnamespace Program1\n{\n class Program\n {\n\n static int Main(string[] args)\n {\n\n string str = GetString();\n //string str = \"\";\n string tmpStr;\n string podstr;\n string otvet = \"^\";\n int count;\n\n\n\n for (int i = 0; i < str.Length; i++)\n {\n for (int g = 0; g < str.Length - i; g++)\n {\n\n tmpStr = str.Substring(i + g - 1);\n podstr = str.Substring(i, g + 1);\n\n if (tmpStr.IndexOf(podstr) > -1)\n {\n if (otvet.Length <= podstr.Length)\n {\n otvet = podstr;\n }\n else continue;\n\n }\n else\n {\n break;\n }\n\n }\n\n }\n\n if (otvet == \"^\") count = 0; else count = otvet.Length;\n Console.WriteLine(count);\n\n return 0;\n }\n\n static string GetString()\n {\n return Console.ReadLine();\n }\n\n }\n}", "lang": "MS C#", "bug_code_uid": "b79afb95cddc4a910b8b29f6476298a3", "src_uid": "13b5cf94f2fabd053375a5ccf3fd44c7", "apr_id": "34060c00d5ccfe605023b45bbe0221c9", "difficulty": 1200, "tags": ["brute force", "greedy"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C#"} {"similarity_score": 0.8351309707241911, "equal_cnt": 28, "replace_cnt": 17, "delete_cnt": 7, "insert_cnt": 3, "fix_ops_cnt": 27, "bug_source_code": "#define USE_FILES\n//#define VERBOSE\n//#define MANY_TESTS_IN_INPUT\n//#define INCREASE_STACK\n\n#if ONLINE_JUDGE // Defined by Codeforces judging system\n#undef USE_FILES\n#endif\n\nusing System;\nusing System.Collections.Generic;\nusing System.Diagnostics;\nusing System.IO;\nusing System.Linq;\n\nnamespace Acm\n{\n /// \n /// For the simplicity of hacking / reading / exploring.\n /// Problem solution is in this class only!\n /// \n class ProblemSolution\n {\n public LineReader In { get; }\n\n public TextWriter Out { get; }\n\n public ProblemSolution(LineReader @in, TextWriter @out)\n {\n In = @in;\n Out = @out;\n }\n\n /// \n /// \n /// \n /// For multi-test inputs: ID of test, from 1 to T\n /// For single-test inputs: -1\n /// \n public void SolveTest(int testId)\n {\n long[] line = In.Read();\n long a = line[0], b = line[1];\n \n long diff = Math.Abs(a - b);\n\n Verbose.Log(() => $\"Diff = {diff}\");\n HashSet divisors = new HashSet();\n\n for (long divisor = 1; divisor * divisor <= diff; divisor++)\n {\n if (diff % divisor == 0)\n {\n Verbose.Log(() => $\"Using divisor {divisor} && {diff / divisor}\");\n divisors.Add(divisor);\n divisors.Add(diff / divisor);\n }\n }\n Verbose.Log(() => $\"Divisors: {String.Join(\" \", divisors)}\");\n\n long answerK = 0;\n long answerLcm = long.MaxValue;\n foreach (long divisor in divisors)\n {\n Verbose.Log(() => $\"Using divisor {divisor}\");\n\n long k = (divisor - (a % divisor)) % divisor;\n long lcm = (a + k) * (b + k) / divisor;\n\n Verbose.Log(() => $\"k = {k}, then a = {a + k}, b = {b + k}. LCM = {lcm}\");\n\n if (lcm < answerLcm)\n {\n Verbose.Log(() => $\"Result is improved with LCM {lcm}, k = {k}\");\n\n answerLcm = lcm;\n answerK = k;\n }\n }\n\n Out.WriteLine(answerK);\n }\n }\n\n // ---------------\n // There is nothing interesting below this line!\n // ---------------\n\n class Program\n {\n private static LineReader In { get; set; }\n\n private static TextWriter Out { get; set; }\n\n public static void Main(string[] args)\n {\n#if USE_FILES\n In = new LineReader(File.OpenText(\"input.txt\"));\n Out = new StreamWriter(\"../../output.txt\", false);\n#else\n In = new LineReader(Console.In);\n Out = Console.Out;\n#endif\n\n try\n {\n#if INCREASE_STACK\n\t\t\t\tvar thread = new Thread(Solve, 32 * 1024 * 1024);\n\t\t\t\tthread.Start();\n\t\t\t\tthread.Join();\n#else\n Solve();\n#endif\n }\n finally\n {\n Out.Dispose();\n }\n }\n\n public static void Solve()\n {\n#if MANY_TESTS_IN_INPUT\n int t = In.Read();\n for (int i = 1; i <= t; i++)\n {\n new ProblemSolution(In, Out).SolveTest(i);\n }\n#else\n new ProblemSolution(In, Out).SolveTest(-1);\n#endif\n }\n }\n\n class Verbose\n {\n public static void Log(Func s)\n {\n#if VERBOSE\n Console.WriteLine(s());\n#endif\n }\n }\n\n /// \n /// Input usability things\n /// \n class InputLine\n {\n private readonly string _line;\n\n public InputLine(string line)\n {\n _line = line;\n }\n\n public static implicit operator string(InputLine line)\n {\n return line._line;\n }\n\n public static implicit operator int(InputLine line)\n {\n return int.Parse(line._line);\n }\n\n public static implicit operator int[] (InputLine line)\n {\n return line._line.Split(new[] { ' ' }, StringSplitOptions.RemoveEmptyEntries).Select(int.Parse).ToArray();\n }\n\n public static implicit operator long[] (InputLine line)\n {\n return line._line.Split(new[] { ' ' }, StringSplitOptions.RemoveEmptyEntries).Select(long.Parse).ToArray();\n }\n }\n\n class LineReader\n {\n public TextReader Reader { get; }\n\n public LineReader(TextReader reader)\n {\n Reader = reader;\n }\n\n public InputLine Read()\n {\n string line = Reader.ReadLine();\n return line == null\n ? null\n : new InputLine(line.Trim());\n }\n }\n}", "lang": "Mono C#", "bug_code_uid": "a8127cdafa9422053c9e6559ebe6ad3c", "src_uid": "414149fadebe25ab6097fc67663177c3", "apr_id": "ae127b65930aa0cd81c501bcd964aba7", "difficulty": 1800, "tags": ["math", "brute force", "number theory"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.5099378881987577, "equal_cnt": 26, "replace_cnt": 20, "delete_cnt": 1, "insert_cnt": 4, "fix_ops_cnt": 25, "bug_source_code": "using System;\nusing System.Collections.Generic;\n\nnamespace ConsoleApp4\n{\n class Program\n {\n\n static int gcd(int a, int b)\n {\n while (b != 0)\n {\n int t = b;\n b = a % b;\n a = t;\n }\n return a;\n }\n\n static void Main(string[] args)\n {\n var str = Console.ReadLine();\n var span = str.Split(' ');\n int a = int.Parse(span[0]);\n int b = int.Parse(span[1]);\n\n if (b > a)\n {\n int t = b;\n b = a;\n a = t;\n }\n long min = int.MaxValue;\n int k = -1;\n\n for (int i = 0; i < a - b+1; i++)\n {\n var g = gcd(a + i, b + i);\n long lcm = (long)(a + i) / g * (b + i);\n if (lcm < min)\n {\n min = lcm;\n k = i;\n }\n\n }\n Console.WriteLine(k);\n }\n }\n}\n\n", "lang": "Mono C#", "bug_code_uid": "cb8d75d347addf03a932495e31d9036a", "src_uid": "414149fadebe25ab6097fc67663177c3", "apr_id": "4a813b5a96ffc1ca2b7ab6868eb685a4", "difficulty": 1800, "tags": ["math", "brute force", "number theory"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.8243727598566308, "equal_cnt": 36, "replace_cnt": 5, "delete_cnt": 2, "insert_cnt": 29, "fix_ops_cnt": 36, "bug_source_code": "using System;\nclass Program {\nstatic void Main() {\n int[] a=Console.ReadLine().Split(' ').Select(x=>int.Parse(x)).ToArray();\nint[] b=Console.ReadLine().Split(' ').Select(x=>int.Parse(x)).ToArray();\nint n = int.Parse(Console.ReadLine());\nn-=Math.Ceiling((double)(a[0]+a[1]+a[2])/5)+Math.Ceiling((double)(b[0]+b[1]+b[2])/10);\nConsole.WriteLine(n <0?\"NO\":\"YES\");\n} \n} ", "lang": "Mono C#", "bug_code_uid": "f7dec98f1ea7cb8655cc77485ac17629", "src_uid": "fe6301816dea7d9cea1c3a06a7d1ea7e", "apr_id": "e27979ac3a6f0f65a4c72d4b1a636042", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.8244590105055222, "equal_cnt": 39, "replace_cnt": 26, "delete_cnt": 6, "insert_cnt": 6, "fix_ops_cnt": 38, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\n\nnamespace _100853_Codeforce\n{\n\n class Program\n {\n private const string FILENAME = \"distance4\";\n\n private const string INPUT = FILENAME + \".in\";\n\n private const string OUTPUT = FILENAME + \".out\";\n\n\n static StreamReader reader = null;\n static StreamWriter writer = null;\n\n private static void Main(string[] args)\n {\n\n int[,] mass = new int[4, 4];\n\n List arr = new List();\n\n for (int i = 0; i < mass.Length; i++)\n arr.Add(Console.ReadLine());\n\n mass = ReadINT2XArray(arr);\n\n bool one = false;\n if (mass[0,3] == 1)\n {\n one = true;\n if (mass[0,1] == 0 && mass[0,2] == 0 && mass[0,0] == 0 && mass[1,0] == 0 && mass[2,1] == 0 && mass[3,2] == 0)\n {\n Console.WriteLine(\"NO\");\n return;\n }\n }\n if (mass[1,3] == 1)\n {\n one = true;\n if (mass[1,1] == 0 && mass[1,2] == 0 && mass[1,0] == 0 && mass[2,0] == 0 && mass[3,1] == 0 && mass[0,2] == 0)\n {\n Console.WriteLine(\"NO\");\n return;\n }\n }\n if (mass[2,3] == 1)\n {\n one = true;\n if (mass[2,1] == 0 && mass[2,2] == 0 && mass[2,0] == 0 && mass[3,0] == 0 && mass[0,1] == 0 && mass[1,2] == 0)\n {\n Console.WriteLine(\"NO\");\n return;\n }\n }\n if (mass[3,3] == 1)\n {\n one = true;\n if (mass[3,1] == 0 && mass[3,2] == 0 && mass[3,0] == 0 && mass[0,0] == 0 && mass[1,1] == 0 && mass[2,2] == 0)\n {\n Console.WriteLine(\"NO\");\n return;\n }\n }\n\n if (one)\n Console.WriteLine(\"YES\");\n else\n Console.WriteLine(\"NO\");\n\n\n\n\n }\n\n static int[] CopyOfRange(int[] src, int start, int end)\n {\n int len = end - start;\n int[] dest = new int[len];\n Array.Copy(src, start, dest, 0, len);\n return dest;\n }\n\n static string StreamReader()\n {\n\n if (reader == null)\n reader = new StreamReader(INPUT);\n string response = reader.ReadLine();\n if (reader.EndOfStream)\n reader.Close();\n return response;\n\n\n }\n\n static void StreamWriter(string text)\n {\n\n if (writer == null)\n writer = new StreamWriter(OUTPUT);\n writer.WriteLine(text);\n\n\n }\n\n\n\n\n\n public static int BFS(int start, int end, int[,] arr)\n {\n Queue> queue = new Queue>();\n List visited = new List();\n for (int i = 0; i < arr.GetLength(0); i++)\n {\n visited.Add(false);\n }\n\n queue.Enqueue(new KeyValuePair(start, 0));\n KeyValuePair node;\n int level = 0;\n bool flag = false;\n\n while (queue.Count != 0)\n {\n node = queue.Dequeue();\n if (node.Key == end)\n {\n return node.Value;\n }\n flag = false;\n for (int i = 0; i < arr.GetLength(0); i++)\n {\n\n if (arr[node.Key, i] == 1)\n {\n if (visited[i] == false)\n {\n if (!flag)\n {\n level = node.Value + 1;\n flag = true;\n }\n queue.Enqueue(new KeyValuePair(i, level));\n visited[i] = true;\n }\n }\n }\n\n }\n return 0;\n\n }\n\n\n\n private static void Write(string source)\n {\n File.WriteAllText(OUTPUT, source);\n }\n\n private static string ReadString()\n {\n return File.ReadAllText(INPUT);\n }\n\n private static void WriteStringArray(string[] source)\n {\n File.WriteAllLines(OUTPUT, source);\n }\n\n private static string[] ReadStringArray()\n {\n return File.ReadAllLines(INPUT);\n }\n\n private static int[] GetIntArray()\n {\n return ReadString().Split(' ').Select(int.Parse).ToArray();\n }\n\n private static double[] GetDoubleArray()\n {\n return ReadString().Split(' ').Select(double.Parse).ToArray();\n }\n\n private static int[,] ReadINT2XArray(List lines)\n {\n int[,] arr = new int[lines.Count, lines.Count];\n\n for (int i = 0; i < lines.Count; i++)\n {\n int[] row = lines[i].Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries).Select(int.Parse).ToArray();\n\n for (int j = 0; j < lines.Count; j++)\n {\n arr[i, j] = row[j];\n }\n }\n\n return arr;\n }\n\n }\n\n\n public class Vector\n {\n public double x { get; set; }\n public double y { get; set; }\n\n public static Vector zero = new Vector(0, 0);\n\n public Vector(double x, double y)\n {\n this.x = x;\n this.y = y;\n }\n\n public double Length(Vector zero)\n {\n return Math.Sqrt((this.x - zero.x) * (this.x - zero.x) + (this.y - zero.y) * (this.y - zero.y));\n }\n\n public override string ToString()\n {\n return string.Format(\"{0} {1}\", x, y).Replace(',', '.');\n }\n }\n\n}\n", "lang": "MS C#", "bug_code_uid": "db34c2aa207421df86ade7f0c7f35a4c", "src_uid": "44fdf71d56bef949ec83f00d17c29127", "apr_id": "1df64aa02839bf028fa3b8f693863d93", "difficulty": 1200, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9681097452342776, "equal_cnt": 6, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 4, "fix_ops_cnt": 6, "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 var matrix = new int[4,4];\n for (int i = 0; i < 4; i++)\n {\n var tempArr = Array.ConvertAll(Console.ReadLine().Split(),Convert.ToInt32);\n for (int j = 0; j < 4; j++)\n {\n matrix[i, j] = tempArr[j];\n }\n }\n var resArr = new bool[4];\n\n var p_0 = matrix[0, 3];\n var p_1 = matrix[1, 3];\n var p_2 = matrix[2, 3];\n var p_3 = matrix[3, 3];\n\n if (p_0 == 1)\n {\n if (matrix[0, 0] == 0 && matrix[0, 1] == 0 && matrix[0, 2] == 0 &&\n matrix[1,0] == 0 && matrix[2,1] == 0 && matrix[3,2] == 0)\n {\n resArr[0] = true;\n }\n else\n {\n resArr[0] = false;\n }\n }\n else\n {\n resArr[0] = true;\n }\n\n if (p_1 == 1)\n {\n if (matrix[1, 0] == 0 && matrix[1, 1] == 0 && matrix[1, 2] == 0 &&\n matrix[2, 0] == 0 && matrix[3, 1] == 0 && matrix[0, 2] == 0)\n {\n resArr[1] = true;\n }\n else\n {\n resArr[1] = false;\n }\n }\n else\n {\n resArr[1] = true;\n }\n\n if (p_2 == 1)\n {\n if (matrix[2, 0] == 0 && matrix[2, 1] == 0 && matrix[2, 2] == 0 &&\n matrix[3, 0] == 0 && matrix[0, 1] == 0 && matrix[1, 2] == 0)\n {\n resArr[2] = true;\n }\n else\n {\n resArr[2] = false;\n }\n }\n else\n {\n resArr[2] = true;\n }\n\n if (p_3 == 1)\n {\n if (matrix[3, 0] == 0 && matrix[3, 1] == 0 && matrix[3, 2] == 0 &&\n matrix[0, 0] == 0 && matrix[1, 1] == 0 && matrix[2, 2] == 0)\n {\n resArr[3] = true;\n }\n else\n {\n resArr[3] = false;\n }\n }\n else\n {\n resArr[3] = true;\n }\n\n if(resArr.Any(x=>x == true))\n {\n Console.WriteLine(\"NO\");\n }\n else\n {\n Console.WriteLine(\"YES\");\n }\n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "4a02e5265d29b9fe946863b2737543b3", "src_uid": "44fdf71d56bef949ec83f00d17c29127", "apr_id": "f8168d87484160f1935e2ad39e88e23e", "difficulty": 1200, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.6774809160305344, "equal_cnt": 16, "replace_cnt": 9, "delete_cnt": 3, "insert_cnt": 3, "fix_ops_cnt": 15, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace ConsoleApplication1 {\n class Program {\n static void Main(string[] args)\n {\n \n var n = int.Parse(Console.ReadLine());\n var t = Console.ReadLine();\n string[] mon = t.Split(new char[] { ' ' });\n int[] money = new int[n];\n int[] kh = new int[n];\n for(var i = 0; i < mon.Length; i++) {\n money[i] = int.Parse(mon[i]);\n }\n Array.Sort(money);\n if(n > 1) {\n for(var i = 0; i < n; i++) {\n var k = money[i];\n for(var j = 0; i < n; j++) {\n if(k == money[j]) {\n kh[i]++;\n }\n else\n break;\n }\n }\n\n }\n \n Array.Sort(kh);\n Console.WriteLine(kh[n-1]+1);\n // Console.ReadKey();\n }\n }\n }\n", "lang": "Mono C#", "bug_code_uid": "61d008f3ba3a11d4781d9fcc5194efa8", "src_uid": "f30329023e84b4c50b1b118dc98ae73c", "apr_id": "4b559b9308faf772ab4f08de1b9ecdc4", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9129251700680272, "equal_cnt": 4, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "using System;\n\nnamespace ConsoleApplication1\n{\n class Program\n {\n static void Main(string[] args)\n {\n int t = Convert.ToInt32(Console.ReadLine());\n string[] s = Console.ReadLine().Split(' ');\n int[] a = new int[t];\n int temp = 0;\n for (int i=0; i temp) temp = b[i];\n Console.WriteLine(temp);\n }\n }\n}", "lang": "Mono C#", "bug_code_uid": "80aaaf23d192c984e14e2723bf0a87a0", "src_uid": "f30329023e84b4c50b1b118dc98ae73c", "apr_id": "ff8e534dac7130bd71bdb6b24fa658cf", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9680998613037448, "equal_cnt": 1, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "using System;\nusing System.Linq;\nusing System.Runtime.Intrinsics.X86;\nusing static System.Console;\nnamespace test\n{\n class Program\n {\n private static string[] a = new string[3];\n private static bool b = false;\n static void Main()\n {\n a[0] = ReadLine();\n a[1] = ReadLine();\n a[2] = ReadLine();\n check(\"rock\", \"scissors\");\n check(\"scissors\", \"paper\");\n check(\"paper\", \"rock\");\n if (b == false)\n WriteLine(\"?\");\n }\n private static void check(string ar, string br)\n {\n int index = 4;\n int licznik = 0;\n for (int i = 0; i < 3; i++)\n {\n if (a[i].Equals(ar)) index = i;\n else if (a[i].Equals(br)) licznik++;\n }\n if (licznik == 2 && index != 4) winner(index);\n }\n private static void winner(int i)\n {\n b = true;\n if (i == 0) WriteLine(\"F\");\n if (i == 1) WriteLine(\"M\");\n if (i == 2) WriteLine(\"S\");\n }\n }\n}", "lang": "Mono C#", "bug_code_uid": "c00834f24b7f4c2cf8426ab2dde11a8b", "src_uid": "072c7d29a1b338609a72ab6b73988282", "apr_id": "28228c1fe6dc64d61c0bc9d5fe43e0bf", "difficulty": 900, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C#"} {"similarity_score": 0.761248852157943, "equal_cnt": 12, "replace_cnt": 11, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 11, "bug_source_code": "// Rock-paper-scissors - CodeForces\n// Status: Unsolved\n\nusing System;\n\nnamespace ConsoleApp {\n class Program {\n\n static Func insr =\n () => Console.ReadLine().Replace(\"\\n\", \"\").ToString();\n\n static bool twoEq(int a, int b, int c) {\n return !((a == b && b == c) || (a != b && a != c && b != c));\n }\n\n static int convert(string s) {\n switch (s) {\n case \"rock\":\n return 2;\n case \"scissors\":\n return 1;\n case \"paper\":\n return 0;\n }\n return 0;\n }\n\n static bool check(int a, int b) {\n return a > b || a == 0 && b == 2;\n }\n\n static int Main(string[] args) {\n int f = convert(insr());\n int m = convert(insr());\n int s = convert(insr());\n // if (!twoEq(f, m, s)) {\n // Console.WriteLine(\"?\");\n // Environment.Exit(0);\n // }\n if (f == m && check(s, f)) {\n Console.WriteLine(\"S\");\n } else if (f == s && check(m, f)) {\n Console.WriteLine(\"M\");\n } else if (s == m && check(f, s)) {\n Console.WriteLine(\"F\");\n } else {\n Console.WriteLine(\"?\");\n }\n return 0;\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "257ffed76ae9ddcb58d1630e32276f68", "src_uid": "072c7d29a1b338609a72ab6b73988282", "apr_id": "4aa1754f72772717bf5179492b7d8495", "difficulty": 900, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.7637698898408812, "equal_cnt": 7, "replace_cnt": 4, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 7, "bug_source_code": "\nusing System;\n\nnamespace _4A_watermelon\n{\n class Program\n {\n static void Main(string[] args)\n {\n string line= Clonsole.ReadLine();\n string[]tok=line.split(' ');\n int n=int.Parse(tok[0]),a=int.Parse(tok[1]);\n Console.WriteLine(\"{0}\",n-a);\n \n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "a0a0acf924bfb0a12c4062388ebd8ae8", "src_uid": "51a072916bff600922a77da0c4582180", "apr_id": "9287daed3461f812ce9ff32b980280dd", "difficulty": 1000, "tags": ["math"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9912987431517886, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Text;\n\nnamespace _39h\n{\n class Program\n {\n\n static string ToPos(Int32 k, Int32 pos)\n {\n string result = \"\";\n while (k > 0)\n {\n result = (k % pos).ToString() + result;\n k = k / pos;\n }\n return result;\n }\n\n\n static void PrintMatr(Int32[,] arr, Int32 pos)\n {\n if (pos == 10)\n {\n for (int i = 0; i < 9; i++)\n {\n for (int j = 0; j < 9; j++)\n {\n Console.Write(\"{1} \", arr[i, j]);\n }\n Console.WriteLine();\n }\n }\n else\n {\n for (int i = 0; i < pos-1; i++)\n {\n for (int j = 0; j < pos-1; j++)\n {\n Console.Write(ToPos(arr[i, j], pos)+ \" \");\n }\n Console.WriteLine();\n }\n }\n }\n static void Main(string[] args)\n {\n Int32 pos = 0;\n pos = Convert.ToInt32(Console.ReadLine());\n Int32[,] arr = new Int32[9, 9];\n for(int i = 1;i<10;i++)\n for (int j = 1; j < 10; j++)\n {\n arr[i-1, j-1] = i * j;\n }\n PrintMatr(arr, 3);\n //Console.ReadLine();\n //\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "bef501935ec692fd3cb158428dd68612", "src_uid": "a705144ace798d6b41068aa284d99050", "apr_id": "d04c7a8e875a9f8431dd3202003dd42e", "difficulty": 1300, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9524782830863566, "equal_cnt": 9, "replace_cnt": 4, "delete_cnt": 0, "insert_cnt": 4, "fix_ops_cnt": 8, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\nusing System.Text;\n\nnamespace TaskC\n{\n class Program\n {\n static void Main(string[] args)\n {\n new Solver().Solve().OutputResult();\n }\n\n private class ExtendedReader : StreamReader\n {\n private static readonly char Separator = ' ';\n\n public ExtendedReader(Stream stream) : base(stream) { }\n public ExtendedReader(Stream stream, bool detectEncodingFromByteOrderMarks) : base(stream, detectEncodingFromByteOrderMarks) { }\n public ExtendedReader(Stream stream, Encoding encoding) : base(stream, encoding) { }\n public ExtendedReader(Stream stream, Encoding encoding, bool detectEncodingFromByteOrderMarks) : base(stream, encoding, detectEncodingFromByteOrderMarks) { }\n public ExtendedReader(Stream stream, Encoding encoding, bool detectEncodingFromByteOrderMarks, int bufferSize) : base(stream, encoding, detectEncodingFromByteOrderMarks, bufferSize) { }\n public ExtendedReader(Stream stream, Encoding encoding, bool detectEncodingFromByteOrderMarks, int bufferSize, bool leaveOpen) : base(stream, encoding, detectEncodingFromByteOrderMarks, bufferSize, leaveOpen) { }\n public ExtendedReader(string path) : base(path) { }\n public ExtendedReader(string path, bool detectEncodingFromByteOrderMarks) : base(path, detectEncodingFromByteOrderMarks) { }\n public ExtendedReader(string path, Encoding encoding) : base(path, encoding) { }\n public ExtendedReader(string path, Encoding encoding, bool detectEncodingFromByteOrderMarks) : base(path, encoding, detectEncodingFromByteOrderMarks) { }\n public ExtendedReader(string path, Encoding encoding, bool detectEncodingFromByteOrderMarks, int bufferSize) : base(path, encoding, detectEncodingFromByteOrderMarks, bufferSize) { }\n\n public char ReadChar()\n {\n return (char)this.Read();\n }\n\n public double ReadDoubleFromArray()\n {\n StringBuilder sb = new StringBuilder();\n char ch = this.ReadChar();\n while (ch != Separator && ch != '\\n')\n {\n sb.Append(ch);\n ch = this.ReadChar();\n }\n return Convert.ToDouble(sb.ToString());\n }\n\n public int ReadInt()\n {\n return int.Parse(this.ReadLine());\n }\n\n public Int64 ReadInt64()\n {\n return Int64.Parse(this.ReadLine());\n }\n\n public int[] ReadIntArray()\n {\n return this.ReadLine().Split(' ').Select(int.Parse).ToArray();\n }\n\n public char[] ReadCharArray()\n {\n return this.ReadLine().ToCharArray();\n }\n\n public string ReadString()\n {\n return this.ReadLine();\n }\n\n public Int64[] ReadInt64Array()\n {\n return this.ReadLine().Split(Separator).Select(Int64.Parse).ToArray();\n }\n\n public Double[] ReadDoubleArray()\n {\n return this.ReadLine().Split(Separator).Select(Double.Parse).ToArray();\n }\n }\n\n private abstract class SolverBase\n {\n protected readonly ExtendedReader _reader;\n protected readonly TextWriter _writer;\n\n protected SolverBase()\n {\n#if DEBUG\n _reader = new ExtendedReader(@\"input.txt\");\n //_writer = new StreamWriter(@\"output.txt\");\n _writer = new StreamWriter(Console.OpenStandardOutput());\n#else\n _reader = new ExtendedReader(Console.OpenStandardInput());\n _writer = new StreamWriter(Console.OpenStandardOutput());\n#endif\n }\n\n public abstract Solver Solve();\n\n public abstract void OutputResult();\n }\n\n private class Solver : SolverBase\n {\n private long result = 0;\n\n public override Solver Solve()\n {\n // link to task: http://codeforces.com/problemset/problem/681/C\n\n var input = _reader.ReadIntArray();\n var n = input[0];\n var m = input[1];\n var maxN = n / 7 + 1;\n var maxM = m / 7 + 1;\n var numbers = new HashSet();\n\n for (int i = 0; i < n; i++)\n {\n for (int j = 0; j < m; j++)\n {\n if (i == j) continue;\n numbers.Clear();\n if (ToSeven(i, maxN, numbers) && ToSeven(j, maxM, numbers))\n {\n result++;\n }\n }\n }\n\n return this;\n }\n\n private bool ToSeven(int val, int max, HashSet nums)\n {\n for (int i = max - 1; i >= 0; i--)\n {\n var value = val % 7;\n if (nums.Contains(value)) return false;\n val /= 7;\n nums.Add(value);\n }\n\n return true;\n }\n\n public override void OutputResult()\n {\n string answer = result.ToString();\n\n _writer.WriteLine(answer);\n _writer.Dispose();\n }\n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "fb38f5d4b01f73ac6408f49dd5c08c22", "src_uid": "0930c75f57dd88a858ba7bb0f11f1b1c", "apr_id": "1201756cdfdf67b64821bf0860d6eca7", "difficulty": 1700, "tags": ["brute force", "math", "combinatorics"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.6168122270742358, "equal_cnt": 16, "replace_cnt": 10, "delete_cnt": 4, "insert_cnt": 2, "fix_ops_cnt": 16, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace _686C\n{\n class Program\n {\n static int[] powers7 = new[] { 7, 49, 343, 2401, 16807, 117649, 823543, 5764801, 40353607, 282475249 };\n\n static void Main(string[] args)\n {\n string[] input = Console.ReadLine().Split(' ');\n int n = int.Parse(input[0]), m = int.Parse(input[1]);\n long answer = 0;\n int firstDigits = Digits(n), secondDigits = Digits(m);\n if (firstDigits + secondDigits <= 7)\n {\n for (int i = 0; i < n; i++)\n {\n for (int j = 0; j < m; j++)\n {\n bool[] used = new bool[7];\n bool correct = true;\n for (int a = i, k = 0; k != firstDigits; a /= 7, k++)\n {\n if (!used[a % 7])\n {\n used[a % 7] = true;\n }\n else\n {\n correct = false;\n break;\n }\n }\n if (!correct) continue;\n\n for (int b = j, k = 0; k != secondDigits; b /= 7, k++)\n {\n if (!used[b % 7])\n {\n used[b % 7] = true;\n }\n else\n {\n correct = false;\n break;\n }\n }\n if (correct) answer++;\n }\n }\n }\n\n Console.WriteLine(answer);\n //Console.ReadLine();\n }\n\n static int Digits(int number)\n {\n for (int i = 0; i < powers7.Length; i++)\n {\n if (number <= powers7[i])\n {\n return i + 1;\n }\n }\n return -1;\n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "5e2c12e8545ac25d436e8c79ffbbda9f", "src_uid": "0930c75f57dd88a858ba7bb0f11f1b1c", "apr_id": "0d0fb88077dbeb39cd6c85d277274223", "difficulty": 1700, "tags": ["brute force", "math", "combinatorics"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9671944268524383, "equal_cnt": 7, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 5, "fix_ops_cnt": 6, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Globalization;\nusing System.IO;\nusing System.Linq;\n\nnamespace CF317\n{\n\tinternal class Program\n\t{\n\t\tprivate static void Main(string[] args)\n\t\t{\n\t\t\tvar sr = new InputReader(Console.In);\n\t\t\t//var sr = new InputReader(new StreamReader(\"input.txt\"));\n\t\t\tvar task = new Task();\n\t\t\tusing (var sw = Console.Out)\n\t\t\t//using (var sw = new StreamWriter(\"output.txt\"))\n\t\t\t{\n\t\t\t\ttask.Solve(sr, sw);\n\t\t\t\t//Console.ReadKey();\n\t\t\t}\n\t\t}\n\t}\n\n\tinternal class Task\n\t{\n\t\tprivate long result = 0L;\n\t\tprivate List daysInSeven;\n\t\tprivate List minsInSeven;\n\t\tprivate string firstStr;\n\t\tprivate string secondStr;\n\n\t\tpublic void Solve(InputReader sr, TextWriter sw)\n\t\t{\n\t\t\tvar input = sr.ReadArray(Int64.Parse);\n\t\t\tvar n = input[0] - 1;\n\t\t\tvar m = input[1] - 1;\n\t\t\tdaysInSeven = ToSevenBase(n);\n\t\t\tminsInSeven = ToSevenBase(m);\n\t\t\tvar reversed = daysInSeven.ToArray().Reverse();\n\t\t\tfirstStr = reversed.Aggregate(\"\", (curr, item) => curr + item);\n\t\t\treversed = minsInSeven.ToArray().Reverse();\n\t\t\tsecondStr = reversed.Aggregate(\"\", (curr, item) => curr + item);\n\t\t\tvar leftCount = daysInSeven.Count;\n\t\t\tvar rightCount = minsInSeven.Count;\n\t\t\tif (leftCount + rightCount > 7) {\n\t\t\t\trightCount -= 7 - leftCount;\n\t\t\t}\n\t\t\tif (rightCount < 0) {\n\t\t\t\trightCount = 0;\n\t\t\t}\n\t\t\tGenerate(0, 0, leftCount, rightCount, leftCount + rightCount, new char[leftCount + rightCount]);\n\n\t\t\tsw.WriteLine(result);\n\t\t}\n\n\t\tprivate void Generate(int currLeft, int currRight, int leftCount, int rightCount, int totalMax, char[] array)\n\t\t{\n\t\t\tif (currLeft + currRight == totalMax) {\n\t\t\t\tvar contains = new int[7];\n\t\t\t\tfor (var i = 0; i < array.Length; i++) {\n\t\t\t\t\tcontains[array[i] - '0']++;\n\t\t\t\t}\n\t\t\t\tvar isDifferent = contains.All(item => item <= 1);\n\t\t\t\tif (isDifferent) {\n\t\t\t\t\tvar leftStr = new String(array, 0, leftCount);\n\t\t\t\t\tvar rightStr = new String(array, leftCount, rightCount);\n\t\t\t\t\tvar leftVal = Int64.Parse(leftStr);\n\t\t\t\t\tvar rightVal = Int64.Parse(rightStr);\n\t\t\t\t\tvar firstVal = Int64.Parse(firstStr);\n\t\t\t\t\tvar secondVal = Int64.Parse(secondStr);\n\t\t\t\t\tif (leftVal <= firstVal && rightVal <= secondVal) {\n\t\t\t\t\t\tresult++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\t\t\t\tfor (var i = 0; i < 7; i++) {\n\t\t\t\t\tarray[currLeft + currRight] = (char) ('0' + i);\n\t\t\t\t\tif (currLeft < leftCount)\n\t\t\t\t\t\tGenerate(currLeft + 1, currRight, leftCount, rightCount, totalMax, array);\n\t\t\t\t\telse\n\t\t\t\t\t\tGenerate(currLeft, currRight + 1, leftCount, rightCount, totalMax, array);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tprivate List ToSevenBase(long n)\n\t\t{\n\t\t\tconst int b = 7;\n\t\t\tvar list = new List();\n\t\t\tvar curr = (int)n;\n\t\t\twhile (curr > 0) {\n\t\t\t\tlist.Add(curr % b);\n\t\t\t\tcurr /= b;\n\t\t\t}\n\n\t\t\treturn list;\n\t\t}\n\t}\n}\n\ninternal class InputReader : IDisposable\n{\n\tprivate bool isDispose;\n\tprivate readonly TextReader sr;\n\n\tpublic InputReader(TextReader stream)\n\t{\n\t\tsr = stream;\n\t}\n\n\tpublic void Dispose()\n\t{\n\t\tDispose(true);\n\t\tGC.SuppressFinalize(this);\n\t}\n\n\tpublic string NextString()\n\t{\n\t\tvar result = sr.ReadLine();\n\t\treturn result;\n\t}\n\n\tpublic int NextInt32()\n\t{\n\t\treturn Int32.Parse(NextString());\n\t}\n\n\tpublic long NextInt64()\n\t{\n\t\treturn Int64.Parse(NextString());\n\t}\n\n\tpublic string[] NextSplitStrings()\n\t{\n\t\treturn NextString()\n\t\t\t.Split(new[] { ' ' }, StringSplitOptions.RemoveEmptyEntries);\n\t}\n\n\tpublic T[] ReadArray(Func func)\n\t{\n\t\treturn NextSplitStrings()\n\t\t\t.Select(s => func(s, CultureInfo.InvariantCulture))\n\t\t\t.ToArray();\n\t}\n\n\tpublic T[] ReadArrayFromString(Func func, string str)\n\t{\n\t\treturn\n\t\t\tstr.Split(new[] { ' ' }, StringSplitOptions.RemoveEmptyEntries)\n\t\t\t\t.Select(s => func(s, CultureInfo.InvariantCulture))\n\t\t\t\t.ToArray();\n\t}\n\n\tprotected void Dispose(bool dispose)\n\t{\n\t\tif (!isDispose) {\n\t\t\tif (dispose)\n\t\t\t\tsr.Close();\n\t\t\tisDispose = true;\n\t\t}\n\t}\n\n\t~InputReader()\n\t{\n\t\tDispose(false);\n\t}\n}", "lang": "MS C#", "bug_code_uid": "055185b2ee4f8780a976f7f574dcd304", "src_uid": "0930c75f57dd88a858ba7bb0f11f1b1c", "apr_id": "7c9d22e0aff1566ed46f81532739fea7", "difficulty": 1700, "tags": ["brute force", "math", "combinatorics"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.9991902834008097, "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.Text;\nusing System.Threading.Tasks;\n\nnamespace ConsoleApplication38\n{\n class Program\n {\n static void Main(string[] args)\n {\n int d = 0;\n string[] arr = Console.ReadLine().Split();\n int a = int.Parse(arr[0]);\n int b = int.Parse(arr[1]);\n int c = int.Parse(arr[2]);\n\n for (int i = 1; i < c; i++)\n {\n if (i%a==0&&i%b==0)\n d++; \n }\n Console.WriteLine(d);\n\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "34108d3e3e3ae5d4759df5e6435a5602", "src_uid": "e7ad55ce26fc8610639323af1de36c2d", "apr_id": "6877acfde1132e6f4387998ad6397f88", "difficulty": 800, "tags": ["math", "brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.9795191451469278, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "using System;\n\nnamespace CodeForces\n{\n\tpublic class A\n\t{\n\t\tstatic void Main()\n\t\t{\n\t\t\tvar n = int.Parse( Console.ReadLine() );\n\t\t\tif ( n == 1 )\n\t\t\t{\n\t\t\t\tConsole.WriteLine( 0 );\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tint res = int.MaxValue;\n\t\t\tfor ( int i = 1; i < n; ++i )\n\t\t\t{\n\t\t\t\tvar x = i;\n\t\t\t\tvar cur = 0;\n\t\t\t\tvar y = n;\n\t\t\t\twhile ( x > 0 && y > 0 )\n\t\t\t\t{\n\t\t\t\t\tif ( x > y )\n\t\t\t\t\t{\n\t\t\t\t\t\tcur += x / y;\n\t\t\t\t\t\tx %= y;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tcur += y / x;\n\t\t\t\t\t\ty %= x;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tres = Math.Min( res, cur );\n\t\t\t}\n\t\t\tConsole.WriteLine( res - 1 );\n\t\t}\n\t}\n}\n", "lang": "Mono C#", "bug_code_uid": "c398436be2ed675b393266e2a0a840e1", "src_uid": "75739f77378b21c331b46b1427226fa1", "apr_id": "380421683a097b9c61e3a8c45c61db2a", "difficulty": 1900, "tags": ["brute force", "math", "dfs and similar", "number theory"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.610758750293634, "equal_cnt": 23, "replace_cnt": 10, "delete_cnt": 2, "insert_cnt": 11, "fix_ops_cnt": 23, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Globalization;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace Codeforces\n{\n\n class Program\n {\n public void Solve()\n {\n var n = int.Parse(Console.ReadLine()); \n var arr = Console.ReadLine().Split(' ').Select(int.Parse).ToArray();\n if (n == 1)\n {\n Console.WriteLine(\"YES\");\n return;\n }\n var pos1 = 0;\n var pos2 = n - 1;\n var i = 1;\n while (i < n)\n {\n if (!(arr[i] > arr[i - 1]))\n break;\n i++; \n }\n pos1 = i;\n i = n - 1;\n while (i>=0)\n {\n if (!(arr[i - 1] > arr[i]))\n break;\n i--;\n }\n pos2 = i;\n\n var val = arr[pos1];\n for(int j = pos1; j <= pos2; j++)\n {\n if (arr[j] != val)\n {\n Console.WriteLine(\"NO\");\n return;\n }\n }\n Console.WriteLine(\"YES\");\n }\n\n static void Main(string[] args)\n {\n var p = new Program();\n p.Solve();\n //Console.ReadLine();\n }\n } \n\n}", "lang": "MS C#", "bug_code_uid": "65caefdea778c7ec40f6e7df12024208", "src_uid": "5482ed8ad02ac32d28c3888299bf3658", "apr_id": "7e6f6c8d63f3228c6ca3847e5bd56d29", "difficulty": 1000, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.999203187250996, "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;\n//using System.Linq;\n//using System.Text;\n//using System.Threading.Tasks;\n\nnamespace Problem492A {\n class Program {\n static void Main(string[] args) {\n List pyramid = generateLevelRequirements();\n int cubes = Convert.ToInt32(Console.ReadLine());\n int pyramidL = pyramid.Count;\n\n int height = 0;\n int cubes2 = 0;\n int index = 0;\n while (cubes2 <= cubes) {\n cubes2 = pyramid[index][1];\n height = pyramid[index][0];\n index++;\n }\n\n height--;\n Console.WriteLine(height);\n }\n\n private static List generateLevelRequirements() {\n int height = 1;\n int cubes = 1;\n\n List result = new List();\n\n while (cubes <= 10000) {\n int[] tmpInfo = new int[2];\n tmpInfo[0] = height;\n tmpInfo[1] = cubes;\n\n result.Add(tmpInfo);\n height++;\n\n int nextLevelCubes = height * (height + 1) / 2;\n cubes += nextLevelCubes;\n }\n return result;\n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "e5b4a9ee801082672fc3678f696e64ba", "src_uid": "873a12edffc57a127fdfb1c65d43bdb0", "apr_id": "28c7ac6e955fbbbd3f7315a6db7023bb", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9954970557672325, "equal_cnt": 6, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 5, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Diagnostics;\nusing System.Linq;\nusing CompLib.Util;\nusing System.Threading;\nusing CompLib.Mathematics;\n\npublic class Program\n{\n private long N, K, A, B;\n private long Min, Max;\n\n public void Solve()\n {\n var sc = new Scanner();\n N = sc.NextInt();\n K = sc.NextInt();\n A = sc.NextInt();\n B = sc.NextInt();\n\n /*\n * n*k都市 1ごとに円周上\n *\n * n軒 kごとにファストフード店\n *\n * sからlkmごとの都市にsに戻るまで行く\n *\n * sから最寄りのファストフード店までa\n * s+lからb\n *\n * 通った都市の最大、最小\n */\n Min = int.MaxValue;\n Max = int.MinValue;\n F((A + B) % K);\n F((A - B) % K);\n F((-A + B) % K);\n F((-A - B) % K);\n /*\n * a,bも右\n * s % k = a\n * (s + l) % k = b\n *\n * (b - a)%k = l % k\n *\n * \n */\n\n Console.WriteLine($\"{Min} {Max}\");\n }\n\n void F(long l)\n {\n while (l <= 0) l += K;\n for (int i = 0; i < 10000000; i++)\n {\n // Console.WriteLine(l);\n var gcd = MathEx.GCD(N * K, l);\n Min = Math.Min(Min, N * K / gcd);\n Max = Math.Max(Max, N * K / gcd);\n l += K;\n }\n }\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\n// https://bitbucket.org/camypaper/complib\nnamespace CompLib.Mathematics\n{\n using System;\n using System.Collections.Generic;\n\n #region GCD LCM\n\n /// \n /// 様々な数学的関数の静的メソッドを提供します.\n /// \n public static partial class MathEx\n {\n /// \n /// 2 つの整数の最大公約数を求めます.\n /// \n /// 最初の値\n /// 2 番目の値\n /// 2 つの整数の最大公約数\n /// ユークリッドの互除法に基づき最悪計算量 O(log N) で実行されます.\n public static int GCD(int n, int m)\n {\n return (int) GCD((long) n, m);\n }\n\n\n /// \n /// 2 つの整数の最大公約数を求めます.\n /// \n /// 最初の値\n /// 2 番目の値\n /// 2 つの整数の最大公約数\n /// ユークリッドの互除法に基づき最悪計算量 O(log N) で実行されます.\n public static long GCD(long n, long m)\n {\n n = Math.Abs(n);\n m = Math.Abs(m);\n while (n != 0)\n {\n m %= n;\n if (m == 0) return n;\n n %= m;\n }\n\n return m;\n }\n\n\n /// \n /// 2 つの整数の最小公倍数を求めます.\n /// \n /// 最初の値\n /// 2 番目の値\n /// 2 つの整数の最小公倍数\n /// 最悪計算量 O(log N) で実行されます.\n public static long LCM(long n, long m)\n {\n return (n / GCD(n, m)) * m;\n }\n }\n\n #endregion\n\n #region PrimeSieve\n\n public static partial class MathEx\n {\n /// \n /// ある値までに素数表を構築します.\n /// \n /// 最大の値\n /// 素数のみを入れた数列が返される\n /// 0 から max までの素数表\n /// エラトステネスの篩に基づき,最悪計算量 O(N loglog N) で実行されます.\n public static bool[] Sieve(int max, List primes = null)\n {\n var isPrime = new bool[max + 1];\n for (int i = 2; i < isPrime.Length; i++) isPrime[i] = true;\n for (int i = 2; i * i <= max; i++)\n if (!isPrime[i]) continue;\n else\n for (int j = i * i; j <= max; j += i)\n isPrime[j] = false;\n if (primes != null)\n for (int i = 0; i <= max; i++)\n if (isPrime[i])\n primes.Add(i);\n\n return isPrime;\n }\n }\n\n #endregion\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": "6a92ce425cc9cbbe6024429ceaf336be", "src_uid": "5bb4adff1b332f43144047955eefba0c", "apr_id": "7234d3347f33ba638bc222f6ebcd28c9", "difficulty": 1700, "tags": ["number theory", "math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9985754985754985, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "// Problem: 893B - Beautiful Divisors\n// Author: Gusztav Szmolik\n\nusing System;\n\nclass BeautifulDivisors\n {\n static int Main ()\n {\n string[] words = ReadSplitLine (1);\n if (words == null)\n return -1;\n uint n;\n if (!UInt32.TryParse (words[0], out n))\n return -1;\n if (n < 1 || n > 100000)\n return -1;\n uint ans = 0;\n for (ushort i = 1; i <= n && ans == 0; i++)\n {\n if (n%i > 0)\n continue;\n uint divisor = n/i;\n uint tmpConvBin = divisor;\n byte countZero = 0;\n byte countOne = 0;\n bool solved = true;\n bool procZero = true;\n while (tmpConvBin > 0 && solved)\n {\n byte digitBin = Convert.ToByte (tmpConvBin%2);\n tmpConvBin /= 2;\n if (digitBin == 0)\n {\n if (procZero)\n countZero++;\n else\n solved = false;\n }\n else\n {\n if (procZero)\n {\n procZero = false;\n countOne = 1;\n }\n else\n {\n countOne++;\n if (countOne > countZero+1)\n solved = false;\n }\n }\n }\n if (solved && countOne == countZero+1)\n ans = divisor;\n }\n Console.WriteLine (ans > 0 ? ans : 1);\n return 0;\n }\n \n static string[] ReadSplitLine (uint numWordNeed)\n {\n string line = Console.ReadLine ();\n if (line == null)\n return null;\n char[] delims = new char[2] {' ', '\\t'};\n string[] words = line.Split (delims,StringSplitOptions.RemoveEmptyEntries);\n return (words.Length == numWordNeed ? words : null);\n } \n }\n", "lang": "Mono C#", "bug_code_uid": "7c3c47b324f8ab90abbdbb6fedc13112", "src_uid": "339246a1be81aefe19290de0d1aead84", "apr_id": "6074f467762e2c4f7054fd65e57b1a15", "difficulty": 1000, "tags": ["brute force", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9821634062140391, "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.Text;\nusing System.Threading.Tasks;\n\nnamespace Beautiful_Divisors\n{\n class Program\n {\n static void Main(string[] args)\n {\n int n = Convert.ToInt32(Console.ReadLine());\n for(int i=n;i>0;i--)\n {\n string binary = Convert.ToString(i, 2);\n int ones = 0;\n int zeroes = 0;\n bool flag = false;\n bool correct = true;\n int count = 0;\n while(count!=binary.Length)\n {\n if (!flag)\n {\n if(binary[count]=='1')\n {\n ones++;\n count++;\n }\n else\n {\n zeroes++;\n flag = true;\n count++;\n }\n }\n else\n {\n if(binary[count]=='0')\n {\n zeroes++;\n count++;\n }\n else\n {\n correct = false;\n break;\n }\n }\n }\n if(correct&&ones-1==zeroes)\n {\n Console.WriteLine(i);\n break;\n }\n \n }\n //Console.ReadKey();\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "38081ea3db9ce8ed4d68194b86639076", "src_uid": "339246a1be81aefe19290de0d1aead84", "apr_id": "2450891a658b14c5768257ea484f6398", "difficulty": 1000, "tags": ["brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.990186125211506, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Text;\nusing System.Diagnostics;\n\nclass Solver\n{\n // test\n static CodeforcesUtils CF = new CodeforcesUtils( new[]{\n\n@\"\n12:00\n\"\n,\n@\"\n04:30\n\"\n,\n@\"\n08:17\n\"\n\n });\n\n public void Solve()\n {\n var ss = CF.ReadLine().Split(':');\n int h = int.Parse(ss[0]);\n int m = int.Parse(ss[1]);\n\n double d1 = 360.0*(h%12)/12+360.0/12*m/60;\n double d2 = 360 * m / 60;\n CF.WriteLine(d1 + \" \" + d2);\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#if DEBUG\n for (int t=0;t();\n string[] ss = _test_input[t].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 public int TestCount\n {\n get\n {\n return _test_input.Length;\n }\n }\n\n public string ReadLine()\n {\n#if DEBUG\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": "57cc01b182ba9eb99258af75fcce2423", "src_uid": "175dc0bdb5c9513feb49be6644d0d150", "apr_id": "5af949b46a805d8c0af8ba9c17193b9e", "difficulty": 1200, "tags": ["geometry", "math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.9611872146118722, "equal_cnt": 4, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 3, "bug_source_code": "using System;\n\nnamespace CFAlgo\n{\n class Program\n {\n static void Main(string[] args)\n {\n int nr = int.Parse(Console.ReadLine());\n string text = Console.ReadLine();\n\n var steps = new int[] { 0, 2, 5, 9, 14, 20, 27, 35, 44, 54 };\n for(int i = 0; steps[i] < nr; ++i)\n {\n Console.Write(text[steps[i]]);\n } \n \n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "2720812882e3f8f62a515442c65c9a4c", "src_uid": "08e8c0c37b223f6aae01d5609facdeaf", "apr_id": "fcce2b026e819116f661bceb8c0b47f9", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.9993373094764745, "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.Text;\n\nnamespace ProgrammingContest.Codeforces.Round82 {\n class A {\n static void Mai() {\n char s = Console.ReadLine()[0];\n var xs = Console.ReadLine().Split(' ');\n\n Dictionary dic = new Dictionary();\n\n for (int i = 6; i < 10; i++)\n dic[(char)(i + '0')] = i;\n\n string str = \"TJQKA\";\n for (int i = 0; i < str.Length; i++)\n dic[str[i]] = i + 10;\n\n Console.WriteLine(\n s == xs[0][1] && s != xs[1][1] ||\n xs[0][1] == xs[1][1] && dic[xs[0][0]] > dic[xs[1][0]] ?\n \"YES\" : \"NO\");\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "1a7c524df6c2d4b449d86fe5955250df", "src_uid": "da13bd5a335c7f81c5a963b030655c26", "apr_id": "e19e9a058d9cea7084dc6b4df3f9df2f", "difficulty": 1000, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.9169303797468354, "equal_cnt": 6, "replace_cnt": 1, "delete_cnt": 2, "insert_cnt": 2, "fix_ops_cnt": 5, "bug_source_code": "using System;\nusing System.Globalization;\nusing System.IO;\nusing System.Linq;\nusing System.Text;\n\nnamespace Ilya_and_Escalator\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 string[] ss = reader.ReadLine().Split(' ');\n int n = int.Parse(ss[0]);\n int t = int.Parse(ss[2]);\n double p = double.Parse(ss[1], CultureInfo.InvariantCulture);\n double q = 1 - p;\n var nn = new double[n + 1];\n nn[0] = 1;\n\n for (int i = 0; i < t; i++)\n {\n nn[n] += p*nn[n - 1];\n\n for (int j = n - 1; j > 0; j--)\n {\n nn[j] = q*nn[j] + p*nn[j - 1];\n }\n\n nn[0] *= q;\n }\n\n writer.WriteLine(\"{0}\", (nn.Sum()).ToString(\"#0.0000000\", CultureInfo.InvariantCulture));\n writer.Flush();\n }\n }\n}", "lang": "MS C#", "bug_code_uid": "abc0e322da6ff192aa5aeb19b5a1cfde", "src_uid": "20873b1e802c7aa0e409d9f430516c1e", "apr_id": "5cbeb6115b2a709b45e307026f9c3356", "difficulty": 1700, "tags": ["dp", "math", "combinatorics", "probabilities"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "C#"} {"similarity_score": 0.9994574064026045, "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.Text;\n\nnamespace soldier_games\n{\n class Program\n {\n static void Main(string[] args)\n {\n int n = int.Parse(Console.ReadLine());\n //int max = 0;\n //int killed = 0;\n //int i, j, k = 0;\n\n //for (i = 1; i <= n/2; i++)\n //{\n // killed += i;\n // for (j = 1; j <= n - i; j++)\n // {\n // killed += j;\n // for (k = 1; k <= n - j && k <= n - i; k++)\n // {\n\n // killed += k;\n // if (killed > max)\n // {\n // max = killed;\n // }\n // killed -= k;\n // }\n // killed -= j;\n // }\n // killed -= i;\n }\n Console.WriteLine(n/2*3);\n }\n }\n}\n// static int getmax(int n)\n// {\n// int max = 0;\n// int killed = 0;\n// int i, j, k = 0;\n\n// for ( i = 1; i <=n; i++)\n// {\n// killed += i;\n// for ( j = 1; j <= n - i ; j++)\n// {\n// killed += j;\n// for ( k = 1; k <= n - j &&k<=n-i ; k++)\n// {\n \n// killed += k;\n// if (killed > max)\n// {\n// max = killed;\n// }\n// killed -= k;\n// }\n// killed -= j;\n// }\n// killed -=i ; \n// }\n// return max;\n// }\n\n// }\n//}\n", "lang": "MS C#", "bug_code_uid": "27d57b2ea12883dd72d2204cd7fd211a", "src_uid": "031e53952e76cff8fdc0988bb0d3239c", "apr_id": "a028eebcd7b51a4695eb7458f24a6178", "difficulty": 900, "tags": ["math", "number theory"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.9037952338923213, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 3, "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 double pi=3.14159265358979323846264338327950288;\n int[] R = new int[6];\n string [] a=Console.ReadLine().Split(' ');\n for (int i = 0; i < 6; i++)\n R[i] = int.Parse(a[i]);\n\n double s1 = Math.Abs(Math.Sin(60.0 / 180.0 * pi) * R[0] * R[1]);\n double s2 = Math.Abs(Math.Sin(60.0 / 180.0 * pi) * R[2] * R[3]);\n double s3 = Math.Abs(Math.Sin(60.0 / 180.0 * pi) * R[4] * R[5]);\n double s4 = Math.Abs((R[0] + 0.5 * R[1]) * (R[5] + R[4]) * Math.Cos(30.0 / 180.0 * pi) \n - R[1] * Math.Sin(60.0 / 180.0 * pi) *0.5* (-R[5] + R[4]));\n double s = s1 + s2 + s3 + s4;\n double k = s / Math.Sin(60.0 / 180.0 * pi);\n Console.WriteLine(k);\n /* int n = (int)k;\n if (k - 0.5 < n)\n\n Console.WriteLine(n);\n else\n Console.WriteLine(n+1);*/\n \n\n //Console.WriteLine(\"n={0} k={1}\",n, k);\n //Console.ReadKey();\n\n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "34478edef0f4b43f3f6c414025b234d0", "src_uid": "382475475427f0e76c6b4ac6e7a02e21", "apr_id": "fdeef152999224f75fcdca08dd146042", "difficulty": 1600, "tags": ["geometry", "math", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9169329073482428, "equal_cnt": 7, "replace_cnt": 5, "delete_cnt": 2, "insert_cnt": 0, "fix_ops_cnt": 7, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\n\nclass PairVariable : IComparable\n{\n public int a, b;\n public PairVariable()\n {\n a = b = 0;\n }\n public PairVariable(string s)\n {\n string[] q = s.Split();\n a = int.Parse(q[0]);\n b = int.Parse(q[1]);\n }\n public PairVariable(int a, int b)\n {\n this.a = a;\n this.b = b;\n }\n\n\n\n public int CompareTo(PairVariable other)\n {\n return other.a.CompareTo(this.a);\n }\n}\n\nnamespace ConsoleApplication254\n{\n\n class Program\n {\n\t\tstatic double scalar(int x1,int y1,int x2,int y2,int x3,int y3)\n\t\t{\n\t\t\treturn (x2-x1)*(x3-x2)+(y2-y1)*(y3-y2);\n\t\t}\n static bool foo(double d1, double d2, double d3)\n {\n double a1=(d1*d1)+(d3*d3)-(d2*d2);\n\t\t\tdouble a2=(d2*d2)+(d3*d3)-(d1*d1);\n\t\t\tbool f=a1>0&&a2>0;\n\t\t\treturn f;\n }\n static void Main(string[] args)\n {\n\t\t\tstring[]ss=Console.ReadLine().Split();\n\t\t\tint[]m=new int[6];\n\t\t\tfor(int i=0; i<6; i++)\n\t\t\t{\n\t\t\t\tm[i]=int.Parse(ss[i]);\n\t\t\t}\n\t\t\tArray.Sort(m);\n\t\t\tif(m[0]==m[6-1])\n\t\t\t{\n\t\t\t\tConsole.WriteLine(6*m[0]);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tConsole.WriteLine(13*(m[6-1]/2));\n\t\t\t}\n\t\t\t\n\t\t}\n }\n}", "lang": "MS C#", "bug_code_uid": "60ff8f1351abfc487ef05706a90884c7", "src_uid": "382475475427f0e76c6b4ac6e7a02e21", "apr_id": "25ee4c65c50af62045cb957c8c7bf7fc", "difficulty": 1600, "tags": ["geometry", "math", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9953827460510328, "equal_cnt": 6, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 4, "fix_ops_cnt": 5, "bug_source_code": "#if DEBUG\nusing System.Reflection;\nusing System.Threading.Tasks;\n#endif\n\nusing System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\nusing System.Text;\n\n\nnamespace _307d\n{\n\tclass Program\n\t{\n\t\tstatic string _inputFilename = \"input.txt\";\n\t\tstatic string _outputFilename = \"output.txt\";\n#if DEBUG\n static bool _useFileInput = false;\n#else\n\t\tstatic bool _useFileInput = false;\n#endif\n\n\t\tstatic void Main(string[] args)\n\t\t{\n\t\t\tStreamWriter file = null;\n\t\t\tif (_useFileInput)\n\t\t\t{\n\t\t\t\tConsole.SetIn(File.OpenText(_inputFilename));\n\t\t\t\tfile = new StreamWriter(_outputFilename);\n\t\t\t\tConsole.SetOut(file);\n\t\t\t}\n\n#if DEBUG\n\t\t\tif (!_useFileInput)\n\t\t\t{\n\t\t\t\tConsole.SetIn(getInput());\n\t\t\t}\n#endif\n\n\t\t\ttry\n\t\t\t{\n\t\t\t\tsolution();\n\t\t\t}\n\t\t\tfinally\n\t\t\t{\n\t\t\t\tif (_useFileInput)\n\t\t\t\t{\n\t\t\t\t\tfile.Close();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tstatic void solution()\n\t\t{\n\t\t\t#region SOLUTION\n\t\t\tvar d = readLongArray();\n\t\t\tvar n = d[0];\n\t\t\tvar k = d[1];\n\t\t\tvar l = (int)d[2];\n\t\t\tvar m = d[3];\n\n\t\t\tif (l == 0)\n\t\t\t{\n\t\t\t\tConsole.WriteLine(0);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tfor (int i = l; i < 64; i++)\n\t\t\t{\n\t\t\t\tif (((1L << i) & k) != 0)\n\t\t\t\t{\n\t\t\t\t\tConsole.WriteLine(0);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tvar fim = new Matrix { _11 = 0, _12 = 1, _21 = 1, _22 = 1 };\n\t\t\t//fim.Print();\n\t\t\tvar sq = pow(fim, n - 1, m);\n\t\t\t//sq.Print();\n\n\t\t\tvar fn0 = (sq._21 + sq._22) % m;\n\t\t\tvar fn1 = (sq._11 + sq._12) % m;\n\t\t\tvar fr = (fn0 + fn1) % m;\n\n\t\t\t//var fi = new int[n + 1];\n\t\t\t//fi[0] = 1;\n\t\t\t//fi[1] = 1;\n\t\t\t//for (int i = 2; i < n + 1; i++)\n\t\t\t//{\n\t\t\t//\tfi[i] = fi[i - 1] + fi[i - 2];\n\t\t\t//}\n\n\t\t\tvar nc = pow(2, n, m);\n\t\t\tnc -= fr;\n\t\t\tif (nc < 0)\n\t\t\t{\n\t\t\t\tnc += m;\n\t\t\t}\n\t\t\t//nc *= ((n - 1) % m);\n\t\t\tnc %= m;\n\n\t\t\tvar res = 1L;\n\t\t\tfor (int i = 0; i < l; i++)\n\t\t\t{\n\t\t\t\tif (((1L << i) & k) != 0)\n\t\t\t\t{\n\t\t\t\t\tres *= nc;\n\t\t\t\t\tres %= m;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tres *= fr;\n\t\t\t\t\tres %= m;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tConsole.WriteLine(res);\n\n\t\t\t//var n = readInt();\n\t\t\t//var m = readInt();\n\n\t\t\t//var a = readIntArray();\n\t\t\t//var b = readIntArray();\n\t\t\t#endregion\n\t\t}\n\n\t\tclass Matrix\n\t\t{\n\t\t\tpublic long _11;\n\t\t\tpublic long _12;\n\t\t\tpublic long _21;\n\t\t\tpublic long _22;\n\n\t\t\tpublic void Mult(Matrix x, long mod)\n\t\t\t{\n\t\t\t\tvar __11 = (_11 * x._11) % mod + (_12 * x._21) % mod;\n\t\t\t\tvar __12 = (_11 * x._21) % mod + (_12 * x._22) % mod;\n\t\t\t\tvar __21 = (_21 * x._11) % mod + (_22 * x._21) % mod;\n\t\t\t\tvar __22 = (_21 * x._21) % mod + (_22 * x._22) % mod;\n\n\t\t\t\t_11 = __11 % mod;\n\t\t\t\t_12 = __12 % mod;\n\t\t\t\t_21 = __21 % mod;\n\t\t\t\t_22 = __22 % mod;\n\t\t\t}\n\n\t\t\tpublic void Square(long mod)\n\t\t\t{\n\t\t\t\tMult(this, mod);\n\t\t\t}\n\n\t\t\tpublic void Print()\n\t\t\t{\n\t\t\t\tConsole.WriteLine(\"{0} {1}\", _11, _12);\n\t\t\t\tConsole.WriteLine(\"{0} {1}\", _21, _22);\n\t\t\t\tConsole.WriteLine();\n\t\t\t}\n\t\t}\n\n\t\tstatic Matrix pow(Matrix x, long p, long mod)\n\t\t{\n\t\t\t//p %= mod;\n\n\t\t\tvar res = new Matrix() { _11 = 1, _22 = 1 };\n\t\t\tvar a = new Matrix() { _11 = x._11, _12 = x._12, _21 = x._21, _22 = x._22 };\n\t\t\twhile (true)\n\t\t\t{\n\t\t\t\tif (p % 2 == 1)\n\t\t\t\t{\n\t\t\t\t\tres.Mult(a, mod);\n\t\t\t\t\tp--;\n\t\t\t\t}\n\n\t\t\t\tif (p == 0)\n\t\t\t\t{\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tp /= 2;\n\t\t\t\ta.Square(mod);\n\t\t\t}\n\n\t\t\treturn res;\n\t\t}\n\n\t\tstatic long pow(long x, long p, long mod)\n\t\t{\n\t\t\tx %= mod;\n\t\t\t//p %= mod;\n\n\t\t\tvar res = 1L;\n\t\t\tvar a = x;\n\t\t\twhile (true)\n\t\t\t{\n\t\t\t\tif (p % 2 == 1)\n\t\t\t\t{\n\t\t\t\t\tres *= a;\n\t\t\t\t\tres %= mod;\n\t\t\t\t\tp--;\n\t\t\t\t}\n\n\t\t\t\tif (p == 0)\n\t\t\t\t{\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tp /= 2;\n\t\t\t\ta *= a;\n\t\t\t\ta %= mod;\n\t\t\t}\n\n\t\t\treturn res;\n\t\t}\n\n\t\tstatic int readInt()\n\t\t{\n\t\t\treturn int.Parse(Console.ReadLine());\n\t\t}\n\n\t\tstatic long readLong()\n\t\t{\n\t\t\treturn long.Parse(Console.ReadLine());\n\t\t}\n\n\t\tstatic int[] readIntArray()\n\t\t{\n\t\t\treturn Console.ReadLine().Split(' ').Where(i => !string.IsNullOrEmpty(i)).Select(i => int.Parse(i)).ToArray();\n\t\t}\n\n\t\tstatic long[] readLongArray()\n\t\t{\n\t\t\treturn Console.ReadLine().Split(' ').Where(i => !string.IsNullOrEmpty(i)).Select(i => long.Parse(i)).ToArray();\n\t\t}\n\n#if DEBUG\n\t\tstatic StreamReader getInput()\n\t\t{\n\t\t\tvar resName = Assembly.GetCallingAssembly().GetManifestResourceNames()[0];\n\t\t\tvar resource = Assembly.GetCallingAssembly().GetManifestResourceStream(resName);\n\n\t\t\treturn new StreamReader(resource);\n\t\t}\n#endif\n\t}\n}\n", "lang": "MS C#", "bug_code_uid": "07bab71d71f17d3c2f484b8c1412b314", "src_uid": "2163eec2ea1eed5da8231d1882cb0f8e", "apr_id": "8a91244ed66abc5063407373ce7d64ea", "difficulty": 2100, "tags": ["combinatorics", "matrices", "number theory", "math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.9861739875198825, "equal_cnt": 11, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 9, "fix_ops_cnt": 10, "bug_source_code": "#if DEBUG\nusing System.Reflection;\nusing System.Threading.Tasks;\n#endif\n\nusing System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\nusing System.Text;\n\n\nnamespace _307d\n{\n\tclass Program\n\t{\n\t\tstatic string _inputFilename = \"input.txt\";\n\t\tstatic string _outputFilename = \"output.txt\";\n#if DEBUG\n static bool _useFileInput = false;\n#else\n\t\tstatic bool _useFileInput = false;\n#endif\n\n\t\tstatic void Main(string[] args)\n\t\t{\n\t\t\tStreamWriter file = null;\n\t\t\tif (_useFileInput)\n\t\t\t{\n\t\t\t\tConsole.SetIn(File.OpenText(_inputFilename));\n\t\t\t\tfile = new StreamWriter(_outputFilename);\n\t\t\t\tConsole.SetOut(file);\n\t\t\t}\n\n#if DEBUG\n\t\t\tif (!_useFileInput)\n\t\t\t{\n\t\t\t\tConsole.SetIn(getInput());\n\t\t\t}\n#endif\n\n\t\t\ttry\n\t\t\t{\n\t\t\t\tsolution();\n\t\t\t}\n\t\t\tfinally\n\t\t\t{\n\t\t\t\tif (_useFileInput)\n\t\t\t\t{\n\t\t\t\t\tfile.Close();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tstatic void solution()\n\t\t{\n\t\t\t#region SOLUTION\n\t\t\tvar d = readLongArray();\n\t\t\tvar n = d[0];\n\t\t\tvar k = d[1];\n\t\t\tvar l = (int)d[2];\n\t\t\tvar m = d[3];\n\n\t\t\tfor (int i = l; i < 64; i++)\n\t\t\t{\n\t\t\t\tif (((1L << i) & k) != 0)\n\t\t\t\t{\n\t\t\t\t\tConsole.WriteLine(0);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tvar fim = new Matrix { _11 = 0, _12 = 1, _21 = 1, _22 = 1 };\n\t\t\t//fim.Print();\n\t\t\tvar sq = pow(fim, n - 1, m);\n\t\t\t//sq.Print();\n\n\t\t\tvar fn0 = (sq._21 + sq._22) % m;\n\t\t\tvar fn1 = (sq._11 + sq._12) % m;\n\t\t\tvar fr = (fn0 + fn1) % m;\n\n\t\t\tvar fi = new int[n + 1];\n\t\t\tfi[0] = 1;\n\t\t\tfi[1] = 1;\n\t\t\tfor (int i = 2; i < n + 1; i++)\n\t\t\t{\n\t\t\t\tfi[i] = fi[i - 1] + fi[i - 2];\n\t\t\t}\n\n\t\t\tvar nc = pow(2, n, m);\n\t\t\tnc -= fr;\n\t\t\tif (nc < 0)\n\t\t\t{\n\t\t\t\tnc += m;\n\t\t\t}\n\t\t\t//nc *= ((n - 1) % m);\n\t\t\tnc %= m;\n\n\t\t\tvar nmod = n % m;\n\t\t\tvar res = 1L;\n\t\t\tfor (int i = 0; i < l; i++)\n\t\t\t{\n\t\t\t\tif (((1L << i) & k) != 0)\n\t\t\t\t{\n\t\t\t\t\tres *= nc;\n\t\t\t\t\tres %= m;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tres *= fr;\n\t\t\t\t\tres %= m;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tConsole.WriteLine(res);\n\n\t\t\t//var n = readInt();\n\t\t\t//var m = readInt();\n\n\t\t\t//var a = readIntArray();\n\t\t\t//var b = readIntArray();\n\t\t\t#endregion\n\t\t}\n\n\t\tclass Matrix\n\t\t{\n\t\t\tpublic long _11;\n\t\t\tpublic long _12;\n\t\t\tpublic long _21;\n\t\t\tpublic long _22;\n\n\t\t\tpublic void Mult(Matrix x, long mod)\n\t\t\t{\n\t\t\t\tvar __11 = (_11 * x._11) % mod + (_12 * x._21) % mod;\n\t\t\t\tvar __12 = (_11 * x._21) % mod + (_12 * x._22) % mod;\n\t\t\t\tvar __21 = (_21 * x._11) % mod + (_22 * x._21) % mod;\n\t\t\t\tvar __22 = (_21 * x._21) % mod + (_22 * x._22) % mod;\n\n\t\t\t\t_11 = __11 % mod;\n\t\t\t\t_12 = __12 % mod;\n\t\t\t\t_21 = __21 % mod;\n\t\t\t\t_22 = __22 % mod;\n\t\t\t}\n\n\t\t\tpublic void Square(long mod)\n\t\t\t{\n\t\t\t\tMult(this, mod);\n\t\t\t}\n\n\t\t\tpublic void Print()\n\t\t\t{\n\t\t\t\tConsole.WriteLine(\"{0} {1}\", _11, _12);\n\t\t\t\tConsole.WriteLine(\"{0} {1}\", _21, _22);\n\t\t\t\tConsole.WriteLine();\n\t\t\t}\n\t\t}\n\n\t\tstatic Matrix pow(Matrix x, long p, long mod)\n\t\t{\n\t\t\t//p %= mod;\n\n\t\t\tvar res = new Matrix() { _11 = 1, _22 = 1 };\n\t\t\tvar a = new Matrix() { _11 = x._11, _12 = x._12, _21 = x._21, _22 = x._22 };\n\t\t\twhile (true)\n\t\t\t{\n\t\t\t\tif (p % 2 == 1)\n\t\t\t\t{\n\t\t\t\t\tres.Mult(a, mod);\n\t\t\t\t\tp--;\n\t\t\t\t}\n\n\t\t\t\tif (p == 0)\n\t\t\t\t{\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tp /= 2;\n\t\t\t\ta.Square(mod);\n\t\t\t}\n\n\t\t\treturn res;\n\t\t}\n\n\t\tstatic long pow(long x, long p, long mod)\n\t\t{\n\t\t\tx %= mod;\n\t\t\t//p %= mod;\n\n\t\t\tvar res = 1L;\n\t\t\tvar a = x;\n\t\t\twhile (true)\n\t\t\t{\n\t\t\t\tif (p % 2 == 1)\n\t\t\t\t{\n\t\t\t\t\tres *= a;\n\t\t\t\t\tres %= mod;\n\t\t\t\t\tp--;\n\t\t\t\t}\n\n\t\t\t\tif (p == 0)\n\t\t\t\t{\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tp /= 2;\n\t\t\t\ta *= a;\n\t\t\t\ta %= mod;\n\t\t\t}\n\n\t\t\treturn res;\n\t\t}\n\n\t\tstatic int readInt()\n\t\t{\n\t\t\treturn int.Parse(Console.ReadLine());\n\t\t}\n\n\t\tstatic long readLong()\n\t\t{\n\t\t\treturn long.Parse(Console.ReadLine());\n\t\t}\n\n\t\tstatic int[] readIntArray()\n\t\t{\n\t\t\treturn Console.ReadLine().Split(' ').Where(i => !string.IsNullOrEmpty(i)).Select(i => int.Parse(i)).ToArray();\n\t\t}\n\n\t\tstatic long[] readLongArray()\n\t\t{\n\t\t\treturn Console.ReadLine().Split(' ').Where(i => !string.IsNullOrEmpty(i)).Select(i => long.Parse(i)).ToArray();\n\t\t}\n\n#if DEBUG\n\t\tstatic StreamReader getInput()\n\t\t{\n\t\t\tvar resName = Assembly.GetCallingAssembly().GetManifestResourceNames()[0];\n\t\t\tvar resource = Assembly.GetCallingAssembly().GetManifestResourceStream(resName);\n\n\t\t\treturn new StreamReader(resource);\n\t\t}\n#endif\n\t}\n}\n", "lang": "MS C#", "bug_code_uid": "dcf725fa73a2c27b80b371c148b33704", "src_uid": "2163eec2ea1eed5da8231d1882cb0f8e", "apr_id": "8a91244ed66abc5063407373ce7d64ea", "difficulty": 2100, "tags": ["combinatorics", "matrices", "number theory", "math", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.99581589958159, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "using System;\nusing System.Linq;\n\nnamespace Codeforces\n{\n\tpublic class C\n\t{\n\t\tconst int N = (int)1e6 + 1;\n\t\tpublic static int Main()\n\t\t{\n\t\t\tint [] input = Console.ReadLine().Split().Select(x => Convert.ToInt32(x)).ToArray();\n\t\t\t\n\t\t\tlong [] a = new long[N];\n\t\t\t\n\t\t\tint A = input[0];\n\t\t\tint B = input[1];\n\t\t\tint C = input[2];\n\t\t\tint D = input[3];\n\t\t\t\n\t\t\tfor (int i = A; i <= B; ++i)\n\t\t\t{\n\t\t\t\t++a[i + B];\n\t\t\t\t--a[i + C + 1];\n\t\t\t}\n\t\t\t\n\t\t\tfor (int i = 1; i < N; ++i)\n\t\t\t{\n\t\t\t\ta[i] += a[i - 1];\n\t\t\t}\n\t\t\t\n\t\t\tfor (int i = 1; i < N; ++i)\n\t\t\t{\n\t\t\t\ta[i] += a[i - 1];\n\t\t\t}\n\t\t\t\n\t\t\tlong result = 0;\n\t\t\tfor (int i = C; i <= D; ++i)\n\t\t\t{\n\t\t\t\tresult += a[N - 1] - a[i];\n\t\t\t}\n\t\t\t\n\t\t\tConsole.WriteLine(result);\n\t\t\t\n\t\t\treturn 0;\n\t\t}\n\t}\n} \n", "lang": "Mono C#", "bug_code_uid": "83cca9cba1831c2f0ee54ce8f62457bc", "src_uid": "4f92791b9ec658829f667fcea1faee01", "apr_id": "1bd631ea4dca59785a40ffeacb1fbc02", "difficulty": 1800, "tags": ["binary search", "math", "implementation", "two pointers"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.5894736842105263, "equal_cnt": 14, "replace_cnt": 8, "delete_cnt": 3, "insert_cnt": 3, "fix_ops_cnt": 14, "bug_source_code": "using System;\nusing System.IO;\nusing System.Linq;\n\nnamespace Codeforces.R1355.C\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 answer)\n {\n tw.WriteLine(answer);\n }\n\n private static long Parse(TextReader tr)\n {\n var t = tr.ReadLine().Split().Select(x => int.Parse(x)).ToArray();\n return Calc(t[0], t[1], t[2], t[3]);\n }\n\n public static long Calc(long a, long b, long c, long d)\n {\n var res = 0L;\n\n for (var x = a; x <= b; ++x)\n {\n var yMin = Math.Max(b, c + 1 - x);\n var zMax = Math.Min(d + 1, x + yMin);\n var zNum = zMax - c;\n\n var yNum = c + 1 - yMin;\n\n res += zNum * yNum;\n res += (yNum - 1) * yNum / 2;\n }\n\n return res;\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "85f2a4f49c3b0086fe79e635233723e2", "src_uid": "4f92791b9ec658829f667fcea1faee01", "apr_id": "d69e157763a01c32c8e187e28f8ea13a", "difficulty": 1800, "tags": ["binary search", "math", "implementation", "two pointers"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.6356968215158925, "equal_cnt": 7, "replace_cnt": 4, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 6, "bug_source_code": "using System;\n\nnamespace CSharpPractice\n{\n internal class Program\n {\n public static void Main(string[] args)\n {\n Int64 input = Int64.Parse(Console.ReadLine());\n\n Int64 value = input / 2;\n Int64 count = 0;\n decimal range = Math.Ceiling((decimal)value / 2);\n for (Int64 i = 1; i < range; i++)\n {\n if (i + (value - i) == value)\n {\n count++;\n }\n }\n Console.WriteLine(count);\n Console.ReadLine();\n }\n }\n}", "lang": "Mono C#", "bug_code_uid": "c61aa9217a25f8712d653cc316372162", "src_uid": "32b59d23f71800bc29da74a3fe2e2b37", "apr_id": "9b0278b23ba52c7f7108cedbb5aa0ca6", "difficulty": 1000, "tags": ["math", "combinatorics"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.8755935422602089, "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.Text;\n\npublic class HQ9\n{\n public HQ9()\n {\n int i = 0;\n bool output = false;\n string x = Console.ReadLine().Trim();\n for (i = 0; i < x.Length; i++)\n {\n if (x[i] == 'H' || x[i] == 'Q' || x[i] == '9')\n {\n output = true;\n break;\n }\n }\n Console.WriteLine(output ? \"YES\" : \"NO\");\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "5cda2b5805a071c2b08e5f61b2b8b34f", "src_uid": "1baf894c1c7d5aeea01129c7900d3c12", "apr_id": "45a1b8946f816b3b056b838165696c88", "difficulty": 900, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C#"} {"similarity_score": 0.9689877121123464, "equal_cnt": 8, "replace_cnt": 2, "delete_cnt": 6, "insert_cnt": 0, "fix_ops_cnt": 8, "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 swap(ref T a, ref T b)\n {\n T c = a;\n a = b;\n b = c;\n }\n static void Main(string[] args)\n {\n string str = Console.ReadLine();\n bool flag = false;\n foreach (char i in str)\n {\n if ((i == 'H') | (i == 'Q') | (i == '9'))\n {\n Console.WriteLine(\"YES\");\n flag = !flag;\n break;\n }\n }\n if (!flag)\n {\n Console.WriteLine(\"NO\");\n \n }\n }\n //System.Console.ReadKey();\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "bfbc85dfc7c4dac921d65ef9813ba126", "src_uid": "1baf894c1c7d5aeea01129c7900d3c12", "apr_id": "d245da494aefdb6089177dca185a20c6", "difficulty": 900, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C#"} {"similarity_score": 0.961564396493594, "equal_cnt": 7, "replace_cnt": 3, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 6, "bug_source_code": "using System;\nusing CompLib.Util;\n\npublic class Program\n{\n public void Solve()\n {\n var sc = new Scanner();\n string a = sc.Next();\n string b = sc.Next();\n string c = sc.Next();\n // 0\n if (a[1] == b[1] && b[1] == c[1])\n {\n if (a[0] == b[0] && b[0] == c[0])\n {\n Console.WriteLine(0);\n return;\n }\n\n int min = Math.Min(a[0], Math.Min(b[0], c[0]));\n int max = Math.Max(a[0], Math.Max(b[0], c[0]));\n int mid = a[0] + b[0] + c[0] - min - max;\n if (min + 1 == mid && mid + 1 == max)\n {\n Console.WriteLine(0);\n return;\n }\n }\n\n // 1\n if (a[1] == b[1] && Math.Abs(a[0] - b[0]) <= 1)\n {\n Console.WriteLine(1);\n return;\n }\n\n if (b[1] == c[1] && Math.Abs(b[0] - c[0]) <= 1)\n {\n Console.WriteLine(1);\n \n return;\n }\n\n if (c[1] == a[1] && Math.Abs(c[0] - a[0]) <= 1)\n {\n Console.WriteLine(1);\n \n return;\n }\nthrow new Exception();\n Console.WriteLine(2);\n }\n\n public static void Main(string[] args) => new Program().Solve();\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": "Mono C#", "bug_code_uid": "adb8e2e0ba6eec65bbb47b677e666674", "src_uid": "7e42cebc670e76ace967e01021f752d3", "apr_id": "21cd2fd17806b9bbd8a22efc158d9e64", "difficulty": 1200, "tags": ["brute force", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.6149577500315299, "equal_cnt": 19, "replace_cnt": 10, "delete_cnt": 5, "insert_cnt": 3, "fix_ops_cnt": 18, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\nusing System.Threading;\nnamespace codeforce_mahjong\n{\n class Program\n {\n private static int koutsu = 0;\n private static int shuntsu = 0;\n private static string[] suit;\n private static int tiles_needed_koutsu = 4;\n private static int tiles_needed_shuntsu = 4;\n\n public static int Min(int[] a, int n)\n {\n int min = 10;\n for (int i = 0; i < n; ++i)\n {\n if (min > a[i])\n {\n min = a[i];\n }\n }\n return min;\n }\n private static void Shuntsu()\n {\n int[] s = new int[10];\n int[] p = new int[10];\n int[] m = new int[10];\n int min = 0;\n int[] numbers = { Int16.Parse(suit[0][0].ToString()), Int16.Parse(suit[1][0].ToString()), Int16.Parse(suit[2][0].ToString()) };\n foreach (String x in suit)\n {\n char c;\n switch (x[1])\n {\n case 's':\n s[Int16.Parse(x[0].ToString())]++;\n break;\n case 'p':\n p[Int16.Parse(x[0].ToString())]++;\n break;\n case 'm':\n m[Int16.Parse(x[0].ToString())]++;\n break;\n\n }\n }\n min = Min(numbers, 3);\n\n if (p[min] == 1 && p[min + 1] == 1 && p[min + 2] == 1)\n {\n shuntsu++;\n }\n if (s[min] == 1 && s[min + 1] == 1 && s[min + 2] == 1)\n {\n shuntsu++;\n }\n if (m[min] == 1 && m[min + 1] == 1 && m[min + 2] == 1)\n {\n shuntsu++;\n }\n\n if (p[min] == 1 && p[min + 1] == 1 || p[min] == 1&& p[min + 2] == 1|| p[min+1] == 1 && p[min + 2] == 1)\n {\n tiles_needed_shuntsu = 1;\n }\n else if (s[min] == 1 && s[min + 1] == 1 || s[min] == 1 && s[min + 2] == 1 || s[min + 1] == 1 && s[min + 2] == 1)\n {\n tiles_needed_shuntsu = 1;\n }\n else if (m[min] == 1 && m[min + 1] == 1 || m[min] == 1 && m[min + 2] == 1 || m[min + 1] == 1 && m[min + 2] == 1)\n {\n tiles_needed_shuntsu = 1;\n }\n else\n {\n if(shuntsu== 0)\n {\n tiles_needed_shuntsu = 2;\n }\n }\n }\n static void Koutsu()\n {\n bool Ok = false;\n int tiles_needed = 2;\n int k = 0;\n if (suit[0].Equals(suit[1]) && suit[0].Equals(suit[2]))\n {\n koutsu++;\n }\n else\n {\n if (suit[0].Equals(suit[1]) || suit[0].Equals(suit[2]) || suit[1].Equals(suit[2]))\n {\n tiles_needed = 1;\n }\n }\n if (koutsu == 0)\n {\n tiles_needed_koutsu = tiles_needed;\n }\n }\n static void Main(string[] args)\n {\n suit = Console.ReadLine().Split(' ');\n\n Thread t1 = new Thread(new ThreadStart(Koutsu));\n t1.Start();\n t1.Join();\n\n Thread t2 = new Thread(new ThreadStart(Shuntsu));\n t2.Start();\n t2.Join();\n\n if(shuntsu!=0 ||koutsu!=0)\n {\n Console.WriteLine(\"0\");\n }\n else\n {\n Console.WriteLine((tiles_needed_koutsu < tiles_needed_shuntsu) ? tiles_needed_koutsu : tiles_needed_shuntsu);\n }\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "406988536de6816130739dd327e3a35a", "src_uid": "7e42cebc670e76ace967e01021f752d3", "apr_id": "bde36a79af6074db794ff50d5d497e36", "difficulty": 1200, "tags": ["brute force", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.8099062918340026, "equal_cnt": 5, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 4, "bug_source_code": "using System;\nusing System.IO;\nusing System.Collections;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\n\nnamespace NSproul //1\n{\n class Program\n {\n static void Main()\n {\n int[] ins = Console.ReadLine().Split();\n\t\t\tint l = ins[0];\n\t\t\tint d = ins[1];\n\t\t\tint n = ins[2];\n\t\t\tchar s = 'L';\n\t\t\tint lout = 0;\n\t\t\tint dout = 0;\n\t\t\t\n if (n%2 == 0) {\n\t\t\t\ts = 'R';\n\t\t\t\tn /= 2;\n\t\t\t}\n\t\t\telse n = (n+1)/2;\n\t\t\t\n\t\t\tlout = Math.Ceiling(n/d);\n\t\t\t\n\t\t\tif (n%d == 0) dout = d;\n\t\t\telse dout = n%d;\n\t\t\t\n Console.WriteLine(lout + \" \" + dout + \" \" + s);\n }\n }\n} ", "lang": "MS C#", "bug_code_uid": "4a07224e0c5ac801a11ee73592b0377b", "src_uid": "d6929926b44c2d5b1a8e6b7f965ca1bb", "apr_id": "6cde2c459101f66f06a1214132ab764d", "difficulty": 800, "tags": ["math", "constructive algorithms"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9926017262638718, "equal_cnt": 5, "replace_cnt": 2, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 4, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace CF752A {\n class Program {\n static void Main(string[] args) {\n string[] inputs = Console.ReadLine().Split(' ');\n int lanes = Convert.ToInt32(inputs[0]);\n int rows = Convert.ToInt32(inputs[1]);\n int seat = Convert.ToInt32(inputs[2]);\n\n //print 'lane row {l/r}'\n int seatsPerLane = 2 * rows;\n int lane = ((seat - 1) / seatsPerLane) + 1;\n int row = (((seat - ((lane - 1) * seatsPerLane)) + 1) / rows) + 1;\n\n char side = 'L';\n if (seat % 2 == 0) {\n side = 'R';\n }\n Console.WriteLine(lane + \" \" + row + \" \" + side);\n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "cb106353cf07cbe6a3d73110d7a75531", "src_uid": "d6929926b44c2d5b1a8e6b7f965ca1bb", "apr_id": "16834495eb54f8c0695b4eb64144d73f", "difficulty": 800, "tags": ["math", "constructive algorithms"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9705882352941176, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "class Program\n{\n static void Main(){\n var n = int.Parse(Console.ReadLine());\n var str = \"\";\n for(int i = 1; i<5000; i++)\n {\n str += i.ToString();\n }\n Console.WriteLine(str[n]);\n }\n}", "lang": "Mono C#", "bug_code_uid": "1a047e475f70b43d2bd529a7ffbc440f", "src_uid": "1503d761dd4e129fb7c423da390544ff", "apr_id": "5de063f0d907974aa86807c03df98569", "difficulty": 1000, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.996415770609319, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "using System;\nclass Program\n{\n static void Main(){\n var n = int.Parse(Console.ReadLine());\n var str = \"\";\n for(int i = 1; i<5000; i++)\n {\n str += i.ToString();\n }\n Console.WriteLine(str[n]);\n }\n}", "lang": "Mono C#", "bug_code_uid": "690a7e81f10291d3a687716ccc96af76", "src_uid": "1503d761dd4e129fb7c423da390544ff", "apr_id": "5de063f0d907974aa86807c03df98569", "difficulty": 1000, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.9928195308760173, "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 ConsoleApplication1\n{\n class Program\n {\n static void Main(string[] args)\n {\n string[] s = Console.ReadLine().Split(' ');\n int n = int.Parse(s[0]), a = int.Parse(s[1]), b = int.Parse(s[2]);\n a += (n - 1);\n b += (n - 1);\n if (a > b)\n {\n int c = b;\n b = a;\n a = c;\n }\n for (int i = 1; a != 1; i /= 2)\n {\n if (a % 2 == 0 && b % 2 == 1 && b - a == 1)\n {\n if (a == 2 && b == 3)\n {\n Console.WriteLine(\"Final!\");\n return;\n }\n else\n {\n Console.WriteLine(i);\n return;\n }\n }\n }\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "f6daba3c307e97b5d75c03fddf7e5cc0", "src_uid": "a753bfa7bde157e108f34a28240f441f", "apr_id": "4213336864ca0a28a6275192a6558470", "difficulty": 1200, "tags": ["constructive algorithms", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9750644883920895, "equal_cnt": 6, "replace_cnt": 2, "delete_cnt": 2, "insert_cnt": 2, "fix_ops_cnt": 6, "bug_source_code": "using System;\nusing System.Linq;\n\nnamespace CodeForces\n{\n class Program\n {\n static void Main(string[] args)\n {\n //Console.WriteLine(\"Hello World!\");\n //FriendsMeeting.FriendsWithBenefits();\n WorldCup.wakaWaka();\n }\n }\n \n class WorldCup\n {\n public static void wakaWaka()\n {\n int[] inp = Array.ConvertAll(Console.ReadLine().Split(' '), int.Parse);\n int teamCount = inp[0];\n int roundCount = (int)Math.Log((double)teamCount, 2), iterationCount = 0;\n List> roughPaper = new List>() { };\n int[] baseArray = new int[teamCount];\n for (int i = 0; i < teamCount; i++)\n {\n baseArray[i] = i;\n }\n roughPaper.Add(baseArray.ToList());\n while(iterationCount < roundCount)\n {\n ++iterationCount;\n roughPaper.Add(roughPaper[iterationCount - 1].Where(x => x != -1).ToList());\n int limit = roughPaper[iterationCount].Count;\n for (int i =0;i< limit;i+=2)\n {\n if ((roughPaper[iterationCount][i] + 1 == inp[1] || roughPaper[iterationCount][i] + 1 == inp[2]) &&\n (roughPaper[iterationCount][i + 1] + 1 == inp[1] || roughPaper[iterationCount][i + 1] + 1 == inp[2])) \n {\n Console.WriteLine(iterationCount.ToString());\n //Console.ReadKey();\n return;\n }\n else if ((roughPaper[iterationCount][i] + 1 == inp[1] || roughPaper[iterationCount][i] + 1 == inp[2]))\n {\n roughPaper[iterationCount][i + 1] = -1;\n }\n else if ((roughPaper[iterationCount][i + 1] + 1 == inp[1] || roughPaper[iterationCount][i + 1] + 1 == inp[2])) \n {\n roughPaper[iterationCount][i] = -1;\n }\n else\n {\n roughPaper[iterationCount][i] = -1;\n }\n }\n }\n Console.WriteLine(\"Final!\");\n //Console.ReadKey();\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "98056e03c28248ccc94107baf041a0b0", "src_uid": "a753bfa7bde157e108f34a28240f441f", "apr_id": "e3f717422e8e8ad81e8b39378ed20700", "difficulty": 1200, "tags": ["constructive algorithms", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9927190406265296, "equal_cnt": 5, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 4, "bug_source_code": "#define GenericArithmetics\n#define Geometrys\n#define ASD\n#if (Debug)\n#define Trace\n#endif\n#if (ASD)\nusing DS.Common;\nusing DS.Dictionaries;\nusing DS.Graphs;\nusing DS.Heaps;\nusing DS.Lists;\nusing DS.Trees;\nusing DS;\nusing AL;\nusing AL.Common;\nusing AL.Graphs;\nusing AL.Numeric;\nusing AL.Sorting;\n#endif\n#if (GenericArithmetics)\nusing GenericArithmetic;\n#endif\n#if Geometrys\nusing Geometry;\n#endif\nusing System;\nusing System.Collections;\nusing System.Collections.Generic;\nusing System.Diagnostics;\nusing System.IO;\nusing System.Linq;\nusing System.Text;\nusing System.Threading;\nusing System.Threading.Tasks;\nusing System.Reflection;\nusing System.Windows;\nusing System.Text.RegularExpressions;\nusing csConsoleforStudy;\nusing System.Resources;\nusing System.Runtime.Serialization;\nusing System.Globalization;\nusing System.Runtime.InteropServices;\n\nnamespace csConsoleforStudy\n{\n class Program\n {\n static readonly Encoding TargetEcoding = Encoding.Unicode;\n#if (Debug)\n#endif\n static void Main(string[] args)\n {\n OpenStream();\n Solver s = new Solver();\n s.Solve();\n CloseStream();\n }\n\n static void OpenStream()\n {\n#if (Debug)\n#endif\n }\n\n static void CloseStream()\n {\n#if (Debug)\n#endif\n }\n\n static void CheckMemory()\n {\n#if (Debug)\n#endif\n }\n }\n\n class Solver\n {\n public static readonly Encoding TargetEncoding = Encoding.Unicode;\n public void Solve()\n {\n int len = ri();\n string cards = rs();\n int R = 0;\n int G = 0;\n int B = 0;\n Tuple RGB = new Tuple(R, G, B);\n for (int i = 0; i < len; i++)\n {\n if (cards[i] == 'R')\n R++;\n else if (cards[i] == 'G')\n G++;\n else if (cards[i] == 'B')\n B++;\n }\n\n RGB = new Tuple(R, G, B);\n if (R > 1 && G > 1 && B > 1)\n {\n Console.WriteLine(\"BGR\");\n return;\n }\n\n Console.WriteLine(next(RGB));\n }\n\n private string check(Tuple RGB)\n {\n if (RGB.Item1 == 0 && RGB.Item2 == 0)\n return \"B\";\n else if (RGB.Item1 == 0 && RGB.Item3 == 0)\n return \"G\";\n else if (RGB.Item2 == 0 && RGB.Item3 == 0)\n return \"R\";\n else\n return \"x\";\n }\n\n private string next(Tuple RGB)\n {\n if (check(RGB) != \"x\")\n return check(RGB);\n string str = \"\";\n if (RGB.Item1 > 0 && RGB.Item2 > 0)\n str += RG(RGB);\n if (RGB.Item1 > 0 && RGB.Item3 > 0)\n str += RB(RGB);\n if (RGB.Item2 > 0 && RGB.Item3 > 0)\n str += GB(RGB);\n if (RGB.Item1 > 1)\n str += RR(RGB);\n if (RGB.Item2 > 1)\n str += GG(RGB);\n if (RGB.Item3 > 1)\n str += BB(RGB);\n string str2 = \"\";\n if (str.Contains(\"B\"))\n str2 += \"B\";\n if (str.Contains(\"G\"))\n str2 += \"G\";\n if (str.Contains(\"R\"))\n str2 += \"R\";\n return str2;\n }\n\n private string RG(Tuple RGB)\n {\n if (check(RGB) == \"x\")\n RGB = new Tuple(RGB.Item1 - 1, RGB.Item2 - 1, RGB.Item3 + 1);\n else\n {\n return check(RGB);\n }\n\n return next(RGB);\n }\n\n private string RB(Tuple RGB)\n {\n if (check(RGB) == \"x\")\n RGB = new Tuple(RGB.Item1 - 1, RGB.Item2 + 1, RGB.Item3 - 1);\n else\n {\n return check(RGB);\n }\n\n return next(RGB);\n }\n\n private string GB(Tuple RGB)\n {\n if (check(RGB) == \"x\")\n RGB = new Tuple(RGB.Item1 + 1, RGB.Item2 - 1, RGB.Item3 - 1);\n else\n {\n return check(RGB);\n }\n\n return next(RGB);\n }\n\n private string RR(Tuple RGB)\n {\n if (check(RGB) == \"x\")\n RGB = new Tuple(RGB.Item1 - 1, RGB.Item2, RGB.Item3);\n else\n {\n return check(RGB);\n }\n\n return next(RGB);\n }\n\n private string GG(Tuple RGB)\n {\n if (check(RGB) == \"x\")\n RGB = new Tuple(RGB.Item1, RGB.Item2 - 1, RGB.Item3);\n else\n {\n return check(RGB);\n }\n\n return next(RGB);\n }\n\n private string BB(Tuple RGB)\n {\n if (check(RGB) == \"x\")\n RGB = new Tuple(RGB.Item1, RGB.Item2, RGB.Item3 - 1);\n else\n {\n return check(RGB);\n }\n\n return next(RGB);\n }\n\n#region SolverUtils\n private const double AbsoluteError = 1e-10;\n private const double RelativeError = 1e-8;\n private static int NextInt()\n {\n int c;\n int res = 0;\n do\n {\n c = Console.Read();\n if (c == -1)\n return res;\n }\n while (c < '0' || c > '9');\n res = c - '0';\n while (true)\n {\n c = Console.Read();\n if (c < '0' || c > '9')\n return res;\n res *= 10;\n res += c - '0';\n }\n }\n\n static string rs()\n {\n return Console.ReadLine();\n }\n\n static int ri()\n {\n return int.Parse(Console.ReadLine());\n }\n\n static uint rui()\n {\n return uint.Parse(Console.ReadLine());\n }\n\n static long rl()\n {\n return long.Parse(Console.ReadLine());\n }\n\n static ulong rul()\n {\n return ulong.Parse(Console.ReadLine());\n }\n\n static double rd()\n {\n return double.Parse(Console.ReadLine());\n }\n\n static string[] rsa()\n {\n return Console.ReadLine().Split(' ');\n }\n\n static int[] ria()\n {\n return Array.ConvertAll(Console.ReadLine().Split(' '), e => int.Parse(e));\n }\n\n static uint[] ruia()\n {\n return Array.ConvertAll(Console.ReadLine().Split(' '), e => uint.Parse(e));\n }\n\n static long[] rla()\n {\n return Array.ConvertAll(Console.ReadLine().Split(' '), e => long.Parse(e));\n }\n\n static ulong[] rula()\n {\n return Array.ConvertAll(Console.ReadLine().Split(' '), e => ulong.Parse(e));\n }\n\n static double[] rda()\n {\n return Array.ConvertAll(Console.ReadLine().Split(' '), e => double.Parse(e));\n }\n\n static void ReadLineAndAssign(string type, params object[] p)\n {\n dynamic input;\n if (type.StartsWith(\"i\"))\n input = ria();\n else if (type.StartsWith(\"l\"))\n input = rla();\n else if (type.StartsWith(\"d\"))\n input = rda();\n else\n throw new AE(\"no match \" + type.ToString());\n for (int i = 0; i < p.Length; i++)\n {\n p[i] = input[i];\n }\n }\n\n static void SwapIfGreater(ref T lhs, ref T rhs)where T : IComparable\n {\n T temp;\n if (lhs.CompareTo(rhs) > 0)\n {\n temp = lhs;\n lhs = rhs;\n rhs = temp;\n }\n }\n\n static bool DoubleEqual(double a, double b)\n {\n double diff = Math.Abs(a - b);\n if (diff < AbsoluteError)\n return true;\n return diff <= RelativeError * Math.Max(Math.Abs(a), Math.Abs(b));\n }\n\n static dynamic abs(dynamic num)\n {\n return Math.Abs(num);\n }\n\n static dynamic max(dynamic a, dynamic b)\n {\n return Math.Max(a, b);\n }\n\n static void For(int start, int end, Delegate method)\n {\n method.DynamicInvoke();\n }\n#endregion\n }\n\n#if (BigRationals)\n#region Members for Internal Support\n#endregion Members for Internal Support\n#region Public Properties\n#endregion Public Properties\n#region Public Instance Methods\n#endregion Public Instance Methods\n#region Constructors\n#endregion Constructors\n#region Public Static Methods\n#endregion Public Static Methods\n#region Operator Overloads\n#endregion Operator Overloads\n#region explicit conversions from BigRational\n#endregion explicit conversions from BigRational\n#region implicit conversions to BigRational\n#endregion implicit conversions to BigRational\n#region serialization\n#endregion serialization\n#region instance helper methods\n#endregion instance helper methods\n#region static helper methods\n#endregion static helper methods\n#endif\n#if (MS)\n#endif\n#region Exceptions\n [Serializable]\n internal class IOE : InvalidOperationException\n {\n public IOE()\n {\n }\n\n public IOE(string message): base (message)\n {\n }\n\n public IOE(string message, Exception innerException): base (message, innerException)\n {\n }\n\n protected IOE(SerializationInfo info, StreamingContext context): base (info, context)\n {\n }\n }\n\n [Serializable]\n internal class AE : ArgumentException\n {\n public AE()\n {\n }\n\n public AE(string message): base (message)\n {\n }\n\n public AE(string message, Exception innerException): base (message, innerException)\n {\n }\n\n protected AE(SerializationInfo info, StreamingContext context): base (info, context)\n {\n }\n }\n#endregion\n}\n\n#if GenericArithmetics\nnamespace GenericArithmetic\n{\n public class Vector\n {\n public static readonly ICalculator Calculator = Number.Calculator;\n public T X\n {\n get;\n set;\n }\n\n public T Y\n {\n get;\n set;\n }\n\n public Vector(T x, T y)\n {\n X = x;\n Y = y;\n }\n\n public override bool Equals(object obj)\n {\n return base.Equals(obj);\n }\n\n public override int GetHashCode()\n {\n return base.GetHashCode();\n }\n\n public static bool operator ==(Vector a, Vector b)\n {\n return EqualityComparer.Default.Equals(a.X, b.X) && EqualityComparer.Default.Equals(a.Y, b.Y);\n }\n\n public static bool operator !=(Vector a, Vector b)\n {\n return !(EqualityComparer.Default.Equals(a.X, b.X) && EqualityComparer.Default.Equals(a.Y, b.Y));\n }\n\n public static Vector operator !(Vector a)\n {\n return new Vector(Calculator.Difference(new Number(default (T)), a.X), Calculator.Difference(new Number(default (T)), a.Y));\n }\n\n public static Vector operator +(Vector a, Vector b)\n {\n return new Vector(Calculator.Sum(a.X, b.X), Calculator.Sum(a.Y, b.Y));\n }\n\n public static Vector operator -(Vector a, Vector b)\n {\n return new Vector(Calculator.Difference(a.X, b.X), Calculator.Difference(a.Y, b.Y));\n }\n }\n\n public class Matrix\n {\n public static readonly ICalculator Calculator = Number.Calculator;\n public int W\n {\n get;\n set;\n }\n\n public int H\n {\n get;\n set;\n }\n\n public int rows\n {\n get\n {\n return H;\n }\n\n set\n {\n H = value;\n }\n }\n\n public int cols\n {\n get\n {\n return W;\n }\n\n set\n {\n W = value;\n }\n }\n\n public T[, ] Map\n {\n get;\n set;\n }\n\n public T this[int x, int y]\n {\n get\n {\n return Map[x, y];\n }\n\n set\n {\n Map[x, y] = value;\n }\n }\n\n public Matrix(T[, ] map)\n {\n Map = map;\n W = map.GetLength(0);\n H = map.GetLength(1);\n }\n\n public Matrix(int w, int h, T defaultValue = default (T))\n {\n W = w;\n H = h;\n Map = new T[W, H];\n#if (ASD)\n Map.Populate(W, H, defaultValue);\n#endif\n }\n\n public override bool Equals(object obj)\n {\n if (obj is Matrix)\n {\n return this == (Matrix)obj;\n }\n\n return base.Equals(obj);\n }\n\n public override int GetHashCode()\n {\n return base.GetHashCode();\n }\n\n public static bool operator ==(Matrix a, Matrix b)\n {\n bool ret = true;\n if (a.Map != b.Map)\n ret = false;\n else if (a.W != b.W)\n ret = false;\n else if (a.H != b.H)\n ret = false;\n return ret;\n }\n\n public static bool operator !=(Matrix a, Matrix b)\n {\n bool ret = true;\n if (a.Map != b.Map)\n ret = false;\n else if (a.W != b.W)\n ret = false;\n else if (a.H != b.H)\n ret = false;\n return !ret;\n }\n\n public static Matrix operator +(Matrix a, Matrix b)\n {\n if (a.W != b.W)\n return null;\n else if (a.H != b.H)\n return null;\n else\n {\n Matrix ret = new Matrix(a.W, a.H);\n for (int i = 0; i < a.W; i++)\n {\n for (int j = 0; j < a.H; j++)\n {\n ret[i, j] = Calculator.Sum(a[i, j], b[i, j]);\n }\n }\n\n return ret;\n }\n }\n\n public static Matrix operator -(Matrix a, Matrix b)\n {\n if (a.W != b.W)\n return null;\n else if (a.H != b.H)\n return null;\n else\n {\n Matrix ret = new Matrix(a.W, a.H);\n for (int i = 0; i < a.W; i++)\n {\n for (int j = 0; j < a.H; j++)\n {\n ret[i, j] = Calculator.Difference(a[i, j], b[i, j]);\n }\n }\n\n return ret;\n }\n }\n\n public static Matrix operator *(Matrix a, Matrix b)\n {\n if (a.cols != b.rows)\n throw new FormatException(\"Cannot multiply : a.W = \" + a.W.ToString() + \" with b.H = \" + b.H.ToString());\n else\n {\n Matrix R = new Matrix(a.rows, b.cols);\n for (int i = 0; i < R.rows; i++)\n for (int j = 0; j < R.cols; j++)\n for (int k = 0; k < a.cols; k++)\n {\n R[i, j] = Calculator.Sum(R[i, j], Calculator.Multiply(a[i, k], b[k, j]));\n }\n\n return R;\n }\n }\n }\n\n public static class Calculator\n {\n public static T Sum(T a, T b)\n {\n return Number.Sum(a, b);\n }\n }\n\n public interface ICalculator\n {\n T Sum(T a, T b);\n T Difference(T a, T b);\n int Compare(T a, T b);\n T Multiply(T a, T b);\n T Divide(T a, T b);\n T Divide(T a, int b);\n }\n\n struct Int32Calculator : ICalculator\n {\n public Int32 Sum(Int32 a, Int32 b)\n {\n return a + b;\n }\n\n public Int32 Difference(Int32 a, Int32 b)\n {\n return a - b;\n }\n\n public int Compare(Int32 a, Int32 b)\n {\n return Difference(a, b);\n }\n\n public int Multiply(Int32 a, Int32 b)\n {\n return a * b;\n }\n\n public int Divide(Int32 a, Int32 b)\n {\n return a / b;\n }\n }\n\n struct Int64Calculator : ICalculator\n {\n public Int64 Sum(Int64 a, Int64 b)\n {\n return a + b;\n }\n\n public Int64 Difference(Int64 a, Int64 b)\n {\n return a - b;\n }\n\n public int Compare(Int64 a, Int64 b)\n {\n if (a > b)\n {\n return 1;\n }\n else if (a < b)\n {\n return -1;\n }\n else\n {\n return 0;\n }\n }\n\n public Int64 Multiply(Int64 a, Int64 b)\n {\n return a * b;\n }\n\n public Int64 Divide(Int64 a, Int64 b)\n {\n return a / b;\n }\n\n public Int64 Divide(Int64 a, int b)\n {\n return a / b;\n }\n }\n\n struct SingleCalculator : ICalculator\n {\n public Single Sum(Single a, Single b)\n {\n return a + b;\n }\n\n public Single Difference(Single a, Single b)\n {\n return a - b;\n }\n\n public int Compare(Single a, Single b)\n {\n if (a > b)\n {\n return 1;\n }\n else if (a < b)\n {\n return -1;\n }\n else\n {\n return 0;\n }\n }\n\n public Single Multiply(Single a, Single b)\n {\n return a * b;\n }\n\n public Single Divide(Single a, Single b)\n {\n return a / b;\n }\n\n public Single Divide(Single a, int b)\n {\n return a / b;\n }\n }\n\n struct DoubleCalculator : ICalculator\n {\n public double Sum(double a, double b)\n {\n return a + b;\n }\n\n public double Difference(double a, double b)\n {\n return a - b;\n }\n\n public int Compare(double a, double b)\n {\n if (a > b)\n {\n return 1;\n }\n else if (a < b)\n {\n return -1;\n }\n else\n {\n return 0;\n }\n }\n\n public double Multiply(double a, double b)\n {\n return a * b;\n }\n\n public Double Divide(Double a, Double b)\n {\n return a / b;\n }\n\n public Double Divide(Double a, int b)\n {\n return a / b;\n }\n }\n\n struct StringCalculator : ICalculator\n {\n public string Sum(string a, string b)\n {\n return a + b;\n }\n\n public string Difference(string a, string b)\n {\n if (b.Length < a.Length)\n {\n return a.Substring(0, b.Length);\n }\n else\n {\n return \"\";\n }\n }\n\n public int Compare(string a, string b)\n {\n return a.CompareTo(b);\n }\n\n public string Multiply(string a, string b)\n {\n if (a.Length == 1 && b.Length == 1)\n {\n return ((char)(((byte)a[0] * (byte)b[0]) % 256)) + \"\";\n }\n\n int bigLength = Math.Max(a.Length, b.Length);\n while (a.Length < bigLength)\n {\n a = \" \" + a;\n }\n\n while (b.Length < bigLength)\n {\n b = \" \" + b;\n }\n\n string result = \"\";\n for (int i = 0; i < bigLength; i++)\n {\n Number numA = a[i] + \"\";\n Number numB = b[i] + \"\";\n result += numA * numB;\n }\n\n return result;\n }\n\n public String Divide(String a, String b)\n {\n return String.Format(\"{0} / {1}\", a, b);\n }\n\n public String Divide(String a, int b)\n {\n return String.Format(\"{0} / {1}\", a, b);\n }\n }\n\n public class Number\n {\n private T value;\n public Number(T value)\n {\n this.value = value;\n Type calculatorType = GetCalculatorType();\n fCalculator = Activator.CreateInstance(calculatorType) as ICalculator;\n }\n\n public static Type GetCalculatorType()\n {\n Type tType = typeof (T);\n Type calculatorType = null;\n if (tType == typeof (Int32))\n {\n calculatorType = typeof (Int32Calculator);\n }\n else if (tType == typeof (Int64))\n {\n calculatorType = typeof (Int64Calculator);\n }\n else if (tType == typeof (Double))\n {\n calculatorType = typeof (DoubleCalculator);\n }\n else if (tType == typeof (string))\n {\n calculatorType = typeof (StringCalculator);\n }\n else\n {\n throw new InvalidCastException(String.Format(\"Unsupported Type- Type {0} does not have a partner implementation of interface ICalculator and cannot be used in generic arithmetic using type Number\", tType.Name));\n }\n\n return calculatorType;\n }\n\n private static ICalculator fCalculator = null;\n public static ICalculator Calculator\n {\n get\n {\n if (fCalculator == null)\n {\n MakeCalculator();\n }\n\n return fCalculator;\n }\n }\n\n public static void MakeCalculator()\n {\n Type calculatorType = GetCalculatorType();\n fCalculator = Activator.CreateInstance(calculatorType) as ICalculator;\n }\n\n#region operation methods\n public static T Sum(T a, T b)\n {\n return Calculator.Sum(a, b);\n }\n\n public static T Difference(T a, T b)\n {\n return Calculator.Difference(a, b);\n }\n\n public static int Compare(T a, T b)\n {\n return Calculator.Compare(a, b);\n }\n\n public static T Multiply(T a, T b)\n {\n return Calculator.Multiply(a, b);\n }\n\n public static T Divide(T a, T b)\n {\n return Calculator.Divide(a, b);\n }\n\n public static T Divide(T a, int b)\n {\n return Calculator.Divide(a, b);\n }\n\n#endregion\n#region Operators\n public static implicit operator Number(T a)\n {\n return new Number(a);\n }\n\n public static implicit operator T(Number a)\n {\n return a.value;\n }\n\n public static Number operator +(Number a, Number b)\n {\n return Calculator.Sum(a.value, b.value);\n }\n\n public static Number operator -(Number a, Number b)\n {\n return Calculator.Difference(a, b);\n }\n\n public static bool operator>(Number a, Number b)\n {\n return Calculator.Compare(a, b) > 0;\n }\n\n public static bool operator <(Number a, Number b)\n {\n return Calculator.Compare(a, b) < 0;\n }\n\n public static Number operator *(Number a, Number b)\n {\n return Calculator.Multiply(a, b);\n }\n\n public static Number operator /(Number a, Number b)\n {\n return Calculator.Divide(a, b);\n }\n\n public static Number operator /(Number a, int b)\n {\n return Calculator.Divide(a, b);\n }\n#endregion\n }\n}\n\n#endif\n#if Geometrys\nnamespace Geometry\n{\n}\n\n#endif\n#if (ASD)\n#region DataStructures\nnamespace DS.Common\n{\n public static class Comparers\n {\n public static bool IsNumber(this T value)\n {\n if (value is sbyte)\n return true;\n if (value is byte)\n return true;\n if (value is short)\n return true;\n if (value is ushort)\n return true;\n if (value is int)\n return true;\n if (value is uint)\n return true;\n if (value is long)\n return true;\n if (value is ulong)\n return true;\n if (value is float)\n return true;\n if (value is double)\n return true;\n if (value is decimal)\n return true;\n return false;\n }\n\n public static bool IsEqualTo(this T firstValue, T secondValue)where T : IComparable\n {\n return firstValue.Equals(secondValue);\n }\n\n public static bool IsGreaterThan(this T firstValue, T secondValue)where T : IComparable\n {\n return firstValue.CompareTo(secondValue) > 0;\n }\n\n public static bool IsLessThan(this T firstValue, T secondValue)where T : IComparable\n {\n return firstValue.CompareTo(secondValue) < 0;\n }\n\n public static bool IsGreaterThanOrEqualTo(this T firstValue, T secondValue)where T : IComparable\n {\n return (firstValue.IsEqualTo(secondValue) || firstValue.IsGreaterThan(secondValue));\n }\n\n public static bool IsLessThanOrEqualTo(this T firstValue, T secondValue)where T : IComparable\n {\n return (firstValue.IsEqualTo(secondValue) || firstValue.IsLessThan(secondValue));\n }\n }\n\n public static class Helpers\n {\n public static void Swap(this IList list, int firstIndex, int secondIndex)\n {\n if (list.Count < 2 || firstIndex == secondIndex)\n return;\n var temp = list[firstIndex];\n list[firstIndex] = list[secondIndex];\n list[secondIndex] = temp;\n }\n\n public static string PadCenter(this string text, int newW, char fillerCharacter = ' ')\n {\n if (string.IsNullOrEmpty(text))\n return text;\n int length = text.Length;\n int cTP = newW - length;\n if (cTP < 0)\n throw new AE(\"New w must be greater than string length.\");\n int pL = cTP / 2 + cTP % 2;\n int pR = cTP / 2;\n StringBuilder rB = new StringBuilder(newW);\n for (int i = 0; i < pL; i++)\n rB.Insert(i, fillerCharacter);\n for (int i = 0; i < length; i++)\n rB.Insert(i + pL, text[i]);\n for (int i = newW - pR; i < newW; i++)\n rB.Insert(i, fillerCharacter);\n return rB.ToString();\n }\n\n public static void Populate(this T[, ] array, int rows, int columns, T defaultValue = default (T))\n {\n for (int i = 0; i < rows; ++i)\n {\n for (int j = 0; j < columns; ++j)\n {\n array[i, j] = defaultValue;\n }\n }\n }\n }\n}\n\nnamespace DS.Dictionaries\n{\n}\n\nnamespace DS.Graphs\n{\n}\n\nnamespace DS.Hashing\n{\n}\n\nnamespace DS.Heaps\n{\n public interface IMaxHeap\n where T : System.IComparable\n {\n int Count\n {\n get;\n }\n\n bool IsEmpty\n {\n get;\n }\n\n void Initialize(System.Collections.Generic.IList newCollection);\n void Add(T heapKey);\n T Peek();\n void RemoveMax();\n T ExtractMax();\n void Clear();\n void RebuildHeap();\n T[] ToArray();\n System.Collections.Generic.List ToList();\n IMinHeap ToMinHeap();\n }\n\n public interface IMinHeap\n where T : System.IComparable\n {\n int Count\n {\n get;\n }\n\n bool IsEmpty\n {\n get;\n }\n\n void Initialize(System.Collections.Generic.IList newCollection);\n void Add(T heapKey);\n T Peek();\n void RemoveMin();\n T ExtractMin();\n void Clear();\n void RebuildHeap();\n T[] ToArray();\n System.Collections.Generic.List ToList();\n IMaxHeap ToMaxHeap();\n }\n}\n\nnamespace DS.Lists\n{\n public class ArrayList : IEnumerable\n {\n bool DefaultMaxCapacityIsX64 = true;\n bool IsMaximumCapacityReached = false;\n public const int MAXIMUM_ARRAY_LENGTH_x64 = 2146435071;\n public const int MAXIMUM_ARRAY_LENGTH_x86 = 134217728;\n private readonly T[] _emptyArray = new T[0];\n private const int _defaultCapacity = 8;\n private T[] _collection;\n private int _size\n {\n get;\n set;\n }\n\n public ArrayList(): this (capacity: 0)\n {\n }\n\n public ArrayList(int capacity)\n {\n if (capacity < 0)\n {\n throw new ArgumentOutOfRangeException();\n }\n else if (capacity == 0)\n {\n _collection = _emptyArray;\n }\n else\n {\n _collection = new T[capacity];\n }\n\n _size = 0;\n }\n\n private void _ensureCapacity(int minCapacity)\n {\n if (_collection.Length < minCapacity && IsMaximumCapacityReached == false)\n {\n int newCapacity = (_collection.Length == 0 ? _defaultCapacity : _collection.Length * 2);\n int maxCapacity = (DefaultMaxCapacityIsX64 == true ? MAXIMUM_ARRAY_LENGTH_x64 : MAXIMUM_ARRAY_LENGTH_x86);\n if (newCapacity < minCapacity)\n newCapacity = minCapacity;\n if (newCapacity >= maxCapacity)\n {\n newCapacity = maxCapacity - 1;\n IsMaximumCapacityReached = true;\n }\n\n this._resizeCapacity(newCapacity);\n }\n }\n\n private void _resizeCapacity(int newCapacity)\n {\n if (newCapacity != _collection.Length && newCapacity > _size)\n {\n try\n {\n Array.Resize(ref _collection, newCapacity);\n }\n catch (OutOfMemoryException)\n {\n if (DefaultMaxCapacityIsX64 == true)\n {\n DefaultMaxCapacityIsX64 = false;\n _ensureCapacity(newCapacity);\n }\n\n throw;\n }\n }\n }\n\n public int Count\n {\n get\n {\n return _size;\n }\n }\n\n public int Capacity\n {\n get\n {\n return _collection.Length;\n }\n }\n\n public bool IsEmpty\n {\n get\n {\n return (Count == 0);\n }\n }\n\n public T First\n {\n get\n {\n return _collection[0];\n }\n }\n\n public T Last\n {\n get\n {\n return _collection[Count - 1];\n }\n }\n\n public T this[int index]\n {\n get\n {\n return _collection[index];\n }\n\n set\n {\n _collection[index] = value;\n }\n }\n\n public void Add(T dataItem)\n {\n if (_size == _collection.Length)\n {\n _ensureCapacity(_size + 1);\n }\n\n _collection[_size++] = dataItem;\n }\n\n public void AddRange(IEnumerable elements)\n {\n if (elements == null)\n throw new ArgumentNullException();\n if (((uint)_size + elements.Count()) > MAXIMUM_ARRAY_LENGTH_x64)\n throw new OverflowException();\n if (elements.Any())\n {\n _ensureCapacity(_size + elements.Count());\n foreach (var element in elements)\n this.Add(element);\n }\n }\n\n public void AddRepeatedly(T value, int count)\n {\n if (count < 0)\n throw new ArgumentOutOfRangeException();\n if (((uint)_size + count) > MAXIMUM_ARRAY_LENGTH_x64)\n throw new OverflowException();\n if (count > 0)\n {\n _ensureCapacity(_size + count);\n for (int i = 0; i < count; i++)\n this.Add(value);\n }\n }\n\n public void InsertAt(T dataItem, int index)\n {\n if (_size == _collection.Length)\n {\n _ensureCapacity(_size + 1);\n }\n\n if (index < _size)\n {\n Array.Copy(_collection, index, _collection, index + 1, (_size - index));\n }\n\n _collection[index] = dataItem;\n _size++;\n }\n\n public bool Remove(T dataItem)\n {\n int index = IndexOf(dataItem);\n if (index >= 0)\n {\n RemoveAt(index);\n return true;\n }\n\n return false;\n }\n\n public void RemoveAt(int index)\n {\n _size--;\n if (index < _size)\n {\n Array.Copy(_collection, index + 1, _collection, index, (_size - index));\n }\n\n _collection[_size] = default (T);\n }\n\n public void Clear()\n {\n if (_size > 0)\n {\n _size = 0;\n Array.Clear(_collection, 0, _size);\n _collection = _emptyArray;\n }\n }\n\n public void Resize(int newSize)\n {\n Resize(newSize, default (T));\n }\n\n public void Resize(int newSize, T defaultValue)\n {\n int currentSize = this.Count;\n if (newSize < currentSize)\n {\n this._ensureCapacity(newSize);\n }\n else if (newSize > currentSize)\n {\n if (newSize > this._collection.Length)\n this._ensureCapacity(newSize + 1);\n this.AddRange(Enumerable.Repeat(defaultValue, newSize - currentSize));\n }\n }\n\n public void Reverse()\n {\n Reverse(0, _size);\n }\n\n public void Reverse(int startIndex, int count)\n {\n if (count < 0 || startIndex > (_size - count))\n {\n throw new ArgumentOutOfRangeException();\n }\n\n Array.Reverse(_collection, startIndex, count);\n }\n\n public void ForEach(Action action)\n {\n if (action == null)\n {\n throw new ArgumentNullException();\n }\n\n for (int i = 0; i < _size; ++i)\n {\n action(_collection[i]);\n }\n }\n\n public bool Contains(T dataItem)\n {\n if ((Object)dataItem == null)\n {\n for (int i = 0; i < _size; ++i)\n {\n if ((Object)_collection[i] == null)\n return true;\n }\n }\n else\n {\n EqualityComparer comparer = EqualityComparer.Default;\n for (int i = 0; i < _size; ++i)\n {\n if (comparer.Equals(_collection[i], dataItem))\n return true;\n }\n }\n\n return false;\n }\n\n public bool Contains(T dataItem, IEqualityComparer comparer)\n {\n if (comparer == null)\n {\n throw new ArgumentNullException();\n }\n\n if ((Object)dataItem == null)\n {\n for (int i = 0; i < _size; ++i)\n {\n if ((Object)_collection[i] == null)\n return true;\n }\n }\n else\n {\n for (int i = 0; i < _size; ++i)\n {\n if (comparer.Equals(_collection[i], dataItem))\n return true;\n }\n }\n\n return false;\n }\n\n public bool Exists(Predicate searchMatch)\n {\n return (FindIndex(searchMatch) != -1);\n }\n\n public int FindIndex(Predicate searchMatch)\n {\n return FindIndex(0, _size, searchMatch);\n }\n\n public int FindIndex(int startIndex, Predicate searchMatch)\n {\n return FindIndex(startIndex, (_size - startIndex), searchMatch);\n }\n\n public int FindIndex(int startIndex, int count, Predicate searchMatch)\n {\n if (count < 0 || startIndex > (_size - count))\n {\n throw new ArgumentOutOfRangeException();\n }\n\n if (searchMatch == null)\n {\n throw new ArgumentNullException();\n }\n\n int endIndex = startIndex + count;\n for (int index = startIndex; index < endIndex; ++index)\n {\n if (searchMatch(_collection[index]) == true)\n return index;\n }\n\n return -1;\n }\n\n public int IndexOf(T dataItem)\n {\n return IndexOf(dataItem, 0, _size);\n }\n\n public int IndexOf(T dataItem, int startIndex)\n {\n return IndexOf(dataItem, startIndex, _size);\n }\n\n public int IndexOf(T dataItem, int startIndex, int count)\n {\n if (count < 0 || startIndex > (_size - count))\n {\n throw new ArgumentOutOfRangeException();\n }\n\n return Array.IndexOf(_collection, dataItem, startIndex, count);\n }\n\n public T Find(Predicate searchMatch)\n {\n if (searchMatch == null)\n {\n throw new ArgumentNullException();\n }\n\n for (int i = 0; i < _size; ++i)\n {\n if (searchMatch(_collection[i]))\n {\n return _collection[i];\n }\n }\n\n return default (T);\n }\n\n public ArrayList FindAll(Predicate searchMatch)\n {\n if (searchMatch == null)\n {\n throw new ArgumentNullException();\n }\n\n ArrayList matchedElements = new ArrayList();\n for (int i = 0; i < _size; ++i)\n {\n if (searchMatch(_collection[i]))\n {\n matchedElements.Add(_collection[i]);\n }\n }\n\n return matchedElements;\n }\n\n public ArrayList GetRange(int startIndex, int count)\n {\n if (count < 0 || startIndex > (_size - count))\n {\n throw new ArgumentOutOfRangeException();\n }\n\n var newArrayList = new ArrayList(count);\n Array.Copy(_collection, startIndex, newArrayList._collection, 0, count);\n newArrayList._size = count;\n return newArrayList;\n }\n\n public T[] ToArray()\n {\n T[] newArray = new T[Count];\n if (Count > 0)\n {\n Array.Copy(_collection, 0, newArray, 0, Count);\n }\n\n return newArray;\n }\n\n public List ToList()\n {\n var newList = new List(this.Count);\n if (this.Count > 0)\n {\n for (int i = 0; i < this.Count; ++i)\n {\n newList.Add(_collection[i]);\n }\n }\n\n return newList;\n }\n\n public string ToHumanReadable(bool addHeader = false)\n {\n int i = 0;\n string listAsString = string.Empty;\n string preLineIndent = (addHeader == false ? \"\" : \"\\t\");\n for (i = 0; i < Count; ++i)\n {\n listAsString = String.Format(\"{0}{1}[{2}] => {3}\\r\\n\", listAsString, preLineIndent, i, _collection[i]);\n }\n\n if (addHeader == true)\n {\n listAsString = String.Format(\"ArrayList of count: {0}.\\r\\n(\\r\\n{1})\", Count, listAsString);\n }\n\n return listAsString;\n }\n\n public IEnumerator GetEnumerator()\n {\n for (int i = 0; i < Count; i++)\n {\n yield return _collection[i];\n }\n }\n\n IEnumerator IEnumerable.GetEnumerator()\n {\n return this.GetEnumerator();\n }\n }\n}\n\nnamespace DS.Trees\n{\n}\n\n#endregion\n#region Algorithms\nnamespace AL.Common\n{\n public static class Helpers\n {\n public static void Populate(this IList collection, T value)\n {\n if (collection == null)\n return;\n for (int i = 0; i < collection.Count; i++)\n {\n collection[i] = value;\n }\n }\n }\n}\n\nnamespace AL.Graphs\n{\n}\n\nnamespace AL.Numeric\n{\n}\n\nnamespace AL.Sorting\n{\n public static class QuickSorter\n {\n public static void QuickSort(this IList collection, Comparer comparer = null)\n {\n int startIndex = 0;\n int endIndex = collection.Count - 1;\n comparer = comparer ?? Comparer.Default;\n collection.InternalQuickSort(startIndex, endIndex, comparer);\n }\n\n private static void InternalQuickSort(this IList collection, int leftmostIndex, int rightmostIndex, Comparer comparer)\n {\n if (leftmostIndex < rightmostIndex)\n {\n int wallIndex = collection.InternalPartition(leftmostIndex, rightmostIndex, comparer);\n collection.InternalQuickSort(leftmostIndex, wallIndex - 1, comparer);\n collection.InternalQuickSort(wallIndex + 1, rightmostIndex, comparer);\n }\n }\n\n private static int InternalPartition(this IList collection, int leftmostIndex, int rightmostIndex, Comparer comparer)\n {\n int wallIndex, pivotIndex;\n pivotIndex = rightmostIndex;\n T pivotValue = collection[pivotIndex];\n wallIndex = leftmostIndex;\n for (int i = leftmostIndex; i <= (rightmostIndex - 1); i++)\n {\n if (comparer.Compare(collection[i], pivotValue) <= 0)\n {\n collection.Swap(i, wallIndex);\n wallIndex++;\n }\n }\n\n collection.Swap(wallIndex, pivotIndex);\n return wallIndex;\n }\n }\n}\n#endregion\n#endif\n", "lang": "MS C#", "bug_code_uid": "7710b4b27c6dd2a9ee798c1a9573c18d", "src_uid": "4cedd3b70d793bc8ed4a93fc5a827f8f", "apr_id": "607fb6cf0f7efb30e9e2c429c814c952", "difficulty": 1300, "tags": ["dp", "math", "constructive algorithms"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9849802371541502, "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.Text;\nusing System.Threading.Tasks;\n\nnamespace cfround\n{\n class Program\n {\n static int rc, gc, bc;\n\n static void Go(bool[,,] rgb, int r, int g, int b)\n {\n if (r > 201 || g > 201 || b > 201) return;\n rgb[r, g, b] = true;\n if (r > 0 && b > 0) Go(rgb, r - 1, g + 1, b - 1);\n if (r > 0 && g > 0) Go(rgb, r - 1, g - 1, b + 1);\n if (g > 0 && b > 0) Go(rgb, r + 1, g - 1, b - 1);\n if (r > 1) Go(rgb, r - 1, g, b);\n if (g > 1) Go(rgb, r, g - 1, b);\n if (b > 1) Go(rgb, r, g, b - 1);\n }\n static void Main(string[] args)\n {\n Console.ReadLine();\n string cards = Console.ReadLine();\n foreach (char c in cards)\n {\n if (c == 'R') rc++;\n else if (c == 'B') bc++;\n else if (c == 'G') gc++;\n }\n bool[,,] rgb = new bool[201, 201, 201];\n Go(rgb, rc, gc, bc);\n if (rgb[0, 0, 1]) Console.Write('B');\n if (rgb[0, 1, 0]) Console.Write('G');\n if (rgb[1, 0, 0]) Console.Write('R');\n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "aca48ad65af986851686bcba40466b21", "src_uid": "4cedd3b70d793bc8ed4a93fc5a827f8f", "apr_id": "bef85fb69a7ad6d92f154b96fff5f3cf", "difficulty": 1300, "tags": ["dp", "math", "constructive algorithms"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.9385579937304075, "equal_cnt": 5, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 4, "bug_source_code": "using System;\nusing System.Collections;\nusing System.Collections.Generic;\nusing System.Speech.Synthesis;\nusing System.Text;\nusing System.Threading.Tasks;\nusing System.IO;\n\nnamespace Grade\n{\n class Program\n {\n /* Driver program to test above functions */\n public static void Main(String[] args)\n {\n var games = int.Parse(Console.ReadLine());\n\n if (games <= 1)\n {\n Console.WriteLine(true);\n return;\n }\n\n var queue = new Queue();\n var winning = int.Parse(Console.ReadLine());\n queue.Enqueue(3);\n queue.Enqueue(3 - winning);\n \n while (--games > 0)\n {\n var challenger = queue.Dequeue();\n var number = int.Parse(Console.ReadLine());\n if (number == challenger)\n {\n queue.Enqueue(winning);\n winning = challenger;\n } else if(number == winning) {\n queue.Enqueue(challenger);\n } else {\n Console.WriteLine(\"NO\");\n return;\n }\n }\n Console.WriteLine(\"YES\");\n }\n\n static List factorize(int n)\n {\n var res = new List();\n for (int i = 2; i * i <= n; ++i)\n {\n while (n % i != 0)\n {\n res.Add(i);\n n /= i;\n }\n }\n return res;\n }\n\n // 3^10 - x = 3, n = 10, result = 1\n // x = 3*3 = 9, n = 10/2 = 5, result = 1\n // n is now odd, result = 1*9 = 9, x = 9*9 = 81, n = 5/2 = 2\n // x = 81*81 = 6561, n = 2/1 = 1, result = 9\n // n is now odd, result = 9 * 6561 = 59049, x = 6561*6561, n = 0\n // return result aka 59049\n public static double pow(double x, int n) // O(log N)\n {\n double result = 1;\n while (n > 0)\n {\n if (n % 2 == 1) result *= x;\n x *= x;\n n /= 2;\n }\n return result;\n }\n\n // a = 16, b = 10\n // r = 16%10 = 6, a = 10, b = 6\n // r = 10%6 = 4, a = 6, b = 4\n // r = 6%4 = 2, a = 4, b = 2\n // r = 4%2 = 0, a = 2, b = 0\n // return 0\n public static int gcd(int a, int b) // O(log A+B)\n {\n while (b > 0)\n {\n int r = a % b;\n a = b;\n b = r;\n }\n return a;\n }\n\n public static double Fib(int n)\n {\n return 1 / Math.Sqrt(5) * (Math.Pow(((1 + Math.Sqrt(5)) / 2), n) - Math.Pow(((1 - Math.Sqrt(5)) / 2), n));\n }\n\n\n public static bool isPrime(int n) // O(log N)\n {\n for (int i = 2; i * i <= n; i++)\n {\n if (n % i == 0)\n {\n return false;\n }\n }\n return true;\n }\n\n\n }\n\n}\n", "lang": "Mono C#", "bug_code_uid": "acf5e5a376db40abe3d7e18fa00a82cc", "src_uid": "6c7ab07abdf157c24be92f49fd1d8d87", "apr_id": "9f86148992ab999d04ab88d418c5340e", "difficulty": 900, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.9051339285714286, "equal_cnt": 15, "replace_cnt": 6, "delete_cnt": 1, "insert_cnt": 7, "fix_ops_cnt": 14, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\n\nnamespace CodeForces\n{\n static class Reader\n {\n public static int NextInt()\n {\n int ret = 0;\n char c;\n\n while (!char.IsDigit(c = (char)Console.Read()))\n {\n if (c == '-')\n return -NextInt();\n }\n do\n {\n ret = ret * 10 + c - '0';\n } while (char.IsDigit(c = (char)Console.Read()));\n\n return ret;\n }\n\n public static double NextDouble()\n {\n double ret = 0;\n char c;\n\n while (!char.IsDigit(c = (char)Console.Read())) \n {\n if (c == '-')\n return -NextDouble();\n }\n do\n {\n ret = ret * 10 + c - '0';\n } while (char.IsDigit(c = (char)Console.Read()));\n if (c != '.') return ret;\n\n double p10 = 0.1;\n while (char.IsDigit(c = (char)Console.Read()))\n {\n ret += p10 * (c - '0');\n p10 *= 0.1;\n }\n\n return ret;\n }\n\n public static string NextToken()\n {\n StringBuilder ret = new StringBuilder();\n char c;\n\n while (char.IsWhiteSpace(c = (char)Console.Read())) ;\n do\n {\n ret.Append(c);\n } while (!char.IsWhiteSpace(c = (char)Console.Read()));\n\n return ret.ToString();\n }\n }\n\n class Program\n {\n static int GCD(int n, int m)\n {\n return m > 0 ? GCD(m, n % m) : n;\n }\n\n static void Get(out int A, out int B, out int C)\n {\n int a = Reader.NextInt();\n int b = Reader.NextInt();\n int c = Reader.NextInt();\n\n int g = GCD(Math.Abs(a), GCD(Math.Abs(b), Math.Abs(c)));\n\n A = a / g;\n B = b / g;\n C = c / g;\n }\n\n static void Main(string[] args)\n {\n int A1, B1, C1, A2, B2, C2;\n\n Get(out A1, out B1, out C1);\n Get(out A2, out B2, out C2);\n\n if (A1 == A2 && B1 == B2 && C1 == C2)\n {\n Console.WriteLine(-1);\n return;\n }\n\n if (A1 * B2 == A2 * B1)\n {\n Console.WriteLine(0);\n return;\n }\n\n Console.WriteLine(1);\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "85ba8913b1e57c04e59d7493a2452439", "src_uid": "c8e869cb17550e888733551c749f2e1a", "apr_id": "89edb451065c17fe5cc172ee1f229b92", "difficulty": 2000, "tags": ["math", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.7454739084132055, "equal_cnt": 5, "replace_cnt": 2, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 4, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Text;\n\nnamespace ProblemsFun\n{\n class Program\n {\n static void Main(string[] args)\n {\n Queue queue = new Queue();\n queue.Enqueue(\"Sheldon\");\n queue.Enqueue(\"Leonard\");\n queue.Enqueue(\"Penny\");\n queue.Enqueue(\"Rajesh\");\n queue.Enqueue(\"Howard\");\n\n int n = Convert.ToInt32(Console.ReadLine());\n string temp = string.Empty;\n for (int i = 1; i < n; i++)\n {\n temp = queue.Dequeue();\n queue.Enqueue(temp);\n queue.Enqueue(temp);\n }\n Console.WriteLine(queue.Dequeue());\n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "14541d0dbcae9631661a9bba1b129a67", "src_uid": "023b169765e81d896cdc1184e5a82b22", "apr_id": "d347d577718a24040637d094bc8f6bc2", "difficulty": 1100, "tags": ["math", "implementation"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.5417661097852029, "equal_cnt": 11, "replace_cnt": 2, "delete_cnt": 7, "insert_cnt": 2, "fix_ops_cnt": 11, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace DoubleCola\n{\n class Program\n {\n static void Main(string[] args)\n {\n var input = Convert.ToInt64(Console.ReadLine());\n string[] people = new string[5] { \"Sheldon\", \"Leonard\", \"Penny\", \"Rajesh\", \"Howard\" };\n List all = new List();\n int iCount = 5;\n\n all.Add(\"Sheldon\");\n all.Add(\"Leonard\");\n all.Add(\"Penny\");\n all.Add(\"Rajesh\");\n all.Add(\"Howard\");\n\n if (input <= 5)\n {\n Console.WriteLine(people[input - 1]);\n }\n else\n {\n\n for (int i = 0; i <= input; i++)\n {\n all.Add(all[i]);\n all.Add(all[i]);\n iCount += 1;\n\n if (iCount == input)\n {\n Console.WriteLine(all.ElementAt(iCount - 1));\n break;\n }\n\n\n }\n }\n }\n }\n}", "lang": "MS C#", "bug_code_uid": "008fa9b706f8854945f43e0b23af92a0", "src_uid": "023b169765e81d896cdc1184e5a82b22", "apr_id": "f1fcd83aaffdfc49f25af1ceea6f2208", "difficulty": 1100, "tags": ["math", "implementation"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "delete", "lang_cluster": "C#"} {"similarity_score": 0.25606060606060604, "equal_cnt": 20, "replace_cnt": 9, "delete_cnt": 5, "insert_cnt": 6, "fix_ops_cnt": 20, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace Problem82A {\n class Program {\n static void Main(string[] args) {\n Queue colaQueue = new Queue(); // 1 - Sheldon, 2 - Leonard, 3 - Penny, 4 - Rajesh, 5 - Howard\n long nThCan = Convert.ToInt32(Console.ReadLine());\n int person = precalculateQ(colaQueue, nThCan);\n\n if (person == 1)\n Console.WriteLine(\"Sheldon\");\n if (person == 2)\n Console.WriteLine(\"Leonard\");\n if (person == 3)\n Console.WriteLine(\"Penny\");\n if (person == 4)\n Console.WriteLine(\"Rajesh\");\n if (person == 5)\n Console.WriteLine(\"Howard\");\n\n }\n\n static int precalculateQ(Queue colaQ, long nThCan) { \n //starting state\n colaQ.Enqueue(1);\n colaQ.Enqueue(2);\n colaQ.Enqueue(3);\n colaQ.Enqueue(4);\n colaQ.Enqueue(5);\n\n long person = 0;\n int actPerson = 0;\n while (person < nThCan) {\n actPerson = colaQ.Dequeue();\n person++;\n colaQ.Enqueue(actPerson);\n colaQ.Enqueue(actPerson);\n }\n\n return actPerson;\n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "47dc80dc0f86baad604f2380f339afdc", "src_uid": "023b169765e81d896cdc1184e5a82b22", "apr_id": "9f872a7698b4044dd05c3ed860299a12", "difficulty": 1100, "tags": ["math", "implementation"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9974819540036931, "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;\nusing System.IO;\n\nnamespace Codeforces_CS\n{\n class Class1\n {\n static void Main(string[] args)\n {\n new Class1().run();\n }\n\n\n void run()\n {\n InputReader cin = new InputReader(Console.OpenStandardInput());\n int a = cin.int32();\n int b = cin.int32();\n int n = cin.int32();\n\n long MOD = ((long)1e9) + 7;\n __modFact = new long[n + 1];\n for (int i = 0; i <= n; i++) __modFact[i] = -1;\n for (int i = 0; i <= n; i += 1000) __modFact[i] = modFact(i, MOD);\n\n long ways = 0;\n for (int i = 0; i <= n; i++)\n {\n long sum = (i * 1L * a) + ((n - i) * 1L * b);\n if (isGood(sum, a, b))\n ways += modComb(n, i, MOD);\n }\n\n Console.WriteLine(ways);\n }\n\n\n bool isGood(long x, int a, int b)\n {\n if (x == 0) return false;\n while (x > 0)\n {\n int r = (int)(x % 10L);\n if (r != a && r != b)\n return false;\n x /= 10;\n }\n return true;\n }\n\n long modPow(long b, long e, long MOD)\n {\n if (e == 0) return 1;\n if (e == 1) return b % MOD;\n long temp = modPow(b, e / 2, MOD);\n temp = (temp * temp) % MOD;\n if (e % 2 == 1)\n temp = (temp * (b % MOD)) % MOD;\n return temp;\n }\n\n long modInv(long b, long MOD)\n {\n return modPow(b, MOD - 2, MOD);\n }\n\n long modComb(long n, long r, long MOD)\n {\n return (modFact(n, MOD) * modInv(modFact(n - r, MOD) * modFact(r, MOD), MOD)) % MOD;\n }\n\n long[] __modFact;\n\n long modFact(long n, long MOD)\n {\n if (n == 0) return 1;\n if (__modFact[n] != -1) return __modFact[n];\n return __modFact[n] = ((n % MOD) * (modFact(n - 1, MOD) % MOD)) % MOD;\n }\n }\n\n class InputReader\n {\n Stream inputStream;\n const int bufferSize = 1 << 16;\n int bytesRead;\n int currentBufferTop;\n byte[] buffer;\n\n public InputReader(Stream _inputStream)\n {\n this.inputStream = _inputStream;\n bytesRead = 0;\n currentBufferTop = 0;\n buffer = new byte[bufferSize];\n }\n\n public byte peekChar()\n {\n if (currentBufferTop < bytesRead)\n {\n return this.buffer[this.currentBufferTop];\n }\n else\n {\n if (!this.refill())\n {\n throw new Exception(\"Error in reading input or reached EOF\");\n }\n else\n {\n return peekChar();\n }\n }\n }\n\n public byte readChar()\n {\n if (currentBufferTop < bytesRead)\n {\n return this.buffer[this.currentBufferTop++];\n }\n else\n {\n if (!this.refill())\n {\n throw new Exception(\"Error in reading input or reached EOF\");\n }\n else\n {\n return readChar();\n }\n }\n }\n\n public bool refill()\n {\n currentBufferTop = 0;\n bytesRead = inputStream.Read(buffer, 0, bufferSize);\n return bytesRead > 0;\n }\n\n public int int32()\n {\n return (int) int64();\n }\n\n public long int64()\n {\n byte temp = peekChar();\n while (temp != '-' && (temp < '0' || temp > '9'))\n {\n readChar();\n temp = peekChar();\n }\n int sign = 1;\n if (temp == '-') sign = -1;\n if (temp == '-') readChar();\n long readValue = 0;\n temp = peekChar();\n while (temp >= '0' && temp <= '9')\n {\n readValue *= 10;\n readValue += (int)(temp - '0');\n readChar();\n try\n {\n temp = peekChar();\n }\n catch (Exception e)\n {\n break;\n }\n }\n return readValue * sign;\n }\n\n public string token()\n {\n byte temp = peekChar();\n while (isSpace(temp))\n {\n readChar();\n temp = peekChar();\n }\n\n StringBuilder sb = new StringBuilder();\n try\n {\n temp = peekChar();\n while (!isSpace(temp))\n {\n readChar();\n sb.Append((char)temp);\n temp = peekChar();\n\n }\n }\n catch (Exception e) { }\n return sb.ToString();\n }\n\n public string line()\n {\n StringBuilder sb = new StringBuilder();\n try\n {\n byte temp;\n do\n {\n temp = peekChar();\n sb.Append(temp);\n readChar();\n } while (temp != '\\n');\n }\n catch (Exception e) { }\n return sb.ToString();\n }\n\n private bool isSpace(byte t)\n {\n if (t == ' ') return true;\n if (t == '\\t') return true;\n if (t == '\\r') return true;\n if (t == '\\n') return true;\n if (t == '\\f') return true;\n return false;\n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "800e76f7332b12aaceb3101676704d40", "src_uid": "d3e3da5b6ba37c8ac5f22b18c140ce81", "apr_id": "5ab953aaa2f9385c2666e11a303285f6", "difficulty": 1800, "tags": ["brute force", "combinatorics"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "C#"} {"similarity_score": 0.8946716232961586, "equal_cnt": 5, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 4, "bug_source_code": "using System;\nusing System.Linq;\nusing System.Collections.Generic;\nusing System.IO;\n\nclass MyClass\n{\n public static void Solve()\n {\n var N = long.Parse(Console.ReadLine());\n var primes = new List();\n var n = N;\n if (n % 2 == 0)\n {\n primes.Add(2);\n while (n % 2 == 0)\n {\n n /= 2;\n }\n }\n for (int p = 3; p * p <= n; p += 2)\n {\n if (n % p == 0)\n {\n primes.Add(p);\n while (n % p == 0)\n {\n n /= p;\n }\n }\n }\n if (n != 1)\n {\n primes.Add(n);\n }\n if (primes.Count == 1)\n {\n Console.WriteLine(primes[0]);\n }\n else\n {\n Console.WriteLine(1);\n }\n }\n\n public static void Main()\n {\n var sw = new StreamWriter(Console.OpenStandardOutput()) { AutoFlush = false };\n Console.SetOut(sw);\n Solve();\n Console.Out.Flush();\n }\n}", "lang": "Mono C#", "bug_code_uid": "9bd799daf3288161c7af1e031fb6acfa", "src_uid": "f553e89e267c223fd5acf0dd2bc1706b", "apr_id": "6e6127c84fc476169e056788077faf2b", "difficulty": 1500, "tags": ["number theory"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.5181674565560821, "equal_cnt": 8, "replace_cnt": 3, "delete_cnt": 3, "insert_cnt": 2, "fix_ops_cnt": 8, "bug_source_code": "using System;\nusing System.Collections;\nusing System.Collections.Generic;\nusing System.Linq;\n\nnamespace ConsoleApp2\n{\n class Program\n {\n static void Main(string[] args)\n {\n\n string data = Console.ReadLine();\n string[] input = data.Split(' ');\n long n, k;\n long sayac = 0;\n\n n = Convert.ToInt64(input[0]);\n k = Convert.ToInt64(input[1]);\n\n if (n >= 10000000000 || k >= 10000000000)\n {\n Console.WriteLine(\"500000000000\");\n Console.Read();\n }\n\n long[] oyuncakSayisi=new long[n+1];\n for (long i = 0; i < n + 1; i++)\n {\n oyuncakSayisi[i]=i;\n }\n\n\n\n for (int i = 1; i < n + 1; i++)\n {\n for (int j = 2; j < n + 1; j++)\n {\n if (Convert.ToInt64(oyuncakSayisi[i]) + Convert.ToInt64(oyuncakSayisi[j]) == k)\n {\n oyuncakSayisi[i] = k + 1;\n oyuncakSayisi[j] = k + 1;\n sayac++;\n }\n }\n }\n\n Console.WriteLine(sayac);\n Console.Read();\n\n\n\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "ab1f9e181c3580a6432cd78a8a9a8b0c", "src_uid": "98624ab2fcd2a50a75788a29e04999ad", "apr_id": "456eba4d2055150add4f9e375136c640", "difficulty": 1000, "tags": ["math"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.5157232704402516, "equal_cnt": 8, "replace_cnt": 3, "delete_cnt": 3, "insert_cnt": 2, "fix_ops_cnt": 8, "bug_source_code": "using System;\nusing System.Collections;\nusing System.Collections.Generic;\nusing System.Linq;\n\nnamespace ConsoleApp2\n{\n class Program\n {\n static void Main(string[] args)\n {\n\n string data = Console.ReadLine();\n string[] input = data.Split(' ');\n long n, k;\n long sayac = 0;\n\n n = Convert.ToInt64(input[0]);\n k = Convert.ToInt64(input[1]);\n\n if (n >= 10000000000 || k >= 10000000000)\n {\n Console.WriteLine(\"500000000000\");\n Console.Read();\n }\n\n List oyuncakSayisi=new List();\n for (long i = 0; i < n + 1; i++)\n {\n oyuncakSayisi.Add(i);\n }\n\n\n\n for (int i = 1; i < n + 1; i++)\n {\n for (int j = 2; j < n + 1; j++)\n {\n if (Convert.ToInt64(oyuncakSayisi[i]) + Convert.ToInt64(oyuncakSayisi[j]) == k)\n {\n oyuncakSayisi[i] = k + 1;\n oyuncakSayisi[j] = k + 1;\n sayac++;\n }\n }\n }\n\n Console.WriteLine(sayac);\n Console.Read();\n\n\n\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "71ce91d30111267fbf980ec740f2a53e", "src_uid": "98624ab2fcd2a50a75788a29e04999ad", "apr_id": "456eba4d2055150add4f9e375136c640", "difficulty": 1000, "tags": ["math"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.48997289972899727, "equal_cnt": 12, "replace_cnt": 8, "delete_cnt": 4, "insert_cnt": 0, "fix_ops_cnt": 12, "bug_source_code": "using System;\nusing System.Collections;\nusing System.Collections.Generic;\nusing System.Linq;\n\nnamespace ConsoleApp2\n{\n class Program\n {\n static void Main(string[] args)\n {\n \n string data = Console.ReadLine();\n string[] input = data.Split(' ');\n long n, k;\n long sayac = 0;\n\n n = Convert.ToInt64(input[0]);\n k = Convert.ToInt64(input[1]);\n long n2=n + 1;\n ArrayList oyuncakSayisi=new ArrayList();\n //List oyuncakSayisi = new List();\n\n for (long i = 0; i <= n; i++)\n {\n oyuncakSayisi.Add(i);\n }\n \n\n\n for (int i = 1; i <= (int) n; i++)\n {\n for (int j = 2; j <= (int)n; j++)\n {\n if (Convert.ToInt64(oyuncakSayisi[i]) + Convert.ToInt64(oyuncakSayisi[j]) == k)\n {\n oyuncakSayisi[i] = k+1;\n oyuncakSayisi[j] = k+1;\n sayac++;\n }\n }\n }\n\n Console.WriteLine(sayac);\n Console.Read();\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "49eed5f6da7a0b12ddc1013b05c9ded6", "src_uid": "98624ab2fcd2a50a75788a29e04999ad", "apr_id": "456eba4d2055150add4f9e375136c640", "difficulty": 1000, "tags": ["math"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.583989501312336, "equal_cnt": 8, "replace_cnt": 5, "delete_cnt": 1, "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 cfPairOfToys\n{\n class Program\n {\n static void Main(string[] args)\n {\n string s = Console.ReadLine();\n long kol = long.Parse(s.Split(' ')[0]);\n long sum = long.Parse(s.Split(' ')[1]);\n long l = 1;\n long r = kol; \n while (l<=r && l + r != sum)\n {\n if (l + r > sum)\n {\n r--;\n }\n else\n {\n l++;\n }\n //Console.WriteLine(l + \" \" + r);\n }\n if (l > r)\n {\n Console.WriteLine(0);\n }\n else\n {\n Console.WriteLine((r - l) / 2 + 1);\n }\n //Console.ReadKey();\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "2e188e401684592879d7b26b36582192", "src_uid": "98624ab2fcd2a50a75788a29e04999ad", "apr_id": "8367ddbf53498165b31f4694a46a7b2b", "difficulty": 1000, "tags": ["math"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9902097902097902, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Text.RegularExpressions;\n\nnamespace AlgoTest\n{\n class Program\n {\n static void Main(string[] args)\n {\n int n = int.Parse(Console.ReadLine());\n int[] a = Console.ReadLine().Split(' ').Select(x => int.Parse(x)).ToArray();\n\n int sum = 0;\n int max = int.MinValue;\n\n for (int i = 0; i < a.Length; i++)\n {\n sum += a[i];\n max = Math.Max(max, a[i]);\n }\n\n int k = max;\n int sum2 = 0;\n\n while(sum2 vowels = new List();\n\n for (int i = 0; i < s.Length; i++)\n {\n if (isVowel(s[i]))\n {\n vowels.Add(i);\n }\n }\n\n int[] c = vowels.ToArray();\n\n char[] answer = new char[s.Length];\n\n int j = 0;\n\n for (int i = 0; i < s.Length; i++)\n {\n if (isVowel(s[i]))\n {\n answer[i] = s[c[c.Length - 1 - j]];\n answer[c[c.Length - 1 - j]] = s[i];\n j++;\n }\n else\n {\n answer[i] = s[i];\n }\n }\n\n return new string(answer);\n }\n\n public static bool isVowel(char c)\n {\n c = char.ToLowerInvariant(c);\n return c == 'a' || c == 'o' || c == 'e' || c == 'u' || c == 'i';\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "411dcb6af8fc0c95025e2768a45784c4", "src_uid": "d215b3541d6d728ad01b166aae64faa2", "apr_id": "788a393cb6744bdd6bad87fc3015c76a", "difficulty": 800, "tags": ["math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9976553341148886, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 0, "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 Algorithm\n{\n class Program\n {\n static int count = 0;\n static void Main(string[] args)\n {\n var n = int.Parse(Console.ReadLine());\n var s = Console.ReadLine();\n\t\t\tint[,] dp = new int[N, N];\n for (int i = 0; i < N; i++)\n {\n for (int j = 0; j < N; j++)\n {\n dp[i, j] = -1;\n }\n }\n Console.WriteLine(findMinimumDeletion(0, n - 1, dp, s));\n }\n\n \n static int findMinimumDeletion(int l, int r,\n int[,] dp, String s)\n {\n\n if (l > r)\n {\n return 0;\n }\n if (l == r)\n {\n return 1;\n }\n if (dp[l, r] != -1)\n {\n return dp[l, r];\n }\n\n // When a single character is deleted \n int res = 1 + findMinimumDeletion(l + 1, r, dp, s);\n\n // When a group of consecutive characters \n // are deleted if any of them matches \n for (int i = l + 1; i <= r; ++i)\n {\n\n // When both the characters are same then \n // delete the letters in between them \n if (s[l] == s[i])\n {\n res = Math.Min(res, findMinimumDeletion(l + 1, i - 1, dp, s)\n + findMinimumDeletion(i, r, dp, s));\n }\n }\n\n // Memoize \n return dp[l, r] = res;\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "b6c61bdcbd5b611d40a0608d8690a455", "src_uid": "516a89f4d1ae867fc1151becd92471e6", "apr_id": "8e502844283e2c7ab944ea3666aad23e", "difficulty": 2000, "tags": ["dp"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9997066588442358, "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.Text;\nusing System.Threading.Tasks;\n\nnamespace Algorithm\n{\n class Program\n {\n static int N = 50;\n static void Main(string[] args)\n {\n var n = int.Parse(Console.ReadLine());\n var s = Console.ReadLine();\n\t\t\tint[,] dp = new int[N, N];\n for (int i = 0; i < N; i++)\n {\n for (int j = 0; j < N; j++)\n {\n dp[i, j] = -1;\n }\n }\n Console.WriteLine(findMinimumDeletion(0, n - 1, dp, s));\n }\n\n \n static int findMinimumDeletion(int l, int r,\n int[,] dp, String s)\n {\n\n if (l > r)\n {\n return 0;\n }\n if (l == r)\n {\n return 1;\n }\n if (dp[l, r] != -1)\n {\n return dp[l, r];\n }\n\n // When a single character is deleted \n int res = 1 + findMinimumDeletion(l + 1, r, dp, s);\n\n // When a group of consecutive characters \n // are deleted if any of them matches \n for (int i = l + 1; i <= r; ++i)\n {\n\n // When both the characters are same then \n // delete the letters in between them \n if (s[l] == s[i])\n {\n res = Math.Min(res, findMinimumDeletion(l + 1, i - 1, dp, s)\n + findMinimumDeletion(i, r, dp, s));\n }\n }\n\n // Memoize \n return dp[l, r] = res;\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "49d1170182ddacfb488e751017ec0f1b", "src_uid": "516a89f4d1ae867fc1151becd92471e6", "apr_id": "8e502844283e2c7ab944ea3666aad23e", "difficulty": 2000, "tags": ["dp"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.9635637634140255, "equal_cnt": 6, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 5, "bug_source_code": "/*\ncsc -debug F.cs && mono --debug F.exe <<< \"5\nabaca\"\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\n\npublic class HelloWorld {\n\n static int n;\n static int m;\n static int[] str;\n static int[,,] memo;\n\n public static void SolveCodeForces() {\n Console.ReadLine();\n str = Console.ReadLine().Select(c => c - 'a').ToArray();\n n = str.Length;\n m = str.Max()+1;\n\n memo = new int[n, n, m];\n for (var i = 0; i < n; i++)\n for (var j = 0; j < n; j++)\n for (var k = 0; k < m; k++)\n memo[i,j,k] = -1;\n\n System.Console.WriteLine(Solve(0, n-1));\n }\n\n static int Solve(int i, int j) {\n if (i > j) return 0;\n if (i == j) return 1;\n\n var ans = 10000;\n for (var sym = 0; sym < m; sym++)\n ans = Math.Min(ans, SolveFun(i, j, sym));\n return ans + 1;\n }\n\n static int SolveFun(int i, int j, int sym) {\n if (i > j) return 0;\n if (i == j) return str[i] == sym ? 0 : 10000;\n if (memo[i,j,sym] >= 0) return memo[i,j,sym];\n\n var ans = 10000;\n\n for (var k = i; k <= j; k++) {\n if (str[k] == sym) {\n\n var fl = SolveFun(i, k-1, sym);\n var sl = Solve(i, k-1);\n\n var fr = SolveFun(k+1, j, sym);\n var sr = Solve(k+1, j);\n\n var sol =\n Math.Min(fl + fr,\n Math.Min(sl + sr,\n Math.Min(fl + sr,\n sl + fr)));\n\n ans = Math.Min(ans, sol);\n }\n }\n\n// System.Console.WriteLine(new { i, j, sym, ans });\n\n memo[i, j, sym] = ans;\n return ans;\n }\n\n static Scanner cin = new Scanner();\n static StringBuilder cout = new StringBuilder();\n\n static public void Main () {\n SolveCodeForces();\n // System.Console.Write(cout.ToString());\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 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}\n\npublic class Scanner\n{\n private string[] line = new string[0];\n private int index = 0;\n\n public string Next() {\n if (line.Length <= index) {\n line = Console.ReadLine().Split(' ');\n index = 0;\n }\n var res = line[index];\n index++;\n return res;\n }\n\n public int NextInt() {\n return int.Parse(Next());\n }\n\n public long NextLong() {\n return long.Parse(Next());\n }\n\n public ulong NextUlong() {\n return ulong.Parse(Next());\n }\n\n public string[] Array() {\n line = Console.ReadLine().Split(' ');\n index = line.Length;\n return line;\n }\n\n public int[] IntArray(int emptyPrefixLen = 0) {\n var array = Array();\n var result = new int[emptyPrefixLen + array.Length];\n for (int i = 0; i < array.Length; i++)\n result[emptyPrefixLen + i] = int.Parse(array[i]);\n return result;\n }\n\n public long[] LongArray() {\n var array = Array();\n var result = new long[array.Length];\n for (int i = 0; i < array.Length; i++)\n result[i] = long.Parse(array[i]);\n return result;\n }\n\n public ulong[] UlongArray() {\n var array = Array();\n var result = new ulong[array.Length];\n for (int i = 0; i < array.Length; i++)\n result[i] = ulong.Parse(array[i]);\n return result;\n }\n}", "lang": "Mono C#", "bug_code_uid": "3ddb8a7c80c2e418d602541938b68efd", "src_uid": "516a89f4d1ae867fc1151becd92471e6", "apr_id": "64b74f7e3e36102bd89fb1f6f4b9a5a9", "difficulty": 2000, "tags": ["dp"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.5869947275922671, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "using System;\n\nnamespace Орехус_и_лифт\n{\n class Program\n {\n static void Main(string[] args)\n {\n Console.WriteLine(\"Hello World!\");\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "27ad2130fffbcaa4b392c8d8c4e37216", "src_uid": "a5002ddf9e792cb4b4685e630f1e1b8f", "apr_id": "03e390c9ac2be2284c5e02c53b8c6a81", "difficulty": 1000, "tags": ["brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.4238128986534373, "equal_cnt": 38, "replace_cnt": 12, "delete_cnt": 5, "insert_cnt": 22, "fix_ops_cnt": 39, "bug_source_code": "class Module1 {\n \n static void Main() {\n Int64 n = Console.ReadLine;\n Int64 i = (Math.Sqrt(ShiftLeft(n, 1)) - 5);\n if ((i < 0)) {\n i = 0;\n }\n \n while (((i \n * ((i + 1) \n / 2)) \n <= n)) {\n i++;\n }\n \n Int64 ans = (i \n - ((i \n * ((i + 1) \n / 2)) \n - n));\n if ((ans == 0)) {\n ans = (i - 1);\n }\n \n Console.WriteLine(ans);\n }\n}", "lang": "MS C#", "bug_code_uid": "38c7efc60390be3e4265112852f9495c", "src_uid": "1db5631847085815461c617854b08ee5", "apr_id": "eb71b099873422e39ea3f5acbd621291", "difficulty": 1000, "tags": ["math", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.9868421052631579, "equal_cnt": 3, "replace_cnt": 2, "delete_cnt": 2, "insert_cnt": 0, "fix_ops_cnt": 4, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\n\nnamespace ProgA\n{\n class Program\n {\n static long counter;\n static long n;\n static List a;\n\n\n static void Main(string[] args)\n {\n counter = 0;\n a = new List();\n n = int.Parse(Console.ReadLine());\n\n int i = 1;\n while (counter < n)\n {\n counter += a.Count + 1;\n a.Add(i++);\n }\n\n Console.WriteLine(a[a.Count - (int)(counter - n) - 1]);\n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "a21a18281238f3286ea73543217bca8c", "src_uid": "1db5631847085815461c617854b08ee5", "apr_id": "7af7ca924ef5d547e38c2c463e4243c3", "difficulty": 1000, "tags": ["math", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.7230698104484512, "equal_cnt": 5, "replace_cnt": 2, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 4, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\n\nclass Solution\n {\n static void Main(string[] args)\n { \n new FriendsMeeting().Solve();\n Console.ReadLine();\n }\n }\n\npublic class FriendsMeeting : ISolution\n {\n public override void Solve()\n {\n var a1 = ReadInt();\n var b1 = ReadInt();\n var a = Math.Min(a1, b1);\n var b = Math.Max(a1, b1);\n var dist = Math.Abs(b - a);\n Console.WriteLine(Math.Min(distance(dist), distance((b - (int)Math.Floor((double)(a + b) / 2))) + distance(((int)Math.Floor((double)(a + b) / 2) - a))));\n }\n\n public int distance(int k)\n {\n return (k * (k + 1) / 2);\n }\n }", "lang": "MS C#", "bug_code_uid": "c731a41d7ca5238e40429e2608a9b450", "src_uid": "d3f2c6886ed104d7baba8dd7b70058da", "apr_id": "a48431c8c5e40b1d5d3337facfe57c44", "difficulty": 800, "tags": ["greedy", "math", "brute force", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9972817879794624, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 2, "insert_cnt": 0, "fix_ops_cnt": 3, "bug_source_code": "#define DEBUG\n\nusing System;\nusing System.Collections;\nusing System.Collections.Generic;\n\n// (づ°ω°)づミe★゜・。。・゜゜・。。・゜☆゜・。。・゜゜・。。・゜\n\nnamespace dd\n{\n\n\tclass MainClass\n\t{\n\t\tconst int Limit = (int)1e9 + 777;\n\n\t\tpublic static bool Check(int x)\n\t\t{\n\t\t\tint Sum = 0;\n\t\t\twhile (x > 0)\n\t\t\t{\n\t\t\t\tSum += x % 10;\n\t\t\t\tx /= 10;\n\t\t\t}\n\t\t\treturn (Sum % 10 == 0) ? true : false;\n\t\t}\n\n\t\tpublic static void Brute(int numb)\n\t\t{\n\t\t\tint cnt = 0;\n\t\t\tfor (int i = 1; i < Limit; ++i)\n\t\t\t{\n\t\t\t\tif (Check(i) == true)\n\t\t\t\t\tcnt++;\n\t\t\t\tif (cnt == numb)\n\t\t\t\t{\n\t\t\t\t\tConsole.WriteLine(i);\n\t\t\t\t\tbreak;1\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tpublic static void Main(string[] args)\n\t\t{\n\t\t\tint numb = Reader.NextInt();\n\t\t\tBrute(numb);\n\t\t}\n\n\t\tclass Reader\n\t\t{\n\t\t\tpublic static int NextInt()\n\t\t\t{\n\t\t\t\tint cnt = 0, sign = 1;\n\t\t\t\tchar ch = Convert.ToChar(Console.Read());\n\t\t\t\twhile (!(ch >= '0' && ch <= '9') && ch != '-')\n\t\t\t\t\tch = Convert.ToChar(Console.Read());\n\t\t\t\tif (ch == '-')\n\t\t\t\t{\n\t\t\t\t\tsign = -1;\n\t\t\t\t\tch = Convert.ToChar(Console.Read());\n\t\t\t\t}\n\t\t\t\twhile (ch >= '0' && ch <= '9')\n\t\t\t\t{\n\t\t\t\t\tint t = Convert.ToInt32(ch);\n\t\t\t\t\tcnt = cnt * 10 + ch - '0';\n\t\t\t\t\tch = Convert.ToChar(Console.Read());\n\t\t\t\t}\n\t\t\t\treturn cnt * sign;\n\t\t\t}\n\t\t\tpublic static long NextLong()\n\t\t\t{\n\t\t\t\tlong cnt = 0, sign = 1;\n\t\t\t\tchar ch = Convert.ToChar(Console.Read());\n\t\t\t\twhile (!(ch >= '0' && ch <= '9') && ch != '-')\n\t\t\t\t\tch = Convert.ToChar(Console.Read());\n\t\t\t\tif (ch == '-')\n\t\t\t\t{\n\t\t\t\t\tsign = -1;\n\t\t\t\t\tch = Convert.ToChar(Console.Read());\n\t\t\t\t}\n\t\t\t\twhile (ch >= '0' && ch <= '9')\n\t\t\t\t{\n\t\t\t\t\tlong t = Convert.ToInt64(ch);\n\t\t\t\t\tcnt = cnt * 10 + ch - '0';\n\t\t\t\t\tch = Convert.ToChar(Console.Read());\n\t\t\t\t}\n\t\t\t\treturn cnt * sign;\n\t\t\t}\n\t\t}\n\t}\n}", "lang": "MS C#", "bug_code_uid": "887ac7d6e937681591647fbe5872c8a3", "src_uid": "0a98a6a15e553ce11cb468d3330fc86a", "apr_id": "acbe2f54b3a5b3cacae28645523a43f1", "difficulty": 1100, "tags": ["dp", "number theory", "implementation", "brute force", "binary search"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C#"} {"similarity_score": 0.9954545454545455, "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;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace Codeforces\n{\n class _268B\n {\n public static void Main_268()\n {\n int n = int.Parse(Console.ReadLine());\n int s = n;\n for (int i = 1; i < n; i++)\n {\n s = s + i * (n - i);\n }\n Console.WriteLine(s);\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "16f8e8bf09145f694faba4ccf8e3a0f8", "src_uid": "6df251ac8bf27427a24bc23d64cb9884", "apr_id": "d895dcd35d4f13f1074a1d3c3d1fa079", "difficulty": 1000, "tags": ["math", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C#"} {"similarity_score": 0.6271028037383177, "equal_cnt": 10, "replace_cnt": 5, "delete_cnt": 3, "insert_cnt": 1, "fix_ops_cnt": 9, "bug_source_code": "namespace CodeForce164\n{\n using System;\n using System.IO;\n using ProblemsResolver;\n\n\n public static class Program\n {\n public static void Main(string[] args)\n {\n ResolveB();\n }\n\n private static void ResolveA()\n {\n#if DEBUG\n TextReader reader = new StreamReader(@\"inputA.txt\");\n#else\n TextReader reader = Console.In;\n#endif\n var n = int.Parse(reader.ReadLine());\n var input = new string[n];\n for (var i = 0; i < n; i++)\n {\n input[i] = reader.ReadLine();\n }\n\n Console.WriteLine(ProblemA.Resolve(input));\n }\n\n private static void ResolveB()\n {\n#if DEBUG\n TextReader reader = new StreamReader(@\"inputB.txt\");\n#else\n TextReader reader = Console.In;\n#endif\n var n = int.Parse(reader.ReadLine());\n\n Console.WriteLine(ProblemB.Resolve(n));\n }\n }\n\n public static class ProblemB\n {\n public static int Resolve(int n)\n {\n var clicks = 1;\n for (var i = 0; i < n; i++)\n {\n clicks *= 2;\n }\n\n return clicks - 1;\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "b7bcdba463f3e58caa6cc9914af3e096", "src_uid": "6df251ac8bf27427a24bc23d64cb9884", "apr_id": "3a9871e37407e84ac5e08d2d70a74ef5", "difficulty": 1000, "tags": ["math", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9792828136829789, "equal_cnt": 9, "replace_cnt": 3, "delete_cnt": 1, "insert_cnt": 4, "fix_ops_cnt": 8, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.IO;\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 Pi = Pair;\n\nclass Solver\n{\n public void Solve(Scanner sc)\n {\n long X, Y;\n sc.Make(out X, out Y);\n var div = new List();\n for(long i=1;i*i<=X;i++)\n if (X % i == 0)\n {\n if (i != 1)\n div.Add(i);\n if (i * i != X) div.Add(X / i);\n }\n var now = GCD(X, Y);\n Y /= now;\n X /= now;\n var res = 0L;\n while (Y != 0)\n {\n var max = 0L;\n foreach(var d in div)\n {\n var y = Y / d * d;\n if (GCD(y, X) == 1) continue;\n chmax(ref max, y);\n }\n res += Y-max;\n Y = max;\n if (now >= X/GCD(X,Y))\n {\n\n Y /= X;\n res += Y;break;\n }\n else\n {\n now *= GCD(Y, X);\n Y /= GCD(Y, X);\n }\n X /= now;\n }\n Console.WriteLine(res);\n }\n #region GCD\n public static int LCM(int num1, int num2)\n => num1 / GCD(num1, num2) * num2;\n\n public static long LCM(long num1, long num2)\n => num1 / GCD(num1, num2) * num2;\n\n public static int GCD(int num1, int num2)\n => num1 < num2 ? GCD(num2, num1) :\n num2 > 0 ? GCD(num2, num1 % num2) : num1;\n\n public static long GCD(long num1, long num2)\n => num1 < num2 ? GCD(num2, num1) :\n num2 > 0 ? GCD(num2, num1 % num2) : num1;\n #endregion\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 { 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 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 int MaxElement(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}\npublic class Pair : IComparable>\n{\n public T1 v1;\n public T2 v2;\n public Pair() { }\n public Pair(T1 v1, T2 v2)\n { this.v1 = v1; this.v2 = v2; }\n\n [MethodImpl(MethodImplOptions.AggressiveInlining)]\n public int CompareTo(Pair p)\n {\n var c = Comparer.Default.Compare(v1, p.v1);\n if (c == 0)\n c = Comparer.Default.Compare(v2, p.v2);\n return c;\n }\n public override string ToString() => $\"{v1.ToString()} {v2.ToString()}\";\n public void Deconstruct(out T1 a, out T2 b) { a = v1; b = v2; }\n}\n\npublic class Pair : Pair, IComparable>\n{\n public T3 v3;\n public Pair() : base() { }\n public Pair(T1 v1, T2 v2, T3 v3) : base(v1, v2)\n { this.v3 = v3; }\n\n [MethodImpl(MethodImplOptions.AggressiveInlining)]\n public int CompareTo(Pair p)\n {\n var c = base.CompareTo(p);\n if (c == 0)\n c = Comparer.Default.Compare(v3, p.v3);\n return c;\n }\n public override string ToString() => $\"{base.ToString()} {v3.ToString()}\";\n public void Deconstruct(out T1 a, out T2 b, out T3 c) { Deconstruct(out a, out b); c = v3; }\n}\n#endregion\n", "lang": "Mono C#", "bug_code_uid": "2a3fe04c0931b71236fc499910a6b675", "src_uid": "ea92cd905e9725e7fcb87b9ed4f64c2e", "apr_id": "3fc432e23113192e7342afad688e04fc", "difficulty": 2100, "tags": ["math", "implementation", "binary search"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.9955028618152085, "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.IO;\nusing System.Linq;\nusing System.Text;\n\nnamespace Vasyas_Function\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 IEnumerable Gi()\n {\n yield return 2;\n for (int i = 3;; i += 2)\n {\n yield return i;\n }\n }\n\n private static void Main(string[] args)\n {\n long x = Next();\n long y = Next();\n\n var list = new List();\n foreach (long i in Gi())\n {\n if (i*i > x)\n break;\n\n while (x%i == 0)\n {\n list.Add(i);\n x /= i;\n }\n }\n if (x != 1)\n list.Add(x);\n\n long count = 0;\n\n long yy = y;\n long d = 1;\n while (yy > 0 && list.Count > 0)\n {\n long min = list.Select(l => y%l).Concat(new[] {y}).Min();\n\n count += min;\n y -= min;\n yy -= d*min;\n\n for (int i = 0; i < list.Count; i++)\n {\n if (y%list[i] == 0)\n {\n y /= list[i];\n d *= list[i];\n list.RemoveAt(i);\n i--;\n }\n }\n\n if (list.Count == 0)\n {\n count += yy/d;\n }\n }\n\n writer.WriteLine(count);\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": "5605be684546051e7643c3ae99022852", "src_uid": "ea92cd905e9725e7fcb87b9ed4f64c2e", "apr_id": "897fd6b49ef56f05502bd2fa9e9c8f5d", "difficulty": 2100, "tags": ["math", "implementation", "binary search"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.9474747474747475, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "using System;\nusing System.Linq;\n\nnamespace CSharp\n{\n public class _721A\n {\n public static void Main(string[] args)\n {\n string[] groups = Console.ReadLine().Split(new char[] { 'W' }, StringSplitOptions.RemoveEmptyEntries);\n\n Console.WriteLine(groups.Length);\n\n if (groups.Any())\n {\n Console.WriteLine(string.Join(\" \", groups.Select(group => group.Length)));\n }\n }\n }\n}{", "lang": "Mono C#", "bug_code_uid": "f5904bdf0e294ecf80887baa1244a789", "src_uid": "e4b3a2707ba080b93a152f4e6e983973", "apr_id": "d136b66274e86d172de0a37363642b12", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C#"} {"similarity_score": 0.8905162943976566, "equal_cnt": 60, "replace_cnt": 4, "delete_cnt": 54, "insert_cnt": 1, "fix_ops_cnt": 59, "bug_source_code": "//using System;\n//using System.IO;\n//using System.Linq;\n\n//namespace Codeforces\n//{\n//\tinternal class Template\n//\t{\n//\t\tprivate static readonly Scanner cin = new Scanner();\n\n//\t\tprivate static void Main()\n//\t\t{\n//#if !ONLINE_JUDGE\n//\t\t\t//Console.SetIn(new StreamReader(@\"C:\\CodeForces\\input.txt\"));\n//#endif\n//\t\t\tnew Template().Solve();\n//\t\t\tConsole.ReadLine();\n//\t\t}\n\n//\t\tprivate void Solve()\n//\t\t{\n//\t\t\tvar codeforces = \"CODEFORCES\";\n//\t\t\tvar str = cin.NextString();\n//\t\t\tvar idx = 0;\n//\t\t\tfor (var i = 0; i < str.Length; i++)\n//\t\t\t{\n//\t\t\t\tfor (var j = i + 1; j < str.Length; j++)\n//\t\t\t\t{\n//\t\t\t\t\tvar newStr = str.Substring(0, i) + str.Substring(j, str.Length - j);\n//\t\t\t\t\tif (newStr == codeforces)\n//\t\t\t\t\t{\n//\t\t\t\t\t\tConsole.WriteLine(\"YES\");\n//\t\t\t\t\t\treturn;\n//\t\t\t\t\t}\n//\t\t\t\t}\n//\t\t\t}\n//\t\t\tConsole.WriteLine(\"NO\");\n//\t\t}\n//\t}\n\n//\tinternal class Scanner\n//\t{\n//\t\tprivate string[] s = new string[0];\n//\t\tprivate int i;\n//\t\tprivate readonly char[] cs = { ' ' };\n\n//\t\tpublic string NextString()\n//\t\t{\n//\t\t\tif (i < s.Length) return s[i++];\n//\t\t\tvar line = Console.ReadLine() ?? string.Empty;\n//\t\t\ts = line.Split(cs, StringSplitOptions.RemoveEmptyEntries);\n//\t\t\ti = 1;\n//\t\t\treturn s.First();\n//\t\t}\n\n//\t\tpublic double NextDouble()\n//\t\t{\n//\t\t\treturn double.Parse(NextString());\n//\t\t}\n\n//\t\tpublic int NextInt()\n//\t\t{\n//\t\t\treturn int.Parse(NextString());\n//\t\t}\n\n//\t\tpublic long NextLong()\n//\t\t{\n//\t\t\treturn long.Parse(NextString());\n//\t\t}\n//\t}\n//}", "lang": "MS C#", "bug_code_uid": "0a854fc2720581edb1da74d55592bbc1", "src_uid": "bda4b15827c94b526643dfefc4bc36e7", "apr_id": "beb8e6e724b4155fd7ac6513007154b1", "difficulty": 1400, "tags": ["brute force", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C#"} {"similarity_score": 0.6350148367952523, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 4, "fix_ops_cnt": 5, "bug_source_code": "namespace a149\n{\n class Program\n {\n static int[] BubbleSort(int[] mas)\n {\n int temp;\n for (int i = 0; i < mas.Length; i++)\n {\n for (int j = i + 1; j < mas.Length; j++)\n {\n if (mas[i] > mas[j])\n {\n temp = mas[i];\n mas[i] = mas[j];\n mas[j] = temp;\n }\n }\n }\n return mas;\n }\n\n static void Main(string[] args)\n { \n int k = Convert.ToInt16(Console.ReadLine());\n int[] mas = Console.ReadLine().Split(' ').Select(e => Convert.ToInt32(e)).ToArray();\n BubbleSort(mas);\n int sum = mas.Sum();\n if (sum < k)\n Console.WriteLine(-1);\n else\n if (k == 0)\n Console.WriteLine(0);\n else\n if (mas[11] >= k)\n Console.WriteLine(1);\n else\n if (mas[11] + mas[10] >= k)\n Console.WriteLine(2);\n else\n if (mas[11] + mas[10] + mas[9] >= k)\n Console.WriteLine(3);\n Console.ReadLine();\n }\n }", "lang": "Mono C#", "bug_code_uid": "032a8694c9d0af4f351d6506354e27e8", "src_uid": "59dfa7a4988375febc5dccc27aca90a8", "apr_id": "842661e7622241ecec2e5a84e89e1442", "difficulty": 900, "tags": ["greedy", "sortings", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.9698375870069605, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "using System;\n\nclass P {\n static void Main() {\n var n = int.Parse(Console.ReadLine());\n for (var i = 1; i <= n ; i++ ) if (i*(i+1)/2 == n)\n Console.Write(\"YES\");\n Console.Write(\"NO\");\n }\n}", "lang": "MS C#", "bug_code_uid": "c4ad0fcf44adc02971014a2ea0b30c98", "src_uid": "587d4775dbd6a41fc9e4b81f71da7301", "apr_id": "98ab26c263827c3e523462f8c8d68baf", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.7415368081676518, "equal_cnt": 27, "replace_cnt": 17, "delete_cnt": 4, "insert_cnt": 5, "fix_ops_cnt": 26, "bug_source_code": "using System;\n\nnamespace Triangulo\n{\n class Triangulo\n {\n static void Main(string[] args)\n {\n \n int [] numeros = new int [4];\n\n for (int i = 0; i < 4; i++)\n {\n numeros[i] = int.Parse(Console.ReadLine());\n }\n\n Array.Sort(numeros);\n\n //revisar los casos \n\n if (numeros[0] + numeros[1] > numeros[2] || numeros[1] + numeros[2] > numeros[3])\n {\n Console.WriteLine(\"TRIANGLE\\n\");\n }\n \n else if(numeros[0] + numeros[1] == numeros[2] || numeros[1] + numeros[2] == numeros[3])\n {\n Console.WriteLine(\"SEGMENT\\n\");\n }\n else\n {\n Console.WriteLine(\"IMPOSSIBLE\\n\");\n }\n\n //Console.ReadKey();\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "1909f1f847d62c1f36ec399d5d920f8d", "src_uid": "8f5df9a41e6e100aa65b9fc1d26e447a", "apr_id": "ca867632b3f99b3564788727fa3bce53", "difficulty": 900, "tags": ["geometry", "brute force"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.0, "equal_cnt": 0, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "вфывыфвфыв", "lang": "Mono C#", "bug_code_uid": "c206e927c4ce0cf8c716d5c7bb2df2dc", "src_uid": "8f5df9a41e6e100aa65b9fc1d26e447a", "apr_id": "27880fcb557a6a9ab1983109e7f71b70", "difficulty": 900, "tags": ["geometry", "brute force"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9612469612469613, "equal_cnt": 16, "replace_cnt": 7, "delete_cnt": 8, "insert_cnt": 0, "fix_ops_cnt": 15, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace ConsoleApplication1\n{\n class Program\n {\n static private string TSI(short a, short b, short c)\n {\n if (a < b + c && b < a + c && c < a + b) return \"TRIANGLE\";\n else\n {\n if (a == b + c || b == a + c || c == a + b) return \"SEGMENT\";\n else return \"IMPOSSIBLE\";\n }\n }\n static void Main()\n {\n short a = 0, b = 0, c = 0, d = 0;\n a = Convert.ToInt16(System.Console.ReadLine());\n b = Convert.ToInt16(System.Console.ReadLine());\n c = Convert.ToInt16(System.Console.ReadLine());\n d = Convert.ToInt16(System.Console.ReadLine());\n \n string s = TSI(a, b, c);\n if (s.Equals(\"TRIANGLE\")) Console.WriteLine(s);\n else\n {\n s = TSI(b, c, d);\n if (s.Equals(\"TRIANGLE\")) Console.WriteLine(s);\n else\n {\n s = TSI(a, b, d);\n if (s.Equals(\"TRIANGLE\")) Console.WriteLine(s);\n else\n {\n s = TSI(a, c, d);\n if (s.Equals(\"TRIANGLE\")) Console.WriteLine(s);\n else\n {\n s = TSI(a, b, c);\n if (s.Equals(\"SEGMENT\")) Console.WriteLine(s);\n else\n {\n s = TSI(b, c, d);\n if (s.Equals(\"SEGMENT\")) Console.WriteLine(s);\n else\n {\n s = TSI(a, b, d);\n if (s.Equals(\"SEGMENT\")) Console.WriteLine(s);\n else\n {\n s = TSI(a, c, d);\n if (s.Equals(\"SEGMENT\")) Console.WriteLine(s);\n else\n {\n s = TSI(a, b, c);\n if (s.Equals(\"IMPOSSIBLE\")) Console.WriteLine(s);\n else\n {\n s = TSI(b, c, d);\n if (s.Equals(\"IMPOSSIBLE\")) Console.WriteLine(s);\n else\n {\n s = TSI(a, b, d);\n if (s.Equals(\"IMPOSSIBLE\")) Console.WriteLine(s);\n else\n {\n Console.WriteLine(\"IMPOSSIBLE\");\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n}", "lang": "Mono C#", "bug_code_uid": "92be077318c9539c55d90c5af45a0475", "src_uid": "8f5df9a41e6e100aa65b9fc1d26e447a", "apr_id": "3a152b0c5276454aa5626b3d22112c31", "difficulty": 900, "tags": ["geometry", "brute force"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C#"} {"similarity_score": 0.7369132049983114, "equal_cnt": 33, "replace_cnt": 23, "delete_cnt": 2, "insert_cnt": 7, "fix_ops_cnt": 32, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\n\nnamespace ConsoleApplication2\n{\n class Program\n {\n static void Main(string[] args)\n {\n\n string[] tokens = Console.ReadLine().Split(' ');\n\n Int32 k = Int32.Parse(tokens[1]);\n Int32 n = Int32.Parse(tokens[0]);\n\n Int32 r = n - k;\n\n int res = 0;\n\n int MaxBook = 0;\n\n if (r == 0)\n {\n Console.WriteLine(0 + \" \" + 0);\n }\n\n //if (n % 2 == 0)\n // {\n MaxBook = n / 2;\n // }\n // else\n // {\n // MaxBook = (n+1) / 2;\n // }\n\n\n\n if (k < MaxBook)\n {\n res = k + 1;\n }\n\n\n if (k == MaxBook)\n {\n res = k;\n }\n\n if (k > MaxBook)\n {\n res = n-k;\n }\n\n\n if (k < n)\n {\n Console.WriteLine(1 + \" \" + res);\n }\n else if (k >= n)\n {\n Console.WriteLine(0 + \" \" + 0);\n }\n else if (k = 0)\n {\n Console.WriteLine(1 + \" \" + 1);\n }\n\n \n // while (Console.ReadKey().Key != ConsoleKey.Enter) { }\n\n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "90c84ca5535a25424da30c72675b9f82", "src_uid": "bdccf34b5a5ae13238c89a60814b9f86", "apr_id": "9346e7cc4fcd667d9dd9a64c2d614d30", "difficulty": 1200, "tags": ["math", "constructive algorithms"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9009695290858726, "equal_cnt": 10, "replace_cnt": 6, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 9, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\n\nnamespace ConsoleApplication2\n{\n class Program\n {\n static void Main(string[] args)\n {\n\n string[] tokens = Console.ReadLine().Split(' ');\n\n Int32 n = Int32.Parse(tokens[0]);\n Int32 k = Int32.Parse(tokens[1]);\n \n\n Int32 r = n - k;\n\n int res = 0;\n\n int MaxBook = 0;\n\n\n\n //if (n % 2 == 0)\n // {\n MaxBook = n / 2;\n // }\n // else\n // {\n // MaxBook = (n+1) / 2;\n // }\n\n\n\n if (k < MaxBook)\n {\n res = k + 1;\n }\n\n\n if (k == MaxBook)\n {\n res = k;\n }\n\n if (k > MaxBook)\n {\n res = n-k;\n }\n\n\n if (k == 0)\n {\n Console.WriteLine(0 + \" \" + 0);\n }\n \n else if (k < n)\n {\n Console.WriteLine(1 + \" \" + res);\n }\n else if (k >= n)\n {\n Console.WriteLine(0 + \" \" + 0);\n }\n \n while (Console.ReadKey().Key != ConsoleKey.Enter) { }\n\n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "82798c5e98b6e9e85c9fef7c26e755cf", "src_uid": "bdccf34b5a5ae13238c89a60814b9f86", "apr_id": "9346e7cc4fcd667d9dd9a64c2d614d30", "difficulty": 1200, "tags": ["math", "constructive algorithms"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9922933829391443, "equal_cnt": 4, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\n\nnamespace CodeForce\n{\n public class Program\n {\n static void Main(string[] args)\n {\n string input1 = Console.ReadLine();\n Console.WriteLine(Solve(input1));\n }\n\n /*\n Luba And The Ticket\n time limit per test2 seconds\n memory limit per test256 megabytes\n inputstandard input\n outputstandard output\n Luba has a ticket consisting of 6 digits. In one move she can choose digit in any position and replace it with arbitrary digit. She wants to know the minimum number of digits she needs to replace in order to make the ticket lucky.\n\n The ticket is considered lucky if the sum of first three digits equals to the sum of last three digits.\n\n Input\n You are given a string consisting of 6 characters (all characters are digits from 0 to 9) — this string denotes Luba's ticket. The ticket can start with the digit 0.\n\n Output\n Print one number — the minimum possible number of digits Luba needs to replace to make the ticket lucky.\n */\n public static int Solve(string input1)\n {\n var firstTree = input1.Substring(0, 3).Select(c => int.Parse(c.ToString()));\n var lastTree = input1.Substring(3).Select(c => int.Parse(c.ToString()));\n\n return InnerSolve(firstTree.ToList(), lastTree.ToList(), 0);\n }\n\n private static int InnerSolve(\n List firstTree,\n List lastTree,\n int count)\n {\n var firstSum = firstTree.Sum();\n var lastSum = lastTree.Sum();\n if (firstSum == lastSum) return count;\n var difference = Math.Abs(firstSum - lastSum);\n var firstDiff = 0;\n if (lastSum > firstSum)//needs increment\n {\n firstTree.Sort();\n firstDiff = 9 - firstTree.First();\n }\n else\n {\n firstTree.Sort((a, b) => b - a);\n firstDiff = firstTree.First();\n }\n\n var lastDiff = 0;\n if (firstSum > lastSum)//needs increment\n {\n lastTree.Sort();\n lastDiff = 9 - lastTree.First();\n }\n else\n {\n lastTree.Sort((a, b) => b - a);\n lastDiff = lastTree.First();\n }\n\n var updateFirst = firstDiff > lastDiff;\n\n var list = (updateFirst ? firstTree : lastTree);\n var other = (updateFirst ? lastTree : firstTree);\n if (list.Sum() > other.Sum())// need to decrement\n {\n list.Sort((a, b) => b - a);\n var original = list.First();\n var decremented = original > difference ?\n original - difference :\n 0;\n list = list.Skip(1).ToList();\n list.Add(decremented);\n return updateFirst ?\n InnerSolve(list, lastTree, count + 1) :\n InnerSolve(firstTree, list, count + 1);\n }\n else //need to increment\n {\n list.Sort();\n var original = list.First();\n var incremented = difference >= 9 ?\n 9 :\n (difference - original) + original;\n list = list.Skip(1).ToList();\n list.Add(incremented);\n return updateFirst ?\n InnerSolve(list, lastTree, count + 1) :\n InnerSolve(firstTree, list, count + 1);\n }\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "3498ff9d034603fe51a986ca51a2a4d5", "src_uid": "09601fd1742ffdc9f822950f1d3e8494", "apr_id": "41cd7bccbe7af5e47ae2c84d9d0fd12f", "difficulty": 1600, "tags": ["greedy", "brute force", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.3269589552238806, "equal_cnt": 20, "replace_cnt": 17, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 19, "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 \n static void Main(string[] args)\n {\n\n String s = Console.ReadLine();\n \n int L = (s[0] - '0') + (s[1] - '0') + (s[2] - '0');\n \n int R = (s[3] - '0') + (s[4] - '0') + (s[5] - '0');\n \n int diff = Math.Abs(L - R), ans = 0;\n \n if (L < R){\n \n int[] a = new int[3];\n \n for (int i = 0; i < 3; i++){\n \n a[i] = s[i] - '0';\n \n }\n \n Array.Sort(a);\n \n while (diff > 0){\n \n diff -= Math.Min(9, Math.Abs(diff - a[ans]));\n \n ans++;\n \n }\n \n }\n else if (L > R){\n \n int[] a = new int[3];\n \n for (int i = 0; i < 3; i++){\n \n a[i] = s[i + 3] - '0';\n \n }\n \n Array.Sort(a);\n \n while (diff > 0){\n \n diff -= Math.Min(9, Math.Abs(diff - a[ans]));\n \n ans++;\n \n }\n \n }\n \n Console.WriteLine(ans);\n\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "f0ca64cda7d3788a0f04a44bffcc655c", "src_uid": "09601fd1742ffdc9f822950f1d3e8494", "apr_id": "2b89a66939b044c9fb3f3d628c93c14c", "difficulty": 1600, "tags": ["greedy", "brute force", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.7524071526822559, "equal_cnt": 5, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 5, "bug_source_code": "using System;\n\nnamespace CodeForces\n{\n\tclass MainClass\n\t{\n\t\tpublic static void Main(string[] args)\n\t\t{\n\t\t\tstring line1 = Console.ReadLine();\n\t\t\tstring line2 = Console.ReadLine();\n\t\t\tstring[] split = line1.Split(new Char[] { ' ', ',', '.', ':', '\\t' });\n\t\t\tstring[] split2 = line2.Split(new Char[] { ' ', ',', '.', ':', '\\t' });\n\t\t\tint n = Int32.Parse(split[0]);\n\t\t\tint s = Int32.Parse(split[1]);\n\t\t\tint[] integers = new int[n];\n\t\t\tfor (int i = 0; i < n; i++)\n\t\t\t{\n\t\t\t\tintegers[i] = Int32.Parse(split2[i]);\n\t\t\t}\n\n\t\t\tConsole.WriteLine(\"YES\");\n\t\t}\n\n\t}", "lang": "MS C#", "bug_code_uid": "04f5bb18745bc3a65ff78e63eded9e3a", "src_uid": "496baae594b32c5ffda35b896ebde629", "apr_id": "25504ec18e90b1dfc3876b6d16170e1f", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.5217391304347826, "equal_cnt": 29, "replace_cnt": 15, "delete_cnt": 3, "insert_cnt": 11, "fix_ops_cnt": 29, "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\tstatic void Main(string[] args)\n\t\t{\n\t\t\t\n\t\t\t var input = Console.ReadLine().Split(' ').Select(int.Parse).ToArray();\n int n = input[0];\n int a = input[1];\n int b = input[2];\n int c = input[3];\n int d = input[4];\n \n\n var mg = new int[3,3];\n mg[0, 1] = a;\n mg[1, 0] = b;\n mg[1, 2] = c;\n mg[2, 1] = d;\n\n \n \n\n int count = 0;\n\n var sum = new int[4];\n for(int i =1; i<= n; i++)\n {\n mg[1, 1] = i;\n sum[0] = a + b + i;\n sum[1] = a + c + i;\n sum[2] = b + d + i;\n sum[3] = c + d + i;\n\n \n int mx = sum.Max();\n for(int j = 1; j<=n; j++)\n {\n int tmp = mx+j;\n bool ok = false;\n for (int m = 0; m < 4; m++)\n {\n if(tmp - sum[m] <= n)\n {\n ok = true;\n }\n else\n {\n ok = false;\n break;\n }\n }\n\n if (ok) count++;\n }\n }\n\n\n\n\n Console.WriteLine(count);\n\t\t\t\n\t\t}\t\n\t\t\n\t}\n}", "lang": "Mono C#", "bug_code_uid": "56be6e7d5bddcd667574856034211670", "src_uid": "b732869015baf3dee5094c51a309e32c", "apr_id": "53da866cdcdb521604011a936f7d42d4", "difficulty": 1400, "tags": ["brute force", "math", "constructive algorithms"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.5503355704697986, "equal_cnt": 27, "replace_cnt": 18, "delete_cnt": 0, "insert_cnt": 10, "fix_ops_cnt": 28, "bug_source_code": "var input = Console.ReadLine().Split(' ').Select(int.Parse).ToArray();\n int n = input[0];\n int a = input[1];\n int b = input[2];\n int c = input[3];\n int d = input[4];\n \n\n \n\n \n \n\n int count = 0;\n\n var sum = new int[4];\n for(int i =1; i<= n; i++)\n {\n \n sum[0] = a + b + i;\n sum[1] = a + c + i;\n sum[2] = b + d + i;\n sum[3] = c + d + i;\n\n \n int mx = sum.Max();\n int tmp = mx + i;\n\n if (n == 1 && sum.Count(m => m == sum[0]) == 4) count = 1;\n else\n {\n if(tmp-sum.Min()<=n) count += n - 1;\n\n }\n \n }\n\n\n\n\n Console.WriteLine(count);", "lang": "Mono C#", "bug_code_uid": "7e0b6a9f0a03518b33e746d8f48f0731", "src_uid": "b732869015baf3dee5094c51a309e32c", "apr_id": "53da866cdcdb521604011a936f7d42d4", "difficulty": 1400, "tags": ["brute force", "math", "constructive algorithms"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.5385329619312906, "equal_cnt": 6, "replace_cnt": 4, "delete_cnt": 2, "insert_cnt": 0, "fix_ops_cnt": 6, "bug_source_code": "using System;\nusing System.Linq;\nusing System.Collections.Generic;\n\nclass Program {\n\tstatic void Main() {\n\t\tstring[] input = Console.ReadLine().Split();\n\t\tint a = int.Parse(input[0]);\n\t\tint b = int.Parse(input[1]);\n\t\tint m = int.Parse(input[2]);\n\t\tint r = int.Parse(input[3]);\n\t\tvar l = new List();\n\t\tvar t = new List();\n\t\tint i = 1;\n\t\twhile(true){\n\t\t\tr = (a * r + b) % m;\n\t\t\tif(!l.Contains(r)){\n\t\t\t\tl.Add(r);\n\t\t\t\tt.Add(i);\n\t\t\t}else{\n\t\t\t\tint index = l.IndexOf(r);\n\t\t\t\tConsole.WriteLine(i - t[index]);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\ti++;\n\t\t}\n\t}\n}", "lang": "MS C#", "bug_code_uid": "11b3c25652ce0bcfed375c7374eb3961", "src_uid": "9137197ee1b781cd5cc77c46f50b9012", "apr_id": "6680840161be282001ec5a45470613a9", "difficulty": 1200, "tags": ["number theory", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.427040395713108, "equal_cnt": 17, "replace_cnt": 9, "delete_cnt": 6, "insert_cnt": 2, "fix_ops_cnt": 17, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace cf172B\n{\n class Program\n {\n static void Main(string[] args)\n {\n var inp = Console.ReadLine().Split().Select(int.Parse).ToArray();\n int a = inp[0], b = inp[1], m = inp[2], r = inp[3];\n var seq = new List();\n var matrix = new int[m];\n for (int i = 1; i < m * 2; i++)\n {\n r = (a * r + b) % m;\n seq.Add(r);\n matrix[r]++;\n }\n var period = matrix.Count(d => d >= matrix.Max() || d >= matrix.Max() - 1);\n Console.WriteLine(period);\n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "7f744eb15a498627ba7a24881a0fbcc1", "src_uid": "9137197ee1b781cd5cc77c46f50b9012", "apr_id": "e0eb93b7daf8292c2122c8db2939be67", "difficulty": 1200, "tags": ["number theory", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.04956350323852436, "equal_cnt": 11, "replace_cnt": 5, "delete_cnt": 4, "insert_cnt": 2, "fix_ops_cnt": 11, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Globalization;\nusing System.IO;\nusing System.Linq;\nusing System.Text;\npublic static class Codeforces\n{\n static TextReader reader;\n static TextWriter writer;\n static void Main()\n {\n reader = new StreamReader(Console.OpenStandardInput(1024 * 10), System.Text.Encoding.ASCII, false, 1024 * 10);\n writer = new StreamWriter(Console.OpenStandardOutput(1024 * 10), System.Text.Encoding.ASCII, 1024 * 10);\n var n = ReadInt();\n var ar = ReadIntArray();\n Array.Sort(ar);\n Write(ar.Skip(1).All(i => i % ar[0] == 0) ? ar[0] : -1);\n reader.Close();\n writer.Close();\n }\n #region Read / Write\n\n private static Queue currentLineTokens = new Queue();\n\n private static string[] ReadAndSplitLine()\n {\n return reader.ReadLine().Split(new[] { ' ', '\\t' }, StringSplitOptions.RemoveEmptyEntries);\n }\n\n public static string ReadToken()\n {\n while (currentLineTokens.Count == 0)\n currentLineTokens = new Queue(ReadAndSplitLine());\n return currentLineTokens.Dequeue();\n }\n\n public static int ReadInt()\n {\n return int.Parse(ReadToken());\n }\n\n public static long ReadLong()\n {\n return long.Parse(ReadToken());\n }\n\n public static double ReadDouble()\n {\n return double.Parse(ReadToken(), CultureInfo.InvariantCulture);\n }\n\n public static int[] ReadIntArray()\n {\n return ReadAndSplitLine().Select(int.Parse).ToArray();\n }\n\n public static long[] ReadLongArray()\n {\n return ReadAndSplitLine().Select(long.Parse).ToArray();\n }\n\n public static double[] ReadDoubleArray()\n {\n return ReadAndSplitLine().Select(s => double.Parse(s, CultureInfo.InvariantCulture)).ToArray();\n }\n public static int[][] ReadIntMatrix(int numberOfRows)\n {\n int[][] matrix = new int[numberOfRows][];\n for (int i = 0; i < numberOfRows; i++)\n matrix[i] = ReadIntArray();\n return matrix;\n }\n public static int[][] ReadAndTransposeIntMatrix(int numberOfRows)\n {\n int[][] matrix = ReadIntMatrix(numberOfRows);\n int[][] ret = new int[matrix[0].Length][];\n for (int i = 0; i < ret.Length; i++)\n {\n ret[i] = new int[numberOfRows];\n for (int j = 0; j < numberOfRows; j++)\n ret[i][j] = matrix[j][i];\n }\n return ret;\n }\n\n public static string[] ReadLines(int quantity)\n {\n string[] lines = new string[quantity];\n for (int i = 0; i < quantity; i++)\n lines[i] = reader.ReadLine().Trim();\n return lines;\n }\n public static void WriteArray(IEnumerable array)\n {\n writer.WriteLine(string.Join(\" \", array));\n }\n\n public static void Write(params T[] array)\n {\n WriteArray(array);\n }\n\n public static void WriteLines(IEnumerable array)\n {\n foreach (var a in array)\n writer.WriteLine(a);\n }\n #endregion\n}", "lang": "MS C#", "bug_code_uid": "88f94631a2644e265d182590c2b1ec88", "src_uid": "9137197ee1b781cd5cc77c46f50b9012", "apr_id": "e0eb93b7daf8292c2122c8db2939be67", "difficulty": 1200, "tags": ["number theory", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.6405959031657356, "equal_cnt": 10, "replace_cnt": 4, "delete_cnt": 3, "insert_cnt": 3, "fix_ops_cnt": 10, "bug_source_code": "using System;\nusing System.Text.RegularExpressions;\n\nnamespace ConsoleApp2\n{\n class Program\n {\n static long A = 0, B = 0;\n static void Main(string[] args)\n {\n long n, a, b, p, q,z,m;\n string[] s = Console.ReadLine().Split();\n n = Int64.Parse(s[0]);\n a = Int64.Parse(s[1]);\n b = Int64.Parse(s[2]);\n p = Int64.Parse(s[3]);\n q = Int64.Parse(s[4]);\n z = a * b;\n for(int i=1;i<=n;i++)\n {\n if (i % z == 0)\n A += Math.Max(p, q);\n else if (i % a == 0)\n A += p;\n else if (i % b == 0)\n A += q;\n }\n Console.WriteLine(A);\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "8e695d37b95fd0e8609126128da7ef90", "src_uid": "35d8a9f0d5b5ab22929ec050b55ec769", "apr_id": "9ad11b26de3b06992b32a4985d54a4f0", "difficulty": 1600, "tags": ["number theory", "math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9785144260282382, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Runtime.CompilerServices;\nusing System.Text;\nusing System.Xml.Xsl;\n\nnamespace Codeforces\n{\n\tclass Program\n\t{\n\t\tstatic void Main(string[] args) \n\t\t{\n\t\t\tstring input1 = Console.ReadLine();\n\t\t\t//string input2 = Console.ReadLine();\n\n\t\t\t//string input3 = Console.ReadLine();\n\t\t\t//string input4 = Console.ReadLine();\n\n\t\t\tvar inputs1 = input1.Split(new[] {' ', '}', '{', ','}, StringSplitOptions.RemoveEmptyEntries).Select(int.Parse).ToArray();\n\t\t\t//var inputs2 = input2.Split(new[] { ' ', '}', '{', ',' }, StringSplitOptions.RemoveEmptyEntries).Select(long.Parse).ToArray();\n\t\t\t//var inputs3 = input3.Split(new[] { ' ', '}', '{', ',' }, StringSplitOptions.RemoveEmptyEntries).Select(long.Parse).ToArray();\n\t\t\t//var inputs4 = input4.Split(new[] { ' ', '}', '{', ',' }, StringSplitOptions.RemoveEmptyEntries).Select(long.Parse).ToArray();\n\n\t\t\tint m = inputs1[0];\n\t\t\tint d = inputs1[1];\n\n\t\t\tif (m == 2) \n\t\t\t{\n\t\t\t\tConsole.WriteLine(4);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (d < 6) \n\t\t\t{\n\t\t\t\tConsole.WriteLine(5);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (m == 1 || m == 3 || m == 5 || m == 7 || m == 8 || m == 10 || m == 12) \n\t\t\t{\n\t\t\t\tConsole.WriteLine(6);\n\t\t\t} \n\t\t\telse \n\t\t\t{\n\t\t\t\tif (d == 7)\n\t\t\t\t{\n\t\t\t\t\tConsole.WriteLine(6);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tConsole.WriteLine(5);\n\t\t\t}\n\t\t}\n\n\t\tpublic class Team\n\t\t{\n\t\t\tpublic string Name { get; set; }\n\n\t\t\tpublic int Points { get; set; }\n\n\t\t\tpublic int GoalsFor { get; set; }\n\n\t\t\tpublic int GoalsAgainst { get; set; }\n\t\t}\n\n\t\tstatic long Factorial(long a) \n\t\t{\n\t\t\treturn a > 1 ? a * Factorial(a - 1) : 1;\n\t\t}\n\t}\n}\n", "lang": "Mono C#", "bug_code_uid": "300801cf095a5f3e429aefa2b72117f3", "src_uid": "5b969b6f564df6f71e23d4adfb2ded74", "apr_id": "77bc86e3e19ba266b5e5cdd7e159bbed", "difficulty": 800, "tags": ["math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.23426911907066797, "equal_cnt": 15, "replace_cnt": 10, "delete_cnt": 4, "insert_cnt": 1, "fix_ops_cnt": 15, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\n\nnamespace plo\n{\n class Program\n {\n static void Main(string[] args)\n {\n //Input m, n, a from keyboard and put it into the long varibaleg\n Console.Write(\"Input m,n,a: \");\n string whole = Console.ReadLine();\n int com = whole.IndexOf(' ');\n long m = long.Parse(whole.Substring(0, com));\n\n string who = whole.Substring(com + 1);\n int com2 = who.IndexOf(' ');\n long n = long.Parse(who.Substring(0, com2));\n\n long a = long.Parse(who.Substring(com + 1));\n\n\n \n\n if (nmoda != 0)\n {\n num_n += 1;\n }\n\n //total number of peaces\n long num_sq = num_n * num_m;\n\n //output the result\n Console.WriteLine();\n Console.WriteLine(\"we need \" + num_sq+ \" peaces\");\n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "b9dac6e0bc1d6d9d6024f95326b94457", "src_uid": "ef971874d8c4da37581336284b688517", "apr_id": "b8d8efb08fc41abc3b68588887fdb0dc", "difficulty": 1000, "tags": ["math"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.8573208722741433, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 3, "bug_source_code": "using System;\n\n\nnamespace ConsoleApplication1\n{\n class Program\n {\n static void Main(string[] args)\n {\n int hojas;\n int[] diasSemana = new int[7];\n hojas = int.Parse(Console.ReadLine());\n for(int i =0; i<7; i++)\n diasSemana[i] = int.Parse(Console.ReadLine());\n int dia=0;\n while(hojas>0)\n {\n hojas-=diasSemana[dia];\n if(hojas<=0)\n {\n Console.WriteLine(dia+1);\n break;\n }\n if(dia==6 )\n {\n dia=0;\n continue;\n }\n dia++;\n }\n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "a4fb38bc15d049c20bc3dd75ef8caf28", "src_uid": "007a779d966e2e9219789d6d9da7002c", "apr_id": "78bf6afd7611a3284ceded88647916f5", "difficulty": 1000, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.7611650485436893, "equal_cnt": 8, "replace_cnt": 4, "delete_cnt": 0, "insert_cnt": 4, "fix_ops_cnt": 8, "bug_source_code": "using System;\n class Main\n {\n static void Main()\n {\n int hojas;\n int[] diasSemana = new int[7];\n hojas = int.Parse(Console.ReadLine());\n for(int i =0; i<7; i++)\n diasSemana[i] = int.Parse(Console.ReadLine());\n int dia=0;\n while(hojas>0)\n {\n hojas-=diasSemana[dia];\n if(hojas<=0)\n {\n Console.WriteLine(dia+1);\n break;\n }\n if(dia==6 )\n {\n dia=0;\n continue;\n }\n dia++;\n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "dc7aa088cc308e03354fba0ecc80aaf5", "src_uid": "007a779d966e2e9219789d6d9da7002c", "apr_id": "78bf6afd7611a3284ceded88647916f5", "difficulty": 1000, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.8678571428571429, "equal_cnt": 8, "replace_cnt": 4, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 7, "bug_source_code": "using System;\n\nnamespace Olymp579A\n{\n class Program\n {\n static void Main(string[] args)\n {\n int n = int.Parse(Console.ReadLine()), m = 0;\n while (n != 1)\n {\n if ((int)Math.Log(n, 2) == Math.Log(n, 2)) break;\n else\n {\n ++m;\n n -= (int)Math.Pow(2, (int)Math.Log(n, 2));\n }\n }\n Console.WriteLine(m + 1);\n Console.ReadLine();\n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "344339912b80c755b0914fb4335d70b0", "src_uid": "03e4482d53a059134676f431be4c16d2", "apr_id": "2bd76af7dddeca9e8b61a203bcbcf305", "difficulty": 1000, "tags": ["bitmasks"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.1707014276846679, "equal_cnt": 9, "replace_cnt": 4, "delete_cnt": 4, "insert_cnt": 1, "fix_ops_cnt": 9, "bug_source_code": "using System;\nusing System.Collections.Generic;\n\n class Program\n {\n static void Main(string[] args)\n {\n Console.WriteLine(new myGameTree(Int64.Parse(Console.ReadLine().Trim())).ToString());\n }\n\n class myGameTree\n {\n static long finish;\n static List LastChildren;\n\n public myGameTree(long x)\n {\n finish = x;\n LastChildren = new List();\n Node first = new Node(1);\n LastChildren.Sort();\n }\n\n public override string ToString()\n {\n return LastChildren[0].ToString();\n }\n \n class Node\n {\n private Node[] myChildren;\n private long value;\n private long score;\n\n public Node(long first)\n {\n value = 1;\n score = 1;\n if (finish - value > 0)\n MakeChild(finish - value);\n LastChildren.Add(finish);\n }\n\n public Node(Node father, long addon)\n {\n value = (father.value << 1) + addon;\n score = father.score + addon;\n \n long prod = finish - (value << 1);\n\n if (prod + 1 > 0)\n MakeChild(prod + 1);\n if (value == finish)\n LastChildren.Add(score);\n \n }\n\n private void MakeChild(long prod)\n {\n myChildren = new Node[prod];\n for (long i = prod; i-- > 0; myChildren[i] = new Node(this, i)); \n }\n }\n }\n }", "lang": "MS C#", "bug_code_uid": "af159756d6c3ab63d9a86ad894fbcd09", "src_uid": "03e4482d53a059134676f431be4c16d2", "apr_id": "771ad636e874c89123c4711935b2e9a3", "difficulty": 1000, "tags": ["bitmasks"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.19185881013378878, "equal_cnt": 11, "replace_cnt": 6, "delete_cnt": 5, "insert_cnt": 0, "fix_ops_cnt": 11, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\n\nnamespace GameTree\n{\n class Program\n {\n static void Main(string[] args)\n {\n Console.WriteLine(new GameTree(Int64.Parse(Console.ReadLine().Trim())).ToString());\n Console.ReadLine();\n }\n\n class GameTree\n {\n private static long finish;\n private static HashSet LastChildren;\n private long min;\n\n public myGameTree(long x)\n {\n finish = x;\n LastChildren = new HashSet();\n Node first = new Node(1);\n min = LastChildren.Min();\n LastChildren.Clear();\n LastChildren = null;\n }\n\n\n\n public override string ToString()\n {\n return min.ToString();\n }\n\n struct Node\n {\n private long value;\n private long score;\n\n public Node(long first)\n {\n value = 1;\n score = 1;\n if (finish - value > 0)\n MakeChild(finish - value);\n LastChildren.Add(finish);\n }\n\n public Node(long father_value, long father_score, long addon)\n {\n value = (father_value << 1) + addon;\n score = father_score + addon;\n\n if (!LastChildren.Contains(LastChildren.Count))\n MakeChild(finish - (value << 1) + 1);\n }\n\n private void MakeChild(long prod)\n { \n for (long i = 0; i < prod; i++)\n {\n if (finish - ((value << 1) + i) > 1)\n {\n Node child = new Node(value, score, i);\n }\n else if ((value << 1) + i == finish)\n LastChildren.Add(score + i);\n }\n\n \n }\n }\n }\n }\n}", "lang": "MS C#", "bug_code_uid": "df9906725b0da7b9930fef8fee0bfcd7", "src_uid": "03e4482d53a059134676f431be4c16d2", "apr_id": "771ad636e874c89123c4711935b2e9a3", "difficulty": 1000, "tags": ["bitmasks"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.19914651493598862, "equal_cnt": 12, "replace_cnt": 6, "delete_cnt": 5, "insert_cnt": 1, "fix_ops_cnt": 12, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\n\nnamespace GameTree\n{\n class Program\n {\n static void Main(string[] args)\n {\n Console.WriteLine(new GameTree(Int64.Parse(Console.ReadLine().Trim())).ToString());\n Console.ReadLine();\n }\n }\n\n public class GameTree\n {\n private static long finish;\n private static HashSet LastChildren;\n private long min;\n\n public GameTree(long x)\n {\n finish = x;\n LastChildren = new HashSet();\n Node first = new Node(1);\n min = LastChildren.Min();\n LastChildren.Clear();\n LastChildren = null;\n }\n\n\n\n public override string ToString()\n {\n return min.ToString();\n }\n\n struct Node\n {\n private long value;\n private long score;\n\n public Node(long first)\n {\n value = 1;\n score = 1;\n if (finish - value > 0)\n MakeChild(finish - value);\n LastChildren.Add(finish);\n }\n\n public Node(long father_value, long father_score, long addon)\n {\n value = (father_value << 1) + addon;\n score = father_score + addon;\n\n if (!LastChildren.Contains(LastChildren.Count))\n MakeChild(finish - (value << 1) + 1);\n }\n\n private void MakeChild(long prod)\n { \n for (long i = 0; i < prod; i++)\n {\n if (finish - ((value << 1) + i) > 1)\n {\n Node child = new Node(value, score, i);\n }\n else if ((value << 1) + i == finish)\n LastChildren.Add(score + i);\n }\n\n \n }\n }\n }\n}", "lang": "MS C#", "bug_code_uid": "2d05415ef87188f9a35ee004f4df781e", "src_uid": "03e4482d53a059134676f431be4c16d2", "apr_id": "771ad636e874c89123c4711935b2e9a3", "difficulty": 1000, "tags": ["bitmasks"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.945518453427065, "equal_cnt": 5, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 4, "bug_source_code": "using System;\n\nclass Program\n{\n void Main()\n {\n int n = int.Parse(Console.ReadLine());\n int result = 0;\n while (n > 0)\n {\n n -= ((int)Math.Log(n, 2) - 1);\n ++result;\n }\n Console.WriteLine(result);\n }\n}", "lang": "MS C#", "bug_code_uid": "aa6b2c7a85460a6f088cb4da70402000", "src_uid": "03e4482d53a059134676f431be4c16d2", "apr_id": "10b550f5c09b5c1312b3924e536a2403", "difficulty": 1000, "tags": ["bitmasks"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.9583333333333334, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "using System;\n\nclass Program\n{\n static void Main()\n {\n int n = int.Parse(Console.ReadLine());\n int result = 0;\n while (n > 0)\n {\n n -= ((int)Math.Log(n, 2) - 1);\n ++result;\n }\n Console.WriteLine(result);\n }\n}", "lang": "MS C#", "bug_code_uid": "8fb88f85a588cb103acc23e35542efb5", "src_uid": "03e4482d53a059134676f431be4c16d2", "apr_id": "10b550f5c09b5c1312b3924e536a2403", "difficulty": 1000, "tags": ["bitmasks"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.04523227383863081, "equal_cnt": 17, "replace_cnt": 16, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 17, "bug_source_code": "\nMicrosoft Visual Studio Solution File, Format Version 12.00\n# Visual Studio 15\nVisualStudioVersion = 15.0.27004.2009\nMinimumVisualStudioVersion = 10.0.40219.1\nProject(\"{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}\") = \"ConsoleApp8\", \"ConsoleApp8\\ConsoleApp8.csproj\", \"{B433AB21-B567-4758-8071-1A5350687DC5}\"\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{B433AB21-B567-4758-8071-1A5350687DC5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{B433AB21-B567-4758-8071-1A5350687DC5}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{B433AB21-B567-4758-8071-1A5350687DC5}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{B433AB21-B567-4758-8071-1A5350687DC5}.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 = {17E13182-9B37-43EE-B8CA-350F37EC1123}\n\tEndGlobalSection\nEndGlobal\n", "lang": "MS C#", "bug_code_uid": "b8b923e335b571bac7c5e203da9c5bbb", "src_uid": "03e4482d53a059134676f431be4c16d2", "apr_id": "0872e331f1d61f71215582c679b2cff2", "difficulty": 1000, "tags": ["bitmasks"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9969135802469136, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "using System;\nusing System.IO;\nclass _320_Div2_ProbA {\n\tpublic static void Main() {\n\t\tConsole.SetIn(new StreamReader(File.OpenRead(\"C://Users//sivak//Desktop//_320_Div2_ProbA.txt\")));\n\t\tvar x = int.Parse(Console.ReadLine());\n\t\tint sum = 0;\n\t\twhile (x != 0) {\n\t\t\tsum += (x % 2);\n\t\t\tx /= 2;\n\t\t}\n\t\tConsole.WriteLine(sum);\n\t}\n}", "lang": "MS C#", "bug_code_uid": "59785eb28c8070f93a5d37f251193f57", "src_uid": "03e4482d53a059134676f431be4c16d2", "apr_id": "7898f3af7578dd0822ee5b3541d8838e", "difficulty": 1000, "tags": ["bitmasks"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.9407665505226481, "equal_cnt": 4, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "using System;\n{\n class Program\n {\n static void Main(string[] args)\n {\n int n , temp;\n\n n= Convert.ToInt32(Console.ReadLine());\n \n temp = (n*(n+1))/ 2;\n\n Console.WriteLine(temp % 2);\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "25151b82cebd1fc41ade9d46ed703d77", "src_uid": "fa163c5b619d3892e33e1fb9c22043a9", "apr_id": "a55ff8407bd3226bc0e075490f5804fc", "difficulty": 800, "tags": ["math"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.3672787979966611, "equal_cnt": 18, "replace_cnt": 9, "delete_cnt": 4, "insert_cnt": 6, "fix_ops_cnt": 19, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace ConsoleApp7\n{\n class Program\n {\n static void Main(string[] args)\n {\n int x = Convert.ToInt16(Console.ReadLine());\n if (x == 3)\n Console.WriteLine(0);\n else\n {\n Console.WriteLine(1);\n }\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "074e64f89c7e5061a3001f6bc027fc06", "src_uid": "fa163c5b619d3892e33e1fb9c22043a9", "apr_id": "abb23acb3b5bb54a039b266d9eb24017", "difficulty": 800, "tags": ["math"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.7618469015795869, "equal_cnt": 6, "replace_cnt": 4, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 5, "bug_source_code": "using System.CodeDom.Compiler;\nusing System.Collections.Generic;\nusing System.Collections;\nusing System.ComponentModel;\nusing System.Diagnostics.CodeAnalysis;\nusing System.Globalization;\nusing System.IO;\nusing System.Linq;\nusing System.Reflection;\nusing System.Runtime.Serialization;\nusing System.Text.RegularExpressions;\nusing System.Text;\nusing System;\n\nclass Solution\n{\n static int pos(int n)\n {\n int left = 0;\n int right = 0;\n left = n;\n int i = n - 1;\n while (i > 0)\n {\n if (left > right)\n right += i;\n else\n left += i;\n i--;\n }\n return Math.Abs(left - right);\n }\n static void Main(string[] args)\n {\n int n;\n string s=Console.ReadLine();\n n = int.Parse(s);\n int res = pos(n);\n Console.WriteLine(res);\n }\n}", "lang": "Mono C#", "bug_code_uid": "d0a48da32235a0600c52766ac66ba8cf", "src_uid": "fa163c5b619d3892e33e1fb9c22043a9", "apr_id": "abb23acb3b5bb54a039b266d9eb24017", "difficulty": 800, "tags": ["math"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.8054474708171206, "equal_cnt": 7, "replace_cnt": 6, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 7, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\n\npublic class GFG\n{\n static public void Main()\n {\n try\n {\n //int test = Convert.ToInt32(Console.ReadLine());\n //for (int i = 0; i < test; i++)\n\n //{\n // var input = Console.ReadLine().Split(' ');\n // var a = int.Parse(input[0]);\n // var b = int.Parse(input[1]);\n // var q = int.Parse(input[2]);\n\n // for (int j = 0; j < q; j++)\n // {\n // var aar1 = Console.ReadLine().Split(' ').Select(x => int.Parse(x)).ToArray();\n // YetAnotherCountProb(a, b, aar1);\n // Console.WriteLine();\n // }\n\n\n //}\n int n = Convert.ToInt32(Console.ReadLine());\n IntSeqDiv(n);\n\n }\n catch (Exception ex)\n {\n Console.Write(ex);\n }\n }\n\n static void IntSeqDiv(int n)\n {\n\n int leftSum = 0;\n int rightSum = 0;\n\n for (int i = n; i > 1; i++)\n {\n if (n % 2 == 0)\n leftSum = leftSum + i;\n else\n rightSum = rightSum + i;\n\n }\n\n var ans1 = Math.Abs((leftSum + 1) - rightSum);\n var ans2 = Math.Abs((leftSum) - (rightSum + 1));\n\n Console.Write(Math.Min(ans1, ans2));\n }\n\n\n}", "lang": "Mono C#", "bug_code_uid": "201a3358d1bfb6ab994a75561ab8bbe7", "src_uid": "fa163c5b619d3892e33e1fb9c22043a9", "apr_id": "66d2983c86aca2055f22fbc78e2d5872", "difficulty": 800, "tags": ["math"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.012547051442910916, "equal_cnt": 8, "replace_cnt": 9, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 9, "bug_source_code": "\nMicrosoft Visual Studio Solution File, Format Version 12.00\n# Visual Studio 15\nVisualStudioVersion = 15.0.28010.2036\nMinimumVisualStudioVersion = 10.0.40219.1\nProject(\"{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}\") = \"ForCodeforces\", \"ForCodeforces\\ForCodeforces.csproj\", \"{9372C2A1-BA75-45D9-8BA0-2C6EBC15BD1C}\"\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{9372C2A1-BA75-45D9-8BA0-2C6EBC15BD1C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{9372C2A1-BA75-45D9-8BA0-2C6EBC15BD1C}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{9372C2A1-BA75-45D9-8BA0-2C6EBC15BD1C}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{9372C2A1-BA75-45D9-8BA0-2C6EBC15BD1C}.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 = {4412A573-E066-4AE4-B95A-69ED731622F1}\n\tEndGlobalSection\nEndGlobal\n", "lang": "Mono C#", "bug_code_uid": "8d90bca00dd73f923848c28ea897ba7f", "src_uid": "fa163c5b619d3892e33e1fb9c22043a9", "apr_id": "3666bc74d65fef2150c66653129760c1", "difficulty": 800, "tags": ["math"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.6192969334330591, "equal_cnt": 10, "replace_cnt": 5, "delete_cnt": 0, "insert_cnt": 5, "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 ConsoleApplication1\n{\n class A1102_IntegerSequenceDividing\n {\n public static void Main()\n {\n decimal sum = 0;\n int a = int.Parse(Console.ReadLine());\n for (int i = 1; i <= a; i++)\n sum += i;\n\n if(sum%2==0)\n Console.WriteLine(0);\n else\n Console.WriteLine(1);\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "d9136819c4b0b144ca6192346d77b93e", "src_uid": "fa163c5b619d3892e33e1fb9c22043a9", "apr_id": "5828c513bbbaf60353a0e60fc29a42d6", "difficulty": 800, "tags": ["math"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.5541922290388548, "equal_cnt": 6, "replace_cnt": 3, "delete_cnt": 2, "insert_cnt": 0, "fix_ops_cnt": 5, "bug_source_code": "using System;\nusing System.Linq;\n\nnamespace CodeForces\n{\n class Program\n {\n static void Main(string[] args)\n {\n int n = Int32.Parse(Console.ReadLine());\n int summA = 0, summB = 0;\n\n for (int i = n; i > 0; i--)\n {\n if (summA >= summB)\n {\n summB += i;\n }\n else\n {\n summA += i;\n }\n }\n Console.WriteLine(Math.Abs(summA - summB));\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "aea15c51107707e21bc15843842bb762", "src_uid": "fa163c5b619d3892e33e1fb9c22043a9", "apr_id": "a441dd4f0f017d0a68fde19e7f101c0b", "difficulty": 800, "tags": ["math"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.5501022494887525, "equal_cnt": 7, "replace_cnt": 4, "delete_cnt": 2, "insert_cnt": 0, "fix_ops_cnt": 6, "bug_source_code": "using System;\nusing System.Linq;\n\nnamespace CodeForces\n{\n class Program\n {\n static void Main(string[] args)\n {\n int n = Int64.Parse(Console.ReadLine());\n int summA = 0, summB = 0;\n\n for (int i = n; i > 0; i--)\n {\n if (summA >= summB)\n {\n summB += i;\n }\n else\n {\n summA += i;\n }\n }\n Console.WriteLine(Math.Abs(summA - summB));\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "ce7c7917f87fa098ca6016ca9ca6d1f3", "src_uid": "fa163c5b619d3892e33e1fb9c22043a9", "apr_id": "a441dd4f0f017d0a68fde19e7f101c0b", "difficulty": 800, "tags": ["math"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9607142857142857, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "namespace Test\n{\n class Program\n {\n\n static void Main(string[] args)\n {\n var num1 = int.Parse(Console.ReadLine());\n var sum = (1 + num1) * num1 / 2;\n Console.WriteLine(sum - sum / 2 * 2);\n \n }\n\n }\n}", "lang": "Mono C#", "bug_code_uid": "8687eec4f9ce0ea5564e0302f0720ffe", "src_uid": "fa163c5b619d3892e33e1fb9c22043a9", "apr_id": "ea2626121689b5be85b0be2cf8149f24", "difficulty": 800, "tags": ["math"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.4755244755244755, "equal_cnt": 7, "replace_cnt": 4, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 6, "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 int n, k;\n static void Main(string[] args)\n {\n\n List inputs = new List { };\n\n\n n = Convert.ToInt32(Console.ReadLine());\n\n List nums = new List { };\n List nums2 = new List { };\n\n for (int i = 0; i < n; i++)\n {\n nums.Add(i + 1);\n }\n while (true)\n {\n if (nums.Sum() == nums2.Sum())\n {\n Console.WriteLine(\"0\");\n break;\n }\n else if (nums.Sum() >= nums2.Sum())\n {\n if(nums.Sum() - nums.Min() < nums2.Sum() + nums.Min())\n {\n k = Math.Abs(nums.Sum() - nums2.Sum());\n nums2.Add(nums.Min());\n nums.Remove(nums.Min());\n }\n else\n {\n nums2.Add(nums.Min());\n nums.Remove(nums.Min());\n } \n }\n\n else if (nums.Sum() <= nums2.Sum())\n {\n if (nums2.Sum() - nums2.Min() < nums.Sum() + nums2.Min())\n {\n if (Math.Abs((nums2.Sum() - nums2.Min()) - (nums.Sum() + nums2.Min())) < Math.Abs(nums.Sum() - nums2.Sum()))\n {\n nums.Add(nums2.Min());\n nums2.Remove(nums2.Min());\n }\n if(Math.Abs(nums.Sum() - nums2.Sum()) < k)\n {\n Console.WriteLine(Math.Abs(nums.Sum() - nums2.Sum()));\n }\n else\n {\n Console.WriteLine(k);\n }\n break;\n }\n else\n {\n nums.Add(nums2.Min());\n nums2.Remove(nums2.Min());\n }\n }\n }\n\n Console.Read();\n\n }\n\n public static List reverse(string s)\n {\n s += \" \";\n string news = \"\";\n List res = new List { };\n for (int i = 0; i < s.Length; i++)\n {\n if (s[i] != ' ')\n {\n news += s[i];\n }\n else\n {\n res.Add(Convert.ToInt32(news));\n news = \"\";\n }\n }\n return res;\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "14a7f90c2028ac95338d2a09597062c4", "src_uid": "fa163c5b619d3892e33e1fb9c22043a9", "apr_id": "ffe0a96681bfd864e381b4b577348364", "difficulty": 800, "tags": ["math"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9276218611521418, "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 ConsoleApp1\n{\n class Program\n {\n static long n,sum;\n static void Main(string[] args)\n {\n\n List inputs = new List { };\n\n\n n = Convert.ToInt32(Console.ReadLine());\n\n for(long i = 0; i < n; i++)\n {\n sum += (i + 1);\n }\n Console.WriteLine(sum % 2);\n Console.Read();\n\n }\n\n public static List reverse(string s)\n {\n s += \" \";\n string news = \"\";\n List res = new List { };\n for (int i = 0; i < s.Length; i++)\n {\n if (s[i] != ' ')\n {\n news += s[i];\n }\n else\n {\n res.Add(Convert.ToInt32(news));\n news = \"\";\n }\n }\n return res;\n }\n\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "5cf4ff8db4e7c2b361b38ff86cda2a13", "src_uid": "fa163c5b619d3892e33e1fb9c22043a9", "apr_id": "ffe0a96681bfd864e381b4b577348364", "difficulty": 800, "tags": ["math"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.5628415300546448, "equal_cnt": 5, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 4, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace ����������_������������������\n{\n class Program\n {\n static void Main(string[] args)\n {\n int n = int.Parse(Console.ReadLine());\n\n if (n == 3)\n Console.WriteLine(0);\n else if (n % 4 == 0)\n Console.WriteLine(0);\n else\n Console.WriteLine(1);\n //Console.ReadKey();\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "bed9d2215b32bd4bf03b4f72b253eddd", "src_uid": "fa163c5b619d3892e33e1fb9c22043a9", "apr_id": "72a7f26ae94bbc9bb5185ac1cbe5e599", "difficulty": 800, "tags": ["math"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9847494553376906, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "using System;\n\nclass B450 {\n const int M = 1000000007;\n\n public static void Main() {\n var line = Console.ReadLine().Split();\n var a1 = (int.Parse(line[0]) + M) % M;\n var a2 = (int.Parse(line[1]) + M) % M;\n var n = int.Parse(Console.ReadLine());\n while (n != 1) {\n var a3 = (a2 + M - a1) % M;\n a1 = a2;\n a2 = a3;\n --n;\n }\n Console.WriteLine(a1);\n }\n}\n", "lang": "MS C#", "bug_code_uid": "388d5c7aed09f299f19464fd0544a814", "src_uid": "2ff85140e3f19c90e587ce459d64338b", "apr_id": "a0995bfbe8ced23467ed9a0cabc7381c", "difficulty": 1300, "tags": ["math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.2577639751552795, "equal_cnt": 9, "replace_cnt": 4, "delete_cnt": 4, "insert_cnt": 1, "fix_ops_cnt": 9, "bug_source_code": "using System;\n\nnamespace tmp6\n{\n class Program\n {\n static void Main(string[] args)\n {\n UInt64 n = Convert.ToUInt64(Console.ReadLine()), count = 0;\n for (UInt64 i = 1; i < n + 1; i++)\n {\n string s = i.ToString();\n if (s.IndexOf('2') < 0 && s.IndexOf('3') < 0 && s.IndexOf('4') < 0 && s.IndexOf('5') < 0 \n && s.IndexOf('6') < 0 && s.IndexOf('7') < 0 && s.IndexOf('8') < 0 && s.IndexOf('9') < 0)\n count++;\n }\n Console.WriteLine(count);\n }\n }\n}", "lang": "MS C#", "bug_code_uid": "604748606931760d55ceee55d65b48db", "src_uid": "64a842f9a41f85a83b7d65bfbe21b6cb", "apr_id": "f4034a898e17710c2db307c17b06fc46", "difficulty": 1200, "tags": ["math", "brute force", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9620853080568721, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "using System;\nusing System.Linq;\nusing MoreLinq;\nclass Program\n{\n static void Main()\n {\n var n = int.Parse(Console.ReadLine());\n var bin = Enumerable.Range(1, 512).Select(i => Convert.ToString(i, 2)).Select(int.Parse).ToArray();\n var index = Array.IndexOf(bin, bin.MinBy(i => n > i));\n if (n == bin[index])\n {\n index++;\n }\n Console.WriteLine(index);\n }\n}\n", "lang": "MS C#", "bug_code_uid": "bc39d00ae06aa37373bbdce83aac8240", "src_uid": "64a842f9a41f85a83b7d65bfbe21b6cb", "apr_id": "c49516b5d7e0f15b38c1b2062ae7db21", "difficulty": 1200, "tags": ["math", "brute force", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9995731967562953, "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 ConsoleApplication1\n{\n class Program\n {\n static int[] ReadInt(int size)\n {\n string[] input = Console.ReadLine().Split(' ');\n int[] res = new int[size]; \n for (int i=0; i b ? a : b);\n }\n\n static void WL (T s)\n {\n Console.WriteLine(s);\n } \n \n static void swap(ref int a, ref int b)\n {\n int temp = a;\n a = b;\n b = temp;\n }\n\n static char[] charArray = new char[10];\n static int count = 0;\n static void attempt(int pos, int n, int k)\n {\n charArray[0] = '0';\n charArray[1] = '1';\n if (pos > k) return; \n for (char ch = '0'; ch <= '1'; ch++)\n {\n charArray[pos] = ch;\n if (pos == k)\n {\n int tmp = Convert.ToInt32(String.Join(\"\", charArray));\n if (tmp <= n) count++;\n }\n attempt(pos + 1, n, k);\n }\n }\n\n static void Main(string[] args)\n {\n int n = ReadInt();\n int k = n.ToString().Length;\n int res = Convert.ToInt32(Math.Pow(2, k - 1)) - 1;\n count = 0;\n if (k == 1) res = 1;\n else attempt(2, n, k);\n res += count;\n WL(res);\n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "4559a29f639a873130c93ee81dec4353", "src_uid": "64a842f9a41f85a83b7d65bfbe21b6cb", "apr_id": "f9092fc4bd9587391a6532f835e3ee92", "difficulty": 1200, "tags": ["math", "brute force", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.42049299178347027, "equal_cnt": 14, "replace_cnt": 8, "delete_cnt": 4, "insert_cnt": 2, "fix_ops_cnt": 14, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace _2018_08_23_alyona_and_numbers\n{\n class Program\n {\n static void Main(string[] args)\n {\n //http://codeforces.com/problemset/problem/682/A\n\n string[] nm = Console.ReadLine().Split(' ');\n int n = int.Parse(nm[0]);\n int m = int.Parse(nm[1]);\n int [] first = new int [n];\n int[] second = new int[m]; \n int modfive = 0;\n\n for (int i= 0; i currentLineTokens = new Queue();\n private static string[] ReadAndSplitLine() { return reader.ReadLine().Split(new[] { ' ', '\\t', }, StringSplitOptions.RemoveEmptyEntries); }\n public static string Read() { while (currentLineTokens.Count == 0) currentLineTokens = new Queue(ReadAndSplitLine()); return currentLineTokens.Dequeue(); }\n public static int ReadInt() { return int.Parse(Read()); }\n public static long ReadLong() { return long.Parse(Read()); }\n public static double ReadDouble() { return double.Parse(Read(), 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]; }\n 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": "42a983949039c3719630e1ff872d2f0d", "src_uid": "df0879635b59e141c839d9599abd77d2", "apr_id": "787a2ae9d44963f94c9a72eefd1492b4", "difficulty": 1100, "tags": ["math", "constructive algorithms", "number theory"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.946969696969697, "equal_cnt": 7, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 5, "fix_ops_cnt": 6, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace ExInCsharp\n{\n class Program\n {\n static void Main(string[] args)\n {\n string str1 = Console.ReadLine();\n int x=0, y=0, m, n;\n bool f = false;\n string[] str = str1.Split(' ');\n n = int.Parse(str[0]); m = int.Parse(str[1]);\n for (int i = 1; i <= n; i++ )\n {\n for (int j=1; j<=m; j++)\n {\n if ((i+j)%5==0)\n {\n x++;\n }\n }\n \n }\n \n Console.WriteLine(x);\n\n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "87a15420497ac6e6f949adf753d57831", "src_uid": "df0879635b59e141c839d9599abd77d2", "apr_id": "acf7fd76add3e4eba64e523d4251c268", "difficulty": 1100, "tags": ["math", "constructive algorithms", "number theory"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.5221101629169899, "equal_cnt": 16, "replace_cnt": 9, "delete_cnt": 5, "insert_cnt": 2, "fix_ops_cnt": 16, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace ConsoleApp11\n{\n class Program\n {\n static void Main(string[] args)\n {\n ulong[] inp = Console.ReadLine().Split().Select(ulong.Parse).ToArray();\n ulong l1 = inp[0];\n ulong r1 = inp[1];\n ulong l2 = inp[2];\n ulong r2 = inp[3];\n ulong k = inp[4];\n ulong y = 0;\n if (l2 > r1 || l1 > r2)\n {\n Console.WriteLine(0);\n }\n else\n {\n for (ulong i = l2; i <= r2; i++)\n {\n if (i >= l1 && i <= r1)\n {\n if ((i < k && r1 - i+1 > y && (k > r1))|| (i > k && r1 - i > y && (k < r1)))\n {\n y = r1 - i+1;\n continue;\n }\n else if(r1-i>y)\n {\n y = r1 - i ;\n continue;\n }\n \n \n }\n if (i > r1)\n {\n break;\n }\n }\n Console.WriteLine(y);\n }\n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "fed248f41d959385891cc29e489cb7c1", "src_uid": "9a74b3b0e9f3a351f2136842e9565a82", "apr_id": "e3bc3170a6b8918c531a958edf25b775", "difficulty": 1100, "tags": ["math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9902767389678384, "equal_cnt": 4, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\n\n\n\n\nnamespace CodeforcesVASYA\n{\n class Program\n {\n static void Main(string[] args)\n {\n \n \n String [] arr = Console.ReadLine().Split(' ');\n \n Int64 k=int.Parse(arr[0]);\n Int64 b=int.Parse(arr[1]);\n Int64 n=int.Parse(arr[2]);\n Int64 t=int.Parse(arr[3]);\n \n Int64 x=1;\n \n for (n; n>0; )\n {\n \n x=k*x+b;\n \n if(x>t)\n {\n\n break;\n }\n else\n {\n dec(n);\n }\n \n \n \n \n }\n \n Console.WritwLine(n);\n \n \n\n \n \n \n }\n }\n\n}", "lang": "Mono C#", "bug_code_uid": "97ef734cff7b0415e867e3a60b9b899a", "src_uid": "e2357a1f54757bce77dce625772e4f18", "apr_id": "08a8050d5b4b03a319768300f0ee3cad", "difficulty": 1700, "tags": ["math"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.3080332409972299, "equal_cnt": 9, "replace_cnt": 3, "delete_cnt": 6, "insert_cnt": 0, "fix_ops_cnt": 9, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Numerics;\nusing System.Text;\n\nnamespace CodeForce\n{\n class _66a\n {\n public static void Main()\n {\n var line = Console.ReadLine();\n var big = BigInteger.Parse(line);\n if (big >= -128 && big <= 127)\n {\n Console.WriteLine(\"byte\");\n }\n else if (big >= -32768 && big <= 32767)\n {\n Console.WriteLine(\"short\");\n }\n else if (big >= -2147483648 && big <= 2147483647)\n {\n Console.WriteLine(\"int\");\n }\n else if (big >= -9223372036854775808 && big <= 9223372036854775807)\n {\n Console.WriteLine(\"long\");\n }\n else\n {\n Console.WriteLine(\"BigInteger\");\n }\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "5cccac07b780990b8c324cab73508f9b", "src_uid": "33041f1832fa7f641e37c4c638ab08a1", "apr_id": "c1bf4e7d3dcc49708e7ae24d2f8b158e", "difficulty": 1300, "tags": ["strings", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C#"} {"similarity_score": 0.8089171974522293, "equal_cnt": 16, "replace_cnt": 5, "delete_cnt": 0, "insert_cnt": 11, "fix_ops_cnt": 16, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\n\nnamespace ConsoleApplication6\n{\n class Program\n {\n static void Main(string[] args)\n {\n long n;\n string res;\n n = long.Parse(Console.ReadLine());\n if (n >= - 9223372036854775808 && n <= 9223372036854775807)\n res = \"long\";\n else\n res = \"BigInteger\";\n if(n >= - 2147483648 && n <= 2147483647)\n res = \"int\";\n if(n >= -32768 && n <= 32768)\n res = \"short\";\n if(n >= -128 && n <= 127)\n res = \"byte\";\n\n Console.WriteLine(res);\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "b6b6b5f6eb8293701c0fda0d76b8e922", "src_uid": "33041f1832fa7f641e37c4c638ab08a1", "apr_id": "e46d70619117ccb45819e9db04ef6daf", "difficulty": 1300, "tags": ["strings", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.9523809523809523, "equal_cnt": 27, "replace_cnt": 5, "delete_cnt": 5, "insert_cnt": 16, "fix_ops_cnt": 26, "bug_source_code": "using System;\n\nnamespace task_61_A\n{\n class MainClass\n {\n public static void Main (string[] args)\n {\n long i;\n try \n {\n i=long.Parse(s);\n }\n catch (Exception ex)\n {\n Console.WriteLine(\"BigInteger\");\n return;\n }\n \n if(i>-129 && i<128)\n {\n Console.WriteLine(\"byte\");\n return;\n }\n if(i>-32769 && i<32769)\n {\n Console.WriteLine(\"short\");\n return;\n }\n if (i>=-2147483648 && i<=2147483647)\n {\n Console.WriteLine(\"int\");\n return;\n } //long\n if(i>=-9223372036854775808 && i<=9223372036854775807)\n {\n Console.WriteLine(\"long\");\n return;\n }\n else \n {\n Console.WriteLine(\"BigInteger\");\n return;\n }\n }\n }\n}", "lang": "Mono C#", "bug_code_uid": "bbc77ab6033f7cfa3df8e55e74c556e3", "src_uid": "33041f1832fa7f641e37c4c638ab08a1", "apr_id": "7e0eb375a644b10656fc91b9007b4b95", "difficulty": 1300, "tags": ["strings", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.8406153846153847, "equal_cnt": 28, "replace_cnt": 5, "delete_cnt": 1, "insert_cnt": 21, "fix_ops_cnt": 27, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\n\nnamespace ConsoleApplication5\n{\n class Program\n {\n static void Main(string[] args)\n {\n string n = Console.ReadLine();\n \n //double d = Convert.ToDouble(Convert.toi n);\n\n Console.WriteLine(Checker(n));\n \n Console.ReadLine();\n }\n\n public static string Checker(string n)\n {\n\n string s = String.Empty;\n\n try\n {\n sbyte wert = Convert.ToSByte(n); // (d >= -128.0 && d <= 127.0)\n s = \"byte\";\n }\n catch {}\n\n try\n {\n short wert = Convert.ToInt16(n); // (d >= -32768.0 && d <= 32767.0)\n s = \"short\";\n }\n catch {}\n\n try\n {\n int wert = Convert.ToInt32(n); // (d >= -2147483648.0 && d <= 2147483647.0)\n s = \"int\";\n }\n catch {}\n\n try\n {\n long wert = Convert.ToInt64(n); // (d >= -9223372036854775808.0 && d <= 9223372036854775807.0)\n s = \"long\";\n }\n catch {}\n\n if (s == String.Empty)\n {\n s = \"BigInteger\";\n }\n \n return s;\n }\n }", "lang": "Mono C#", "bug_code_uid": "179d1da7a69d4e5330b096e7b21bb8d0", "src_uid": "33041f1832fa7f641e37c4c638ab08a1", "apr_id": "0f2526b47310dc7d932b560cfd6d4f63", "difficulty": 1300, "tags": ["strings", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.31274638633377133, "equal_cnt": 11, "replace_cnt": 9, "delete_cnt": 2, "insert_cnt": 1, "fix_ops_cnt": 12, "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 string buf;\n string[] arr = new string[3];\n int n = int.Parse(Console.ReadLine());\n int x = 0, y = 0, z = 0;\n for (int i = 0; i < n; i++)\n {\n buf = Console.ReadLine();\n arr = buf.Split(' ');\n x += int.Parse(arr[0]);\n y += int.Parse(arr[1]);\n z += int.Parse(arr[2]);\n }\n if (x == 0 && y == 0 && z == 0)\n Console.WriteLine(\"YES\");\n else\n Console.WriteLine(\"NO\");\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "3d91d7ebef820cebf54af1241714683a", "src_uid": "33041f1832fa7f641e37c4c638ab08a1", "apr_id": "389eab27dded4bc27e30f1f8c0814cbc", "difficulty": 1300, "tags": ["strings", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9679166666666666, "equal_cnt": 5, "replace_cnt": 0, "delete_cnt": 2, "insert_cnt": 2, "fix_ops_cnt": 4, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace PetyaJava\n{\n static class Operacao\n {\n //Matriz de 5x4, sendo a primeira coluna o tipo de variável, e a segunda a informação se aquele tipo pode guardar o número informado\n static string[,] TipoDeVariavel = new string[,] { { \"byte\", \"false\" }, { \"short\", \"false\" }, \n { \"int\", \"false\" }, { \"long\", \"false\" }, { \"BigInteger\", \"false\" } };\n\n\n public static void Compara(string valor)\n {\n //Usando o sistema de try catch, testar se o tipo de variável suporta o numero\n try\n {\n sbyte x = sbyte.Parse(valor); //Tentar fazer a conversão\n TipoDeVariavel[0, 1] = \"true\"; //Caso positivo, armazenar na matriz na celula correspondente\n }\n catch (System.Exception) //Testar outros tipos, em caso de erro\n {\n try\n {\n short x = short.Parse(valor);\n TipoDeVariavel[1, 1] = \"true\";\n }\n catch (System.Exception)\n {\n try\n {\n int x = int.Parse(valor);\n TipoDeVariavel[2, 1] = \"true\";\n }\n catch (System.Exception)\n {\n try\n {\n long x = long.Parse(valor);\n TipoDeVariavel[3, 1] = \"true\";\n }\n //Se der erro em todas, ele guarda em BigInteger, visto que é o tipo que armazena números de qualquer tamanho\n catch (System.Exception) \n {\n TipoDeVariavel[4, 1] = \"true\";\n }\n }\n }\n }\n\n for (int i = 0; i < 5; i++) //Percorrer a segunda coluna da matriz\n {\n if (TipoDeVariavel[i, 1] == \"true\") //O primeiro tipo que ela identificar já vai ser o resultado\n {\n Console.Write(TipoDeVariavel[i, 0]);\n return;\n }\n }\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "c566078aa2153d7d2e4aeae347bd8065", "src_uid": "33041f1832fa7f641e37c4c638ab08a1", "apr_id": "7fd973cfae8d7f103da527e1208f6ed4", "difficulty": 1300, "tags": ["strings", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C#"} {"similarity_score": 0.9652982535722386, "equal_cnt": 10, "replace_cnt": 0, "delete_cnt": 8, "insert_cnt": 2, "fix_ops_cnt": 10, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\nusing System.Numerics;\n\nnamespace Fibonacci_Freeza\n{\n class Operacao\n {\n string num;\n\n public Operacao(string x) { num = x; }\n\n public string compara()\n {\n // if (num.Length <= 3)\n // return \"byte\";\n // else\n // {\n // if (num.Length <= 5)\n // return \"short\";\n // else\n // {\n // if (num.Length <= 10)\n // return \"int\";\n // else\n // {\n // if (num.Length <= 19)\n // return \"long\";\n // else\n // return \"BigInteger\";\n // }\n // }\n // }\n try {\n sbyte x = sbyte.Parse(num);\n return \"byte\";\n }\n catch (System.Exception)\n {\n try { \n short x = short.Parse(num);\n return \"short\";\n }\n catch (System.Exception)\n {\n try\n {\n int x = int.Parse(num);\n return \"int\";\n }\n catch (System.Exception)\n {\n try\n {\n long x = long.Parse(num);\n return \"long\";\n }\n catch (System.Exception)\n {\n return \"BigInteger\";\n }\n }\n }\n }\n\n }\n\n \n }\n class Program\n {\n static void Main(string[] args)\n {\n int escolha = 15;\n while (escolha == 15)\n {\n Operacao x = new Operacao(Console.ReadLine());\n Console.Write(x.compara());\n }\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "80790ae08da2131589e83f4dfb807754", "src_uid": "33041f1832fa7f641e37c4c638ab08a1", "apr_id": "1b17a8584841670ec7f4c7fd3ef916bc", "difficulty": 1300, "tags": ["strings", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "delete", "lang_cluster": "C#"} {"similarity_score": 0.9432134996331621, "equal_cnt": 5, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 4, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Globalization;\nusing System.IO;\nusing System.Linq;\nusing System.Text;\nusing System.Text.RegularExpressions;\nusing System.Threading;\n\nnamespace Olymp\n{\n public class ProblemSolver\n {\n private Tokenizer input;\n\n public void Solve()\n {\n int n = input.NextInt();\n long k = input.NextInt();\n if (k % 2 == 1)\n {\n Console.WriteLine(1);\n }\n else\n {\n long m = 1;\n int i = 1;\n while (m < k)\n {\n m = 2 * m + 1;\n ++i;\n }\n long l = 1;\n long r = m;\n int d = i;\n long c = (r - l) / 2 + 1;\n while (c != k)\n {\n if (c < k)\n {\n l = c;\n }\n else\n {\n r = c;\n }\n c = (r - l) / 2 + 1;\n --d;\n }\n Console.WriteLine(d);\n }\n }\n\n public ProblemSolver(TextReader input)\n {\n this.input = new Tokenizer(input);\n }\n }\n\n #region Service classes\n\n public class Tokenizer\n {\n private TextReader reader;\n\n public int NextInt()\n {\n var c = SkipWS();\n if (c == -1)\n throw new EndOfStreamException();\n bool isNegative = false;\n if (c == '-' || c == '+')\n {\n isNegative = c == '-';\n c = this.reader.Read();\n if (c == -1)\n throw new InvalidOperationException();\n }\n if (!char.IsDigit((char)c))\n throw new InvalidOperationException();\n int result = (char)c - '0';\n c = this.reader.Read();\n while (c > 0 && !char.IsWhiteSpace((char)c))\n {\n if (!char.IsDigit((char)c))\n throw new InvalidOperationException();\n result = result * 10 + (char)c - '0';\n c = this.reader.Read();\n }\n if (isNegative)\n result = -result;\n return result;\n }\n\n public string ReadLine()\n {\n return reader.ReadLine();\n }\n\n public long NextLong()\n {\n return long.Parse(this.NextToken());\n }\n\n public double NextDouble()\n {\n return double.Parse(this.NextToken(), CultureInfo.InvariantCulture);\n }\n\n public int[] ReadIntArray(int n)\n {\n int[] a = new int[n];\n for (int i = 0; i < n; i++)\n a[i] = NextInt();\n return a;\n }\n\n public long[] ReadLongArray(int n)\n {\n long[] a = new long[n];\n for (int i = 0; i < n; i++)\n a[i] = NextLong();\n return a;\n }\n\n public double[] ReadDoubleArray(int n)\n {\n double[] a = new double[n];\n for (int i = 0; i < n; i++)\n a[i] = NextDouble();\n return a;\n }\n\n public string NextToken()\n {\n var c = SkipWS();\n if (c == -1)\n return null;\n var sb = new StringBuilder();\n while (c > 0 && !char.IsWhiteSpace((char)c))\n {\n sb.Append((char)c);\n c = this.reader.Read();\n }\n return sb.ToString();\n }\n\n private int SkipWS()\n {\n int c = this.reader.Read();\n if (c == -1)\n return c;\n while (c > 0 && char.IsWhiteSpace((char)c))\n c = this.reader.Read();\n return c;\n }\n\n public Tokenizer(TextReader reader)\n {\n this.reader = reader;\n }\n }\n\n class Program\n {\n public static void Main(string[] args)\n {\n var solver = new ProblemSolver(Console.In);\n solver.Solve();\n }\n }\n\n #endregion\n}", "lang": "MS C#", "bug_code_uid": "5ab7617d6d0e2efb0444de4127f3b835", "src_uid": "0af400ea8e25b1a36adec4cc08912b71", "apr_id": "903baee520575b806e2c88585beb43e7", "difficulty": 1200, "tags": ["implementation", "constructive algorithms", "bitmasks", "binary search"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.99860529986053, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "using System;\nusing System.Text;\nusing System.Collections.Generic;\nusing System.Collections;\nusing System.Linq;\nclass Problem\n{\n static void Main()\n {\n //--------------------------------input--------------------------------//\n\n int n = Convert.ToInt32( Console.ReadLine() );\n var a = Array.ConvertAll( Console.ReadLine().Split(), Convert.ToInt32 );\n var b = Array.ConvertAll( Console.ReadLine().Split(), Convert.ToInt32 );\n\n //--------------------------------solve--------------------------------/\n\n int sum = a.Sum();\n sum -= b.Sum();\n if(sum == 0)\n Console.WriteLine( \"Yes\" );\n else\n Console.WriteLine( \"No\" );\n\n }\n\n\n\n}", "lang": "Mono C#", "bug_code_uid": "f57e319facb7b7f9104fcb4f1204214a", "src_uid": "e0ddac5c6d3671070860dda10d50c28a", "apr_id": "f3c98f0185f12f7b031199cdd786633a", "difficulty": 800, "tags": ["math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9980952380952381, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "using System;\nclass Program\n{\n static void Main()\n {\n int n = Convert.ToInt32(Console.ReadLine());\n int[] Fday = Array.ConvertAll(Console.ReadLine().Split(), Convert.ToInt32);\n int[] Sday = Array.ConvertAll(Console.ReadLine().Split(), Convert.ToInt32);\n int sum0 = 0, sum1 = 0;\n foreach (int i in Fday)\n {\n sum0 += i;\n }\n foreach (int i in Sday)\n {\n sum1 += i;\n }\n Console.WriteLine(sum0 <= sum1 ? \"Yes\" : \"No\");\n }\n}", "lang": "Mono C#", "bug_code_uid": "083d9c84b69e32536a51b9a2119c63fa", "src_uid": "e0ddac5c6d3671070860dda10d50c28a", "apr_id": "d90c8d7350c0b71415dbcc7a5ac736ec", "difficulty": 800, "tags": ["math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.10786371709995156, "equal_cnt": 26, "replace_cnt": 16, "delete_cnt": 2, "insert_cnt": 8, "fix_ops_cnt": 26, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\n \nnamespace Codeforces\n{\n class Program\n {\n static void Main(string[] args)\n {\n var line = Console.ReadLine();\n \n long x1, y1, x2, y2, x3, y3, x4, y4, x5, y5, x6, y6;\n \n x1 = long.Parse(line.Split(' ')[0]);\n y1 = long.Parse(line.Split(' ')[1]);\n x2 = long.Parse(line.Split(' ')[2]);\n y2 = long.Parse(line.Split(' ')[3]);\n \n line = Console.ReadLine();\n \n x3 = long.Parse(line.Split(' ')[0]);\n y3 = long.Parse(line.Split(' ')[1]);\n x4 = long.Parse(line.Split(' ')[2]);\n y4 = long.Parse(line.Split(' ')[3]);\n \n line = Console.ReadLine();\n x5 = long.Parse(line.Split(' ')[0]);\n y5 = long.Parse(line.Split(' ')[1]);\n x6 = long.Parse(line.Split(' ')[2]);\n y6 = long.Parse(line.Split(' ')[3]);\n \n \n long area1 = 0, area2 = 0, area3 = 0;\n \n if (x3 <= x1)\n {\n x3 = x1;\n }\n \n if (x4 >= x2)\n {\n x4 = x2;\n }\n \n if (y3 <= y1)\n {\n y3 = y1;\n }\n \n if (y4 >= y2)\n {\n y4 = y2;\n }\n \n if (x3 <= x4 && y3 <= y4)\n {\n area2 = (x4 - x3) * (y4 - y3);\n }\n \n if (x5 <= x1)\n {\n x5 = x1;\n }\n \n if (x6 >= x2)\n {\n x6 = x2;\n }\n \n if (y5 <= y1)\n {\n y5 = y1;\n }\n \n if (y6 >= y2)\n {\n y6 = y2;\n }\n \n if (x5 <= x6 && y5 <= y6)\n {\n area3 = (x6 - x5) * (y6 - y5);\n }\n \n var result = false;\n \n if (x1 == x3 && y1 == y3 && x2 == x4 && y2 == y4)\n {\n result = true;\n }\n else if (x1 == x5 && y1 == y5 && x2 == x6 && y2 == y6)\n {\n result = true;\n }\n else if (area2 == 0 || area3 == 0)\n {\n result = false;\n }\n else if (area2 > 0 && area3 > 0 && ((x4-x3 + x6-x5) >= (x2-x1)) && y1 == y3 && y2 == y4 && y1 == y5 && y2 == y6)\n {\n result = true;\n }\n else if (area2 > 0 && area3 > 0 && ((y4 - y3 + y6 - y5) >= (y2 - y1)) && x1 == x3 && x2 == x4 && x1 == x5 && x2 == x6)\n {\n result = true;\n }\n \n \n Console.WriteLine(!result ? \"YES\" : \"NO\");\n \n \n \n }\n \n \n }\n}", "lang": "Mono C#", "bug_code_uid": "996a923ba61699a2a6856162aa6d1795", "src_uid": "05c90c1d75d76a522241af6bb6af7781", "apr_id": "5d39f37a0aa4cf6e8665684f610f574b", "difficulty": 1700, "tags": ["geometry", "math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9940759670112673, "equal_cnt": 10, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 7, "fix_ops_cnt": 9, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.IO;\nusing SB = System.Text.StringBuilder;\n//using System.Threading.Tasks;\n//using System.Text.RegularExpressions;\n//using System.Globalization;\n//using System.Diagnostics;\nusing static System.Console;\nusing System.Numerics;\nusing static System.Math;\nusing pair = Pair;\n\nclass Program\n{\n static void Main()\n {\n //SetOut(new StreamWriter(OpenStandardOutput()) { AutoFlush = false });\n new Program().solve();\n Out.Flush();\n }\n readonly Scanner cin = new Scanner();\n readonly int[] dd = { 0, 1, 0, -1, 0 }; //→↓←↑\n readonly int mod = 1000000007;\n readonly int dom = 998244353;\n bool chmax(ref T a, T b) where T : IComparable { if (a.CompareTo(b) < 0) { a = b; return true; } return false; }\n bool chmin(ref T a, T b) where T : IComparable { if (b.CompareTo(a) < 0) { a = b; return true; } return false; }\n\n void solve()\n {\n int N = cin.nextint;\n int T = cin.nextint;\n\n var A = new int[N];\n var G = new int[N];\n\n for (int i = 0; i < N; i++)\n {\n A[i] = cin.nextint;\n G[i] = cin.nextint - 1;\n }\n\n ModInt ans = 0;\n for (int S = 0; S < 1 << N; S++)\n {\n int time = 0;\n var type = new int[3];\n for (int i = 0; i < N; i++)\n {\n if ((S >> i & 1) == 1)\n {\n time += A[i];\n type[G[i]]++;\n }\n }\n if (time != T)\n {\n continue;\n }\n int X = type[0];\n int Y = type[1];\n int Z = type[2];\n\n var dp = new long[type[0] + 1, type[1] + 1, type[2] + 1, 4];\n\n\n for (int i = 0; i <= X; i++)\n {\n for (int j = 0; j <= Y; j++)\n {\n for (int k = 0; k <= Z; k++)\n {\n for (int l = 0; l < 4; l++)\n {\n dp[i, j, k, l] = -1;\n }\n }\n }\n }\n var ret = calc(X, Y, Z, 3, dp);\n if (X > 1) ret = ret * X;\n if (Y > 1) ret = ret * Y;\n if (Z > 1) ret = ret * Z;\n ans += ret % mod;\n\n }\n WriteLine(ans);\n }\n\n long calc(int x, int y, int z, int before, long[,,,] dp)\n {\n //WriteLine(x + \" \" + y + \" \" + z);\n if (dp[x, y, z, before] >= 0)\n {\n return dp[x, y, z, before];\n }\n if (x == 0 && y == 0 && z == 0)\n {\n return 1;\n }\n\n long ret = 0;\n if (x > 0 && before != 0)\n {\n ret += calc(x - 1, y, z, 0, dp);\n }\n if (y > 0 && before != 1)\n {\n ret += calc(x, y - 1, z, 1, dp);\n }\n if (z > 0 && before != 2)\n {\n ret += calc(x, y, z - 1, 2, dp);\n }\n ret %= mod;\n return dp[x, y, z, before] = ret;\n }\n\n}\n\n/// \n/// [0,) までの値を取るような数\n/// \n/// camypaper\nstruct ModInt\n{\n /// \n /// 剰余を取る値.\n /// \n public const long Mod = (int)1e9 + 7;\n\n /// \n /// 実際の数値.\n /// \n public long num;\n /// \n /// 値が であるようなインスタンスを構築します.\n /// \n /// インスタンスが持つ値\n /// パフォーマンスの問題上,コンストラクタ内では剰余を取りません.そのため, ∈ [0,) を満たすような を渡してください.このコンストラクタは O(1) で実行されます.\n public ModInt(long n) { num = n; }\n /// \n /// このインスタンスの数値を文字列に変換します.\n /// \n /// [0,) の範囲内の整数を 10 進表記したもの.\n public override string ToString() { return num.ToString(); }\n public static ModInt operator +(ModInt l, ModInt r) { l.num += r.num; if (l.num >= Mod) l.num -= Mod; return l; }\n public static ModInt operator -(ModInt l, ModInt r) { l.num -= r.num; if (l.num < 0) l.num += Mod; return l; }\n public static ModInt operator *(ModInt l, ModInt r) { return new ModInt(l.num * r.num % Mod); }\n public static implicit operator ModInt(long n) { n %= Mod; if (n < 0) n += Mod; return new ModInt(n); }\n\n /// \n /// 与えられた 2 つの数値からべき剰余を計算します.\n /// \n /// べき乗の底\n /// べき指数\n /// 繰り返し二乗法により O(N log N) で実行されます.\n public static ModInt Pow(ModInt v, long k) { return Pow(v.num, k); }\n\n /// \n /// 与えられた 2 つの数値からべき剰余を計算します.\n /// \n /// べき乗の底\n /// べき指数\n /// 繰り返し二乗法により O(N log N) で実行されます.\n public static ModInt Pow(long v, long k)\n {\n long ret = 1;\n for (k %= Mod - 1; k > 0; k >>= 1, v = v * v % Mod)\n if ((k & 1) == 1) ret = ret * v % Mod;\n return new ModInt(ret);\n }\n /// \n /// 与えられた数の逆元を計算します.\n /// \n /// 逆元を取る対象となる数\n /// 逆元となるような値\n /// 法が素数であることを仮定して,フェルマーの小定理に従って逆元を O(log N) で計算します.\n public static ModInt Inverse(ModInt v) { return Pow(v, Mod - 2); }\n}\n\nclass BinomialCoefficient\n{\n public ModInt[] fact, ifact;\n /// \n /// 未満でお願いします。\n /// \n /// \n public BinomialCoefficient(ModInt _n)\n {\n int n = (int)_n.num;\n fact = new ModInt[n + 1];\n ifact = new ModInt[n + 1];\n fact[0] = 1;\n for (int i = 1; i <= n; i++)\n fact[i] = fact[i - 1] * i;\n ifact[n] = ModInt.Inverse(fact[n]);\n for (int i = n - 1; i >= 0; i--)\n ifact[i] = ifact[i + 1] * (i + 1);\n ifact[0] = ifact[1];\n }\n public ModInt this[int n, int r]\n {\n get\n {\n if (n < 0 || n >= fact.Length || r < 0 || r > n) return 0;\n return fact[n] * ifact[n - r] * ifact[r];\n }\n }\n public ModInt RepeatedCombination(int n, int k)\n {\n if (k == 0) return 1;\n return this[n + k - 1, k];\n }\n}\n\nstatic class Ex\n{\n public static void join(this IEnumerable values, string sep = \" \") => WriteLine(string.Join(sep, values));\n public static string concat(this IEnumerable values) => string.Concat(values);\n public static string reverse(this string s) { var t = s.ToCharArray(); Array.Reverse(t); return t.concat(); }\n\n public static int lower_bound(this IList arr, T val) where T : IComparable\n {\n int low = 0, high = arr.Count;\n int mid;\n while (low < high)\n {\n mid = ((high - low) >> 1) + low;\n if (arr[mid].CompareTo(val) < 0) low = mid + 1;\n else high = mid;\n }\n return low;\n }\n public static int upper_bound(this IList arr, T val) where T : IComparable\n {\n int low = 0, high = arr.Count;\n int mid;\n while (low < high)\n {\n mid = ((high - low) >> 1) + low;\n if (arr[mid].CompareTo(val) <= 0) low = mid + 1;\n else high = mid;\n }\n return low;\n }\n}\n\nclass Pair : IComparable> where T : IComparable where U : IComparable\n{\n public T f; public U s;\n public Pair(T f, U s) { this.f = f; this.s = s; }\n public int CompareTo(Pair a) => f.CompareTo(a.f) != 0 ? f.CompareTo(a.f) : s.CompareTo(a.s);\n public override string ToString() => $\"{f} {s}\";\n}\n\nclass Scanner\n{\n string[] s; int i;\n readonly char[] cs = new char[] { ' ' };\n public Scanner() { s = new string[0]; i = 0; }\n public string[] scan => ReadLine().Split();\n public int[] scanint => Array.ConvertAll(scan, int.Parse);\n public long[] scanlong => Array.ConvertAll(scan, long.Parse);\n public double[] scandouble => Array.ConvertAll(scan, double.Parse);\n public string next\n {\n get\n {\n if (i < s.Length) return s[i++];\n string st = ReadLine();\n while (st == \"\") st = ReadLine();\n s = st.Split(cs, StringSplitOptions.RemoveEmptyEntries);\n i = 0;\n return next;\n }\n }\n public int nextint => int.Parse(next);\n public long nextlong => long.Parse(next);\n public double nextdouble => double.Parse(next);\n}\n", "lang": "Mono C#", "bug_code_uid": "6f19c393e0cfdee661b9ad58bed520b9", "src_uid": "ac2a37ff4c7e89a345b189e4891bbf56", "apr_id": "4f1a7c3d73e150732b2516289400764f", "difficulty": 2100, "tags": ["dp", "combinatorics", "bitmasks"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.38544409863538426, "equal_cnt": 40, "replace_cnt": 26, "delete_cnt": 8, "insert_cnt": 6, "fix_ops_cnt": 40, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace ProblemSets\n{\n using System;\n using System.Collections.Generic;\n using System.Collections;\n using System.Linq;\n using System.Text;\n\n namespace LongPath\n {\n public class Problem420b\n {\n public static void Main(string[] args)\n {\n var input = Console.ReadLine().Split(' ').Select(x => int.Parse(x)).ToArray();\n var numberOfPeople = input[0];\n var numberOfMessage = input[1];\n var employees = new int[100000 + 1];\n\n for (int i = 1; i <= numberOfPeople; i++)\n {\n employees[i] = 99;\n }\n\n var NotALeader = new ArrayList();\n\n\n for (int i = 0; i < numberOfMessage; i++)\n {\n\n var status = Console.ReadLine().Split(' ');\n var symbol = status[0][0];\n var id = int.Parse(status[1]);\n\n if (symbol == '+')\n {\n for (int j = 1; j <= numberOfPeople; j++)\n {\n if (j == id) continue;\n if (employees[j] == 1)\n {\n NotALeader.Add(id);\n }\n if (employees[j] == 0) \n {\n NotALeader.Add(j);\n }\n }\n employees[id] = 1;\n }\n\n if (symbol == '-')\n {\n var prevStatusOfEmployee = employees[id];\n\n \n if (prevStatusOfEmployee == 1)\n {\n\n for (int j = 1; j <= numberOfPeople; j++)\n {\n if (j == id) continue;\n if (employees[j] == 1 || employees[j]== 0)\n {\n NotALeader.Add(id);\n }\n }\n }\n else if (prevStatusOfEmployee == 99)\n {\n for (int j = 1; j <= numberOfPeople; j++)\n {\n if (j == id) continue;\n if (employees[j] == 1)\n {\n NotALeader.Add(id);\n NotALeader.Add(j);\n }\n }\n }\n\n employees[id] = 0;\n }\n lastEmployeeID = id;\n }\n\n var leaders = new ArrayList();\n for (int i = 1; i <= numberOfPeople; i++)\n {\n\n if (employees[i] == 99 || employees[i] == 1)\n {\n if (!NotALeader.Contains(i)) leaders.Add(i);\n }\n else if (!NotALeader.Contains(i)) leaders.Add(i);\n }\n\n var numberOfLeader = leaders.Count;\n Console.WriteLine(numberOfLeader);\n\n foreach (var leader in leaders)\n {\n Console.Write(leader);\n Console.Write(\" \");\n }\n\n }\n }\n }\n\n\n}\n", "lang": "MS C#", "bug_code_uid": "966f8fa92eba79a0d3b34d00a9319756", "src_uid": "a3a337c7b919e7dfd7ff45ebf59681b5", "apr_id": "fb7efbf1b0b1cc4143f71f3ffe508f5d", "difficulty": 1800, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.3109217171717172, "equal_cnt": 58, "replace_cnt": 26, "delete_cnt": 10, "insert_cnt": 22, "fix_ops_cnt": 58, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Collections;\nusing System.Linq;\nusing System.Text;\n\nnamespace LongPath\n{\n public class Problem420b\n {\n public static void Main(string[] args)\n {\n var input = Console.ReadLine().Split(' ').Select(x => int.Parse(x)).ToArray();\n var numberOfPeople = input[0];\n var numberOfMessage = input[1];\n var employees = new int[100000];\n\n for (int i = 0; i < numberOfPeople; i++)\n {\n employees[i] = 99;\n }\n\n var NotALeader = new ArrayList();\n for (int i = 0; i < numberOfMessage; i++)\n {\n var status = Console.ReadLine().Split(' ').Select(x => int.Parse(x)).ToArray();\n var symbol = status[0];\n var id = status[1];\n if (symbol == '+') employees[id] = 1;\n\n if (symbol == '-')\n {\n employees[id] = 0;\n for (int j = 0; j < numberOfPeople; j++)\n {\n if (employees[j] == 1)\n {\n NotALeader.Add(id);\n }\n }\n }\n }\n\n var leaders = new ArrayList();\n for (int i = 0; i < numberOfPeople; i++)\n {\n\n if (employees[i] == 99)\n {\n leaders.Add(i);\n }\n else if (!NotALeader.Contains(i))\n {\n leaders.Add(i);\n }\n }\n\n\n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "5629e8e8e7cf4077048d315ae8a1b48a", "src_uid": "a3a337c7b919e7dfd7ff45ebf59681b5", "apr_id": "fb7efbf1b0b1cc4143f71f3ffe508f5d", "difficulty": 1800, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.48516536964980544, "equal_cnt": 46, "replace_cnt": 27, "delete_cnt": 9, "insert_cnt": 10, "fix_ops_cnt": 46, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace ProblemSets\n{\n using System;\n using System.Collections.Generic;\n using System.Collections;\n using System.Linq;\n using System.Text;\n\n namespace LongPath\n {\n public class Problem420b\n {\n public static void Main(string[] args)\n {\n var input = Console.ReadLine().Split(' ').Select(x => int.Parse(x)).ToArray();\n var numberOfPeople = input[0];\n var numberOfMessage = input[1];\n Dictionary employees = new Dictionary();\n \n var NotALeader = new ArrayList();\n\n int lastPersonId = -1;\n for (int i = 0; i < numberOfMessage; i++)\n {\n\n var status = Console.ReadLine().Split(' ');\n var symbol = status[0][0];\n var id = int.Parse(status[1]);\n\n if (symbol == '+')\n {\n foreach (var pair in employees)\n {\n if (pair.Key == id) continue;\n // if others joined before me, I am not a leader\n if (pair.Value == 1)\n {\n NotALeader.Add(id);\n }\n // if other people joined and logged out before me, they are not a leader.\n // I am also not a leader unless I just logged out and logging back in\n if (pair.Value == 0)\n {\n NotALeader.Add(pair.Key);\n if (lastPersonId != id) NotALeader.Add(id);\n }\n }\n employees[id] = 1;\n }\n\n if (symbol == '-')\n {\n bool havePreviousRecord = employees.ContainsKey(id);\n\n // when I am logging out, if others are still logged in, i am not a leader\n foreach (var pair in employees)\n {\n if (pair.Key == id) continue;\n if (pair.Value == 1)\n {\n NotALeader.Add(id);\n }\n // if I have no record of me joining, then other who logged in (or logged in and out) after me are not a leader \n if (!havePreviousRecord)\n {\n if (pair.Value == 1 || pair.Value == 0) NotALeader.Add(pair.Key);\n }\n }\n\n employees[id] = 0;\n }\n lastPersonId = id;\n }\n\n var leaders = new ArrayList();\n for (int i = 1; i <= numberOfPeople; i++)\n {\n if (!NotALeader.Contains(i)) leaders.Add(i);\n }\n\n var numberOfLeader = leaders.Count;\n Console.WriteLine(numberOfLeader);\n\n foreach (var leader in leaders)\n {\n Console.Write(leader);\n Console.Write(\" \");\n }\n\n }\n }\n }\n\n\n}\n", "lang": "MS C#", "bug_code_uid": "96180a5a5fde6849c8a3a25252d51c82", "src_uid": "a3a337c7b919e7dfd7ff45ebf59681b5", "apr_id": "fb7efbf1b0b1cc4143f71f3ffe508f5d", "difficulty": 1800, "tags": ["implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.2840051274747187, "equal_cnt": 30, "replace_cnt": 21, "delete_cnt": 4, "insert_cnt": 6, "fix_ops_cnt": 31, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\n\nnamespace Problems\n{\n public class Problem420B\n {\n public static void Main(string[] args)\n {\n var nm = Console.ReadLine().Split(' ');\n var n = int.Parse(nm[0]);\n var m = int.Parse(nm[1]);\n\n var notLeaders = new bool[n];\n var present = new HashSet();\n var absent = new HashSet();\n\n int lastpersonToLeave = 0;\n for (int i = 0; i < m; i++)\n {\n var msg = Console.ReadLine().Split(' ');\n var action = msg[0][0];\n var id = int.Parse(msg[1]);\n\n if (action == '+')\n {\n if (present.Count > 0)\n {\n // Not the first guy to be in the session\n notLeaders[id - 1] = true;\n }\n\n present.Add(id);\n absent.Remove(id);\n\n if (lastpersonToLeave != 0 && lastpersonToLeave != id)\n {\n // Other people have left when current guy was absent\n // current guy is not leader\n notLeaders[id - 1] = true;\n }\n\n // Anyone who is absent cannot be leader, \n // because they are certainly not here when a new person is joining\n foreach (var absentee in absent)\n {\n notLeaders[absentee - 1] = true;\n }\n\n absent = new HashSet();\n }\n else\n {\n lastpersonToLeave = id;\n\n // Means anyone who is present now joined after current guy joined\n // None of them can be leader\n if (!present.Contains(id))\n {\n foreach (var presented in present)\n {\n notLeaders[presented - 1] = true;\n }\n }\n\n present.Remove(id);\n\n // Other people are present when current guy left\n // Current guy cannot be leader\n if (present.Count > 0)\n {\n notLeaders[id - 1] = true;\n }\n\n // Anyone who is absent for sure cannot be leader, \n // because they are for sure nto the last person to leave the room\n foreach (var absentee in absent)\n {\n notLeaders[absentee - 1] = true;\n }\n\n absent = new HashSet(); \n absent.Add(id);\n }\n }\n\n var k = notLeaders.Sum(notLeader => notLeader ? 0 : 1);\n Console.WriteLine(k);\n\n for (int i = 0; i < n; i++)\n {\n if (!notLeaders[i])\n {\n Console.Write(\"{0} \", i + 1);\n }\n }\n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "3bd96edf8754874d76444a5c6c74a668", "src_uid": "a3a337c7b919e7dfd7ff45ebf59681b5", "apr_id": "b1fac974c529a4040ee0d6a5c18b7091", "difficulty": 1800, "tags": ["implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9939849624060151, "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;\nclass Program\n{\n\tstatic void Main(string[] args)\n\t{\n\t\tstring[] str = Console.ReadLine().Split();\n\t\tlong N = long.Parse(str[0]);\n\t\tlong M = long.Parse(str[1]);\n\t\tlong ct = 0;\n\t\tfor(var i=1;i<=M;i++){\n\t\t\tfor(var j=1;j<=M;j++){\n\t\t\t\tif((i*i+j*j)%M==0){\n\t\t\t\t\tct += 1;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tlong ans = (N/M)*(N/M)*ct;\n\t\tlong ct2 = 0;\n\t\tfor(var i=1;i<=M;i++){\n\t\t\tfor(var j=1;j<=N%M;j++){\n\t\t\t\tif((i*i+j*j)%M==0){\n\t\t\t\t\tct2 += 1;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tans += ct2 * 2;\n\t\tlong ct3 = 0;\n\t\tfor(var i=1;i<=N%M;i++){\n\t\t\tfor(var j=1;j<=N%M;j++){\n\t\t\t\tif((i*i+j*j)%M==0){\n\t\t\t\t\tct3 += 1;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tans += ct3;\n\t\tConsole.Write(ans);\n\t}\n}", "lang": "Mono C#", "bug_code_uid": "90bf009f2652dacec5b3dd9d94f41a83", "src_uid": "2ec9e7cddc634d7830575e14363a4657", "apr_id": "4bb0e841e3fe584847e15a7c427dffa2", "difficulty": 1600, "tags": ["math", "number theory"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.9990323204954519, "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.Text;\n\nnamespace ConsoleApplication5\n{\n class Program\n {\n\n static void Main()\n {\n string[] vrem = Console.ReadLine().Split(':');\n char[] a = new char[5];\n char[] b = new char[5];\n int[] a1 = new int[5];\n int[] b1 = new int[5];\n\n\n for (int i = vrem[0].Length - 1; i >= 0; i--)\n {\n a[vrem[0].Length - 1 - i] = vrem[0][i];\n if (a[vrem[0].Length - 1 - i] >= 65 && a[vrem[0].Length - 1 - i] <= 90)\n a1[vrem[0].Length - 1 - i] = Convert.ToInt32(a[vrem[0].Length - 1 - i] - 55);\n else\n a1[vrem[0].Length - 1 - i] = Convert.ToInt32(a[vrem[0].Length - 1 - i] - 48);\n }\n for (int i = vrem[1].Length - 1; i >= 0; i--)\n {\n b[vrem[1].Length - 1 - i] = vrem[1][i];\n if (b[vrem[1].Length - 1 - i] >= 65 && b[vrem[1].Length - 1 - i] <= 90)\n b1[vrem[1].Length - 1 - i] = Convert.ToInt32(b[vrem[1].Length - 1 - i] - 55);\n else\n b1[vrem[1].Length - 1 - i] = Convert.ToInt32(b[vrem[1].Length - 1 - i] - 48);\n }\n\n\n int max = 0;\n for (int i = 0; i < a1.Length; i++)\n {\n if (max < a1[i])\n max = a1[i];\n if (max < b1[i])\n max = b1[i];\n }\n\n\n\n int[] otvet = new int[60];\n int k = max;\n\n double q = 0;\n double w = 0;\n while (k < 61)\n {\n k++;\n q = 0;\n w = 0;\n for (int i = a1.Length - 1; i >= 0; i--)\n q = q + a1[i] * Math.Pow(k, i);\n\n for (int i = b1.Length - 1; i >= 0; i--)\n w = w + b1[i] * Math.Pow(k, i);\n\n if (q <= 23 && w <= 59)\n otvet[k-1] = k;\n else\n break;\n }\n\n if (k == 600)\n Console.WriteLine(\"-1\");\n else if (k == max + 1)\n Console.WriteLine(\"0\");\n else\n {\n for (int i = 0; i < otvet.Length; i++)\n if (otvet[i] != 0)\n Console.Write(otvet[i] + \" \");\n } \n \n \n }\n }\n}", "lang": "Mono C#", "bug_code_uid": "906d99b4ee45a87921039d93d6c1c256", "src_uid": "c02dfe5b8d9da2818a99c3afbe7a5293", "apr_id": "cc5f8cfb5e64cc8ba75223c2b2d6c5b4", "difficulty": 1600, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9374138406396471, "equal_cnt": 5, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 4, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace CF526A {\n class Program {\n static void Main(string[] args) {\n int seg = int.Parse(Console.ReadLine());\n char[] segments = new char[seg];\n List platPos = new List();\n\n for(int i = 0; i < seg; i++) {\n char segType = (char)Console.Read();\n if(segType == '*') {\n platPos.Add(i);\n }\n segments[i] = segType;\n }\n\n bool isPossible = false;\n for(int i = 0, startPlat = platPos[i]; i < platPos.Count - 4; i++, startPlat = platPos[i]) {\n for(int jump = 1; jump < seg; jump++) {\n int count = 1;\n //Console.WriteLine(\"Jumplength = \" + jump);\n for(int j = 1; startPlat + j*jump < seg; j++) { //index through segments by jump length from given platform\n //Console.WriteLine(\"Jumped to pos \" + (startPlat + j * jump) + \" found \" + segments[startPlat + j * jump]);\n if(segments[startPlat + j*jump] == '*') {\n count++;\n } else {\n j = seg;\n }\n }\n if(count >= 5) {\n isPossible = true;\n jump = seg;\n i = platPos.Count - 4;\n }\n }\n }\n\n if(isPossible) {\n Console.WriteLine(\"yes\");\n } else {\n Console.WriteLine(\"no\");\n }\n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "001682675fee7a26ef86ebc7c127d992", "src_uid": "12d451eb1b401a8f426287c4c6909e4b", "apr_id": "144b26a601ce5ccbda7a58e22d0fe4eb", "difficulty": 1300, "tags": ["brute force", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9954663212435233, "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.Text;\n\nnamespace Codeforces\n{\n\tclass Program\n\t{\n\t\tstatic void Main(string[] args)\n\t\t{\n\t\t\tstring input1 = Console.ReadLine();\n\t\t\t//string input2 = Console.ReadLine();\n\n\t\t\t//var inputs1 = input1.Split(new[] { ' ' }, StringSplitOptions.RemoveEmptyEntries).Select(long.Parse).ToArray();\n\t\t\t//var inputs2 = input2.Split(new[] { ' ' }, StringSplitOptions.RemoveEmptyEntries).Select(int.Parse).ToArray();\n\n\t\t\tvar input = input1;\n\t\t\tvar words = new List();\n\t\t\tint index = -1;\n\t\t\twhile (input.Length > 0)\n\t\t\t{\n\t\t\t\tindex = input.IndexOf(\"WUB\");\n\t\t\t\tswitch (index) \n\t\t\t\t{\n\t\t\t\t\tcase -1:\n\t\t\t\t\t\twords.Add(input);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 0:\n\t\t\t\t\t\tinput = input.Substring(3);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\twords.Add(input.Substring(0, index));\n\t\t\t\t\t\tinput = input.Substring(index);\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tConsole.WriteLine(words.Aggregate((a, b) => $\"{a} {b}\"));\n\t\t}\n\n\t\t//private static long GCD(long a, long b)\n\t\t//{\n\t\t//\tlong max = Math.Max(a, b);\n\t\t//\tlong min = Math.Min(a, b);\n\n\t\t//\tif (min == 0)\n\t\t//\t{\n\t\t//\t\treturn max;\n\t\t//\t}\n\n\t\t//\ta = min;\n\t\t//\tb = max % min;\n\t\t//\treturn GCD(a, b);\n\t\t//}\n\n\t\t//private static long LCM(long a, long b)\n\t\t//{\n\t\t//\treturn Math.Abs(a * b) / GCD(a, b);\n\t\t//}\n\n\t\t//private static int Length(short[] a)\n\t\t//{\n\t\t//\tint firstItemIndex = 0;\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{\n\t\t//\t\t\tcontinue;\n\t\t//\t\t}\n\n\t\t//\t\tfirstItemIndex = i;\n\t\t//\t\tbreak;\n\t\t//\t}\n\n\t\t//\treturn a.Length - firstItemIndex;\n\t\t//}\n\n\t\t//private static short[] Subtract(short[] a, short[] b)\n\t\t//{\n\t\t//\tif (a.Length != b.Length)\n\t\t//\t{\n\t\t//\t\tthrow new ArgumentException();\n\t\t//\t}\n\n\t\t//\tshort[] result = new short[a.Length];\n\t\t//\tArray.Copy(a, result, a.Length);\n\t\t//\tfor (int i = result.Length - 1; i >= 0; i--)\n\t\t//\t{\n\t\t//\t\tif (result[i] < b[i])\n\t\t//\t\t{\n\t\t//\t\t\tint j = i - 1;\n\t\t//\t\t\twhile (result[j] == 0)\n\t\t//\t\t\t{\n\t\t//\t\t\t\tresult[j--] = 9;\n\t\t//\t\t\t}\n\n\t\t//\t\t\tresult[j]--;\n\t\t//\t\t\tresult[i] += 10;\n\t\t//\t\t}\n\n\t\t//\t\tresult[i] -= b[i];\n\t\t//\t}\n\n\t\t//\treturn result;\n\t\t//}\n\n\t\t//private static short[] Multiply(short[] a, int b)\n\t\t//{\n\t\t//\tshort[] result = new short[a.Length];\n\t\t//\tfor (int i = a.Length - 1; i > 0; i--)\n\t\t//\t{\n\t\t//\t\tint temp = a[i] * b;\n\t\t//\t\tresult[i] = (short)(result[i] + temp % 10);\n\t\t//\t\tresult[i - 1] = (short)(result[i - 1] + temp / 10);\n\t\t//\t}\n\n\t\t//\treturn result;\n\t\t//}\n\n\t\t//private static int Mod(short[] a, int b)\n\t\t//{\n\t\t//\tint rest = 0, i = 0;\n\t\t//\twhile (i < a.Length)\n\t\t//\t{\n\t\t//\t\tint d = 10 * rest + a[i];\n\t\t//\t\twhile (d < b && i < a.Length - 1)\n\t\t//\t\t{\n\t\t//\t\t\td = 10 * d + a[++i];\n\t\t//\t\t}\n\n\t\t//\t\trest = d % b;\n\t\t//\t\ti++;\n\t\t//\t}\n\n\t\t//\treturn rest;\n\t\t//}\n\n\t\t//private static short[] Divide(short[] a, int b)\n\t\t//{\n\t\t//\tshort[] result = new short[a.Length];\n\t\t//\tint rest = 0, i = 0;\n\t\t//\twhile (i < a.Length)\n\t\t//\t{\n\t\t//\t\tint d = 10 * rest + a[i];\n\t\t//\t\twhile (d < b && i < a.Length - 1)\n\t\t//\t\t{\n\t\t//\t\t\td = 10 * d + a[++i];\n\t\t//\t\t}\n\n\t\t//\t\tresult[i] = (short)(d / b);\n\t\t//\t\trest = d % b;\n\t\t//\t\ti++;\n\t\t//\t}\n\n\t\t//\treturn result;\n\t\t//}\n\t}\n}\n", "lang": "Mono C#", "bug_code_uid": "cb6177dc6846db498372e21241c411b8", "src_uid": "edede580da1395fe459a480f6a0a548d", "apr_id": "c1cb8d855486b0ca8c516d513a2aa3aa", "difficulty": 900, "tags": ["strings"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.8856964397251718, "equal_cnt": 16, "replace_cnt": 8, "delete_cnt": 4, "insert_cnt": 4, "fix_ops_cnt": 16, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Collections;\n\nnamespace SolvingAlgorithms\n{\n class Program\n {\n static void Main(string[] args)\n {\n\n string Input1;\n Input1 = Console.ReadLine();\n string[] split = Input1.Split(' ');\n int n, m, output=0;\n n = Convert.ToInt32(split[0]);\n m = Convert.ToInt32(split[1]);\n double x=0;\n \n if (m > n) {\n Console.WriteLine(\"-1\");\n }\n else\n {\n x= m*2;\n x=n/m;\n x=Math.Ceiling(x);\n Console.writeLine(x);\n }\n \n\n\n\n }\n\n }\n}", "lang": "Mono C#", "bug_code_uid": "95208be6bbe3f4ba289f33ae5f2b127c", "src_uid": "0fa526ebc0b4fa3a5866c7c5b3a4656f", "apr_id": "98ea08a3c1d135c9c4182fa4e30f2026", "difficulty": 1000, "tags": ["math", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.02422145328719723, "equal_cnt": 15, "replace_cnt": 11, "delete_cnt": 4, "insert_cnt": 1, "fix_ops_cnt": 16, "bug_source_code": "#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n\nusing namespace std;\n\n#define forn(i,n) for (int i = 0;i < int(n);i++)\n#define ford(i,n) for (int i = n-1;i >=0;i--)\n#define fore(i,l,r) for (int i = int(l);i < int(r);i++)\n#define forv(a) for(int i = 0;i < (a).size();i++) cin >> a[i]\n#define correct(x,n) (((x) >= 0) && ((x) < n))\n#define sort_all(a) sort((a).begin(),(a).end())\n#define mp(a,b) make_pair((a),(b))\n#define all(a) (a).begin(),(a).end()\n#define pb(a) push_back(a)\n#define rnd() (rand() + (RAND_MAX+1)*rand())\n#define fi first\n#define se second\n#define V(A) vector\n//#define DEBUG_\n\n//#define x first\n//#define y second\n\ntypedef long long li;\ntypedef vector vi;\ntypedef vector
  • vli;\ntypedef pair pi;\ntypedef vector vpi;\ntypedef vector vvi;\ntypedef vector vvli;\ntypedef long double ld;\ntypedef pair Point;\n\nconst ld Eps = 1e-9;\n\nvector> fact(li b)\n{\n\tvector> res;\n\tfor (li i = 2; i*i <= b; i++)\n\t{\n\t\tif (b % i != 0)\n\t\t\tcontinue;\n\t\tres.push_back(mp(i, 0));\n\t\twhile (b % i == 0)\n\t\t{\n\t\t\tb /= i;\n\t\t\tres.back().second++;\n\t\t}\n\t}\n\n\tif (b != 1)\n\t\tres.push_back(mp(b, 1));\n\n\treturn res;\n}\n\nint main()\n{\n\t//freopen(\"in.txt\", \"r\", stdin);\n\tios_base::sync_with_stdio(false);\n\tcin.tie(nullptr);\n\tcout.tie(nullptr);\n\tli n, b;\n\tcin >> n >> b;\n\tvector> a = fact(b);\n\n\tli mn = 2000000000000000000;\n\n\tfor (auto pr : a)\n\t{\n\t\tli p = pr.first;\n\t\tli k = pr.second;\n\t\tli pw = 0;\n\t\tfor (li n1 = n / p; n1 > 0; n1 /= p)\n\t\t\tpw += n1;\n\t\tmn = min(mn, pw / k);\n\t}\n\n\tcout << mn << endl;\n}", "lang": "Mono C#", "bug_code_uid": "e84a073b151457593946a45d02dfef56", "src_uid": "d54201591f7284da5e9ce18984439f4e", "apr_id": "5840f6a40f0e50976a5aff6e8b89a25c", "difficulty": 800, "tags": ["greedy", "brute force", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9707459775719162, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 2, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "using LinkedList;\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace VaniaAndLight\n{\n class Program\n {\n static void Main(string[] args)\n {\n int x, y, z, a, b, c;\n string[] arrayXYZ = Console.ReadLine().Split(new char[] { ' '}, StringSplitOptions.RemoveEmptyEntries);\n string[] arrayABC = Console.ReadLine().Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries);\n x = int.Parse(arrayXYZ[0]);\n y = int.Parse(arrayXYZ[1]);\n z = int.Parse(arrayXYZ[2]);\n a = int.Parse(arrayABC[0]);\n b = int.Parse(arrayABC[1]);\n c = int.Parse(arrayABC[2]);\n\n if (x > a)\n {\n Console.WriteLine(\"NO\");\n return;\n }\n else\n {\n a -= x;\n }\n\n if (y > (a + b))\n {\n Console.WriteLine(\"NO\");\n return;\n }\n else\n {\n if (y - a > 0)\n {\n y -= a;\n a = 0;\n b -= y;\n }\n else\n {\n a -= y;\n }\n }\n\n if (z > (a + b + c))\n {\n Console.WriteLine(\"NO\");\n return;\n }\n else\n {\n Console.WriteLine(\"YES\");\n }\n }\n\n static int rank(int key, int[] a)\n {\n int lo = 0;\n int hi = a.Length;\n\n while (lo <= hi)\n {\n int mid = lo + (hi - lo) / 2;\n if (key < a[mid])\n {\n hi = mid - 1;\n }\n else if (key > a[mid])\n {\n lo = mid + 1;\n }\n else\n {\n return mid;\n }\n }\n return -1;\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "873777ed0d2615d79f23658be7f79283", "src_uid": "d54201591f7284da5e9ce18984439f4e", "apr_id": "37eff8e3246b3783db0b605d54996b58", "difficulty": 800, "tags": ["greedy", "brute force", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C#"} {"similarity_score": 0.9972727272727273, "equal_cnt": 4, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 3, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Text;\n\nnamespace CodeForcesProblems.A\n{\n class A111_Got_Any_Grapes\n {\n public static void Main()\n {\n while(true)\n {\n string[] a = Console.ReadLine().Split(' ');\n int A = int.Parse(a[0]);\n int D = int.Parse(a[1]);\n int M = int.Parse(a[2]);\n a = Console.ReadLine().Split(' ');\n int g = int.Parse(a[0]);\n int p = int.Parse(a[1]);\n int b = int.Parse(a[2]);\n bool f = true;\n if (A <= g)\n g -= A;\n else\n f = false;\n g += p;\n if (D <= g)\n g -= D;\n else\n f = false;\n g += b;\n\n if (M > g)\n f = false;\n if(f)\n Console.WriteLine(\"YES\");\n else\n Console.WriteLine(\"NO\");\n }\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "a978c1bf9b6850d77e42784f3995160a", "src_uid": "d54201591f7284da5e9ce18984439f4e", "apr_id": "6cd001f4c9b17a2904da2ea3e0cc4826", "difficulty": 800, "tags": ["greedy", "brute force", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.28483920367534454, "equal_cnt": 30, "replace_cnt": 14, "delete_cnt": 5, "insert_cnt": 11, "fix_ops_cnt": 30, "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 a, b, c,x,y,z;\n a = Convert.ToInt16(Console.ReadLine());\n b = Convert.ToInt16(Console.ReadLine());\n c = Convert.ToInt16(Console.ReadLine());\n x = Convert.ToInt16(Console.ReadLine());\n y = Convert.ToInt16(Console.ReadLine());\n z = Convert.ToInt16(Console.ReadLine());\n if (a <= x)\n {\n x -= a;\n if (b <= x + y)\n {\n if (x >= b)\n {\n x -= b;\n }\n else\n {\n if (y >= b)\n {\n y -= b;\n }\n else\n {\n x -= b;\n b = 0;\n y -= b;\n if (c <= x + y + z)\n Console.WriteLine(\"YES\");\n else\n Console.WriteLine(\"No\");\n }\n }\n\n }\n else\n Console.WriteLine(\"NO\");\n }\n else\n Console.WriteLine(\"NO\");\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "cd01142623aadf33a6d9297a05c28d8b", "src_uid": "d54201591f7284da5e9ce18984439f4e", "apr_id": "61808cc4eb9c29cdd01a4913d3924973", "difficulty": 800, "tags": ["greedy", "brute force", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.722254844392249, "equal_cnt": 29, "replace_cnt": 21, "delete_cnt": 2, "insert_cnt": 7, "fix_ops_cnt": 30, "bug_source_code": "public class Problem\n\nstatic void Main()\n{\n\tif (Eat())\n\t\tConsole.WriteLine(\"YES\");\n\telse\n\t\tConsole.WriteLine(\"NO\");\n\t\n}\n\nstatic bool Eat()\n{\n\tvar s1 = Console.ReadLine();\n\tvar s2 = Console.ReadLine();\n\tvar toEats = s1.Split(' ').Select(s => int.Parse(s)).ToArray();\n\tvar grapes = s2.Split(' ').Select(s => int.Parse(s)).ToArray();\n\tvar andrew = toEats[0];\n\tvar dmitry = toEats[1];\n\tvar michael = toEats[2];\n\n\tvar green = grapes[0];\n\tvar purple = grapes[1];\n\tvar black = grapes[2];\n\n\tif (andrew > green) return false;\n\tgreen = green - andrew;\n\t\n\tif (dmitry > green + purple) return false;\n\tif (michael > black + (green + purple) - dmitry) return false;\n\treturn true;\n}\n}", "lang": "Mono C#", "bug_code_uid": "9b5f9821b1b39a09b85a7baef6796ae4", "src_uid": "d54201591f7284da5e9ce18984439f4e", "apr_id": "c664d4db06c82f41d346713094356c23", "difficulty": 800, "tags": ["greedy", "brute force", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9848942598187311, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "using System;\nusing System.Linq;\n\nnamespace ACM\n{\n class Program\n {\n static void Main()\n {\n var input = Console.ReadLine();\n var a = input.Count(c => c == '-');\n var b = input.Count(c => c == 'o');\n Console.WriteLine(a % b == 0 ? \"YES\" : \"NO\");\n }\n }\n}", "lang": "Mono C#", "bug_code_uid": "cdf00d8b2a3f2ee596234d171ae3fed0", "src_uid": "6e006ae3df3bcd24755358a5f584ec03", "apr_id": "fc6b718ab7dc0f363e00317c9248b390", "difficulty": 900, "tags": ["math", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.8990318118948825, "equal_cnt": 6, "replace_cnt": 1, "delete_cnt": 2, "insert_cnt": 2, "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 Codeforces\n{\n class Program\n {\n static void Main(string[] args)\n {\n string s = Console.ReadLine();\n int numbLink = 0, numbPearl = 0;\n foreach (char c in s)\n {\n if (c == '-') numbLink++;\n else numbPearl ++;\n }\n if(numbLink % numbPearl == 0)\n {\n Console.WriteLine(\"YES\");\n }else\n {\n Console.WriteLine(\"NO\");\n }\n //Console.ReadKey();\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "f6c5cbd739351629985cbfc07fd01381", "src_uid": "6e006ae3df3bcd24755358a5f584ec03", "apr_id": "830e4cae0a210761f5cd0d29dfa32b65", "difficulty": 900, "tags": ["math", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C#"} {"similarity_score": 0.8734982332155476, "equal_cnt": 7, "replace_cnt": 2, "delete_cnt": 2, "insert_cnt": 2, "fix_ops_cnt": 6, "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 numbLink = 0, numbPearl = 0;\n foreach (char c in s)\n {\n if (c == '-') numbLink++;\n else numbPearl ++;\n }\n if(numbLink % numbPearl == 0)\n {\n Console.WriteLine(\"YES\");\n }else\n {\n Console.WriteLine(\"NO\");\n }\n=\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "499478c2e7b8ccd88c30be6330b8cacf", "src_uid": "6e006ae3df3bcd24755358a5f584ec03", "apr_id": "830e4cae0a210761f5cd0d29dfa32b65", "difficulty": 900, "tags": ["math", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.996274217585693, "equal_cnt": 4, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 4, "fix_ops_cnt": 4, "bug_source_code": "using System;\n public class Program\n {\n public static void Main(string[] args)\n {\n int[] aClassCounter, bClassCounter;\n {\n string[] input = Console.In.ReadToEnd().Split(new char[] { '\\r', '\\n', ' ', '\\t' }, StringSplitOptions.RemoveEmptyEntries);\n aClassCounter = new int[6];\n bClassCounter = new int[6];\n for(int i = 1, j = int.Parse(input[0])+1; jbClassCounter[i])\n {\n if ((aClassCounter[i] - bClassCounter[i]) % 2 == 0)\n aClassCounter[0] += (aClassCounter[i] - bClassCounter[i]) / 2;\n else { aClassCounter[0]=-1; break; }\n }\n else\n {\n if ((bClassCounter[i] - aClassCounter[i]) % 2 ==1)\n { aClassCounter[0] = -1; break;}\n }\n }\n Console.WriteLine(aClassCounter[0]);\n }", "lang": "MS C#", "bug_code_uid": "6d5724a93e430987f16932e41520bb07", "src_uid": "47da1dd95cd015acb8c7fd6ae5ec22a3", "apr_id": "aaaa890f7435eab60422547f4b2a04b4", "difficulty": 1000, "tags": ["math", "constructive algorithms"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.988442487616951, "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.Text;\n\nnamespace Guess_the_Tree\n{\n internal class Program\n {\n private static readonly StreamReader reader =\n new StreamReader(Console.OpenStandardInput(1024 * 10), Encoding.ASCII, false, 1024 * 10);\n\n private static readonly StreamWriter writer =\n new StreamWriter(Console.OpenStandardOutput(1024 * 10), Encoding.ASCII, 1024 * 10);\n\n private static void Main(string[] args)\n {\n int n = int.Parse(reader.ReadLine());\n\n string[] ss = reader.ReadLine().Split(' ');\n int[] nn = new int[n];\n for (int i = 0; i < n; i++)\n {\n nn[i] = int.Parse(ss[i]);\n }\n\n Array.Sort(nn);\n\n bool[] used = new bool[n];\nbool ok = true;\n for (int i = 0; i < n; i++)\n {\n if (nn[i]>1)\n {\n int count = nn[i] - 1;\n int p = 0;\n for (int j = i; j >=0; j--)\n {\n if (!used[j] && nn[j]<=count)\n {\n if (p == 0 && nn[j] == count)\n continue;\n used[j] = true;\n count -= nn[j];\n p++;\n }\n if (count==0)\n break;\n }\n if (count!=0)\n {\n ok = false;\n break;\n }\n }\n }\n\n \n\n writer.WriteLine(\"{0}\", ok ? \"YES\" : \"NO\");\n writer.Flush();\n }\n }\n}", "lang": "MS C#", "bug_code_uid": "d3cf0051b590150e7c47e53f848b70ef", "src_uid": "ed0925cfaee961a3ceebd13b3c96a15a", "apr_id": "c05b69f900c035ae4294760d04eabe3b", "difficulty": 2300, "tags": ["data structures", "dfs and similar", "constructive algorithms"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.982862389064572, "equal_cnt": 7, "replace_cnt": 2, "delete_cnt": 4, "insert_cnt": 1, "fix_ops_cnt": 7, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nclass Solver\n{\n void Solve()\n {\n var n = sc.Integer();\n var m = sc.Integer();\n var hori = sc.ScanLine().Select(x => x == '>' ? 1 : -1).ToArray();\n var ver = sc.ScanLine().Select(x => x == 'v' ? 1 : -1).ToArray();\n var isGood = new bool[n, m];\n for (int r = 0; r < n; r++)\n {\n for (int c = 0; c < m; c++)\n {\n var good = false;\n var used = new bool[n, m];\n var qr = new Queue();\n var qc = new Queue();\n qr.Enqueue(r);\n qc.Enqueue(c);\n while (qr.Any())\n {\n var pr = qr.Dequeue();\n var pc = qc.Dequeue();\n if (isGood[pr, pc])\n {\n good = true;\n break;\n }\n used[pr, pc] = true;\n //horizon\n {\n var nc = pc + hori[pr];\n if (nc < 0 || nc >= m || used[pr, nc]) { }\n else\n {\n\n qr.Enqueue(pr);\n qc.Enqueue(nc);\n }\n\n }\n //vertical\n {\n var nr = pr + ver[pc];\n if (nr < 0 || nr >= n || used[nr, pc]) { }\n else\n {\n qr.Enqueue(nr);\n qc.Enqueue(pc);\n }\n }\n }\n if (good)\n {\n isGood[r, c] = true;\n continue;\n }\n for (int i = 0; i < n; i++)\n for (int j = 0; j < m; j++)\n if (!used[i, j])\n {\n Printer.PrintLine(\"NO\");\n return;\n }\n }\n }\n Printer.PrintLine(\"YES\");\n }\n\n static void Main()\n {\n#if DEBUG\n var ostream = new System.IO.FileStream(\"debug.txt\", System.IO.FileMode.Create, System.IO.FileAccess.Write);\n var iStream = new System.IO.FileStream(\"input.txt\", System.IO.FileMode.Open, System.IO.FileAccess.Read, System.IO.FileShare.ReadWrite);\n Console.SetIn(new System.IO.StreamReader(iStream));\n System.Diagnostics.Debug.AutoFlush = true;\n System.Diagnostics.Debug.Listeners.Add(new System.Diagnostics.TextWriterTraceListener(new System.IO.StreamWriter(ostream, System.Text.Encoding.UTF8)));\n try\n {\n#endif\n var solver = new Solver();\n solver.Solve();\n#if DEBUG\n }\n catch (Exception ex)\n {\n Console.WriteLine(ex.Message);\n Console.WriteLine(ex.StackTrace);\n }\n Console.ReadKey(true);\n#endif\n }\n _Scanner sc = new _Scanner();\n\n}\n\nstatic public class Printer\n{\n static readonly private System.IO.TextWriter writer;\n static readonly private System.Globalization.CultureInfo info;\n static string Separator { get; set; }\n static Printer()\n {\n writer = Console.Out;\n info = System.Globalization.CultureInfo.InvariantCulture;\n Separator = \" \";\n }\n\n static public void Print(int num) { writer.Write(num.ToString(info)); }\n static public void Print(int num, string format) { writer.Write(num.ToString(format, info)); }\n static public void Print(long num) { writer.Write(num.ToString(info)); }\n static public void Print(long num, string format) { writer.Write(num.ToString(format, info)); }\n static public void Print(double num) { writer.Write(num.ToString(info)); }\n static public void Print(double num, string format) { writer.Write(num.ToString(format, info)); }\n static public void Print(string str) { writer.Write(str); }\n static public void Print(string format, params object[] arg) { writer.Write(format, arg); }\n static public void Print(IEnumerable sources) { writer.Write(sources.AsString()); }\n static public void Print(params object[] arg)\n {\n var res = new System.Text.StringBuilder();\n foreach (var x in arg)\n {\n res.AppendFormat(info, \"{0}\", x);\n if (!string.IsNullOrEmpty(Separator))\n res.Append(Separator);\n }\n writer.Write(res.ToString(0, res.Length - Separator.Length));\n }\n static public void Print(IEnumerable sources)\n {\n var res = new System.Text.StringBuilder();\n foreach (var x in sources)\n {\n res.AppendFormat(info, \"{0}\", x);\n if (string.IsNullOrEmpty(Separator))\n res.Append(Separator);\n }\n writer.Write(res.ToString(0, res.Length - Separator.Length));\n }\n static public void PrintLine(int num) { writer.WriteLine(num.ToString(info)); }\n static public void PrintLine(int num, string format) { writer.WriteLine(num.ToString(format, info)); }\n static public void PrintLine(long num) { writer.WriteLine(num.ToString(info)); }\n static public void PrintLine(long num, string format) { writer.WriteLine(num.ToString(format, info)); }\n static public void PrintLine(double num) { writer.WriteLine(num.ToString(info)); }\n static public void PrintLine(double num, string format) { writer.WriteLine(num.ToString(format, info)); }\n static public void PrintLine(string str) { writer.WriteLine(str); }\n static public void PrintLine(string format, params object[] arg) { writer.WriteLine(format, arg); }\n static public void PrintLine(IEnumerable sources) { writer.WriteLine(sources.AsString()); }\n static public void PrintLine(params object[] arg)\n {\n var res = new System.Text.StringBuilder();\n foreach (var x in arg)\n {\n res.AppendFormat(info, \"{0}\", x);\n if (!string.IsNullOrEmpty(Separator))\n res.Append(Separator);\n }\n writer.WriteLine(res.ToString(0, res.Length - Separator.Length));\n }\n static public void PrintLine(IEnumerable sources)\n {\n var res = new System.Text.StringBuilder();\n foreach (var x in sources)\n {\n res.AppendFormat(info, \"{0}\", x);\n if (!string.IsNullOrEmpty(Separator))\n res.Append(Separator);\n }\n writer.WriteLine(res.ToString(0, res.Length - Separator.Length));\n }\n static public void PrintLine(System.Linq.Expressions.Expression> ex)\n {\n var res = ex.Parameters[0];\n writer.WriteLine(res.Name);\n }\n}\npublic class _Scanner\n{\n readonly private System.Globalization.CultureInfo info;\n readonly System.IO.TextReader reader;\n string[] buffer = new string[0];\n int position;\n\n public char[] Separator { get; set; }\n public _Scanner(System.IO.TextReader reader = null, string separator = null, System.Globalization.CultureInfo info = null)\n {\n\n this.reader = reader ?? Console.In;\n if (string.IsNullOrEmpty(separator))\n separator = \" \";\n this.Separator = separator.ToCharArray();\n this.info = info ?? System.Globalization.CultureInfo.InvariantCulture;\n }\n public string Scan()\n {\n if (this.position < this.buffer.Length)\n return this.buffer[this.position++];\n this.buffer = this.reader.ReadLine().Split(this.Separator, StringSplitOptions.RemoveEmptyEntries);\n this.position = 0;\n return this.buffer[this.position++];\n }\n\n public string[] ScanToEndLine()\n {\n if (this.position >= this.buffer.Length)\n return this.reader.ReadLine().Split(this.Separator, StringSplitOptions.RemoveEmptyEntries);\n var size = this.buffer.Length - this.position;\n var ar = new string[size];\n Array.Copy(this.buffer, position, ar, 0, size);\n return ar;\n\n }\n\n public string ScanLine()\n {\n if (this.position >= this.buffer.Length)\n return this.reader.ReadLine();\n else\n {\n var sb = new System.Text.StringBuilder();\n for (; this.position < buffer.Length; this.position++)\n {\n sb.Append(this.buffer[this.position]);\n sb.Append(' ');\n }\n return sb.ToString();\n }\n }\n public string[] ScanArray(int length)\n {\n var ar = new string[length];\n for (int i = 0; i < length; i++)\n {\n ar[i] = this.Scan();\n }\n return ar;\n }\n\n public int Integer()\n {\n return int.Parse(this.Scan(), info);\n }\n public long Long()\n {\n return long.Parse(this.Scan(), info);\n }\n public double Double()\n {\n return double.Parse(this.Scan(), info);\n }\n public double Double(string str)\n {\n return double.Parse(str, info);\n }\n\n public int[] IntArray(int length)\n {\n var a = new int[length];\n for (int i = 0; i < length; i++)\n a[i] = this.Integer();\n return a;\n }\n public long[] LongArray(int length)\n {\n var a = new long[length];\n for (int i = 0; i < length; i++)\n a[i] = this.Long();\n return a;\n }\n public double[] DoubleArray(int length)\n {\n var a = new double[length];\n for (int i = 0; i < length; i++)\n a[i] = this.Double();\n return a;\n }\n\n}\nstatic public partial class EnumerableEx\n{\n static public string AsString(this IEnumerable source)\n {\n return new string(source.ToArray());\n }\n static public IEnumerable Enumerate(this int count, Func selector)\n {\n return Enumerable.Range(0, count).Select(x => selector(x));\n }\n}\n", "lang": "MS C#", "bug_code_uid": "4607b17a9c77d91ce59089a819320138", "src_uid": "eab5c84c9658eb32f5614cd2497541cf", "apr_id": "077cd0a5c942cd70f270c3ebf374132f", "difficulty": 1400, "tags": ["graphs", "brute force", "dfs and similar", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "delete", "lang_cluster": "C#"} {"similarity_score": 0.9790628115653041, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "using System;\nusing System.Linq;\nnamespace codeforces\n{\n class Program\n {\n static void Main(string[] args)\n {\n int[] nk = Console.ReadLine().Split().Select(x => int.Parse(x)).ToArray();\n int nowPage = nk[1];\n int rez = 1;\n int i = 1;\n while (nowPage= c)\n {\n Console.WriteLine(day);\n break;\n }\n }\n }\n }\n}", "lang": "Mono C#", "bug_code_uid": "63adcba63a7f55414989bbc03cb6572a", "src_uid": "b743110117ce13e2090367fd038d3b50", "apr_id": "d1c66fab61ef202e881d7dfccc96a6c3", "difficulty": 900, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "C#"} {"similarity_score": 0.9985315712187959, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "using System;\nusing System.Linq;\n\nnamespace Contest\n{\n class Program\n {\n static void Main(string[] args)\n {\n int[] str1 = Console.ReadLine().Split(' ').Select(int.Parse).ToArray();\n int[] a = Console.ReadLine().Split(' ').Select(int.Parse).ToArray();\n\n int n = str1[0];\n int m = str1[1] - 1;\n int k = str1[2];\n\n int distance1 = 0;\n for (int i = m + 1; i <= n; ++i)\n {\n if (a[i] != 0 && a[i] <= k)\n {\n distance1 = (i - m) * 10;\n break;\n }\n }\n\n int distance2 = 0;\n for (int i = m - 1; i >= 0; --i)\n {\n if (a[i] != 0 && a[i] <= k)\n {\n distance2 = (m - i) * 10;\n break;\n }\n }\n\n int result;\n if (distance1 == 0)\n {\n result = distance2;\n }\n else if (distance2 == 0)\n {\n result = distance1;\n }\n else\n {\n result = Math.Min(distance1, distance2);\n }\n\n Console.WriteLine(result);\n ///////////////////////////////\n //Console.ReadKey();\n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "bc6e42bdc2df21d2daf163134a9ac299", "src_uid": "57860e9a5342a29257ce506063d37624", "apr_id": "620d2f666fd385d385a0bb275161c7cd", "difficulty": 800, "tags": ["brute force", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.9973890339425587, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "using System;\n\nnamespace BuyAShovel\n{\n class Program\n {\n static void Main(string[] args)\n {\n string[] input = Console.ReadLine().Split();\n\n int price = Convert.ToInt32(input[0]);\n int change = Convert.ToInt32(input[1]);\n\n bool paid = false;\n\n int curentPrice = price;\n int items = 1;\n\n while (paid == false)\n {\n if (curentPrice % 10 != 0 || (curentPrice - change) % 10 != 0)\n {\n items++;\n curentPrice += price;\n }\n else\n {\n paid = true;\n }\n }\n\n Console.WriteLine(items);\n }\n }\n}\n", "lang": ".NET Core C#", "bug_code_uid": "f08c20960321d9741591732d44f6d893", "src_uid": "18cd1cd809df4744bb7bcd7cad94e2d3", "apr_id": "1706b58656dfbe2a08357455d9c5b111", "difficulty": 800, "tags": ["brute force", "math", "constructive algorithms", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.8490566037735849, "equal_cnt": 9, "replace_cnt": 5, "delete_cnt": 2, "insert_cnt": 2, "fix_ops_cnt": 9, "bug_source_code": "using System;\nusing System.Collections.Generic;\nnamespace shoval\n{\n class Program\n {\n static void Main(string[] args)\n {\n string[] input = Console.ReadLine().Split(' ');\n int sum = 1, TotalPrice = 0;\n int Price = int.Parse(input[0];\n r = int.Parse(input[1]);\n TotalPrice = x ;\n while (true)\n {\n if ((x*sum) % 10 ==0 || (sum*x) % 10 == Price)\n break;\n TotalPrice +=x;\n sum++;\n }\n Console.WriteLine(sum);\n }\n }\n}", "lang": "Mono C#", "bug_code_uid": "3191ba604f94f3fa6869be8d0c3e71c4", "src_uid": "18cd1cd809df4744bb7bcd7cad94e2d3", "apr_id": "2d20945b511fbb8b6462b0f084341f94", "difficulty": 800, "tags": ["brute force", "math", "constructive algorithms", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.8383500557413601, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "using System;\nusing System.Linq;\nusing System.Collections.Generic;\n\t\t\t\t\t\npublic class Program\n{\n\tpublic static void Main()\n\t{\n\t\tvar arr= Console.ReadLine().Split();\n int n=int.Parse(arr[0]);\n\t\tint r=int.Parse(arr[1]);\n\t\tint p=0;\n\t\t\n\t\tfor(int i=1; i testInput = new Queue(string.Format(@\"\n\n5 2 1 4 5\n\").Split(new[] { Environment.NewLine }, StringSplitOptions.RemoveEmptyEntries));\n#endif\n\n\t\tstatic string str(double a)\n\t\t{\n\t\t\treturn a.ToString(\"0.0000000000\", System.Globalization.CultureInfo.InvariantCulture);\n\t\t}\n\n\t\tstatic long calc(long val)\n\t\t{\n\t\t\tif (val * k >= d)\n\t\t\t\treturn long.MaxValue;\n\n\t\t\tlong res = val * ((a * k) + t);\n\t\t\tlong rem = d - val * k;\n\t\t\tlong last = Math.Min(k, rem);\n\t\t\tres += last * a;\n\t\t\trem -= last;\n\t\t\tres += rem * b;\n\t\t\treturn res;\n\t\t}\n\n\t\tstatic long d, k, a, b, t;\n\t\tstatic string Solve()\n\t\t{\n\t\t\tchecked\n\t\t\t{\n\t\t\t\tread(out d, out k, out a, out b, out t);\n\n\t\t\t\tlong left = 0;\n\t\t\t\tlong right = d / k + 1;\n\n\t\t\t\twhile (left < right)\n\t\t\t\t{\n\t\t\t\t\tlong mid = (left + right) >> 1;\n\t\t\t\t\tif (calc(mid) < calc(mid + 1))\n\t\t\t\t\t{\n\t\t\t\t\t\tright = mid;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tleft = mid + 1;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\n\n\t\t\t\treturn calc(left).ToString();\n\t\t\t}\n\t\t}\n#endif\n\t\t#endregion\n\n\t\t// Everything after this comment is template code\n\n\t\tprivate static T read()\n\t\t{\n\t\t\treturn (T)Convert.ChangeType(read(), typeof(T));\n\t\t}\n\n\t\tprivate static T[] readMany()\n\t\t{\n\t\t\treturn readMany(' ');\n\t\t}\n\n\t\tprivate static _[] readMany<_>(params char[] ___)\n\t\t{\n\t\t\treturn read().Split(___).Select(__ => (_)Convert.ChangeType(__, typeof(_))).ToArray();\n\t\t}\n\n\t\tprivate static string[] readMany()\n\t\t{\n\t\t\treturn readMany();\n\t\t}\n\n\t\tprivate static T[][] readMany(int n)\n\t\t{\n\t\t\tT[][] res = new T[n][];\n\t\t\tfor (int i = 0; i < n; i++)\n\t\t\t{\n\t\t\t\tres[i] = readMany();\n\t\t\t}\n\t\t\treturn res;\n\t\t}\n\n\t\tprivate static T[][] readField(int height, Func map)\n\t\t{\n\t\t\tT[][] res = new T[height][];\n\t\t\tfor (int _ = 0; _ < height; _++)\n\t\t\t{\n\t\t\t\tres[_] = read().Select(c => map(c)).ToArray();\n\t\t\t}\n\t\t\treturn res;\n\t\t}\n\n\t\tprivate static char[][] readField(int height)\n\t\t{\n\t\t\treturn readField(height, c => c);\n\t\t}\n\n\t\tprivate static T[][] readField(int height, Dictionary dic)\n\t\t{\n\t\t\treturn readField(height, c => dic[c]);\n\t\t}\n\n\t\tprivate static void read(out T1 t1)\n\t\t{\n\t\t\tvar vals = readMany();\n\t\t\tt1 = (T1)Convert.ChangeType(vals[0], typeof(T1));\n\t\t}\n\n\t\tprivate static void read(out T1 t1, out T2 t2)\n\t\t{\n\t\t\tvar vals = readMany();\n\t\t\tt1 = (T1)Convert.ChangeType(vals[0], typeof(T1));\n\t\t\tt2 = (T2)Convert.ChangeType(vals[1], typeof(T2));\n\t\t}\n\n\t\tprivate static void read(out T1 t1, out T2 t2, out T3 t3)\n\t\t{\n\t\t\tvar vals = readMany();\n\t\t\tt1 = (T1)Convert.ChangeType(vals[0], typeof(T1));\n\t\t\tt2 = (T2)Convert.ChangeType(vals[1], typeof(T2));\n\t\t\tt3 = (T3)Convert.ChangeType(vals[2], typeof(T3));\n\t\t}\n\n\t\tprivate static void read(out T1 t1, out T2 t2, out T3 t3, out T4 t4)\n\t\t{\n\t\t\tvar vals = readMany();\n\t\t\tt1 = (T1)Convert.ChangeType(vals[0], typeof(T1));\n\t\t\tt2 = (T2)Convert.ChangeType(vals[1], typeof(T2));\n\t\t\tt3 = (T3)Convert.ChangeType(vals[2], typeof(T3));\n\t\t\tt4 = (T4)Convert.ChangeType(vals[3], typeof(T4));\n\t\t}\n\n\t\tprivate static void read(out T1 t1, out T2 t2, out T3 t3, out T4 t4, out T5 t5)\n\t\t{\n\t\t\tvar vals = readMany();\n\t\t\tt1 = (T1)Convert.ChangeType(vals[0], typeof(T1));\n\t\t\tt2 = (T2)Convert.ChangeType(vals[1], typeof(T2));\n\t\t\tt3 = (T3)Convert.ChangeType(vals[2], typeof(T3));\n\t\t\tt4 = (T4)Convert.ChangeType(vals[3], typeof(T4));\n\t\t\tt5 = (T5)Convert.ChangeType(vals[4], typeof(T5));\n\t\t}\n\n\t\tstatic Func DP(Func, TResult> f)\n\t\t{\n\t\t\tvar cache = new Dictionary, TResult>();\n\t\t\tFunc res = null;\n\t\t\tres = (t1) =>\n\t\t\t{\n\t\t\t\tvar key = Tuple.Create(t1);\n\t\t\t\tif (!cache.ContainsKey(key))\n\t\t\t\t\tcache.Add(key, f(t1, res));\n\t\t\t\treturn cache[key];\n\t\t\t};\n\t\t\treturn res;\n\t\t}\n\n\t\tstatic Func DP(Func, TResult> f)\n\t\t{\n\t\t\tvar cache = new Dictionary, TResult>();\n\t\t\tFunc res = null;\n\t\t\tres = (t1, t2) =>\n\t\t\t{\n\t\t\t\tvar key = Tuple.Create(t1, t2);\n\t\t\t\tif (!cache.ContainsKey(key))\n\t\t\t\t\tcache.Add(key, f(t1, t2, res));\n\t\t\t\treturn cache[key];\n\t\t\t};\n\t\t\treturn res;\n\t\t}\n\n\t\tstatic Func DP(Func, TResult> f)\n\t\t{\n\t\t\tvar cache = new Dictionary, TResult>();\n\t\t\tFunc res = null;\n\t\t\tres = (t1, t2, t3) =>\n\t\t\t{\n\t\t\t\tvar key = Tuple.Create(t1, t2, t3);\n\t\t\t\tif (!cache.ContainsKey(key))\n\t\t\t\t\tcache.Add(key, f(t1, t2, t3, res));\n\t\t\t\treturn cache[key];\n\t\t\t};\n\t\t\treturn res;\n\t\t}\n\n\t\tstatic Func DP(Func, TResult> f)\n\t\t{\n\t\t\tvar cache = new Dictionary, TResult>();\n\t\t\tFunc res = null;\n\t\t\tres = (t1, t2, t3, t4) =>\n\t\t\t{\n\t\t\t\tvar key = Tuple.Create(t1, t2, t3, t4);\n\t\t\t\tif (!cache.ContainsKey(key))\n\t\t\t\t\tcache.Add(key, f(t1, t2, t3, t4, res));\n\t\t\t\treturn cache[key];\n\t\t\t};\n\t\t\treturn res;\n\t\t}\n\n\t\tstatic IEnumerable single(T it)\n\t\t{\n\t\t\tyield return it;\n\t\t}\n\n\t\tstatic IEnumerable range(long first, long last, long step = 1)\n\t\t{\n\t\t\tfor (long i = first; i <= last; i += step)\n\t\t\t{\n\t\t\t\tyield return i;\n\t\t\t}\n\t\t}\n\n\t\tstatic IEnumerable range(int first, int last, int step = 1)\n\t\t{\n\t\t\tfor (int i = first; i <= last; i += step)\n\t\t\t{\n\t\t\t\tyield return i;\n\t\t\t}\n\t\t}\n\n\t\tstatic T id(T a)\n\t\t{\n\t\t\treturn a;\n\t\t}\n\n\t\tpublic static T[][] mkarr(int x, int y)\n\t\t{\n\t\t\tT[][] res = new T[x][];\n\t\t\tfor (int i = 0; i < x; i++)\n\t\t\t{\n\t\t\t\tres[i] = new T[y];\n\t\t\t}\n\t\t\treturn res;\n\t\t}\n\n\t\tpublic static T[][][] mkarr(int x, int y, int z)\n\t\t{\n\t\t\tT[][][] res = new T[x][][];\n\t\t\tfor (int i = 0; i < x; i++)\n\t\t\t{\n\t\t\t\tres[i] = new T[y][];\n\t\t\t\tfor (int j = 0; j < y; j++)\n\t\t\t\t{\n\t\t\t\t\tres[i][j] = new T[z];\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn res;\n\t\t}\n\n\t\tstatic bool[] tf = new[] { true, false };\n\n\n#if CodeJam\n\n\t\tstatic void Main(string[] args)\n\t\t{\n\t\t\tif (DEBUG)\n\t\t\t{\n\t\t\t\tdebug();\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tInitialize();\n\t\t\t\tSolveAll(solveCase);\n\t\t\t}\n\t\t\tConsole.ReadKey();\n\t\t}\n\n\t\tprivate static StreamReader inf;\n\t\tprivate static StreamWriter outf;\n\n\t\tprivate delegate void o(string format, params object[] args);\n\t\tprivate static o Output;\n\n\t\tpublic static void Initialize()\n\t\t{\n\t\t\tConsole.ForegroundColor = ConsoleColor.Yellow;\n\t\t\tConsole.Write(\"File name: \");\n\t\t\tstring name = Console.ReadLine();\n\t\t\tinf = new StreamReader($\"D:\\\\Users\\\\marku\\\\Downloads\\\\{name}.in\");\n\t\t\toutf = new StreamWriter($\"D:\\\\Users\\\\marku\\\\Downloads\\\\{name}.out\");\n\t\t\tConsole.ForegroundColor = ConsoleColor.White;\n\t\t\tOutput = highlightedPrint;\n\t\t\tOutput += outf.WriteLine;\n\t\t}\n\n\t\tprivate static void highlightedPrint(string format, params object[] args)\n\t\t{\n\t\t\tConsoleColor prev = Console.ForegroundColor;\n\t\t\tConsole.ForegroundColor = ConsoleColor.Green;\n\t\t\tConsole.WriteLine(format, args);\n\t\t\tConsole.ForegroundColor = prev;\n\t\t}\n\n\t\tpublic static void SolveAll(Func calc)\n\t\t{\n\t\t\tint cases = int.Parse(inf.ReadLine());\n\t\t\tfor (int _ = 1; _ <= cases; _++)\n\t\t\t{\n\t\t\t\tOutput($\"Case #{_}: {calc(_)}\");\n\t\t\t}\n\t\t\tinf.Close();\n\t\t\toutf.Close();\n\t\t\tConsole.ForegroundColor = ConsoleColor.Cyan;\n\t\t\tConsole.WriteLine(\"Eureka!\");\n\t\t}\n\n\t\tprivate static string read()\n\t\t{\n\t\t\treturn inf.ReadLine();\n\t\t}\n#endif\n\n#if CodeForces\n\t\tstatic void Main(string[] args)\n\t\t{\n#if DEBUG\n\t\t\tvar sw = new System.Diagnostics.Stopwatch();\n\t\t\tsw.Start();\n#endif\n\t\t\tstring s = Solve();\n\t\t\tif (!string.IsNullOrEmpty(s))\n\t\t\t{\n\t\t\t\tConsole.WriteLine(s);\n\t\t\t}\n#if DEBUG\n\t\t\tsw.Stop();\n\t\t\tConsole.WriteLine(sw.Elapsed);\n\t\t\tConsole.ReadKey();\n#endif\n\t\t}\n\n\t\tprivate static string read()\n\t\t{\n#if !DEBUG\n\t\t\treturn Console.ReadLine();\n#else\n\t\t\treturn testInput.Dequeue();\n#endif\n\t\t}\n#endif\n\t}\n\n\tpublic static class ExtensionMethods\n\t{\n\t\tpublic static IEnumerable Cartesian(this IEnumerable first, IEnumerable second, Func collector)\n\t\t{\n\t\t\treturn first.SelectMany(f => second.Select(s => collector(f, s)));\n\t\t}\n\n\t\tpublic static IEnumerable> Cartesian(this IEnumerable first, IEnumerable second)\n\t\t{\n\t\t\treturn first.Cartesian(second, Tuple.Create);\n\t\t}\n\n\t\tpublic static IEnumerable> CartesianE(this IEnumerable first, IEnumerable second)\n\t\t{\n\t\t\t// Calling CartesianE prevents selection of the wrong overload of Cartesian when you want a tuple of tuples to be returned\n\t\t\treturn first.Cartesian(second);\n\t\t}\n\n\t\tpublic static IEnumerable> Cartesian(this IEnumerable> first, IEnumerable second)\n\t\t{\n\t\t\treturn first.Cartesian(second, (x, y) => Tuple.Create(x.Item1, x.Item2, y));\n\t\t}\n\n\t\tpublic static IEnumerable> Cartesian(this IEnumerable> first, IEnumerable second)\n\t\t{\n\t\t\treturn first.Cartesian(second, (x, y) => Tuple.Create(x.Item1, x.Item2, x.Item3, y));\n\t\t}\n\n\t\tpublic static IEnumerable> Cartesian(this IEnumerable> first, IEnumerable second)\n\t\t{\n\t\t\treturn first.Cartesian(second, (x, y) => Tuple.Create(x.Item1, x.Item2, x.Item3, x.Item4, y));\n\t\t}\n\n\t\tpublic static IEnumerable> Cartesian(this IEnumerable> source)\n\t\t{\n\t\t\tIEnumerable> res = source.First().Select(x => single(x));\n\t\t\tforeach (IEnumerable next in source.Skip(1))\n\t\t\t{\n\t\t\t\tres = res.Cartesian(next, (sofar, n) => sofar.Concat(single(n)));\n\t\t\t}\n\t\t\treturn res;\n\t\t}\n\n\t\tpublic static IEnumerable> Pow(this IEnumerable it, int num)\n\t\t{\n\t\t\treturn Enumerable.Repeat(it, num).Cartesian();\n\t\t}\n\n\t\tpublic static IEnumerable Demask(this IEnumerable> inp)\n\t\t{\n\t\t\tforeach (var pair in inp)\n\t\t\t{\n\t\t\t\tif (pair.Item2)\n\t\t\t\t{\n\t\t\t\t\tyield return pair.Item1;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tpublic static IEnumerable>> Partition(this IEnumerable source, int groups)\n\t\t{\n\t\t\tforeach (var part in Enumerable.Range(0, groups).Pow(source.Count()).Select(x => x.ToArray()))\n\t\t\t{\n\t\t\t\tyield return Enumerable.Range(0, groups).Select(x => source.Where((item, idx) => part[idx] == x));\n\t\t\t}\n\t\t}\n\n\t\tpublic static IEnumerable> Combinations(this IEnumerable it)\n\t\t{\n\t\t\tforeach (var conf in new[] { true, false }.Pow(it.Count()))\n\t\t\t{\n\t\t\t\tyield return it.Zip(conf, Tuple.Create).Demask();\n\t\t\t}\n\t\t}\n\n\t\tprivate static IEnumerable single(T it)\n\t\t{\n\t\t\tyield return it;\n\t\t}\n\n\t\tprivate static IEnumerable ExceptSingle(this IEnumerable first, T it, IEqualityComparer comp = null)\n\t\t{\n\t\t\tcomp = comp ?? EqualityComparer.Default;\n\t\t\tbool seen = false;\n\t\t\tforeach (T a in first)\n\t\t\t{\n\t\t\t\tif (!seen && comp.Equals(a, it))\n\t\t\t\t{\n\t\t\t\t\tseen = true;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tyield return a;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tpublic static IEnumerable> Permutations(this IEnumerable it)\n\t\t{\n\t\t\tif (it.Count() < 2)\n\t\t\t{\n\t\t\t\tyield return it;\n\t\t\t\tyield break;\n\t\t\t}\n\n\t\t\tforeach (T first in it)\n\t\t\t{\n\t\t\t\tforeach (IEnumerable part in Permutations(it.ExceptSingle(first)))\n\t\t\t\t{\n\t\t\t\t\tyield return single(first).Concat(part);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tpublic static T[][] Rho(this IEnumerable source, int x, int y)\n\t\t{\n\t\t\tT[][] res = Program.mkarr(x, y);\n\n\t\t\tint i = 0, j = 0;\n\n\t\t\twhile (true)\n\t\t\t{\n\t\t\t\tforeach (T item in source)\n\t\t\t\t{\n\t\t\t\t\tres[i][j] = item;\n\t\t\t\t\tj++;\n\t\t\t\t\tif (j == y)\n\t\t\t\t\t{\n\t\t\t\t\t\tj = 0;\n\t\t\t\t\t\ti++;\n\t\t\t\t\t\tif (i == x)\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (i == x)\n\t\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\treturn res;\n\t\t}\n\n\t\tpublic static T[][][] Rho(this IEnumerable source, int x, int y, int z)\n\t\t{\n\t\t\tT[][][] res = Program.mkarr(x, y, z);\n\n\t\t\tint i = 0, j = 0, k = 0;\n\t\t\twhile (true)\n\t\t\t{\n\t\t\t\tforeach (T item in source)\n\t\t\t\t{\n\t\t\t\t\tres[i][j][k] = item;\n\t\t\t\t\tk++;\n\t\t\t\t\tif (k == z)\n\t\t\t\t\t{\n\t\t\t\t\t\tk = 0;\n\t\t\t\t\t\tj++;\n\t\t\t\t\t\tif (j == y)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tj = 0;\n\t\t\t\t\t\t\ti++;\n\t\t\t\t\t\t\tif (i == x)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (i == x)\n\t\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\treturn res;\n\t\t}\n\t}\n}\n", "lang": "MS C#", "bug_code_uid": "c7ec70a260c1ed0d9868745a00226624", "src_uid": "359ddf1f1aed9b3256836e5856fe3466", "apr_id": "5ac0dc976887952b35b9b380ccb49b0f", "difficulty": 1900, "tags": ["math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9936686598663383, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\n//namespace Practice\n//{\n class TaskF\n {\n public static void Main(string[] args)\n {\n new TaskF().solve();\n }\n const int P = 1000000007;\n public int pow(int a, int b)\n {\n if (b == 0) return 1;\n int res = pow(a, (b >> 1));\n res = (int)((1L * res * res) % P);\n if ((b & 1) == 1)\n {\n return (int)((1L * res * a) % P);\n }\n return res;\n }\n\n int comb(int n, int k, int[] fac, int[] finv)\n {\n if (k > n) return 0;\n if (k == 0 || k == n) return 1;\n return (int) ((((1L * fac[n] * finv[k]) % P) * finv[n-k]) % P);\n }\n\n public void solve()\n {\n string[] inputs = Console.ReadLine().Split(' ');\n int f = int.Parse(inputs[0]);\n int w = int.Parse(inputs[1]);\n int h = int.Parse(inputs[2]);\n\n if (w == 0 || h == 0)\n {\n Console.WriteLine(1);\n return;\n }\n else if (f == 0)\n {\n if (w > h)\n {\n Console.WriteLine(1);\n return;\n }\n else\n {\n Console.WriteLine(0);\n return;\n }\n }\n if (w <= h && w > 0)\n {\n Console.WriteLine(0);\n return;\n }\n int n = Math.Max(f + 1, w - 1) + 1;\n int[] fac = new int[n];\n int[] finv = new int[n];\n fac[0] = finv[0] = 1;\n fac[1] = finv[1] = 1;\n for (int i = 2; i < n; i++)\n {\n fac[i] = (int)((1L * fac[i - 1] * i) % P);\n finv[i] = pow(fac[i], P - 2); \n }\n\n int all = 0, good = 0, f1 = f + 1, w1 = w - 1, upper = w / (h + 1);\n for (int u = 1; u <= w; u++)\n {\n if (u > f1) break;\n int f1u = comb(f1, u, fac, finv);\n all += mult(f1u, comb(w1, u - 1, fac, finv));\n all %= P;\n if (u <= upper)\n {\n good += mult(f1u, comb(w - u * h - 1, u - 1, fac, finv));\n }\n }\n //Console.WriteLine(pow(all, P-2));\n int res = (int)(1L * good * pow(all, P - 2) % P);\n //Console.WriteLine(res + \" = \" + good +\" / \" + all);\n Console.WriteLine(res);\n\n //Console.Read();\n }\n public int mult(int a, int b)\n {\n return (int)((1L * a * b) % P);\n }\n }\n//}\n", "lang": "MS C#", "bug_code_uid": "5fa8a16b15ea098b1b717c0fa5bd911a", "src_uid": "a69f95db3fe677111cf0558271b40f39", "apr_id": "ed8b072e7287288678cc070b6aa1406a", "difficulty": 2300, "tags": ["probabilities", "combinatorics", "number theory", "math", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.9831649831649831, "equal_cnt": 21, "replace_cnt": 0, "delete_cnt": 4, "insert_cnt": 16, "fix_ops_cnt": 20, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace Practice\n{\n class TaskF\n {\n //public static void Main(string[] args)\n //{\n // new TaskF().solve();\n //}\n const int P = 1000000007;\n public int pow(int a, int b)\n {\n if (b == 0) return 1;\n int res = pow(a, (b >> 1));\n res = (int)(1L * res * res % P);\n if ((b & 1) == 1)\n {\n return (int)(1L * res * a % P);\n }\n return res;\n }\n\n int comb(int n, int k, int[] fac, int[] finv)\n {\n if (k == 0 || k == n) return 1;\n return (int) (((1L * fac[n] * finv[k] % P) * finv[n-k]) % P);\n }\n\n public void solve()\n {\n string[] inputs = Console.ReadLine().Split(' ');\n int f = int.Parse(inputs[0]);\n int w = int.Parse(inputs[1]);\n int h = int.Parse(inputs[2]);\n\n if (w == 0 || h == 0)\n {\n Console.WriteLine(1);\n return;\n }\n else if (f == 0)\n {\n if (w > h)\n {\n Console.WriteLine(1);\n return;\n }\n else\n {\n Console.WriteLine(0);\n return;\n }\n }\n if (w <= h && w > 0)\n {\n Console.WriteLine(0);\n return;\n }\n int n = Math.Max(f + 1, w - 1) + 1;\n int[] fac = new int[n];\n int[] finv = new int[n];\n fac[0] = finv[0] = 1;\n fac[1] = finv[1] = 1;\n for (int i = 2; i < n; i++)\n {\n fac[i] = (int)(1L * fac[i - 1] * i % P);\n finv[i] = pow(fac[i], P - 2); \n }\n\n int all = 0, good = 0, f1 = f + 1, w1 = w - 1, upper = w / (h + 1);\n for (int u = 1; u <= w; u++)\n {\n if (u > f1) break;\n int f1u = comb(f1, u, fac, finv);\n all += mult(f1u, comb(w1, u - 1, fac, finv));\n all %= P;\n if (u <= upper)\n {\n good += mult(f1u, comb(w - u * h - 1, u - 1, fac, finv));\n }\n }\n Console.WriteLine(pow(all, P-2));\n int res = (int)(1L * good * pow(all, P - 2) % P);\n //Console.WriteLine(res + \" = \" + good +\" / \" + all);\n Console.WriteLine(res);\n\n //Console.Read();\n }\n public int mult(int a, int b)\n {\n return (int)(1L * a * b % P);\n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "6df993579ef5ab285e49e8549926d813", "src_uid": "a69f95db3fe677111cf0558271b40f39", "apr_id": "ed8b072e7287288678cc070b6aa1406a", "difficulty": 2300, "tags": ["probabilities", "combinatorics", "number theory", "math", "brute force"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.020697167755991286, "equal_cnt": 17, "replace_cnt": 14, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 17, "bug_source_code": "\n\n \n \n Debug\n AnyCPU\n {0D76C9E7-FD9E-4713-B82F-27910CE473BD}\n Exe\n Properties\n ConsoleApplication9\n ConsoleApplication9\n v4.6.1\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": "ff57b38499ef0cbb4b1a2bddec2c9edf", "src_uid": "2acf686862a34c337d1d2cbc0ac3fd11", "apr_id": "851d68e95dd0bc84c60fce3adf768939", "difficulty": 1000, "tags": ["brute force"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.6558983666061706, "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 Debug = System.Diagnostics.Debug;\nusing SB = System.Text.StringBuilder;\nusing Number = System.Int64;\nusing System.Numerics;\nusing static System.Math;\nnamespace Program {\n public class Solver {\n Random rnd = new Random ();\n public void Solve () {\n\n var k = rl;\n var n = rl;\n var s = rl;\n var p = rl;\n\n var X = (n + s - 1) / s;\n var Y = (X * k + p - 1) / p;\n Console.WriteLine (Y);\n }\n const long INF = 1L << 60;\n //static int[] dx = { -1, 0, 1, 0 };\n //static int[] dy = { 0, 1, 0, -1 };\n\n int ri { get { return sc.Integer (); } }\n long rl { get { return sc.Long (); } }\n double rd { get { return sc.Double (); } }\n string rs { get { return sc.Scan (); } }\n public IO.StreamScanner sc = new IO.StreamScanner (Console.OpenStandardInput ());\n\n static T[] Enumerate (int n, Func f) {\n var a = new T[n];\n for (int i = 0; i < n; ++i) a[i] = f (i);\n return a;\n }\n static public void Swap (ref T a, ref T b) { var tmp = a; a = b; b = tmp; }\n }\n}\n#region main\nstatic class Ex {\n static public string AsString (this IEnumerable ie) { return new string (ie.ToArray ()); }\n static public string AsJoinedString (this IEnumerable ie, string st = \" \") {\n return string.Join (st, ie);\n }\n static public void Main () {\n Console.SetOut (new Program.IO.Printer (Console.OpenStandardOutput ()) { AutoFlush = false });\n var solver = new Program.Solver ();\n try {\n solver.Solve ();\n Console.Out.Flush ();\n } catch { }\n }\n}\n#endregion\n#region Ex", "lang": "Mono C#", "bug_code_uid": "8f377fa0c951d5a68505a31c206f4043", "src_uid": "73f0c7cfc06a9b04e4766d6aa61fc780", "apr_id": "d7e93c3b2ef56234ef6628b8b1c6baec", "difficulty": 800, "tags": ["math"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.9982046678635548, "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.RegularExpressions;\n\nnamespace Rextester\n{\n public class Program\n {\n public static void Main(string[] args)\n {\n int ans=0;\n string[] tokens = Console.ReadLine().Split();\n int k = int.Parse(tokens[0]);\n int n = int.Parse(tokens[1]);\n int s = int.Parse(tokens[2]);\n int p = int.Parse(tokens[3]);\n ans=((k*(n+s-1)/s)+p-1)/p;\n Console.WriteLine(ans);\n }\n }\n}", "lang": "Mono C#", "bug_code_uid": "9b0efa1b4acd32424a0db7e38c499974", "src_uid": "73f0c7cfc06a9b04e4766d6aa61fc780", "apr_id": "a514385153853a010f1a9fc5ef5aecfd", "difficulty": 800, "tags": ["math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "C#"} {"similarity_score": 0.889267461669506, "equal_cnt": 21, "replace_cnt": 0, "delete_cnt": 18, "insert_cnt": 4, "fix_ops_cnt": 22, "bug_source_code": "class MainClass\n {\n public static void Main(string[] args)\n {\n var fl = Console.ReadLine().Split(' ').Select(i => int.Parse(i)).ToArray();\n var sl = Console.ReadLine().Split(' ').Select(i => int.Parse(i)).ToArray();\n\n int n = fl[0] - 1;\n int k = fl[1];\n int x = fl[2];\n\n int sum = 0;\n for (var i = n; i > -1; i--){\n if (n - i < k){\n continue;\n }\n\n sum += sl[i];\n }\n\n Console.WriteLine(sum + k * x);\n }\n }", "lang": "Mono C#", "bug_code_uid": "3b8a85cf0e8511a05045d11bee08c66d", "src_uid": "92a233f8d9c73d9f33e4e6116b7d0a96", "apr_id": "b2d078ea28184fc8269382a82743ff69", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C#"} {"similarity_score": 0.017159763313609466, "equal_cnt": 16, "replace_cnt": 14, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 17, "bug_source_code": "\n\n \n \n Debug\n AnyCPU\n {C22E8B66-0EF5-43B8-86DC-85B1FB630485}\n Exe\n Properties\n A.Keyboard\n A.Keyboard\n v4.5\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": "MS C#", "bug_code_uid": "f2fc688a0cb0abe9f8a50a74ff1d56ba", "src_uid": "df49c0c257903516767fdb8ac9c2bfd6", "apr_id": "932f3e14631d8ef61aeea595ee3db1aa", "difficulty": 900, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9351851851851852, "equal_cnt": 16, "replace_cnt": 6, "delete_cnt": 8, "insert_cnt": 1, "fix_ops_cnt": 15, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace ConsoleApplication1\n{\n class Program\n {\n static void Main(string[] args)\n {\n int[,] arr = new int[3, 3];\n for (int i = 0; i < 3; i++)\n {\n String line = Console.ReadLine();\n String[] ps = line.Split(' ');\n for (int j = 0; j < 3; i++)\n {\n arr[i, j] = int.Parse(ps[i]);\n }\n }\n\n arr[0, 0] = ((arr[1, 0] + arr[1, 2]) - (arr[0, 1] + arr[0, 2]) + (arr[2, 0] + arr[2, 1])) / 2;\n arr[1, 1] = (arr[2, 0] + arr[2, 1])-arr[0, 0] ;\n arr[2, 2] = (arr[0,0] + arr[0,1]) - arr[1, 2];\n for (int i = 0; i < 3; i++)\n {\n \n for (int j = 0; j < 3; i++)\n {\n Console.Write(arr[i, j] + \" \");\n }\n Console.WriteLine();\n }\n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "5305e26a450b8c6d2c31b93f85c03eac", "src_uid": "0c42eafb73d1e30f168958a06a0f9bca", "apr_id": "e56eb99bd882f5cb3865e2c871e54292", "difficulty": 1100, "tags": ["brute force", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C#"} {"similarity_score": 0.6771910724006532, "equal_cnt": 6, "replace_cnt": 5, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 5, "bug_source_code": "using System; using System.Linq;\n\nclass P {\n static void Main() {\n var m = Enumerable.Range(0,3).Select(i =>\n Console.ReadLine().Split(' ').Select(int.Parse).ToArray())\n .ToArray();\n m[0][0] = m[1][1] = m[2][2] = 1;\n var r = new int[3];\n var c = new int[3];\n for (var y=0;y<3;y++)for (var x=0;x<3;x++){r[y]+=m[y][x];c[x]+=m[y][x]; }\n \n var d1 = m[0][0]+m[1][1]+m[2][2];\n var d2 = m[0][2]+m[1][1]+m[2][0];\n\n var max = new [] { r[0], r[1], r[2],\n c[0], c[1], c[2],\n d1, d2 }.Max();\n var k = 0;\n for (var i = 0; k < 3 ; i = (i+1)%3) {\n var c2 = (new [] { r[i], c[i], i==1?d2:int.MaxValue}).Min();\n var diff = max - c2;\n k = diff==0? k + 1 : 0;\n m[i][i]+=diff; r[i]+=diff; c[i]+=diff; d1 += diff; if (i==2)d2+=diff;\n max = Math.Max(max, r[i]);\n max = Math.Max(max, c[i]);\n max = Math.Max(max, d1);\n max = Math.Max(max, d2);\n }\n for (var y = 0; y < 3 ; y++) Console.WriteLine(string.Join(\" \", m[y]));\n }\n}", "lang": "MS C#", "bug_code_uid": "4bd4ef806fda947c1f89c7f9ba065da6", "src_uid": "0c42eafb73d1e30f168958a06a0f9bca", "apr_id": "d56f2c4c52c5ff1ad97bf9cac589161f", "difficulty": 1100, "tags": ["brute force", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9164116999143311, "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.Globalization;\nusing System.IO;\nusing System.Linq;\nusing System.Text;\npublic class Codeforces\n{\n protected static TextReader reader;\n protected static TextWriter writer;\n static void Main()\n {\n reader = new StreamReader(Console.OpenStandardInput(1024 * 10), System.Text.Encoding.ASCII, false, 1024 * 10);\n writer = new StreamWriter(Console.OpenStandardOutput(1024 * 10), System.Text.Encoding.ASCII, 1024 * 10);\n var ar = new int[9];\n for (int i = 0; i < 9; i++)\n {\n ar[i] = Next();\n }\n var diag = ar.Sum() / 2;\n for (int i = 1; i <= diag - 2; i++)\n {\n for (int j = 1; j <= diag - 2; j++)\n {\n for (int k = 1; k <= diag - 2; k++)\n {\n if ((ar[0] = i) + ar[1] + ar[2] == (ar[4] = j) + ar[3] + ar[5] && j + ar[3] + ar[5] == (ar[8] = k) + ar[6] + ar[7] && ar[0] + ar[4] + ar[8] == ar[2] + ar[4] + ar[6])\n {\n WriteArray(ar.Take(3));\n WriteArray(ar.Skip(3).Take(3));\n WriteArray(ar.Skip(6));\n break;\n }\n }\n }\n }\n reader.Close();\n writer.Close();\n }\n #region Read / Write\n\n private static Queue currentLineTokens = new Queue();\n\n private static string[] ReadAndSplitLine()\n {\n return reader.ReadLine().Split(new[] { ' ', '\\t' }, StringSplitOptions.RemoveEmptyEntries);\n }\n\n public static string ReadToken()\n {\n while (currentLineTokens.Count == 0)\n currentLineTokens = new Queue(ReadAndSplitLine());\n return currentLineTokens.Dequeue();\n }\n\n public static int ReadInt()\n {\n return int.Parse(ReadToken());\n }\n\n public static long ReadLong()\n {\n return long.Parse(ReadToken());\n }\n\n public static double ReadDouble()\n {\n return double.Parse(ReadToken(), CultureInfo.InvariantCulture);\n }\n\n public static int[] ReadIntArray()\n {\n return ReadAndSplitLine().Select(int.Parse).ToArray();\n }\n\n public static long[] ReadLongArray()\n {\n return ReadAndSplitLine().Select(long.Parse).ToArray();\n }\n\n public static double[] ReadDoubleArray()\n {\n return ReadAndSplitLine().Select(s => double.Parse(s, CultureInfo.InvariantCulture)).ToArray();\n }\n public static int[][] ReadIntMatrix(int numberOfRows)\n {\n int[][] matrix = new int[numberOfRows][];\n for (int i = 0; i < numberOfRows; i++)\n matrix[i] = ReadIntArray();\n return matrix;\n }\n public static int[][] ReadAndTransposeIntMatrix(int numberOfRows)\n {\n int[][] matrix = ReadIntMatrix(numberOfRows);\n int[][] ret = new int[matrix[0].Length][];\n for (int i = 0; i < ret.Length; i++)\n {\n ret[i] = new int[numberOfRows];\n for (int j = 0; j < numberOfRows; j++)\n ret[i][j] = matrix[j][i];\n }\n return ret;\n }\n\n public static string[] ReadLines(int quantity)\n {\n string[] lines = new string[quantity];\n for (int i = 0; i < quantity; i++)\n lines[i] = reader.ReadLine().Trim();\n return lines;\n }\n public static void WriteArray(IEnumerable array)\n {\n writer.WriteLine(string.Join(\" \", array));\n }\n\n public static void Write(params T[] array)\n {\n WriteArray(array);\n }\n\n public static void WriteLines(IEnumerable array)\n {\n foreach (var a in array)\n writer.WriteLine(a);\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 != '-' && (c < '0' || c > '9'));\n int sign = 1;\n if (c == '-')\n {\n sign = -1;\n c = reader.Read();\n }\n res = c - '0';\n while (true)\n {\n c = reader.Read();\n if (c < '0' || c > '9')\n return res * sign;\n res *= 10;\n res += c - '0';\n }\n }\n #endregion\n}", "lang": "MS C#", "bug_code_uid": "7531e201c4016941a3b3834c0ecd31a2", "src_uid": "0c42eafb73d1e30f168958a06a0f9bca", "apr_id": "f14540b1cf27fa41aa10366623a21db5", "difficulty": 1100, "tags": ["brute force", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.2477923468022478, "equal_cnt": 13, "replace_cnt": 7, "delete_cnt": 5, "insert_cnt": 1, "fix_ops_cnt": 13, "bug_source_code": "using System;\nusing System.Collections.Generic;\n\nnamespace InsomniaCure\n{\n class Program\n {\n static void Main(string[] args)\n {\n int k = Convert.ToInt32(Console.ReadLine());\n int l = Convert.ToInt32(Console.ReadLine());\n int m = Convert.ToInt32(Console.ReadLine());\n int n = Convert.ToInt32(Console.ReadLine());\n int d = Convert.ToInt32(Console.ReadLine());\n\n int ogk = k;\n int ogl = l;\n int ogm = m;\n int ogn = n;\n\n\n int[] dragons = new int[d];\n\n for(int i = 0; i < dragons.Length; i++)\n {\n dragons[i] = i + 1;\n }\n\n List hurt_dragons = new List();\n\n for(int i = 0; i < dragons.Length; i++)\n {\n if(i == k - 1)\n {\n bool isHurt = false;\n for(int j = 0; j < hurt_dragons.Count; j++)\n {\n if (hurt_dragons[j] == dragons[i])\n {\n isHurt = true;\n }\n }\n if (!isHurt)\n {\n hurt_dragons.Add(dragons[i]);\n }\n\n k += ogk;\n }\n\n if (i == l - 1)\n {\n bool isHurt = false;\n for (int j = 0; j < hurt_dragons.Count; j++)\n {\n if (hurt_dragons[j] == dragons[i])\n {\n isHurt = true;\n }\n }\n if (!isHurt)\n {\n hurt_dragons.Add(dragons[i]);\n }\n\n l += ogl;\n }\n\n if (i == m - 1)\n {\n bool isHurt = false;\n for (int j = 0; j < hurt_dragons.Count; j++)\n {\n if (hurt_dragons[j] == dragons[i])\n {\n isHurt = true;\n }\n }\n if (!isHurt)\n {\n hurt_dragons.Add(dragons[i]);\n }\n\n m += ogm;\n }\n\n if (i == n - 1)\n {\n bool isHurt = false;\n for (int j = 0; j < hurt_dragons.Count; j++)\n {\n if (hurt_dragons[j] == dragons[i])\n {\n isHurt = true;\n }\n }\n if (!isHurt)\n {\n hurt_dragons.Add(dragons[i]);\n }\n\n n += ogn;\n }\n }\n\n Console.WriteLine(hurt_dragons.Count);\n\n }\n }\n}\n", "lang": ".NET Core C#", "bug_code_uid": "928f371b6912ba3ce61ea00ebbd61b09", "src_uid": "46bfdec9bfc1e91bd2f5022f3d3c8ce7", "apr_id": "1ea9cebb99a08fa15bcea386d7ae50e8", "difficulty": 800, "tags": ["math", "constructive algorithms", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9977443609022556, "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 Codeforces\n{\n class Program\n {\n static void Main(string[] args)\n {\n // the inputs\n int k = int.Parse(Console.ReadLine());\n int l = int.Parse(Console.ReadLine());\n int m = int.Parse(Console.ReadLine());\n int n = int.Parse(Console.ReadLine());\n int d = int.Parse(Console.ReadLine());\n\n var vDamaged = new bool[d];\n for (int i = 0; i < k - 1; ++i)\n {\n vDamaged[i] = false;\n }\n\n for (int i = k - 1; i < d; i += k)\n {\n vDamaged[i] = true;\n }\n\n for (int i = l - 1; i < d; i += l)\n {\n vDamaged[i] = true;\n }\n\n for (int i = m - 1; i < d; i += m)\n {\n vDamaged[i] = true;\n }\n\n for (int i = n - 1; i < d; i += n)\n {\n vDamaged[i] = true;\n }\n\n int cnt = 0;\n for (int i = 0; i < vDamaged.Length; ++i)\n {\n cnt += vDamaged[i] ? 1 : 0;\n }\n\n // display results\n Console.WriteLine(cnt);\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "c2e7de95a956d741d9c29617931b7efa", "src_uid": "46bfdec9bfc1e91bd2f5022f3d3c8ce7", "apr_id": "f714a358a5d11ad0849a98ef7975b436", "difficulty": 800, "tags": ["math", "constructive algorithms", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9987745098039216, "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;\n\nnamespace testSH\n{\n\n class Program\n {\n static void Main(string[] args)\n {\n string[] s = Console.ReadLine().Split(' ');\n int key = int.Parse(s[0]);\n if (string.Compare(s[3], \"week\") == 0)\n {\n if ((key < 5) || (key == 7))\n Console.WriteLine(52);\n else\n Console.WriteLine(53);\n }\n else\n {\n if (key < 30)\n Console.WriteLine(12);\n else\n if (key == 30)\n Console.WriteLine(11);\n else\n Console.WriteLine(7);\n }\n }\n }\n}", "lang": "MS C#", "bug_code_uid": "eaae89b8f66c379d18e00ac2208e83c1", "src_uid": "9b8543c1ae3666e6c163d268fdbeef6b", "apr_id": "3e0c1b0bae3e3ef6becccd5db21144bc", "difficulty": 900, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9389880952380952, "equal_cnt": 6, "replace_cnt": 2, "delete_cnt": 2, "insert_cnt": 1, "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 er\n{\n class Program\n {\n \n \n static void Main(string[] args)\n {\n var s = Console.ReadLine().Split(' ');\n\n int n = int.Parse(s[0]);\n int ans = 0; \n if(s[2]==\"week\")\n {\n ans = 52;\n }\n else\n {\n if (n == 31) ans = 7;\n else if (n == 30) ans = 11;\n else ans = 12;\n }\n\n Console.WriteLine(ans);\n \n\n\n\n }\n }\n }\n", "lang": "MS C#", "bug_code_uid": "c2eefa38d64d1ba38a46e5811b72bd62", "src_uid": "9b8543c1ae3666e6c163d268fdbeef6b", "apr_id": "21095e840bb00868b885b7146527a55a", "difficulty": 900, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9784296807592753, "equal_cnt": 1, "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;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace raising_bactaria\n{\n class Program\n {\n static void Main(string[] args)\n {\n int z = 0;\n int n = int.Parse(Console.ReadLine());\n string x = Convert.ToString(n, 2);\n for (int i = 0; i < x.Length; i++)\n {\n if (x[i] == '1')\n {\n z++;\n }\n }\n Console.WriteLine(z);\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": "8a83bb8e9931c78a8a9c1084573a7087", "src_uid": "03e4482d53a059134676f431be4c16d2", "apr_id": "0eecf9108dccd93932365ab43699b3ac", "difficulty": 1000, "tags": ["bitmasks"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C#"} {"similarity_score": 0.8592910848549946, "equal_cnt": 1, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "namespace Problem3\n{\n class Program\n {\n static void Main(string[] args)\n {\n int count = 0;\n string input = Convert.ToString(int.Parse(Console.ReadLine()), 2);\n for(int i = 0; i < input.Length; i++)\n {\n if (input[i] == '1')\n count++;\n }\n Console.WriteLine(count);\n }\n }\n}", "lang": "Mono C#", "bug_code_uid": "d2ae17878a4681edcfcea18a4b827808", "src_uid": "03e4482d53a059134676f431be4c16d2", "apr_id": "7a60ad4c21f38da4684cb4f046b6decb", "difficulty": 1000, "tags": ["bitmasks"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.9985959985959986, "equal_cnt": 5, "replace_cnt": 4, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 4, "bug_source_code": "using System;\nusing System.Collections;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\n\nclass TEST{\n\tstatic void Main(){\n\t\tSol mySol =new Sol();\n\t\tmySol.Solve();\n\t}\n}\n\nclass Sol{\n\tpublic void Solve(){\n\t\t\n\t\t\n\t\t\n\t\tfor(int i=0;i<4;i++){\n\t\t\tif(Inside(A[2*i], A[2*i+1], B)){\n\t\t\t\tConsole.WriteLine(\"YES\");\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(Inside(B[2*i], B[2*i+1], A)){\n\t\t\t\tConsole.WriteLine(\"YES\");\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\tfor(int i=0;i<4;i++){\n\t\t\tfor(int j=0;j<4;j++){\n\t\t\t\tif(OnLine(A[2*i], A[2*i+1], B[2*j], B[2*j+1], B[(2*j+2)%8], B[(2*j+3)%8])){\n\t\t\t\t\tConsole.WriteLine(\"YES\");\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tif(OnLine(B[2*i], B[2*i+1], A[2*j], A[2*j+1], A[(2*j+2)%8], A[(2*j+3)%8])){\n\t\t\t\t\tConsole.WriteLine(\"YES\");\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tfor(int i=0;i<4;i++){\n\t\t\tfor(int j=0;j<4;j++){\n\t\t\t\tif(Intersects(A[2*j], A[2*j+1], A[(2*j+2)%8], A[(2*j+3)%8], B[2*j], B[2*j+1], B[(2*j+2)%8], B[(2*j+3)%8])){\n\t\t\t\t\tConsole.WriteLine(\"YES\");\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tConsole.WriteLine(\"NO\");\n\t\t\n\t}\n\t\n\tbool Inside(int x, int y, int[] rect){\n\t\tvar h = new HashSet();\n\t\tfor(int i=0;i<4;i++){\n\t\t\tvar d = det(rect[2*i] - x, rect[2*i+1] - y, rect[(2*i+2)%8] - x, rect[(2*i+3)%8] - y);\n\t\t\tif(d == 0) return false;\n\t\t\td = d > 0 ? 1 : -1;\n\t\t\th.Add(d); \n\t\t}\n\t\treturn h.Count == 1;\n\t}\n\tbool OnLine(int x, int y, int x1, int y1, int x2, int y2){\n\t\tif(x == x1 && y == y1) return true;\n\t\tif(x == x2 && y == y2) return true;\n\t\tif(det(x1 - x, y1 - y, x2 - x, y2 - y) != 0) return false;\n\t\treturn (x1 - x) * (x2 - x) + (y1 - y) * (y2 - y) < 0; \n\t}\n\tbool Intersects(int x1, int y1, int x2, int y2, int x3, int y3, int x4, int y4){\n\t\t\n\t\tint d0 = det0(x3 - x1, y3 - y1, x2 - x1, y2 - y1);\n\t\tint d1 = det0(x4 - x1, y4 - y1, x2 - x1, y2 - y1);\n\t\tif(d0 == 0 || d1 == 0 || d0 == d1) return false;\n\t\tint d2 = det0(x1 - x3, y1 - y3, x4 - x3, y4 - y3);\n\t\tint d3 = det0(x2 - x3, y2 - y3, x4 - x3, y4 - y3);\n\t\tif(d2 == 0 || d3 == 0 || d2 == d3) return false;\n\t\treturn true;\n\t\t\n\t}\n\t\n\t\n\t\n\tint det (int a, int b, int c, int d){\n\t\treturn a * d - b * c;\n\t}\n\tint det0 (int a, int b, int c, int d){\n\t\tvar ret = a * d - b * c;\n\t\tif(ret == 0) return 0;\n\t\tif(ret > 0) return 1;\n\t\treturn -1;\n\t}\n\t\n\t\n\t\n\tint[] A, B;\n\tpublic Sol(){\n\t\tA = ria();\n\t\tB = ria();\n\t}\n\n\tstatic String rs(){return Console.ReadLine();}\n\tstatic int ri(){return int.Parse(Console.ReadLine());}\n\tstatic long rl(){return long.Parse(Console.ReadLine());}\n\tstatic double rd(){return double.Parse(Console.ReadLine());}\n\tstatic String[] rsa(char sep=' '){return Console.ReadLine().Split(sep);}\n\tstatic int[] ria(char sep=' '){return Array.ConvertAll(Console.ReadLine().Split(sep),e=>int.Parse(e));}\n\tstatic long[] rla(char sep=' '){return Array.ConvertAll(Console.ReadLine().Split(sep),e=>long.Parse(e));}\n\tstatic double[] rda(char sep=' '){return Array.ConvertAll(Console.ReadLine().Split(sep),e=>double.Parse(e));}\n}\n", "lang": "Mono C#", "bug_code_uid": "de9c9ed5c6a23912616083547521fa3b", "src_uid": "f6a3dd8b3bab58ff66055c61ddfdf06a", "apr_id": "60660acdf49ccf20d638e8342529eddc", "difficulty": 1600, "tags": ["brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9996538594669436, "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;\n\nnamespace CodeForces\n{\n static class Program\n {\n static void Main()\n {\n const string filePath = @\"Data\\R488C.txt\";\n if (System.IO.File.Exists(filePath))\n {\n Console.SetIn(new System.IO.StreamReader(filePath));\n }\n\n IProblem counter = new R488C();\n\n foreach (var result in counter.GetResults())\n {\n Console.WriteLine(result);\n }\n }\n }\n\n internal class R488C : ProblemBase\n {\n public class Point\n {\n public double X { get; set; }\n public double Y { get; set; }\n }\n\n private double Area(Point a, Point b, Point c)\n {\n return (b.X - a.X) * (c.Y - a.Y) - (b.Y - a.Y) * (c.X - a.X);\n }\n\n private bool HasProjectionIntersection(double a, double b, double c, double d)\n {\n double temp;\n if (a > b)\n {\n temp = a;\n a = b;\n b = temp;\n }\n\n if (c > d)\n {\n temp = c;\n c = d;\n d = temp;\n }\n return Math.Max(a, c) <= Math.Min(b, d);\n }\n\n private bool HasIntersection(Point a, Point b, Point c, Point d)\n {\n return HasProjectionIntersection(a.X, b.X, c.X, d.X)\n && HasProjectionIntersection(a.Y, b.Y, c.Y, d.Y)\n && Area(a, b, c) * Area(a, b, d) <= 0\n && Area(c, d, a) * Area(c, d, b) <= 0;\n }\n\n public override IEnumerable GetResults()\n {\n var line = this.ReadIntArray();\n var first = new Point[4];\n for (int i = 0; i < 4; i++)\n {\n first[i] = new Point {X = line[2 * i], Y = line[2 * i + 1]};\n }\n\n var second = new Point[4];\n line = this.ReadIntArray();\n for (int i = 0; i < 4; i++)\n {\n second[i] = new Point { X = line[2 * i], Y = line[2 * i + 1] };\n }\n\n var hasIntersection = SimpleCheck(first, second);\n if (!hasIntersection)\n {\n var centerX = second.Sum(item => item.X) / 4.0;\n var centerY = second.Sum(item => item.Y) / 4.0;\n\n for (int i = 0; i < 4; i++)\n {\n first[i].X -= centerX;\n first[i].Y -= centerY;\n second[i].X -= centerX;\n second[i].Y -= centerY;\n }\n\n first = Rotate45(first);\n second = Rotate45(second);\n\n hasIntersection = SimpleCheck(second, first);\n }\n\n yield return hasIntersection? \"YES\" : \"n/a\";\n }\n\n private Point[] Rotate45(Point[] first)\n {\n var cos45 = Math.Cos(Math.PI / 4.0);\n var sin45 = Math.Sin(Math.PI / 4.0);\n var newPoints = new Point[4];\n for (int i = 0; i < 4; i++)\n {\n newPoints[i] = new Point\n {\n X = cos45 * first[i].X + sin45 * first[i].Y,\n Y = -sin45 * first[i].X + cos45 * first[i].Y\n };\n }\n\n return newPoints;\n }\n\n private bool SimpleCheck(Point[] first, Point[] second)\n {\n bool hasIntersection = false;\n for (int firstIndex = 0; firstIndex < 4; firstIndex++)\n {\n for (int secondIndex = 0; secondIndex < 4; secondIndex++)\n {\n if (HasIntersection(first[firstIndex], first[(firstIndex + 1) % 4], second[secondIndex],\n second[(secondIndex + 1) % 4]))\n {\n hasIntersection = true;\n break;\n }\n }\n }\n\n if (!hasIntersection)\n {\n var point = new Point\n {\n X = second.Sum(item => item.X) / 4.0,\n Y = second.Sum(item => item.Y) / 4.0\n };\n\n var minX = first[0].X;\n var maxX = first[0].X;\n var minY = first[0].Y;\n var maxY = first[0].Y;\n for (int i = 1; i < 4; i++)\n {\n if (first[i].X < minX)\n {\n minX = first[i].X;\n }\n\n if (first[i].Y < minY)\n {\n minY = first[i].Y;\n }\n\n if (first[i].X > maxX)\n {\n maxX = first[i].X;\n }\n\n if (first[i].Y > maxY)\n {\n maxY = first[i].Y;\n }\n }\n\n if (point.X <= maxX && point.X >= minX && point.Y >= minY && point.Y <= maxY)\n {\n hasIntersection = true;\n }\n }\n\n return hasIntersection;\n }\n }\n\n internal class R488D : ProblemBase\n {\n public override IEnumerable GetResults()\n {\n yield return \"n/a\";\n }\n }\n\n abstract class MultipleTestsBase : ProblemBase\n {\n public sealed override IEnumerable GetResults()\n {\n var t = Convert.ToInt32(Console.ReadLine());\n for (int testCaseNumber = 0; testCaseNumber < t; testCaseNumber++)\n {\n foreach (var result in GetTestResult(testCaseNumber + 1))\n {\n yield return result;\n }\n\n }\n\n }\n\n protected abstract IEnumerable GetTestResult(int caseNumber);\n }\n\n public interface IProblem\n {\n IEnumerable GetResults();\n }\n\n public abstract class ProblemBase : IProblem\n {\n public void PrintArray(IEnumerable items, string prefixMessage)\n {\n Console.WriteLine(\"{0}: {1}\", prefixMessage, string.Join(\",\", items));\n }\n\n public void WriteDiagnostics(string message, params object[] objects)\n {\n Console.WriteLine(message, objects);\n }\n\n public virtual IEnumerable GetResults()\n {\n yield return \"No result\";\n }\n\n protected int[] ReadIntArray()\n {\n return Array.ConvertAll(ReadTokens(), Convert.ToInt32);\n }\n\n protected long[] ReadLongArray()\n {\n return Array.ConvertAll(ReadTokens(), Convert.ToInt64);\n }\n\n protected string[] ReadTokens()\n {\n var readLine = Console.ReadLine();\n if (readLine == null)\n {\n throw new Exception(\"Value read from Console is null\");\n }\n return readLine.Split(' ');\n }\n\n protected int ReadInt32()\n {\n return Convert.ToInt32(Console.ReadLine());\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "49abd69c9624df4952c12f98db9bad2e", "src_uid": "f6a3dd8b3bab58ff66055c61ddfdf06a", "apr_id": "33e968591435a332a4eabcb629e3643e", "difficulty": 1600, "tags": ["brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.8046387154326494, "equal_cnt": 7, "replace_cnt": 4, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 6, "bug_source_code": "using System;\n\nclass Program\n{\n static void Main(string[] args)\n {\n int n = Convert.ToInt16(Console.ReadLine());\n string[] inp = Console.ReadLine().Split(' ');\n int p = Convert.ToInt16(inp[n - 2]);\n int c = Convert.ToInt16(inp[n - 1]);\n if (n == 1) Console.WriteLine(c == 15 ? \"DOWN\" : (c == 0 ? \"UP\" : \"-1\"));\n else\n {\n if (c > p) Console.WriteLine(c == 15 ? \"DOWN\" : \"UP\");\n else Console.WriteLine(c == 0 ? \"UP\" : \"DOWN\");\n }\n }\n}", "lang": "MS C#", "bug_code_uid": "501d6fa9878a4cf4fd40239e797762cc", "src_uid": "8330d9fea8d50a79741507b878da0a75", "apr_id": "7a1779ec8afbf8fab56fa0fdb15d3d0b", "difficulty": 1100, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.5107794361525705, "equal_cnt": 13, "replace_cnt": 7, "delete_cnt": 1, "insert_cnt": 4, "fix_ops_cnt": 12, "bug_source_code": "using System;\nusing System.Collections.Generic;\n\nnamespace Div._2_Vitya_in_the_Countryside\n{\n class Program\n {\n static int szamoksz1;\n static int[] szamok = new int[2];\n static void Main(string[] args)\n {\n szamoksz1 = int.Parse(Console.ReadLine());\n string[] s = Console.ReadLine().Split(' ');\n for (int i = szamoksz1-2; i < szamoksz1; i++)\n {\n szamok[i] = int.Parse(s[i]);\n }\n if (szamoksz1 == 1)\n\t {\n\t\t Console.Write(-1);\n\t }\n else\n Console.Write(Megoldas());;\n }\n static string Megoldas()\n {\n if (szamok[0] < szamok[1] && szamok[1] != 15)\n {\n return \"UP\";\n }\n else if (szamok[0] > szamok[1] && szamok[1] != 0)\n {\n return \"DOWN\";\n }\n else if (szamok[1] == 15)\n return \"DOWN\";\n else\n return \"UP\";\n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "a9b97379890010f9347f0890e88d6736", "src_uid": "8330d9fea8d50a79741507b878da0a75", "apr_id": "17831e7a8b3c93bf21874ff842ba3f69", "difficulty": 1100, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9941060903732809, "equal_cnt": 5, "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;\n\nnamespace ConsoleApp1\n{\n class Program\n {\n static int ReadInt() => int.Parse(Console.ReadLine());\n static long ReadLong() => long.Parse(Console.ReadLine());\n static double ReadDouble() => double.Parse(Console.ReadLine());\n static string ReadString() => Console.ReadLine();\n static int[] ReadIntArray() => (Console.ReadLine().Split(' ')).Select(int.Parse).ToArray();\n static double[] ReadDoubleArray() => (Console.ReadLine().Split(' ')).Select(double.Parse).ToArray();\n static long[] ReadLongArray() => (Console.ReadLine().Split(' ')).Select(long.Parse).ToArray();\n static List ReadIntList() => (Console.ReadLine().Split(' ')).Select(int.Parse).ToList();\n static List ReadLongList() => (Console.ReadLine().Split(' ')).Select(long.Parse).ToList();\n static char[] ReadCharArray() => (Console.ReadLine().Split(' ')).Select(char.Parse).ToArray();\n\n public struct P {\n int x;\n int y;\n public P(int x, int y)\n {\n this.x = x;\n this.y = y;\n }\n }\n \n\n static void Main(string[] args)\n {\n long n = ReadLong();\n long ans = 0;\n\n if (n % 2 == 0)\n {\n ans += n/2;\n n = 0;\n }\n for (long i = 3; i <= n; i+=2)\n {\n if (n % i == 0)\n {\n ans++;\n n -= i;\n break;\n }\n }\n ans += n / 2;\n\n Console.WriteLine(ans);\n Console.ReadLine();\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "e26e46d7c201fced565c1579c3fe8058", "src_uid": "a1e80ddd97026835a84f91bac8eb21e6", "apr_id": "dda4167ad4ba0ffd16187b0d09af434e", "difficulty": 1200, "tags": ["number theory", "math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.9718875502008032, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 3, "bug_source_code": "using System;\nusing System.Collections.Generic;\n\nnamespace CSharp\n{\n class _1076B\n {\n public static void Main()\n {\n long n = long.Parse(Console.ReadLine());\n\n var primes = new SortedSet();\n for (long i = 2; ; i++)\n {\n bool isPrime = true;\n\n foreach (long p in primes)\n {\n if (i % p == 0)\n {\n isPrime = false;\n break;\n }\n\n if (i * i >= p)\n {\n break;\n }\n }\n\n if (isPrime)\n {\n primes.Add(i);\n\n if (n % i == 0)\n {\n Console.WriteLine((n - i) / 2 + 1);\n break;\n }\n }\n }\n }\n }\n}", "lang": "Mono C#", "bug_code_uid": "a23ed1d5d6f868f09d5c59f363aa85aa", "src_uid": "a1e80ddd97026835a84f91bac8eb21e6", "apr_id": "5a39d741036939bf4c0b7ad4b44c40c4", "difficulty": 1200, "tags": ["number theory", "math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.17531446540880502, "equal_cnt": 9, "replace_cnt": 6, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 8, "bug_source_code": "using System;\nusing System.Collections.Generic;\n\nnamespace Program\n{\n class Program\n {\n static Dictionary primes = new Dictionary();\n static Dictionary divisors = new Dictionary();\n \n static long Sieve(long n)\n {\n if(divisors.ContainsKey(n)) return divisors[n];\n \n long root = (long)Math.Ceiling(Math.Sqrt(n));\n\n for (long i = 2; i <= root; i++)\n {\n if(!primes.ContainsKey(i))\n {\n primes.Add(i, true);\n if(n % i == 0)\n {\n divisors.Add(n, i);\n return i;\n }\n\n long k = 1;\n \n for (long j = i * i; j < n; )\n {\n if(!primes.ContainsKey(j)) primes.Add(j, false);\n j = i * i + k * i;\n k++;\n }\n }\n }\n\n divisors.Add(n, n);\n return n;\n }\n \n static void Main(string[] args)\n {\n\n long n, count = 0, divisor;\n\n n = Convert.ToInt64(Console.ReadLine());\n\n while (true)\n {\n if(n == 0) break;\n\n if(n % 2 == 0)\n {\n count += n / 2;\n break;\n }\n\n divisor = Sieve(n);\n\n n -= divisor;\n\n count++;\n }\n\n Console.WriteLine(count);\n }\n }\n}", "lang": "Mono C#", "bug_code_uid": "05ac39358ef9f9804d4b7db8eb14e395", "src_uid": "a1e80ddd97026835a84f91bac8eb21e6", "apr_id": "34efb11be7b9096e32e9c4b076a2c10a", "difficulty": 1200, "tags": ["number theory", "math", "implementation"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.6831858407079646, "equal_cnt": 11, "replace_cnt": 5, "delete_cnt": 2, "insert_cnt": 3, "fix_ops_cnt": 10, "bug_source_code": "using System;\n\nclass tf\n{\n public static void Main()\n {\n long n = long.Parse(Console.ReadLine());\n \n int i = 3;\n int c = 0;\n \n var sqrt = Math.Sqrt(n);\n \n if(n % 2 == 0) \n {\n Console.WriteLine(n / 2);\n return;\n }\n while(i <= sqrt)\n {\n if(n % i == 0)\n {\n n -= i;\n c++;\n i = 2;\n }\n \n i+= 3;\n }\n \n if(i > sqrt) c= 1;\n \n Console.WriteLine(c);\n }\n}", "lang": "Mono C#", "bug_code_uid": "3e57c5963b593cc2c685a17585b5c2e0", "src_uid": "a1e80ddd97026835a84f91bac8eb21e6", "apr_id": "3fecc85268114dc6ad88c9114e056a5c", "difficulty": 1200, "tags": ["number theory", "math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.40477453580901857, "equal_cnt": 29, "replace_cnt": 24, "delete_cnt": 4, "insert_cnt": 1, "fix_ops_cnt": 29, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Text.RegularExpressions;\nusing System.Threading.Tasks;\n\nnamespace CodeForces\n{\n public class CodeForces\n {\n static void Main(string[] args)\n {\n\n var n = int.Parse(Console.ReadLine());\n //var arr = GetArray();\n Console.WriteLine(Solve(n));\n // Tests();\n\n }\n\n public static void Tests()\n {\n //Solve(10, new int[] { 1, 2, 3, 5, 8, 13, 21, 34, 55, 89});\n }\n\n\n\n public static long Solve(int n)\n {\n var sieve = new int[1000000];\n var primes = new List();\n for (var i = 2; i < sieve.Length; i++)\n {\n if (sieve[i] == 1)\n continue;\n\n primes.Add(i);\n var k = i + i;\n while(k < sieve.Length)\n {\n sieve[k] = 1;\n k += i;\n }\n }\n long cn = 0;\n while (n > 0)\n { \n for (var i = 0; i < primes.Count; i++)\n {\n if (n % primes[i] == 0)\n {\n n -= primes[i];\n cn++;\n break;\n }\n }\n }\n return cn;\n }\n\n static int[] GetArray()\n {\n return Array.ConvertAll(Console.ReadLine().Split(), Convert.ToInt32);\n }\n\n\n }\n}", "lang": "Mono C#", "bug_code_uid": "bc0c32c2a8b44e820918f32d8882e324", "src_uid": "a1e80ddd97026835a84f91bac8eb21e6", "apr_id": "207dd2e951730b7c1562a0b4e5b07321", "difficulty": 1200, "tags": ["number theory", "math", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9841493483620993, "equal_cnt": 6, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 5, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Diagnostics.CodeAnalysis;\nusing System.Linq;\nusing System.Resources;\nusing System.Text;\n\nnamespace Codeforces\n{\n\tclass Program\n\t{\n\t\tstatic void Main(string[] args)\n\t\t{\n\t\t\tstring input1 = Console.ReadLine();\n\t\t\t//string input2 = Console.ReadLine();\n\n\t\t\t//string input3 = Console.ReadLine();\n\t\t\t//string input4 = Console.ReadLine();\n\n\t\t\t//var inputs1 = input1.Split(new[] { ' ' }, StringSplitOptions.RemoveEmptyEntries).Select(long.Parse).ToArray();\n\t\t\t//var inputs2 = input2.Split(new[] { ' ' }, StringSplitOptions.RemoveEmptyEntries).Select(long.Parse).ToArray();\n\n\t\t\tlong n = long.Parse(input1);\n\t\t\tif (n % 2 == 0) \n\t\t\t{\n\t\t\t\tConsole.WriteLine(n / 2);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tlong d = 3;\n\t\t\twhile (n % d > 0) \n\t\t\t{\n\t\t\t\td += 2;\n\t\t\t}\n\n\t\t\tif (n > d) \n\t\t\t{\n\t\t\t\tConsole.WriteLine(1 + (n - d) / 2);\n\t\t\t} \n\t\t\telse \n\t\t\t{\n\t\t\t\tConsole.WriteLine(1);\n\t\t\t}\n\t\t}\n\n\t\tpublic static void Print(int[] number) \n\t\t{\n\t\t\tvar stringBuilder = new StringBuilder();\n\t\t\tforeach (var i in number)\n\t\t\t{\n\t\t\t\tif (i == 0 && stringBuilder.Length == 0)\n\t\t\t\t{\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tstringBuilder.Append(i);\n\t\t\t}\n\n\t\t\tConsole.WriteLine(stringBuilder.ToString());\n\t\t}\n\n\t\tpublic void Method1(ref int n1, ref int n2, ref int k1, ref int k2) \n\t\t{\n\t\t\tdouble a = (double)n1 / k1;\n\t\t\tdouble b = (double)n2 / k2;\n\t\t\tif (n1 >= n2 || (a >= b && a < 2 * b))\n\t\t\t{\n\n\t\t\t}\n\t\t}\n\n\t\tpublic void Method2(ref int n1, ref int n2, ref int k1, ref int k2)\n\t\t{\n\t\t\tdouble a = (double)n1 / k1;\n\t\t\tdouble b = (double)n2 / k2;\n\t\t\tif (n2 >= n1 || (b >= a && b < 2 * a))\n\t\t\t{\n\n\t\t\t}\n\t\t}\n\n\t\tpublic class Node\n\t\t{\n\t\t\tpublic int Count { get; set; }\n\n\t\t\tpublic int FirstIndex { get; set; } = -1;\n\n\t\t\tpublic int LastIndex { get; set; } = -1;\n\t\t}\n\n\t\t//public class Node\n\t\t//{\n\t\t//\tpublic Node Left { get; set; }\n\n\t\t//\tpublic Node Right { get; set; }\n\n\t\t//\tpublic T Value { get; set; }\n\n\t\t//\tpublic Node(T value) \n\t\t//\t{\n\t\t//\t\tValue = value;\n\t\t//\t}\n\t\t//}\n\n\t\t//public class Tree\n\t\t//{\n\t\t//\tpublic Node Root { get; set; }\n\n\t\t//\tpublic Tree(T value) \n\t\t//\t{\n\t\t//\t\tRoot = new Node(value);\n\t\t//\t}\n\t\t//}\n\n\t\tprivate static long GCD(long a, long b)\n\t\t{\n\t\t\tlong max = Math.Max(a, b);\n\t\t\tlong min = Math.Min(a, b);\n\n\t\t\tif (min == 0)\n\t\t\t{\n\t\t\t\treturn max;\n\t\t\t}\n\n\t\t\ta = min;\n\t\t\tb = max % min;\n\t\t\treturn GCD(a, b);\n\t\t}\n\n\t\tprivate static long LCM(long a, long b)\n\t\t{\n\t\t\treturn Math.Abs(a * b) / GCD(a, b);\n\t\t}\n\n\t\t//private static int Length(short[] a)\n\t\t//{\n\t\t//\tint firstItemIndex = 0;\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{\n\t\t//\t\t\tcontinue;\n\t\t//\t\t}\n\n\t\t//\t\tfirstItemIndex = i;\n\t\t//\t\tbreak;\n\t\t//\t}\n\n\t\t//\treturn a.Length - firstItemIndex;\n\t\t//}\n\n\t\t//private static short[] Subtract(short[] a, short[] b)\n\t\t//{\n\t\t//\tif (a.Length != b.Length)\n\t\t//\t{\n\t\t//\t\tthrow new ArgumentException();\n\t\t//\t}\n\n\t\t//\tshort[] result = new short[a.Length];\n\t\t//\tArray.Copy(a, result, a.Length);\n\t\t//\tfor (int i = result.Length - 1; i >= 0; i--)\n\t\t//\t{\n\t\t//\t\tif (result[i] < b[i])\n\t\t//\t\t{\n\t\t//\t\t\tint j = i - 1;\n\t\t//\t\t\twhile (result[j] == 0)\n\t\t//\t\t\t{\n\t\t//\t\t\t\tresult[j--] = 9;\n\t\t//\t\t\t}\n\n\t\t//\t\t\tresult[j]--;\n\t\t//\t\t\tresult[i] += 10;\n\t\t//\t\t}\n\n\t\t//\t\tresult[i] -= b[i];\n\t\t//\t}\n\n\t\t//\treturn result;\n\t\t//}\n\n\t\t//private static short[] Multiply(short[] a, int b)\n\t\t//{\n\t\t//\tshort[] result = new short[a.Length];\n\t\t//\tfor (int i = a.Length - 1; i > 0; i--)\n\t\t//\t{\n\t\t//\t\tint temp = a[i] * b;\n\t\t//\t\tresult[i] = (short)(result[i] + temp % 10);\n\t\t//\t\tresult[i - 1] = (short)(result[i - 1] + temp / 10);\n\t\t//\t}\n\n\t\t//\treturn result;\n\t\t//}\n\n\t\t//private static int Mod(short[] a, int b)\n\t\t//{\n\t\t//\tint rest = 0, i = 0;\n\t\t//\twhile (i < a.Length)\n\t\t//\t{\n\t\t//\t\tint d = 10 * rest + a[i];\n\t\t//\t\twhile (d < b && i < a.Length - 1)\n\t\t//\t\t{\n\t\t//\t\t\td = 10 * d + a[++i];\n\t\t//\t\t}\n\n\t\t//\t\trest = d % b;\n\t\t//\t\ti++;\n\t\t//\t}\n\n\t\t//\treturn rest;\n\t\t//}\n\n\t\t//private static short[] Divide(short[] a, int b)\n\t\t//{\n\t\t//\tshort[] result = new short[a.Length];\n\t\t//\tint rest = 0, i = 0;\n\t\t//\twhile (i < a.Length)\n\t\t//\t{\n\t\t//\t\tint d = 10 * rest + a[i];\n\t\t//\t\twhile (d < b && i < a.Length - 1)\n\t\t//\t\t{\n\t\t//\t\t\td = 10 * d + a[++i];\n\t\t//\t\t}\n\n\t\t//\t\tresult[i] = (short)(d / b);\n\t\t//\t\trest = d % b;\n\t\t//\t\ti++;\n\t\t//\t}\n\n\t\t//\treturn result;\n\t\t//}\n\t}\n}\n", "lang": "Mono C#", "bug_code_uid": "f5e4cc40702f55b988e8833e60b5e0ed", "src_uid": "a1e80ddd97026835a84f91bac8eb21e6", "apr_id": "9a7e4f52d0e55077b46555624641e767", "difficulty": 1200, "tags": ["number theory", "math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.9981921176328794, "equal_cnt": 11, "replace_cnt": 5, "delete_cnt": 5, "insert_cnt": 0, "fix_ops_cnt": 10, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\n\nnamespace Shower_Line\n{\n class Program\n {\n static void Main(string[] args)\n {\n IO io = new IO();\n const int i_Num = 5;\n int[,] td_arr_Inputs = new int[i_Num,i_Num];\n\n for(int i =0;i i_Max)\n {\n i_Max = td_arr_Inputs[i, j] + td_arr_Inputs[j, i] +\n td_arr_Inputs[p,q] + td_arr_Inputs[q,p] +\n td_arr_Inputs[j,p] + td_arr_Inputs[p,j] +\n td_arr_Inputs[q,k] + td_arr_Inputs[k,q] +\n td_arr_Inputs[p,q] + td_arr_Inputs[q,p] +\n td_arr_Inputs[q,k] + td_arr_Inputs[k,q];\n }\n }\n }\n }\n }\n }\n }\n #endregion\n io.PutStr(i_Max);\n io.ReadInt();\n }\n }\n\n\n\n class IO\n {\n private static Queue currentLineTokens = new Queue();\n private static string[] ReadAndSplitLine()\n {\n return Console.ReadLine().Split(new[] { ' ', '\\t' }, StringSplitOptions.RemoveEmptyEntries);\n }\n public int ReadNextInt()\n {\n return int.Parse(ReadToken());\n }\n public long ReadNextLong()\n {\n return long.Parse(ReadToken());\n }\n\n public int ReadInt()\n {\n return Convert.ToInt32(Console.ReadLine());\n }\n public long ReadLong()\n {\n return Convert.ToInt64(Console.ReadLine());\n }\n public string ReadStr()\n {\n return Console.ReadLine();\n }\n public string[] ReadStrArr()\n {\n return Console.ReadLine().Split(' ');\n }\n public int[] ReadIntArr()\n {\n return Array.ConvertAll(Console.ReadLine().Split(' '), s => int.Parse(s));\n }\n public long[] ReadLongArr()\n {\n return Array.ConvertAll(Console.ReadLine().Split(' '), s => long.Parse(s));\n }\n public void PutStr(string str)\n {\n Console.WriteLine(str);\n }\n public void PutStr(int str)\n {\n Console.WriteLine(str);\n }\n public void PutStr(long str)\n {\n Console.WriteLine(str);\n }\n\n public static string ReadToken()\n {\n while (currentLineTokens.Count == 0)\n currentLineTokens = new Queue(ReadAndSplitLine());\n return currentLineTokens.Dequeue();\n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "13be89030c1da6915a4a8f1eed982948", "src_uid": "be6d4df20e9a48d183dd8f34531df246", "apr_id": "2fc8ec55aa33bf4fb529a75d5b026966", "difficulty": 1200, "tags": ["brute force", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9064914992272025, "equal_cnt": 30, "replace_cnt": 4, "delete_cnt": 25, "insert_cnt": 0, "fix_ops_cnt": 29, "bug_source_code": "using System;\nusing System.IO;\nusing System.Linq;\n\nnamespace Tournir247\n{\n\tclass ProgramB\n\t{\n\n\t\tpublic static void Main(string[] args)\n\t\t{\n\t\t\tnew ProgramB().run();\n\t\t}\n\n\t\tpublic void run()\n\t\t{\n\t\t\tusing (StreamReader input = new StreamReader(\"input.txt\"))\n\t\t\tusing (StreamWriter output = new StreamWriter(\"output.txt\"))\n\t\t\t{\n\t\t\t\tint[][] g = new int[5][];\n\n\t\t\t\tfor (int i = 0; i < g.GetLength(0); i++)\n\t\t\t\t{\n\t\t\t\t\tg[i] = input.ReadLine().Split(' ').Select(stringNumber => int.Parse(stringNumber)).ToArray();\n\t\t\t\t}\n\n\t\t\t\tfor (int i = 0; i < 5; i++)\n\t\t\t\t{\n\t\t\t\t\tfor (int j = i + 1; j < 5; j++)\n\t\t\t\t\t{\n\t\t\t\t\t\tg[i][j] = g[j][i] = g[i][j] + g[j][i];\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tlong maxJoi = 0;\n\n\t\t\t\tfor (int a1 = 0; a1 < 5; a1++)\n\t\t\t\t\tfor (int a2 = 0; a2 < 5; a2++)\n\t\t\t\t\t\tif (a2 != a1)\n\t\t\t\t\t\t\tfor (int a3 = 0; a3 < 5; a3++)\n\t\t\t\t\t\t\t\tif (a3 != a1 && a3 != a2)\n\t\t\t\t\t\t\t\t\tfor (int a4 = 0; a4 < 5; a4++)\n\t\t\t\t\t\t\t\t\t\tif (a4 != a1 && a4 != a2 && a4 != a3)\n\t\t\t\t\t\t\t\t\t\t\tfor (int a5 = 0; a5 < 5; a5++)\n\t\t\t\t\t\t\t\t\t\t\t\tif (a5 != a1 && a5 != a2 && a5 != a3 && a5 != a4)\n\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\tlong joi = getJoi(g, a1, a2, a3, a4, a5);\n\t\t\t\t\t\t\t\t\t\t\t\t\tif (joi > maxJoi)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tmaxJoi = joi;\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\toutput.Write(maxJoi);\n\t\t\t}\n\t\t}\n\n\t\tpublic long getJoi(int[][] g, int a1, int a2, int a3, int a4, int a5)\n\t\t{\n\t\t\treturn g[a1][a2] + g[a3][a4] + g[a2][a3] + g[a4][a5] + g[a3][a4] + g[a4][a5];\n\t\t}\n\n\t}\n}", "lang": "MS C#", "bug_code_uid": "f2fde825705ee2ed3cd7e964104bc1b8", "src_uid": "be6d4df20e9a48d183dd8f34531df246", "apr_id": "ceee439caae4bd6c53ba53a939dff16c", "difficulty": 1200, "tags": ["brute force", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C#"} {"similarity_score": 0.5261813537675607, "equal_cnt": 10, "replace_cnt": 4, "delete_cnt": 3, "insert_cnt": 3, "fix_ops_cnt": 10, "bug_source_code": "using System;\n\nclass test\n{\n static void Main()\n {\n int n = int.Parse(Console.ReadLine()),\n k = int.Parse(Console.ReadLine()),\n x = int.Parse(Console.ReadLine()),r = 0;\n for (int i = 0; i < n - k; i++)\n r += int.Parse(Console.ReadLine());\n for (int i = 0; i < k; i++)\n {\n Console.ReadLine();\n r += x;\n }\n Console.WriteLine(r);\n }\n}", "lang": "MS C#", "bug_code_uid": "785bd885c01c4558a98c7bad5f01a2f9", "src_uid": "92a233f8d9c73d9f33e4e6116b7d0a96", "apr_id": "0feaa0683bf6be6628c019519a27612f", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9903945618442441, "equal_cnt": 13, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 10, "fix_ops_cnt": 12, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Diagnostics;\nusing System.IO;\nusing System.Linq;\nusing System.Numerics;\n\nnamespace CodeforcesTemplate\n{\n class Program\n {\n private const string FILENAME = \"distance4\";\n\n private const string INPUT = FILENAME + \".in\";\n\n private const string OUTPUT = FILENAME + \".out\";\n\n private static Stopwatch _stopwatch = new Stopwatch();\n\n private static StreamReader _reader = null;\n private static StreamWriter _writer = null;\n\n private static string[] _curLine;\n private static int _curTokenIdx;\n\n private static char[] _whiteSpaces = new char[] { ' ', '\\t', '\\r', '\\n' };\n\n private static string ReadNextToken()\n {\n if (_curTokenIdx >= _curLine.Length)\n {\n //Read next line\n string line = _reader.ReadLine();\n if (line != null)\n _curLine = line.Split(_whiteSpaces, StringSplitOptions.RemoveEmptyEntries);\n else\n _curLine = new string[] { };\n _curTokenIdx = 0;\n }\n\n if (_curTokenIdx >= _curLine.Length)\n return null;\n\n return _curLine[_curTokenIdx++];\n }\n\n private static int ReadNextInt()\n {\n return int.Parse(ReadNextToken());\n }\n\n private static void RunTimer()\n {\n#if (DEBUG)\n\n _stopwatch.Start();\n\n#endif\n }\n\n private static void Main(string[] args)\n {\n#if (DEBUG)\n double before = GC.GetTotalMemory(false);\n#endif\n\n int[] toks = ReadIntArray();\n\n int n = toks[0];\n int x = toks[1];\n\n int[] arr = ReadIntArray();\n\n RunTimer();\n\n Array.Sort(arr);\n\n int count = 0;\n\n for (int i = 0; i <= x; i++)\n {\n if (!arr.Contains(i) && i != x)\n {\n count++;\n }\n\n if (i == x && arr.Contains(x))\n {\n count++;\n }\n \n }\n\n Console.WriteLine(count);\n\n\n#if (DEBUG)\n _stopwatch.Stop();\n\n double after = GC.GetTotalMemory(false);\n\n double consumedInMegabytes = (after - before) / (1024 * 1024);\n\n Console.WriteLine($\"Time elapsed: {_stopwatch.Elapsed}\");\n\n Console.WriteLine($\"Consumed memory (MB): {consumedInMegabytes}\");\n\n Console.ReadKey();\n#endif\n\n\n }\n\n private static int CountLeadZeros(string source)\n {\n int countZero = 0;\n\n for (int i = source.Length - 1; i >= 0; i--)\n {\n if (source[i] == '0')\n {\n countZero++;\n }\n\n else\n {\n break;\n }\n\n }\n\n return countZero;\n }\n\n private static string ReverseString(string source)\n {\n char[] reverseArray = source.ToCharArray();\n\n Array.Reverse(reverseArray);\n\n string reversedString = new string(reverseArray);\n\n return reversedString;\n }\n\n\n private static int[] CopyOfRange(int[] src, int start, int end)\n {\n int len = end - start;\n int[] dest = new int[len];\n Array.Copy(src, start, dest, 0, len);\n return dest;\n }\n\n private static string StreamReader()\n {\n\n if (_reader == null)\n _reader = new StreamReader(INPUT);\n string response = _reader.ReadLine();\n if (_reader.EndOfStream)\n _reader.Close();\n return response;\n\n\n }\n\n private static void StreamWriter(string text)\n {\n\n if (_writer == null)\n _writer = new StreamWriter(OUTPUT);\n _writer.WriteLine(text);\n\n\n }\n\n\n\n\n\n private static int BFS(int start, int end, int[,] arr)\n {\n Queue> queue = new Queue>();\n List visited = new List();\n for (int i = 0; i < arr.GetLength(0); i++)\n {\n visited.Add(false);\n }\n\n queue.Enqueue(new KeyValuePair(start, 0));\n KeyValuePair node;\n int level = 0;\n bool flag = false;\n\n while (queue.Count != 0)\n {\n node = queue.Dequeue();\n if (node.Key == end)\n {\n return node.Value;\n }\n flag = false;\n for (int i = 0; i < arr.GetLength(0); i++)\n {\n\n if (arr[node.Key, i] == 1)\n {\n if (visited[i] == false)\n {\n if (!flag)\n {\n level = node.Value + 1;\n flag = true;\n }\n queue.Enqueue(new KeyValuePair(i, level));\n visited[i] = true;\n }\n }\n }\n\n }\n return 0;\n\n }\n\n\n\n private static void Write(string source)\n {\n File.WriteAllText(OUTPUT, source);\n }\n\n private static string ReadString()\n {\n return File.ReadAllText(INPUT);\n }\n\n private static void WriteStringArray(string[] source)\n {\n File.WriteAllLines(OUTPUT, source);\n }\n\n private static string[] ReadStringArray()\n {\n return File.ReadAllLines(INPUT);\n }\n\n private static int[] ReadIntArray()\n {\n return ReadString().Split(' ').Select(int.Parse).ToArray();\n }\n\n private static double[] ReadDoubleArray()\n {\n return ReadString().Split(' ').Select(double.Parse).ToArray();\n }\n\n private static int[,] ReadINT2XArray(List lines)\n {\n int[,] arr = new int[lines.Count, lines.Count];\n\n for (int i = 0; i < lines.Count; i++)\n {\n int[] row = lines[i].Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries).Select(int.Parse).ToArray();\n\n for (int j = 0; j < lines.Count; j++)\n {\n arr[i, j] = row[j];\n }\n }\n\n return arr;\n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "19ad1896211724b60907e9003b6f0ea3", "src_uid": "21f579ba807face432a7664091581cd8", "apr_id": "e117ea2a9f6ccca7f23c12199cf79eb9", "difficulty": 1000, "tags": ["greedy", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.9872444522103792, "equal_cnt": 4, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "using System;\nusing System.Collections.Generic;\n\nnamespace CodeForceCs\n{\n static class Program\n {\n static void Main(string[] args)\n {\n Solver solver = new _462_2D();\n solver.SolveProblem();\n //Console.ReadKey();\n }\n }\n\n static class Utility\n { \n static public T[] NewArrayWithValue(int length, T value)\n {\n T[] array = new T[length];\n for (int i = 0; i < array.Length; i++)\n {\n array[i] = value;\n }\n return array;\n }\n }\n\n abstract class Solver\n {\n abstract public void SolveProblem();\n }\n\n class _462_2D : Solver\n {\n Int64 p, k, z;\n int d;\n List a, q;\n String result;\n public override void SolveProblem()\n {\n String[] input = Console.ReadLine().Split();\n p = Int64.Parse(input[0]);\n k = Int64.Parse(input[1]);\n a = new List();\n q = new List();\n\n d = 1;\n z = p % k;\n a.Add(z);\n q.Add((z - p) / k);\n\n while (!(q[d-1] >= 0 && q[d-1] < k))\n {\n z = q[d - 1] % k;\n if (z < 0)\n z += k;\n a.Add(z);\n q.Add((z - q[d - 1]) / k);\n d++;\n }\n a.Add(q[d - 1]);\n\n Console.WriteLine(d+1);\n\n result = \"\";\n foreach (Int64 v in a)\n result += v + \" \";\n Console.WriteLine(result);\n\n //result = \"\";\n //foreach (Int64 v in q)\n // result += v + \" \";\n //Console.WriteLine(result);\n }\n }\n\n class _462_2C : Solver\n {\n List a;\n int n, result;\n\n public override void SolveProblem()\n {\n a = new List();\n n = int.Parse(Console.ReadLine());\n result = Math.Min(n, 2);\n\n String[] input = Console.ReadLine().Split();\n foreach (String s in input)\n a.Add(int.Parse(s));\n\n for (int i = 1; i < n-1; i++)\n {\n result = Math.Max(result, GetMaxNonDec(0, i) + GetMaxNonDec(i, n - i));\n }\n Console.WriteLine(result);\n\n }\n\n int GetMaxNonDec(int start, int length)\n {\n if (length <= 0)\n return 0;\n\n int[] oneNum, twoNum;\n oneNum = new int[length];\n twoNum = new int[length];\n oneNum[0] = a[start] == 1 ? 1 : 0;\n twoNum[0] = a[start + length - 1] == 2 ? 1 : 0;\n\n for (int i = 1; i < length; i++ )\n {\n oneNum[i] = oneNum[i-1];\n twoNum[i] = twoNum[i-1];\n if (a[start + i] == 1)\n oneNum[i]++;\n if (a[start + length - 1 - i] == 2)\n twoNum[i]++;\n }\n\n int result = Math.Min(length, 2);\n for (int i = 0; i < length; i++)\n result = Math.Max(result, oneNum[i] + twoNum[length - i - 1]);\n return result;\n }\n }\n\n class _462_2B : Solver\n {\n String result = \"\";\n int k;\n public override void SolveProblem()\n {\n k = int.Parse(Console.ReadLine());\n if (k > 36)\n {\n Console.WriteLine(\"-1\");\n return;\n }\n while (k > 1)\n {\n result += \"8\";\n k -= 2;\n }\n if (k == 1)\n result += \"6\";\n Console.WriteLine(result);\n }\n }\n\n class _462_2A : Solver\n {\n int n, m;\n List a, b;\n Int64 result;\n public override void SolveProblem()\n {\n a = new List();\n b = new List();\n\n String[] input = Console.ReadLine().Split();\n n = int.Parse(input[0]);\n m = int.Parse(input[1]);\n\n input = Console.ReadLine().Split();\n foreach (String s in input)\n a.Add(Int64.Parse(s));\n\n input = Console.ReadLine().Split();\n foreach (String s in input)\n b.Add(Int64.Parse(s));\n\n a.Sort();\n b.Sort();\n\n Int64 p11, p12, p21, p22;\n p11 = Math.Max(a[1] * b[0], a[1] * b[m-1]);\n p12 = Math.Max(a[n - 1] * b[0], a[n - 1] * b[m - 1]);\n p21 = Math.Max(a[0] * b[0], a[0] * b[m - 1]);\n p22 = Math.Max(a[n - 2] * b[0], a[n - 2] * b[m - 1]);\n\n result = Math.Min(Math.Max(p11, p12), Math.Max(p21, p22));\n\n Console.WriteLine(result);\n }\n }\n\n class _910A : Solver\n {\n int n, d;\n int[] minstep;\n string lily;\n override public void SolveProblem()\n {\n var input = Console.ReadLine().Split();\n n = int.Parse(input[0]);\n d = int.Parse(input[1]);\n lily = Console.ReadLine();\n minstep = Utility.NewArrayWithValue(n+1, 999);\n minstep[1] = 0;\n\n for (int i = 2; i <= n; i++)\n {\n for (int j = i; j >= Math.Max(1, i-d); j--)\n {\n if (lily[j-1] == '0')\n continue;\n\n minstep[i] = Math.Min(minstep[i], minstep[j] + 1);\n }\n }\n\n if (minstep[n] > n)\n Console.WriteLine(-1);\n else\n Console.WriteLine(minstep[n]);\n }\n\n }\n}\n\n", "lang": "MS C#", "bug_code_uid": "733d7d15e6c6d66629166437f3d27092", "src_uid": "f4dbaa8deb2bd5c054fe34bb83bc6cd5", "apr_id": "c412d6a0fd08a7db7665539f461fdf2f", "difficulty": 2000, "tags": ["math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9966178128523112, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "using System;\nclass Program\n{\n static int Main()\n {\n int n=Int32.Parse(Console.ReadLine());\n int k=0;\n do{\n if(n>99)\n n-=100;\n else if(n>19)\n n-=20;\n else if(n>9)\n n-=10;\n else if(n>4)\n n-=5;\n else if(n>0)\n n-=1;\n k++;\n }while(n>-1);\n Console.WriteLine(k);\n return 0;\n }\n}", "lang": "Mono C#", "bug_code_uid": "113c70a983e03e5c7707200a66435ce0", "src_uid": "8e81ad7110552c20297f08ad3e5f8ddc", "apr_id": "673640af27da04754294a1e5f801782e", "difficulty": 800, "tags": ["dp", "greedy"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9973474801061007, "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 Allen\n{\n class Program\n {\n static void Main(string[] args)\n {\n int[] numbers = Console.ReadLine().Split().Select(x => int.Parse(x)).ToArray();\n int quantityOFcash = 0;\n while(numbers[0] - 100 >= 0)\n {\n if (numbers[0] - 100 >= 0)\n {\n quantityOFcash++;\n numbers[0] -= 100;\n }\n }\n while (numbers[0] - 20 >= 0)\n {\n if (numbers[0] - 20 >= 0)\n {\n quantityOFcash++;\n numbers[0] -= 20;\n }\n }\n while (numbers[0] - 10 >= 0)\n {\n if (numbers[0] - 10 >= 0)\n {\n quantityOFcash++;\n numbers[0] -= 10;\n }\n }\n while (numbers[0] - 5 >= 0)\n {\n if (numbers[0] - 5 >= 0)\n {\n quantityOFcash++;\n numbers[0] -= 5;\n }\n }\n while (numbers[0] - 1 >= 0)\n {\n if (numbers[0] - 1 >= 0)\n {\n quantityOFcash++;\n numbers[0] -= 1;\n }\n }\n Console.WriteLine(quantityOFcash);\n }", "lang": "Mono C#", "bug_code_uid": "24e7cb5267411e787cd76d3818489448", "src_uid": "8e81ad7110552c20297f08ad3e5f8ddc", "apr_id": "85ebfd5c34a08ddcd94e4ee2c9b99acf", "difficulty": 800, "tags": ["dp", "greedy"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.3562374916611074, "equal_cnt": 9, "replace_cnt": 3, "delete_cnt": 5, "insert_cnt": 1, "fix_ops_cnt": 9, "bug_source_code": "using System;\nusing static System.Math;\nusing System.Linq;\n\nnamespace ConsoleApplication\n{\n sealed class Program\n {\n static void Main(string[] args)\n {\n var n = Int32.Parse(Console.ReadLine());\n mem = new int[n + 1];\n Console.WriteLine(F(n));\n }\n\n\n private static int[] mem;\n\n static int F(int n)\n {\n if (n < 0)\n return 1000000;\n if (n % 100 == 0)\n return n / 100;\n if (n == 1)\n return 1;\n if (mem[n] == 0)\n mem[n] = Min(Min(F(n - 1), F(n - 5)), Min(Min(F(n - 10), F(n - 20)), F(n - 100))) + 1;\n return mem[n];\n }\n }\n}", "lang": "Mono C#", "bug_code_uid": "0d9200c77afadaa915c851cc90274976", "src_uid": "8e81ad7110552c20297f08ad3e5f8ddc", "apr_id": "c120c9cfe5196836ded24c71320a2bc6", "difficulty": 800, "tags": ["dp", "greedy"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C#"} {"similarity_score": 0.35286284953395475, "equal_cnt": 10, "replace_cnt": 4, "delete_cnt": 5, "insert_cnt": 1, "fix_ops_cnt": 10, "bug_source_code": "using System;\nusing static System.Math;\nusing System.Linq;\n\nnamespace ConsoleApplication\n{\n sealed class Program\n {\n static void Main(string[] args)\n {\n var n = Int64.Parse(Console.ReadLine());\n mem = new int[n + 1];\n Console.WriteLine(F(n));\n }\n\n\n private static long[] mem;\n\n static long F(long n)\n {\n if (n < 0)\n return 1000000;\n if (n % 100 == 0)\n return n / 100;\n if (n == 1)\n return 1;\n if (mem[n] == 0)\n mem[n] = Min(Min(F(n - 1), F(n - 5)), Min(Min(F(n - 10), F(n - 20)), F(n - 100))) + 1;\n return mem[n];\n }\n }\n}", "lang": "Mono C#", "bug_code_uid": "4214c3a0755097b50da47f7ef345c828", "src_uid": "8e81ad7110552c20297f08ad3e5f8ddc", "apr_id": "c120c9cfe5196836ded24c71320a2bc6", "difficulty": 800, "tags": ["dp", "greedy"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C#"} {"similarity_score": 0.43099048944560425, "equal_cnt": 23, "replace_cnt": 13, "delete_cnt": 8, "insert_cnt": 2, "fix_ops_cnt": 23, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace C\n{\n class Program\n {\n //static void nok(int a, int b)\n //{\n // while()\n //}\n\n static void Main(string[] args)\n {\n TextReader sr = Console.In;\n //StreamReader sr = new StreamReader(\"in1.txt\");\n string[] s1 = sr.ReadLine().Split();\n int la = Convert.ToInt32(s1[0]);\n int ra = Convert.ToInt32(s1[1]);\n int ta = Convert.ToInt32(s1[2]);\n s1 = sr.ReadLine().Split();\n int lb = Convert.ToInt32(s1[0]);\n int rb = Convert.ToInt32(s1[1]);\n int tb = Convert.ToInt32(s1[2]);\n long ok = (long)ta * (long)tb;\n\n int uda = ra - la + 1; //кол-во удачных денй у Алисы\n int nuda =ta- uda; //кол-во не удачных денй у Алисы\n int udb = rb - lb + 1; //кол-во удачных денй у Боба\n int nudb = tb-udb; //кол-во не удачных денй у Боба\n\n bool suda, sudb;\n int ddsua,ddsub;\n if (la == 0)\n {\n suda = true;//удачный ли сегодня день у Алисы\n ddsua = uda;//через скольо дней удача изменит Алисе\n }\n else\n {\n suda = false;\n ddsua = la;\n }\n if (lb == 0)\n {\n sudb = true;//удачный ли сегодня день у Боба\n ddsub = udb;//через скольо дней удача изменит Бобу\n }\n else\n {\n sudb = false;\n ddsub = lb;\n }\n\n int tdp = 0;//текущая длинна последовательности удачных дней\n int mdp = 0;//максимальная длина подходящей последовательности (ответ)\n for (long i = 0; i < ok; i++)\n {\n if (suda && sudb)\n {\n tdp++;\n if (tdp > mdp) mdp = tdp;\n }\n else\n {\n tdp = 0;\n }\n //определяем следующие знаяения удачи(для следующего дня)\n ddsua--;\n if (ddsua == 0)\n {\n if (suda) ddsua = nuda;\n else ddsua = uda;\n suda = !suda;\n }\n ddsub--;\n if (ddsub == 0)\n {\n if (sudb) ddsub = nudb;\n else ddsub = udb;\n sudb = !sudb;\n }\n\n }\n\n Console.WriteLine(mdp);\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "538e0d2701f11f20f5db058bee8fd34a", "src_uid": "faa75751c05c3ff919ddd148c6784910", "apr_id": "b5379bf65362d16ac7b60c2d05e2f0ee", "difficulty": 1900, "tags": ["math", "number theory"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.32062199185486856, "equal_cnt": 25, "replace_cnt": 13, "delete_cnt": 9, "insert_cnt": 3, "fix_ops_cnt": 25, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace C\n{\n class Program\n {\n //static void nok(int a, int b)\n //{\n // while()\n //}\n\n static void Main(string[] args)\n {\n //TextReader sr = Console.In;\n StreamReader sr = new StreamReader(\"in100.txt\");\n string[] s1 = sr.ReadLine().Split();\n int la = Convert.ToInt32(s1[0]);\n int ra = Convert.ToInt32(s1[1]);\n int ta = Convert.ToInt32(s1[2]);\n s1 = sr.ReadLine().Split();\n int lb = Convert.ToInt32(s1[0]);\n int rb = Convert.ToInt32(s1[1]);\n int tb = Convert.ToInt32(s1[2]);\n long ok = (long)ta * (long)tb;\n\n int uda = ra - la + 1; //кол-во удачных денй у Алисы\n int nuda =ta- uda; //кол-во не удачных денй у Алисы\n int udb = rb - lb + 1; //кол-во удачных денй у Боба\n int nudb = tb-udb; //кол-во не удачных денй у Боба\n\n int min_la_lb = int.MaxValue;\n int min_ra_rb = int.MaxValue;\n long lai = (long)la;\n long lbi = (long)lb;\n\n long tdp = 0;//текущая длинна последовательности удачных дней\n long mdp = 0;//максимальная длина подходящей последовательности (ответ)\n\n while (lai mdp) mdp = tdp;\n // }\n // else\n // {\n // tdp = 0;\n // }\n // //определяем следующие знаяения удачи(для следующего дня)\n // ddsua--;\n // if (ddsua == 0)\n // {\n // if (suda) ddsua = nuda;\n // else ddsua = uda;\n // suda = !suda;\n // }\n // ddsub--;\n // if (ddsub == 0)\n // {\n // if (sudb) ddsub = nudb;\n // else ddsub = udb;\n // sudb = !sudb;\n // }\n\n //}\n\n Console.WriteLine(mdp);\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "4a87d141bdba91ae8ef684da252bf608", "src_uid": "faa75751c05c3ff919ddd148c6784910", "apr_id": "b5379bf65362d16ac7b60c2d05e2f0ee", "difficulty": 1900, "tags": ["math", "number theory"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9524096385542169, "equal_cnt": 13, "replace_cnt": 8, "delete_cnt": 2, "insert_cnt": 3, "fix_ops_cnt": 13, "bug_source_code": "using System;\nusing System.Collections;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\n\nclass TEST{\n\tstatic void Main(){\n\t\tSol mySol =new Sol();\n\t\tmySol.Solve();\n\t}\n}\n\nclass Sol{\n\tpublic void Solve(){\n\t\tlong mT = 100000L;\n\t\tif(Tb < mT){\n\t\t\tvar h = new Dictionary();\n\t\t\tfor(long k=0;k hl = h.Keys.ToList();\n\t\t\thl.Sort();\n\t\t\tint l = 0, r = hl.Count;\n\t\t\tlong max = 0;\n\t\t\tif(hl[l] >= Lb){\n\t\t\t\tif(hl[l] > Rb){\n\t\t\t\t\tmax = Math.Max(max, 0);\n\t\t\t\t} else {\n\t\t\t\t\tmax = Math.Max(max, Math.Min(hl[l] + (Ra - La), Rb) - hl[l] + 1);\n\t\t\t\t}\n\t\t\t\tConsole.WriteLine(max);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\twhile(r - l > 1){\n\t\t\t\tint c = (r + l) / 2;\n\t\t\t\tif(hl[c] < Lb){\n\t\t\t\t\tl = c;\n\t\t\t\t} else {\n\t\t\t\t\tr = c;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tif(r < hl.Count){\n\t\t\t\tmax = Math.Max(max, Math.Min(hl[r] + (Ra - La), Rb) - hl[r] + 1);\n\t\t\t}\n\t\t\tmax = Math.Max(max, Math.Min(hl[l] + (Ra - La), Rb) - Math.Max(Lb, hl[l]) + 1);\n\t\t\t\n\t\t\tConsole.WriteLine(max);\n\t\t\t\n\t\t\t\n\t\t} else {\n\t\t\n\t\t\tvar h = new Dictionary();\n\t\t\tfor(long k=0;k hl = h.Keys.ToList();\n\t\t\thl.Sort();\n\t\t\tint n = hl.Count;\n\t\t\tfor(int i=0;i= lb){\n\t\t\t\t\tif(hl[l] > rb){\n\t\t\t\t\t\tmax = Math.Max(max, 0);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tmax = Math.Max(max, Math.Min(hl[l] + (Ra - La), lb) - hl[l] + 1);\n\t\t\t\t\t}\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\twhile(r - l > 1){\n\t\t\t\t\tint c = (r + l) / 2;\n\t\t\t\t\tif(hl[c] < lb){\n\t\t\t\t\t\tl = c;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tr = c;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(r < hl.Count){\n\t\t\t\t\tmax = Math.Max(max, Math.Min(hl[r] + (Ra - La), rb) - hl[r] + 1);\n\t\t\t\t}\n\t\t\t\tmax = Math.Max(max, Math.Min(hl[l] + (Ra - La), rb) - Math.Max(lb, hl[l]) + 1);\n\t\t\t}\n\t\t\tConsole.WriteLine(max);\n\t\t}\n\t\t\n\t}\n\tlong La,Lb,Ra,Rb,Ta,Tb;\n\tpublic Sol(){\n\t\t\n\t\t//var d = rla();\n\t\tvar ss = rsa();\n\t\tlong[] d = new long[3];\n\t\tfor(int i=0;i<3;i++) d[i] = long.Parse(ss[i]);\n\t\tLa = d[0]; Ra = d[1]; Ta = d[2];\n\t\t//d = rla();\n\t\tss = rsa();\n\t\td = new long[3];\n\t\tfor(int i=0;i<3;i++) d[i] = long.Parse(ss[i]);\n\t\tLb = d[0]; Rb = d[1]; Tb = d[2];\n\t\t\n\t}\n\n\tstatic String rs(){return Console.ReadLine();}\n\tstatic int ri(){return int.Parse(Console.ReadLine());}\n\tstatic long rl(){return long.Parse(Console.ReadLine());}\n\tstatic double rd(){return double.Parse(Console.ReadLine());}\n\tstatic String[] rsa(char sep=' '){return Console.ReadLine().Split(sep);}\n\tstatic int[] ria(char sep=' '){return Array.ConvertAll(Console.ReadLine().Split(sep),e=>int.Parse(e));}\n\tstatic long[] rla(char sep=' '){return Array.ConvertAll(Console.ReadLine().Split(sep),e=>long.Parse(e));}\n\tstatic double[] rda(char sep=' '){return Array.ConvertAll(Console.ReadLine().Split(sep),e=>double.Parse(e));}\n}\n", "lang": "Mono C#", "bug_code_uid": "f3bed5b38f8638d99155c6b77cb3b370", "src_uid": "faa75751c05c3ff919ddd148c6784910", "apr_id": "13aa46734dfa1ff75d9fce500b8faf9e", "difficulty": 1900, "tags": ["math", "number theory"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.906603378472707, "equal_cnt": 46, "replace_cnt": 24, "delete_cnt": 8, "insert_cnt": 13, "fix_ops_cnt": 45, "bug_source_code": "using System;\nusing System.Linq;\nusing CompLib.Mathematics;\nusing CompLib.Util;\n\npublic class Program\n{\n int N, K;\n public void Solve()\n {\n var sc = new Scanner();\n N = sc.NextInt();\n K = sc.NextInt();\n\n /*\n * n行n列 タイル 白or黒\n * 隣接する行 すべて同じか違うかつ\n * k個以上の単色のタイルの長方形が存在しないならbeautiful\n * \n * beautifulなパターン数\n * \n */\n\n /*\n * 最大の連続がxの列\n * \n * O(n^3)で調べる\n * \n */\n\n // iまで見る、現在連続j 連続最大k\n var row = new ModInt[N + 1, N + 1, N + 1];\n row[1, 1, 1] = 2;\n for (int i = 1; i < N; i++)\n {\n for (int j = 1; j <= i; j++)\n {\n for (int k = j; k <= i; k++)\n {\n // 同色\n if (j + 1 <= N) row[i + 1, j + 1, Math.Max(j + 1, k)] += row[i, j, k];\n // 別\n row[i + 1, 1, k] += row[i, j, k];\n }\n }\n }\n\n ModInt ans = 0;\n for (int x = 1; x < K && x <= N; x++)\n {\n var t = (K - 1) / x;\n var dp = new ModInt[N + 1, t + 1];\n dp[1, 1] = 1;\n\n for (int i = 1; i < N; i++)\n {\n for (int j = 1; j <= t; j++)\n {\n if (j + 1 <= t) dp[i + 1, j + 1] += dp[i, j];\n dp[i + 1, 1] += dp[i, j];\n }\n }\n\n ModInt s = 0;\n for (int y = 1; y <= t; y++)\n {\n s += dp[N, y];\n }\n ModInt u = 0;\n for(int j = 1;j <= x; j++)\n {\n u += row[N, j, x];\n }\n ans += s * u;\n }\n\n Console.WriteLine(ans);\n }\n\n public static void Main(string[] args) => new Program().Solve();\n}\n\n// https://bitbucket.org/camypaper/complib\nnamespace CompLib.Mathematics\n{\n #region ModInt\n /// \n /// [0,) までの値を取るような数\n /// \n public struct ModInt\n {\n /// \n /// 剰余を取る値.\n /// \n // public const long Mod = (int)1e9 + 7;\n public const long Mod = 998244353;\n\n /// \n /// 実際の数値.\n /// \n public long num;\n /// \n /// 値が であるようなインスタンスを構築します.\n /// \n /// インスタンスが持つ値\n /// パフォーマンスの問題上,コンストラクタ内では剰余を取りません.そのため, ∈ [0,) を満たすような を渡してください.このコンストラクタは O(1) で実行されます.\n public ModInt(long n) { num = n; }\n /// \n /// このインスタンスの数値を文字列に変換します.\n /// \n /// [0,) の範囲内の整数を 10 進表記したもの.\n public override string ToString() { return num.ToString(); }\n public static ModInt operator +(ModInt l, ModInt r) { l.num += r.num; if (l.num >= Mod) l.num -= Mod; return l; }\n public static ModInt operator -(ModInt l, ModInt r) { l.num -= r.num; if (l.num < 0) l.num += Mod; return l; }\n public static ModInt operator *(ModInt l, ModInt r) { return new ModInt(l.num * r.num % Mod); }\n public static implicit operator ModInt(long n) { n %= Mod; if (n < 0) n += Mod; return new ModInt(n); }\n\n /// \n /// 与えられた 2 つの数値からべき剰余を計算します.\n /// \n /// べき乗の底\n /// べき指数\n /// 繰り返し二乗法により O(N log N) で実行されます.\n public static ModInt Pow(ModInt v, long k) { return Pow(v.num, k); }\n\n /// \n /// 与えられた 2 つの数値からべき剰余を計算します.\n /// \n /// べき乗の底\n /// べき指数\n /// 繰り返し二乗法により O(N log N) で実行されます.\n public static ModInt Pow(long v, long k)\n {\n long ret = 1;\n for (k %= Mod - 1; k > 0; k >>= 1, v = v * v % Mod)\n if ((k & 1) == 1) ret = ret * v % Mod;\n return new ModInt(ret);\n }\n /// \n /// 与えられた数の逆元を計算します.\n /// \n /// 逆元を取る対象となる数\n /// 逆元となるような値\n /// 法が素数であることを仮定して,フェルマーの小定理に従って逆元を O(log N) で計算します.\n public static ModInt Inverse(ModInt v) { return Pow(v, Mod - 2); }\n }\n #endregion\n #region Binomial Coefficient\n public class BinomialCoefficient\n {\n public ModInt[] fact, ifact;\n public BinomialCoefficient(int n)\n {\n fact = new ModInt[n + 1];\n ifact = new ModInt[n + 1];\n fact[0] = 1;\n for (int i = 1; i <= n; i++)\n fact[i] = fact[i - 1] * i;\n ifact[n] = ModInt.Inverse(fact[n]);\n for (int i = n - 1; i >= 0; i--)\n ifact[i] = ifact[i + 1] * (i + 1);\n ifact[0] = ifact[1];\n }\n public ModInt this[int n, int r]\n {\n get\n {\n if (n < 0 || n >= fact.Length || r < 0 || r > n) return 0;\n return fact[n] * ifact[n - r] * ifact[r];\n }\n }\n public ModInt RepeatedCombination(int n, int k)\n {\n if (k == 0) return 1;\n return this[n + k - 1, k];\n }\n }\n #endregion\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 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}\n", "lang": "Mono C#", "bug_code_uid": "7a784b1a77afccf2b634c9645c6327dd", "src_uid": "77177b1a2faf0ba4ca1f4d77632b635b", "apr_id": "648754795995a847d4498f5a23eafa65", "difficulty": 2100, "tags": ["dp", "math", "combinatorics"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9219088937093276, "equal_cnt": 42, "replace_cnt": 28, "delete_cnt": 9, "insert_cnt": 4, "fix_ops_cnt": 41, "bug_source_code": "using System;\nusing System.Linq;\nusing CompLib.Mathematics;\nusing CompLib.Util;\n\npublic class Program\n{\n int N, K;\n public void Solve()\n {\n var sc = new Scanner();\n N = sc.NextInt();\n K = sc.NextInt();\n\n /*\n * n行n列 タイル 白or黒\n * 隣接する行 すべて同じか違うかつ\n * k個以上の単色のタイルの長方形が存在しないならbeautiful\n * \n * beautifulなパターン数\n * \n */\n\n /*\n * 最大の連続がxの列\n * \n * O(n^3)で調べる\n * \n */\n\n // iまで見る、現在連続j 最大連続k\n\n // iは2で割ったあまり\n var row = new ModInt[2, N + 1, N + 1];\n row[1, 1, 1] = 2;\n for (int i = 1; i < N; i++)\n {\n for (int j = 1; j <= N; j++)\n {\n for (int k = 1; k <= N; k++)\n {\n row[(i + 1) & 1, j, k] = 0;\n }\n }\n for (int j = 1; j <= i; j++)\n {\n for (int k = j; k <= i; k++)\n {\n // 同色\n row[(i + 1) & 1, j + 1, Math.Max(j + 1, k)] += row[i & 1, j, k];\n // 別色\n row[(i + 1) & 1, 1, k] += row[i & 1, j, k];\n }\n }\n }\n\n ModInt ans = 0;\n for (int x = 1; x < K && x <= N; x++)\n {\n var t = (K - 1) / x;\n\n // i行目、連続j列同じ\n // iは2でわったあまり\n var dp = new ModInt[2, t + 1];\n dp[1, 1] = 1;\n\n for (int i = 1; i < N; i++)\n {\n for (int j = 1; j <= t; j++)\n {\n dp[(i + 1) & 1, j] = 0;\n }\n for (int j = 1; j <= t; j++)\n {\n if (j + 1 <= t) dp[(i + 1) & 1, j + 1] += dp[i & 1, j];\n dp[(i + 1) & 1, 1] += dp[i & 1, j];\n }\n }\n\n ModInt s = 0;\n for (int y = 1; y <= t; y++)\n {\n s += dp[N & 1, y];\n }\n ModInt u = 0;\n for (int j = 1; j <= x; j++)\n {\n u += row[N & 1, j, x];\n }\n ans += s * u;\n }\n\n Console.WriteLine(ans);\n }\n\n public static void Main(string[] args) => new Program().Solve();\n}\n\n// https://bitbucket.org/camypaper/complib\nnamespace CompLib.Mathematics\n{\n #region ModInt\n /// \n /// [0,) までの値を取るような数\n /// \n public struct ModInt\n {\n /// \n /// 剰余を取る値.\n /// \n // public const long Mod = (int)1e9 + 7;\n public const long Mod = 998244353;\n\n /// \n /// 実際の数値.\n /// \n public long num;\n /// \n /// 値が であるようなインスタンスを構築します.\n /// \n /// インスタンスが持つ値\n /// パフォーマンスの問題上,コンストラクタ内では剰余を取りません.そのため, ∈ [0,) を満たすような を渡してください.このコンストラクタは O(1) で実行されます.\n public ModInt(long n) { num = n; }\n /// \n /// このインスタンスの数値を文字列に変換します.\n /// \n /// [0,) の範囲内の整数を 10 進表記したもの.\n public override string ToString() { return num.ToString(); }\n public static ModInt operator +(ModInt l, ModInt r) { l.num += r.num; if (l.num >= Mod) l.num -= Mod; return l; }\n public static ModInt operator -(ModInt l, ModInt r) { l.num -= r.num; if (l.num < 0) l.num += Mod; return l; }\n public static ModInt operator *(ModInt l, ModInt r) { return new ModInt(l.num * r.num % Mod); }\n public static implicit operator ModInt(long n) { n %= Mod; if (n < 0) n += Mod; return new ModInt(n); }\n\n /// \n /// 与えられた 2 つの数値からべき剰余を計算します.\n /// \n /// べき乗の底\n /// べき指数\n /// 繰り返し二乗法により O(N log N) で実行されます.\n public static ModInt Pow(ModInt v, long k) { return Pow(v.num, k); }\n\n /// \n /// 与えられた 2 つの数値からべき剰余を計算します.\n /// \n /// べき乗の底\n /// べき指数\n /// 繰り返し二乗法により O(N log N) で実行されます.\n public static ModInt Pow(long v, long k)\n {\n long ret = 1;\n for (k %= Mod - 1; k > 0; k >>= 1, v = v * v % Mod)\n if ((k & 1) == 1) ret = ret * v % Mod;\n return new ModInt(ret);\n }\n /// \n /// 与えられた数の逆元を計算します.\n /// \n /// 逆元を取る対象となる数\n /// 逆元となるような値\n /// 法が素数であることを仮定して,フェルマーの小定理に従って逆元を O(log N) で計算します.\n public static ModInt Inverse(ModInt v) { return Pow(v, Mod - 2); }\n }\n #endregion\n #region Binomial Coefficient\n public class BinomialCoefficient\n {\n public ModInt[] fact, ifact;\n public BinomialCoefficient(int n)\n {\n fact = new ModInt[n + 1];\n ifact = new ModInt[n + 1];\n fact[0] = 1;\n for (int i = 1; i <= n; i++)\n fact[i] = fact[i - 1] * i;\n ifact[n] = ModInt.Inverse(fact[n]);\n for (int i = n - 1; i >= 0; i--)\n ifact[i] = ifact[i + 1] * (i + 1);\n ifact[0] = ifact[1];\n }\n public ModInt this[int n, int r]\n {\n get\n {\n if (n < 0 || n >= fact.Length || r < 0 || r > n) return 0;\n return fact[n] * ifact[n - r] * ifact[r];\n }\n }\n public ModInt RepeatedCombination(int n, int k)\n {\n if (k == 0) return 1;\n return this[n + k - 1, k];\n }\n }\n #endregion\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 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}\n", "lang": "Mono C#", "bug_code_uid": "0a4b2544f0381d96283fc2693a5c7c2f", "src_uid": "77177b1a2faf0ba4ca1f4d77632b635b", "apr_id": "648754795995a847d4498f5a23eafa65", "difficulty": 2100, "tags": ["dp", "math", "combinatorics"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9967438494934877, "equal_cnt": 5, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 4, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Text;\nusing System.Diagnostics;\n\nclass Solver\n{\n public void Solve()\n {\n\t\tvar ss = CF.ReadLine().Split(' ');\n\t\tint n = int.Parse(ss[0]);\n\t\tint m = int.Parse(ss[1]);\n\t\tint a = int.Parse(ss[2]);\n\t\tint b = int.Parse(ss[3]);\n\n\n\t\tint l1 = (a - 1) / m;\n\t\tint l2 = (b - 1) / m;\n\t\tint p1 = (a - 1) % m;\n\t\tint p2 = (b - 1) % m;\n\n\t\t\n\t\tif (b == n)\n\t\t\tp2 = m - 1;\n\t\t\n\n\t\tint res = 0;\n\t\tif (l1 == l2)\n\t\t\tres = 1;\n\t\telse if (l1 + 1 == l2)\n\t\t{\n\t\t\tres = 2;\n\t\t\tif ( p1 == 0 && p2 == m-1 )\n\t\t\t\tres--;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tres = 3;\n\n\n\t\t\tif (p1 == 0)\n\t\t\t\tres--;\n\n\t\t\tif (p2 == m-1 )\n\t\t\t\tres--;\n\n\t\t\tif (res > 2 && p1+1== p2)\n\t\t\t\tres--;\n\t\t}\n\n\t\tCF.WriteLine(res);\n }\n\n\n\n\t// test\n\tstatic Utils CF = new Utils(new[]{\n@\"\n11 4 3 9\n\"\n,\n\n@\"\n20 5 2 20\n\"\n,\n\n@\"\n21 5 1 15\n\"\n\n\t});\n\n #region test\n\n static void Main(string[] args)\n {\n#if DEBUG\n for (int t=0;t();\n string[] ss = _test_input[t].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 public int TestCount\n {\n get\n {\n return _test_input.Length;\n }\n }\n\n public string ReadLine()\n {\n#if DEBUG\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 string[] _test_input;\n\n List _lines;\n\n#if DEBUG\n public Utils(string[] test_input)\n {\n _test_input = test_input;\n }\n#else\n\n public Utils(string[] dummy)\n {\n //_sr = new System.IO.StreamReader(\"input.txt\");\n //_sw = new System.IO.StreamWriter(\"output.txt\");\n }\n#endif\n\n }\n\n #endregion\n}\n\n", "lang": "Mono C#", "bug_code_uid": "86e466b3277e8cdbcf81e1ec347a81c9", "src_uid": "f256235c0b2815aae85a6f9435c69dac", "apr_id": "d5a82541e856bf455a8dfa7b760dd1a6", "difficulty": 1700, "tags": ["math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.738152610441767, "equal_cnt": 24, "replace_cnt": 12, "delete_cnt": 4, "insert_cnt": 7, "fix_ops_cnt": 23, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\n\nnamespace C\n{\n class Program\n {\n static void Main(string[] args)\n {\n string[] s = Console.ReadLine().Split(' ');\n int n = int.Parse(s[0]);\n int m = int.Parse(s[1]);\n int a = int.Parse(s[2]);\n int b = int.Parse(s[3]);\n int res;\n if (b != n)\n {\n if (a / m == b / m) res = 1;\n else\n {\n if ((b / m - a / m) == 1)\n {\n if (b % m == 0 && a % m == 1) res = 1;\n else res = 2;\n }\n else\n {\n if (b % m == 0 && a % m == 1) res = 1;\n else if (b % m == 0 || a % m == 1) res = 2;\n else res = 3;\n }\n }\n if (a % m == b % m + 1 && b % m != 0)\n res = 2;\n }\n else\n {\n if (a / m == b / m) res = 1;\n else\n {\n if (a % m == 1) res = 1; \n else res = 2;\n }\n\n }\n Console.WriteLine(res);\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "10f7cf0606d30b960a9fafaee093ce71", "src_uid": "f256235c0b2815aae85a6f9435c69dac", "apr_id": "eff1ca1a7118636e5ce98f38449747d4", "difficulty": 1700, "tags": ["math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9853064651553316, "equal_cnt": 12, "replace_cnt": 0, "delete_cnt": 10, "insert_cnt": 1, "fix_ops_cnt": 11, "bug_source_code": "using System;\nusing System.Collections;\nusing System.Collections.Generic;\nusing System.Collections.Specialized;\nusing System.Diagnostics;\nusing System.IO;\nusing System.Text;\nusing System.Linq;\n\nnamespace Codeforces\n{\n internal class Program\n {\n private const string Test = \"E2\";\n\n \n private static void Solve()\n {\n var MOD = 1000000007;\n var input = ReadIntArray();\n var n = input[0];\n var m = input[1];\n var k = input[2];\n var dp = new List>();\n for (int i = 0; i <= 1001; i++)\n {\n dp.Add(new List());\n for (int j = 0; j <= i; j++)\n {\n if(j == 0 || j == i)\n dp[i].Add(1);\n else\n {\n dp[i].Add((dp[i-1][j-1] + dp[i - 1][j]) % MOD);\n }\n }\n }\n var res = dp[n - 1][Math.Min(2 * k, n-1)] * dp[m - 1][Math.Min(2 * k, m-1)];\n res %= MOD;\n Console.WriteLine(res);\n }\n\n\n private static void Main()\n {\n if (Debugger.IsAttached)\n {\n Console.SetIn(new StreamReader(String.Format(@\"..\\..\\..\\..\\Tests\\{0}.in\", Test)));\n }\n\n Solve();\n\n if (Debugger.IsAttached)\n {\n Console.In.Close();\n Console.SetIn(new StreamReader(Console.OpenStandardInput()));\n Console.ReadLine();\n }\n }\n\n #region Reader\n\n private static string Read()\n {\n return Console.ReadLine();\n }\n\n private static string[] ReadArray()\n {\n return Console.ReadLine().Split(' ');\n }\n\n private static int[] ReadIntArray()\n {\n var input = Console.ReadLine().Split(' ').Select(Int32.Parse).ToArray();\n return input;\n }\n\n private static int ReadInt()\n {\n return Int32.Parse(Console.ReadLine());\n }\n\n private static long ReadLong()\n {\n return long.Parse(Console.ReadLine());\n }\n\n private static int ReadNextInt(string[] input, int index)\n {\n return Int32.Parse(input[index]);\n }\n\n #endregion\n }\n}", "lang": "Mono C#", "bug_code_uid": "920d9dc98c7df0646b46231e20a7e042", "src_uid": "309d2d46086d526d160292717dfef308", "apr_id": "ecfb492e9408fbd3d466ec6bf4578b0b", "difficulty": 2000, "tags": ["dp", "combinatorics"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "C#"} {"similarity_score": 0.8662420382165605, "equal_cnt": 8, "replace_cnt": 5, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 7, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\n\nnamespace DNO\n{\n class Program\n {\n static void Main(string[] args)\n {\n int n = Convert.ToInt32(Console.ReadLine());\n int sum = 0;\n for (int i = 1; i <= n; i++)\n sum += i.ToString().Length;\n Console.Write(sum);\n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "34ee9795165c37039cf011e38b13395b", "src_uid": "4e652ccb40632bf4b9dd95b9f8ae1ec9", "apr_id": "aa8282273774213fe980e56a42355a53", "difficulty": 1200, "tags": ["math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.40824742268041236, "equal_cnt": 9, "replace_cnt": 6, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 8, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\n\nnamespace ConsoleApp6\n{\n class Program\n {\n static void Main(string[] args)\n {\n int n = int.Parse(Console.ReadLine());\n int u = 0;\n for (int i = 1; i <=n ; i++)\n {\n string s = i.ToString();\n u += s.Count();\n \n }\n Console.WriteLine(u);\n \n \n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "ecffc4aa59ebdc6b40ed7f94ec5f050d", "src_uid": "4e652ccb40632bf4b9dd95b9f8ae1ec9", "apr_id": "ccc7ee6479c886e2b29a883c24934740", "difficulty": 1200, "tags": ["math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9850020267531414, "equal_cnt": 4, "replace_cnt": 0, "delete_cnt": 3, "insert_cnt": 1, "fix_ops_cnt": 4, "bug_source_code": "using System;\n\nnamespace _977A\n{\n class Program\n {\n static void Main(string[] args)\n {\n while (true)\n {\n string words = Console.ReadLine();\n //check if string is null or empty\n if (string.IsNullOrEmpty(words) == false)\n {\n string[] seperatedWords = words.Split(' ');\n int number = Convert.ToInt32(seperatedWords[0]);\n int k = Convert.ToInt32(seperatedWords[1]);\n if (((2 <= number) && (number <= 1000000000)) && ((1 <= k) && (k <= 50)))\n {\n for (int i = 0; i < k; i++)\n {\n if (number % 10 == 0)\n {\n number = number / 10;\n }\n else\n {\n number--;\n }\n }\n //check if the number diviseble by 10\n\n }\n Console.WriteLine(number);\n }\n }\n \n \n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "f265e3557d9b81016678f639c93af879", "src_uid": "064162604284ce252b88050b4174ba55", "apr_id": "838b3b09ab2d193eef9b2e72aeb51f0e", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "delete", "lang_cluster": "C#"} {"similarity_score": 0.8263772954924875, "equal_cnt": 7, "replace_cnt": 5, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 6, "bug_source_code": "using System;\n\nnamespace C_\n{\n class Program\n {\n static void Main(string[] args)\n {\n int n = Int32.Parse(Console.ReadLine());\n int k = Int32.Parse(Console.ReadLine());\n for(int i = 0; i < k; i++){\n string storer = Convert.ToString(n);\n if(storer[storer.Length - 1] == '0'){\n n = n/10;\n }\n else{\n n--;\n }\n }\n System.Console.WriteLine(n);\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "e2fd1a4c51b19cf4fa219665c0c962a9", "src_uid": "064162604284ce252b88050b4174ba55", "apr_id": "731d283ef3c680dd5e99fb04c2d173b1", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9193473193473194, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 3, "bug_source_code": " public static void Main(string[] args)\n {\n string nk= Console.ReadLine();\n string astr = Console.ReadLine();\n int n = Convert.ToInt32(nk.Split(' ')[0]);\n int k = Convert.ToInt32(nk.Split(' ')[1]);\n int ind = 0,saved=0,given=0;\n for (int i=0; i< n;i++)\n {\n int aday= Convert.ToInt32((astr.Split(' ')[i]));\n if (aday > 8)\n {\n saved += aday - 8;\n aday = 8;\n }\n if (aday < 8 && saved > 0)\n {\n while (aday <= 8 && saved > 0)\n {\n aday++;\n saved--;\n }\n }\n given += aday;\n ind += 1;\n if (given >= k)\n { Console.WriteLine(ind); return; }\n }\n Console.WriteLine(-1);\n\n }\n", "lang": "MS C#", "bug_code_uid": "84dea547a645cfc5dff0a83f673e0b44", "src_uid": "24695b6a2aa573e90f0fe661b0c0bd3a", "apr_id": "4e98d44a2aeeeceea3f234ad47f69af7", "difficulty": 900, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.9330825047030368, "equal_cnt": 9, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 8, "fix_ops_cnt": 9, "bug_source_code": "using System;\nusing System.Text.RegularExpressions;\n\n\nnamespace contest839a\n{\n class MainClass\n {\n public static void Main(string[] args)\n {\n string NnK = Console.ReadLine();\n string candy = Console.ReadLine();\n\n int n = 0;\n int k = 0;\n\n int[] candies = new int[100];\n int count = 0;\n\n string[] nnk = NnK.Split(' ');\n\n n = Convert.ToInt32(nnk[0]);\n k = Convert.ToInt32(nnk[1]);\n\n MatchCollection amounts = Regex.Matches(candy, @\"(\\d+)\");\n\n foreach (Match amount in amounts)\n {\n candies[count] = Convert.ToInt32(amount.Value);\n count++;\n }\n\n int minDays = 0;\n\n int currentCandy = 0;\n int totalGiven = 0;\n\n if(n * 8 < k){\n Console.WriteLine(-1);\n return;\n }\n\n while (totalGiven < k)\n {\n currentCandy += candies[minDays];\n if (candies[minDays] > 8)\n {\n totalGiven += 8;\n currentCandy -= 8;\n minDays++;\n }\n else if (currentCandy > 8)\n {\n totalGiven += 8;\n currentCandy -= 8;\n minDays++;\n }\n else\n {\n totalGiven += currentCandy;\n currentCandy = 0;\n minDays++;\n }\n }\n\n Console.WriteLine(minDays);\n\n\n\n }\n }\n}", "lang": "MS C#", "bug_code_uid": "6abcc41d47100438f717372ad28c6b20", "src_uid": "24695b6a2aa573e90f0fe661b0c0bd3a", "apr_id": "3f013c504e33bbcac171c5ebf9d61c3c", "difficulty": 900, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.5666016894087069, "equal_cnt": 9, "replace_cnt": 6, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 8, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Text.RegularExpressions;\n\nnamespace ConsoleApplication1\n{\n class Program\n {\n static void Main(string[] args)\n {\n int n, m, r=1;\n string[] inp = Console.ReadLine().ToString().Split(' ');\n n = Convert.ToInt32(inp[0]);\n m = Convert.ToInt32(inp[1]);\n\n for (int i = 1; i <= n; i++)\n {\n r = (r * 3) % m;\n }\n\n Console.WriteLine((r-1)%m);\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "f4ed1ae223a7eead9b4eb685facea0f7", "src_uid": "c62ad7c7d1ea7aec058d99223c57d33c", "apr_id": "2366ea044037ed3d20461aa305c7a379", "difficulty": 1400, "tags": ["math"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.5588420390182505, "equal_cnt": 12, "replace_cnt": 9, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 12, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\n\nnamespace CodeForces\n{\n class Program_R158_Div2_255A\n {\n static void Main(string[] args)\n {\n string[] s = (Console.ReadLine().Split());\n long n = int.Parse(s[0]);\n long m = int.Parse(s[1]);\n\n long num = 1;\n for (int i = 0; i < n; i++)\n num = (num * 3);\n num = (num -1) % m;\n\n Console.WriteLine(num); \n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "54c2c419c93a7d767f8943485cc5a107", "src_uid": "c62ad7c7d1ea7aec058d99223c57d33c", "apr_id": "36df8cad66d73d9526f894b429cc25f8", "difficulty": 1400, "tags": ["math"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.8608270342374389, "equal_cnt": 14, "replace_cnt": 9, "delete_cnt": 2, "insert_cnt": 2, "fix_ops_cnt": 13, "bug_source_code": "using System;\nusing System.Collections;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\n\nnamespace KROK_QR\n{\n class TaskB\n {\n static void Main(string[] args)\n {\n\n int a, b, m, r_cur, r_next, index;\n string str;\n string[] s = new string[4];\n //int[] r = new int[110000];\n ArrayList r = new ArrayList();\n str = Console.ReadLine();\n s = str.Split();\n a = int.Parse(s[0]);\n b = int.Parse(s[1]);\n m = int.Parse(s[2]);\n r_cur = int.Parse(s[3]);\n \n \n while (1 == 1)\n {\n r_next = (a * r_cur + b) % m;\n index = r.IndexOf(r_next);\n if (index == -1)\n {\n r.Add(r_next);\n r_cur = r_next;\n } \n else\n break;\n } \n \n Console.WriteLine(r.Count - index); \n \n }\n }\n}", "lang": "Mono C#", "bug_code_uid": "0d2ee4d75bdcfc132be03356b08b97c3", "src_uid": "9137197ee1b781cd5cc77c46f50b9012", "apr_id": "a74aae263bfd0096067a028fd72a34e3", "difficulty": 1200, "tags": ["number theory", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9089048106448311, "equal_cnt": 10, "replace_cnt": 5, "delete_cnt": 2, "insert_cnt": 2, "fix_ops_cnt": 9, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\n\nnamespace krok02\n{\n class Program\n {\n \n static void Main(string[] args)\n {\n string s = Console.ReadLine();\n string[] ss = s.Split();\n int a, b, m, r0;\n a = Convert.ToInt32(ss[0]);\n b = Convert.ToInt32(ss[1]);\n m = Convert.ToInt32(ss[2]);\n r0 = Convert.ToInt32(ss[3]);\n int t = 0;\n int x = 0;\n int[] mas = new int[100000];\n mas[0] = r0;\n for (int i = 1; i < mas.Length; i++)\n {\n mas[i] = (a * mas[i - 1] + b) % m;\n x = Array.IndexOf(mas, mas[i]);\n if (x < i)\n {\n t = i - x;\n break;\n }\n }\n Console.WriteLine(t);\n //Console.ReadLine();\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "baf27e7bd13ec35af0b21d76f78edd1a", "src_uid": "9137197ee1b781cd5cc77c46f50b9012", "apr_id": "9fa8e691b63b6e9d42db082eb7037901", "difficulty": 1200, "tags": ["number theory", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9636462289744981, "equal_cnt": 9, "replace_cnt": 7, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 8, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\n\nnamespace krokA\n{\n class Program\n {\n class Scanner\n {\n string[] s;\n int i;\n\n char[] cs = new char[] { ' ' };\n\n public Scanner()\n {\n //s = @\"3 6 81 9\".Split(cs, StringSplitOptions.RemoveEmptyEntries);\n s = new string[0];\n i = 0;\n }\n\n public string next()\n {\n if (i < s.Length) return s[i++];\n s = Console.ReadLine().Split(cs, StringSplitOptions.RemoveEmptyEntries);\n i = 0;\n return s[i++];\n }\n\n public int nextInt()\n {\n return int.Parse(next());\n }\n\n public long nextLong()\n {\n return long.Parse(next());\n }\n }\n static void Main(string[] args)\n {\n RC rc = new RC();\n rc.Go();\n }\n\n class RC\n {\n public void Go()\n {\n Scanner sc = new Scanner();\n int a = sc.nextInt();\n int b = sc.nextInt();\n int m = sc.nextInt();\n int r0 = sc.nextInt();\n\n List lst = new List();\n //lst.Add(r0);\n while (true)\n {\n r0 = (r0 * a + b) % m;\n if(lst.Contains(r0))\n {\n int pos = lst.FindIndex(p => p == r0);\n Console.WriteLine(lst.Count - pos);\n return;\n }\n lst.Add(r0);\n }\n }\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "2b7e7af83e6d63c7051eaad922ed8d3d", "src_uid": "9137197ee1b781cd5cc77c46f50b9012", "apr_id": "e7649684ac7beba17a406c0260e03c15", "difficulty": 1200, "tags": ["number theory", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.8686314827507425, "equal_cnt": 15, "replace_cnt": 7, "delete_cnt": 3, "insert_cnt": 4, "fix_ops_cnt": 14, "bug_source_code": "using System;\nusing System.Collections;\nusing System.Collections.Generic;\nusing System.Collections.Specialized;\nusing System.Diagnostics;\nusing System.Globalization;\nusing System.IO;\nusing System.Text;\nusing System.Linq;\n\nnamespace Codeforces\n{\n internal class Program\n {\n private const string Test = \"A1\";\n\n private static void Solve()\n {\n var input = ReadIntArray();\n var a = input[0];\n var b = input[1];\n var m = input[2];\n var r0 = input[3];\n var res = new List();\n var r = r0;\n for (int i = 0; i < m; i++)\n {\n r = (a*r + b)%m;\n if(res.Contains(r))\n break;\n res.Add(r);\n }\n int first = 0;\n for (; first < res.Count; first++)\n {\n if (res[first] == r)\n break;\n }\n Console.WriteLine(res.Count - first);\n }\n\n\n private static void Main()\n {\n if (Debugger.IsAttached)\n {\n Console.SetIn(new StreamReader(String.Format(@\"..\\..\\..\\..\\Tests\\{0}.in\", Test)));\n }\n\n Solve();\n\n if (Debugger.IsAttached)\n {\n Console.In.Close();\n Console.SetIn(new StreamReader(Console.OpenStandardInput()));\n Console.ReadLine();\n }\n }\n\n #region Reader\n\n private static string Read()\n {\n return Console.ReadLine();\n }\n\n private static string[] ReadArray()\n {\n return Console.ReadLine().Split(' ');\n }\n\n private static List ReadIntArray()\n {\n var input = Console.ReadLine().Split(' ').Select(Int32.Parse).ToList();\n return input;\n }\n\n private static int ReadInt()\n {\n return Int32.Parse(Console.ReadLine());\n }\n\n private static long ReadLong()\n {\n return long.Parse(Console.ReadLine());\n }\n\n private static int ReadNextInt(string[] input, int index)\n {\n return Int32.Parse(input[index]);\n }\n\n #endregion\n }\n}", "lang": "Mono C#", "bug_code_uid": "54394e9da75a63e633f2f0a40a414e66", "src_uid": "9137197ee1b781cd5cc77c46f50b9012", "apr_id": "53bbb0ec313c00f4afadfa50d0fb02ae", "difficulty": 1200, "tags": ["number theory", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9942922374429224, "equal_cnt": 1, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Text;\n\nnamespace CODE2\n{\n class Program\n {\n static void Main(string[] args)\n {\n string[] str = Console.ReadLine().Split(' ');\n int a = int.Parse(str[0]);\n int b = int.Parse(str[1]);\n int m = int.Parse(str[2]);\n int r0 = int.Parse(str[3]);\n int [] array = new int[m];\n int ri = (a * r0 + b) % m;\n array[ri] = 0;\n int count = 1;\n for (; ;count++ )\n {\n ri = (a * ri + b) % m;\n if (array[ri] == 0)\n {\n array[ri] = count;\n }\n else\n {\n Console.Write(count - array[ri]);\n return;\n }\n }\n }\n }\n}\n\n[close]\n", "lang": "Mono C#", "bug_code_uid": "9a97dd4e7091e4f4a13f93b8d043cc63", "src_uid": "9137197ee1b781cd5cc77c46f50b9012", "apr_id": "88cdeb0d1b57d397b4b5c76ef33d474d", "difficulty": 1200, "tags": ["number theory", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C#"} {"similarity_score": 0.9836829836829837, "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.Text;\n\nnamespace CODE2\n{\n class Program\n {\n static void Main(string[] args)\n {\n string[] str = Console.ReadLine().Split(' ');\n int a = int.Parse(str[0]);\n int b = int.Parse(str[1]);\n int m = int.Parse(str[2]);\n int r0 = int.Parse(str[3]);\n int [] array = new int[m];\n int ri = (a * r0 + b) % m;\n array[ri] = 0;\n int count = 1;\n for (; ;count++ )\n {\n ri = (a * ri + b) % m;\n if (array[ri] == 0)\n {\n array[ri] = count;\n }\n else\n {\n Console.Write(count - array[ri]);\n }\n }\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "423538ccf1ff7e5c4f3cafdf97ccd880", "src_uid": "9137197ee1b781cd5cc77c46f50b9012", "apr_id": "b54213abbc532bf4afb865cb32d54822", "difficulty": 1200, "tags": ["number theory", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.9994269340974212, "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.Text;\n\nnamespace CODE2\n{\n class Program\n {\n static void Main(string[] args)\n {\n string[] str = Console.ReadLine().Split(' ');\n int a = int.Parse(str[0]);\n int b = int.Parse(str[1]);\n int m = int.Parse(str[2]);\n int r0 = int.Parse(str[3]);\n int [] array = new int[m];\n int ri = (a * r0 + b) % m;\n array[ri] = 0;\n int count = 1;\n for (; ;count++ )\n {\n ri = (a * ri + b) % m;\n if (array[ri] == 0)\n {\n array[ri] = count;\n }\n else\n {\n Console.Write(count - array[ri]);\n return;\n }\n }a\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "5c0d91d5a8da805b05f0f67833ffd7f3", "src_uid": "9137197ee1b781cd5cc77c46f50b9012", "apr_id": "b54213abbc532bf4afb865cb32d54822", "difficulty": 1200, "tags": ["number theory", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C#"} {"similarity_score": 0.9992412746585736, "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;\n\nnamespace ConsoleApplication11\n{\n class Program\n {\n static void Main(string[] args)\n {\n string[] str = Console.ReadLine().Split(' ');\n int r = int.Parse(str[3]);\n int r1,i=0;\n int a = int.Parse(str[0]);\n int b = int.Parse(str[1]);\n int m = int.Parse(str[2]);\n bool flag=false;\n List lis = new List();\n while (true)\n {\n r1 = (a * r + b) % m;\n lis.Add(r1);\n r = r1;\n if (lis.Count >10000)\n {\n for (i = 0; i < lis.Count; i++)\n {\n for (int j = i + 1; j < lis.Count; j++)\n {\n if (lis[i] == lis[j])\n {\n i = j - i;\n flag = true;\n break;\n }\n }\n if (flag)\n break;\n }\n if (flag)\n break;\n }\n }\n Console.WriteLine(i);\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "f19791242b6d65328ab94a247d83e9e3", "src_uid": "9137197ee1b781cd5cc77c46f50b9012", "apr_id": "90b7f48e86eb37e85d8121ed73a613c9", "difficulty": 1200, "tags": ["number theory", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.7408597830453998, "equal_cnt": 12, "replace_cnt": 8, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 11, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\n\nnamespace krok2\n{\n class Program\n {\n private static int a, b, m, r0;\n static List nums = new List();\n\n static void Main(string[] args)\n {\n string readLine = Console.ReadLine();\n string[] strings = readLine.Split(new[] {' '});\n // a b m r0\n a = int.Parse(strings[0]);\n b = int.Parse(strings[1]);\n m = int.Parse(strings[2]);\n r0 = int.Parse(strings[3]);\n nums.Add(r0);\n \n bool notFound = true;\n int count = 1;\n\n while (notFound)\n {\n int number = Generate(count);\n if (!nums.Contains(number))\n {\n nums.Add(number);\n count++;\n }\n else\n {\n int i = count - nums.IndexOf(number);\n Console.WriteLine(i);\n break;\n }\n }\n }\n\n static int Generate(int i)\n {\n int result = (a * nums[i - 1] + b) % m;\n return result;\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "164e1a4956f3167b44e578eb8eb7ffcb", "src_uid": "9137197ee1b781cd5cc77c46f50b9012", "apr_id": "1df8c9a61c2d4f47143b4542cdf427ba", "difficulty": 1200, "tags": ["number theory", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.8381294964028777, "equal_cnt": 20, "replace_cnt": 11, "delete_cnt": 0, "insert_cnt": 8, "fix_ops_cnt": 19, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\n\nnamespace codeforces\n{\n class Program\n {\n static int a, b, m, r0;\n\n static void Main()\n {\n var input = Console.ReadLine().Split(' ');\n a = int.Parse(input[0]);\n b = int.Parse(input[1]);\n m = int.Parse(input[2]);\n r0 = int.Parse(input[3]);\n\n List nums = new List();\n\n int r = (a * r0 + b) % m;\n nums.Add(r);\n\n while (true)\n {\n r = (a * r + b) % m;\n if (!nums.Contains(r))\n {\n nums.Add(r);\n }\n else\n {\n Console.WriteLine(nums.Count - nums.IndexOf(r));\n break;\n } \n }\n }\n\n static int Next(int r)\n {\n return (a * r + b) % m;\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "4d7c958a93e919724c2a672b4d48ddc5", "src_uid": "9137197ee1b781cd5cc77c46f50b9012", "apr_id": "f177b56519436afa564477eb55c54533", "difficulty": 1200, "tags": ["number theory", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.819454679439941, "equal_cnt": 10, "replace_cnt": 6, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 9, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\n\nnamespace CrocCupB\n{\n class Program\n {\n static void Main(string[] args)\n {\n //получим исходные данные\n var nkList = Console.ReadLine().Split(' ').Select(int.Parse).ToList();\n var a = nkList[0];\n var b = nkList[1];\n var m = nkList[2];\n var r0 = nkList[3];\n\n var randGenerator = new RandGenerator(a, b, m, r0);\n var randList = new List();\n\n //поищем цикл...\n var curRandom = randGenerator.GetNext();\n var cycleIndex = -1;\n while ((cycleIndex = randList.IndexOf(curRandom)) < 0)\n {\n randList.Add(curRandom);\n curRandom = randGenerator.GetNext();\n }\n\n Console.WriteLine(randList.Count - cycleIndex);\n }\n }\n\n internal class RandGenerator\n {\n private readonly int _a;\n private readonly int _b;\n private readonly int _m;\n private int _ri;\n\n public RandGenerator(int a, int b, int m, int r0)\n {\n _a = a;\n _b = b;\n _m = m;\n _ri = r0;\n }\n\n public int GetNext()\n {\n return _ri = (((_a*_ri) + _b)%_m);\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "ee404b40a444e44c631e8a364f98137f", "src_uid": "9137197ee1b781cd5cc77c46f50b9012", "apr_id": "e08c0a1ebb1832960ec46891d4542ea7", "difficulty": 1200, "tags": ["number theory", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.42787682333873583, "equal_cnt": 28, "replace_cnt": 16, "delete_cnt": 8, "insert_cnt": 4, "fix_ops_cnt": 28, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\n\nclass Program\n{\n static void p(object value)\n {\n Console.WriteLine(value.ToString());\n }\n\n static string gets()\n {\n return Console.ReadLine();\n }\n static void Main(string[] args) \n {\n string input = gets();\n \n int[] r = new int[100001];\n \n int a = int.Parse(input.Split(' ')[0]);\n int b = int.Parse(input.Split(' ')[1]);\n int m = int.Parse(input.Split(' ')[2]);\n \n r[0] = int.Parse(input.Split(' ')[3]);\n \n bool found = false;\n int end = 0;\n int start = 0;\n int t=0;\n \n for (int i=1; i<100001;i++)\n {\n r[i] = (a*r[i-1]+b) % m;\n \n if (found) { \n if (r[i] == r[start]) {\n p(t);\n break;\n }\n \n if (r[i] == r[start+t]) {\n t = t +1;\n continue;\n } \n \n if (r[i] != r[start+t]) {\n found = false;\n i = end + 1;\n }\n }\n \n for (int j = 1; j s.Contains(name) && s.IndexOf(name, s.IndexOf(name) + name.Length) < 0) == 1 ? \"YES\" : \"NO\");\n }\n }\n}", "lang": "Mono C#", "bug_code_uid": "a8394f63a152694a8ae2db59eb54eec5", "src_uid": "db2dc7500ff4d84dcc1a37aebd2b3710", "apr_id": "4cfdb45ddf3c192e6409c901d822286e", "difficulty": 1100, "tags": ["strings", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "C#"} {"similarity_score": 0.6038809831824062, "equal_cnt": 66, "replace_cnt": 10, "delete_cnt": 54, "insert_cnt": 1, "fix_ops_cnt": 65, "bug_source_code": "//using System;\n//using System.Collections.Generic;\n//using System.IO;\n//using System.Linq;\n\n//namespace Codeforces\n//{\n//\tinternal class Template\n//\t{\n//\t\tprivate void Solve()\n//\t\t{\n//\t\t\tvar n = cin.NextInt();\n//\t\t\tvar x = new List();\n//\t\t\tvar y = new List();\n//\t\t\tfor (var i = 0; i < n; i++)\n//\t\t\t{\n//\t\t\t\tx.Add(cin.NextInt());\n//\t\t\t\ty.Add(cin.NextInt());\n//\t\t\t}\n//\t\t\tx = x.Distinct().ToList();\n//\t\t\ty = y.Distinct().ToList();\n//\t\t\tif (x.Count == 2 && y.Count == 2)\n//\t\t\t{\n//\t\t\t\tvar area = Math.Abs(x[0] - x[1]) * Math.Abs(y[0] - y[1]);\n//\t\t\t\tConsole.WriteLine(area);\n//\t\t\t}\n//\t\t\telse\n//\t\t\t{\n//\t\t\t\tConsole.WriteLine(-1);\n//\t\t\t}\n//\t\t}\n\n//\t\tprivate static readonly Scanner cin = new Scanner();\n\n//\t\tprivate static void Main()\n//\t\t{\n//#if DEBUG\n//\t\t\tConsole.SetIn(new StreamReader(@\"..\\..\\input.txt\"));\n//#endif\n//\t\t\tnew Template().Solve();\n//\t\t\tConsole.ReadLine();\n//#if DEBUG\n//\t\t\tConsole.ReadKey();\n//#endif\n//\t\t}\n//\t}\n\n//\tinternal class Scanner\n//\t{\n//\t\tprivate string[] s = new string[0];\n//\t\tprivate int i;\n//\t\tprivate readonly char[] cs = { ' ' };\n\n//\t\tpublic string NextString()\n//\t\t{\n//\t\t\tif (i < s.Length) return s[i++];\n//\t\t\tvar line = Console.ReadLine() ?? string.Empty;\n//\t\t\ts = line.Split(cs, StringSplitOptions.RemoveEmptyEntries);\n//\t\t\ti = 1;\n//\t\t\treturn s.First();\n//\t\t}\n\n//\t\tpublic double NextDouble()\n//\t\t{\n//\t\t\treturn double.Parse(NextString());\n//\t\t}\n\n//\t\tpublic int NextInt()\n//\t\t{\n//\t\t\treturn int.Parse(NextString());\n//\t\t}\n\n//\t\tpublic long NextLong()\n//\t\t{\n//\t\t\treturn long.Parse(NextString());\n//\t\t}\n//\t}\n//}", "lang": "MS C#", "bug_code_uid": "17ba628098b64f10cf147c3374a46b4d", "src_uid": "ba49b6c001bb472635f14ec62233210e", "apr_id": "e18e04acf21bb0d6ee8a4faa4e0bc84a", "difficulty": 1100, "tags": ["geometry", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C#"} {"similarity_score": 0.9553805774278216, "equal_cnt": 8, "replace_cnt": 1, "delete_cnt": 3, "insert_cnt": 3, "fix_ops_cnt": 7, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\n\nnamespace Codeforces582\n{\n internal class Program2\n {\n private static void Main()\n {\n var input = Console.ReadLine().Split(' ').Select(int.Parse);\n var n = input.First();\n var k = input.Skip(1).First();\n var a = Console.ReadLine().Split(' ').Select(int.Parse).ToArray();\n\n var zeroCosts = new int[n];\n for (var i = 0; i < n; i++)\n {\n var tmpCost = 0;\n var tmpAi = a[i];\n while (tmpAi > 0)\n {\n tmpCost++;\n tmpAi /= 2;\n }\n\n zeroCosts[i] = tmpCost;\n }\n\n Array.Sort(zeroCosts);\n var zeroAns = 0;\n for (var i = 0; i < k; i++) zeroAns += zeroCosts[i];\n var ans = zeroAns;\n\n\n foreach (var item in a)\n {\n var costs = new int[n];\n for (var i = 0; i < n; i++)\n if (a[i] < item)\n {\n costs[i] = -1;\n }\n else\n {\n var tmpCost = 0;\n var tmpAi = a[i];\n while (tmpAi > item)\n {\n tmpCost++;\n tmpAi /= 2;\n }\n\n if (tmpAi != item) costs[i] = -1;\n else costs[i] = tmpCost;\n }\n\n Array.Sort(costs);\n var tmpAns = 0;\n var tmpNum = 0;\n for (var i = 0; i < n && tmpNum < k; i++)\n {\n if (costs[i] == -1) continue;\n\n tmpNum++;\n tmpAns += costs[i];\n }\n\n if (tmpNum == k && tmpAns < ans) ans = tmpAns;\n }\n\n Console.WriteLine(ans);\n }\n }\n}", "lang": "Mono C#", "bug_code_uid": "8aad6bc04164b6162f377a03a0994e47", "src_uid": "ed1a2ae733121af6486568e528fe2d84", "apr_id": "5b2b7d869bbcf98251022d8f56f8b49b", "difficulty": 1500, "tags": ["brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "C#"} {"similarity_score": 0.9906542056074766, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "using System;\n\npublic class Test\n{\n\tpublic static void Main()\n\t{\n\t\tstring input = Console.ReadLine();\n\t\t\n\t\tConsole.WriteLine(GetHQ9p(input));\n\t}\n\t\n\tpublic static string GetHQ9p(string input)\n\t{\n\t\tchar[] alphabet = new char[]{'H','Q','9','+'}\n\t\t\n\t\tforeach(char a in input){\n\t\t\tforeach(char a2 in alphabet){\t\n\t\t\t\tif(a==a2){\n\t\t\t\t\treturn \"YES\";\t\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn \"NO\";\n\t}\n}", "lang": "MS C#", "bug_code_uid": "2138943b541a1ff6c20c3256a5e178e3", "src_uid": "1baf894c1c7d5aeea01129c7900d3c12", "apr_id": "504a231f32eca6116f63f05d1e874c1a", "difficulty": 900, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.976231884057971, "equal_cnt": 9, "replace_cnt": 4, "delete_cnt": 0, "insert_cnt": 4, "fix_ops_cnt": 8, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace HQ+9\n{\n class Program\n {\n static void Main(string[] args)\n {\n here: string p = Console.ReadLine();\n if(p.Length<1||p.Length>100)\n {\n goto here;\n }\n char[] arr = p.ToCharArray();\n bool check = false;\n for(int i=0;i\n\n \n \n Debug\n AnyCPU\n {BBEEF3C8-5164-42A6-A65A-D19AFC694892}\n Exe\n Properties\n HelloWorld\n HelloWorld\n v4.5.2\n 512\n true\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 \n", "lang": "MS C#", "bug_code_uid": "62dfbd522b61034c9714ae6cc2de0a05", "src_uid": "1baf894c1c7d5aeea01129c7900d3c12", "apr_id": "e81500cea1c962c6af014cd89acdc2c9", "difficulty": 900, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9986996098829649, "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;\nusing System.Text;\n\nnamespace HQ9+\n{\n class Program\n {\n static void Main(string[] args)\n {\n string line = Console.ReadLine();\n if (line.Contains('H')||line.Contains('Q')||line.Contains('9')) Console.WriteLine(\"YES\");\n else Console.WriteLine(\"NO\");\n }\n }\n}", "lang": "MS C#", "bug_code_uid": "56409f8d8bb0e183e5ceb39a6da62e9d", "src_uid": "1baf894c1c7d5aeea01129c7900d3c12", "apr_id": "f5d3c95fb9d590c937e061024092885d", "difficulty": 900, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C#"} {"similarity_score": 0.9993355481727575, "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.Text;\nusing System.Threading.Tasks;\n\nnamespace Pr1\n{\n class Program\n {\n static void Main()\n {\n string a= Console.ReadLine();\n int k=1,max=0;\n string s=\"AEIOUY\";\n for(int i=0;i Convert.ToInt32(x));\n C = new long[200, 200];\n C[0, 0] = 1;\n for (int i = 1; i < 200; i++) {\n C[i, 0] = C[i, i] = 1;\n for (int j = 1; j <= i; j++)\n C[i, j] = (C[i - 1, j] + C[i - 1, j - 1]) % MOD;\n }\n\n long ans = 0;\n for (int k = a.Sum(); k <= n; k++) {\n\n long[,] dp = new long[110, 30];\n dp[k, 0] = 1;\n\n for (int j = 0; j < 10; j++)\n for (int i = a[j]; i <= k; i++)\n for (int l = a[j]; l <= i; l++) {\n if (j == 0) dp[i - l, j + 1] = (dp[i - l, j + 1] + dp[i, j] * CNK(i - 1, l) % MOD) % MOD;\n else dp[i - l, j + 1] = (dp[i - l, j + 1] + dp[i, j] * CNK(i, l) % MOD) % MOD;\n }\n\n ans += dp[0, 10];\n ans %= MOD;\n }\n\n Console.WriteLine(ans);\n\t }\n static long[,] C;\n static long CNK(long n, long k) {\n if (k > n || k < 0) return 0;\n if (k == n || k == 0) return 1;\n return C[n, k];\n }\n}", "lang": "MS C#", "bug_code_uid": "a6c926380cade263e0c2911c486b3b08", "src_uid": "c1b5169a5c3b1bd4a2f1df1069ee7755", "apr_id": "d16077847bad41a928f2a98d6ddbf63a", "difficulty": 1900, "tags": ["dp", "combinatorics"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C#"} {"similarity_score": 0.659043659043659, "equal_cnt": 8, "replace_cnt": 3, "delete_cnt": 2, "insert_cnt": 3, "fix_ops_cnt": 8, "bug_source_code": "using System;\n\nclass Program\n{\n static void Main()\n {\n string s = Console.ReadLine();\n int val = Convert.ToInt32(Console.ReadLine());\n string all = \"\";\n for (int i = 0; i < val; i++)\n {\n all += Console.ReadLine();\n }\n Console.WriteLine(all.Contains(s)?\"YES\":\"NO\");\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "fe73489a79f205579c6fbff543e9a390", "src_uid": "cad8283914da16bc41680857bd20fe9f", "apr_id": "97a0fb0c27f2e768510dc806c7b070ef", "difficulty": 900, "tags": ["strings", "brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.37682441397611677, "equal_cnt": 13, "replace_cnt": 9, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 12, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\n\nnamespace DoubleCola\n{\n class Program\n {\n static void Main(string[] args)\n {\n int number = int.Parse(Console.ReadLine());\n\n List queu = new List();\n \n int i = 0 ;\n int k = 1;\n while (i < number )\n\n {\n \n for (int j = 1; j <= k; j++)\n {\n queu.Add(\"Sheldon\");\n i++;\n }\n for (int j = 1; j <= k; j++)\n {\n queu.Add(\"Leonard\");\n i++;\n }\n for (int j = 1; j <= k; j++)\n {\n queu.Add(\"Penny\");\n i++;\n }\n for (int j = 1; j <= k; j++)\n {\n queu.Add(\"Rajesh\");\n i++;\n }\n for (int j = 1; j <= k; j++)\n {\n queu.Add(\"Howard\");\n i++;\n }\n k *= 2;\n }\n\n Console.WriteLine(queu[number-1]);\n Console.ReadLine();\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "8227e0987e6f1532c92bf3c412e65b86", "src_uid": "023b169765e81d896cdc1184e5a82b22", "apr_id": "8d8a490e848a09ba1f1665e2211f6af5", "difficulty": 1100, "tags": ["math", "implementation"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9862765406525117, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Globalization;\nusing System.Linq;\nusing System.Text;\nusing System.Text.RegularExpressions;\nusing System.Threading;\n\nnamespace Codeforces\n{\n class C\n {\n private static ThreadStart s_threadStart = new C().Go;\n private static bool s_time = true;\n\n Dictionary memo;\n int DP(int x)\n {\n if (!memo.ContainsKey(x))\n {\n string s = \"\" + x;\n int ret = int.MaxValue;\n if (s.Length == 1)\n ret = 0;\n else\n {\n foreach (char ch in s)\n {\n if (ch != '0')\n {\n int y = DP(x - (ch - '0'));\n if (ret > y) ret = y;\n }\n }\n }\n\n memo[x] = ret + 1;\n }\n return memo[x];\n }\n\n private void Go()\n {\n int n = GetInt();\n int[] dp = new int[n + 1];\n\n if (n < 10)\n {\n Wl(1);\n return;\n }\n\n dp[n] = 0;\n for (int i = n; i >= 0; i--)\n {\n if (i == n || dp[i] != 0)\n {\n string s = i.ToString();\n foreach (char ch in s)\n {\n if (ch != '0')\n {\n int ind = i - (ch - '0');\n if (dp[ind] == 0 || dp[ind] > dp[i] + 1)\n dp[ind] = dp[i] + 1;\n }\n }\n }\n }\n\n Wl(dp[0]);\n }\n\n #region Template\n\n public static void Main(string[] args)\n {\n System.Diagnostics.Stopwatch timer = new System.Diagnostics.Stopwatch();\n Thread main = new Thread(new ThreadStart(s_threadStart), 200 * 1024 * 1024);\n timer.Start();\n main.Start();\n main.Join();\n timer.Stop();\n if (s_time)\n Wl(timer.ElapsedMilliseconds);\n }\n\n private static IEnumerator ioEnum;\n private static string GetString()\n {\n while (ioEnum == null || !ioEnum.MoveNext())\n {\n ioEnum = Console.ReadLine().Split().AsEnumerable().GetEnumerator();\n }\n\n return ioEnum.Current;\n }\n\n private static int GetInt()\n {\n return int.Parse(GetString());\n }\n\n private static long GetLong()\n {\n return long.Parse(GetString());\n }\n\n private static double GetDouble()\n {\n return double.Parse(GetString());\n }\n\n private static List GetIntArr(int n)\n {\n List ret = new List(n);\n for (int i = 0; i < n; i++)\n {\n ret.Add(GetInt());\n }\n return ret;\n }\n\n private static void Wl(T o)\n {\n if (o is double)\n {\n Wld((o as double?).Value, \"\");\n }\n else if (o is float)\n {\n Wld((o as float?).Value, \"\");\n }\n else\n Console.WriteLine(o.ToString());\n }\n\n private static void Wl(IEnumerable enumerable)\n {\n Wl(string.Join(\" \", enumerable.Select(e => e.ToString()).ToArray()));\n }\n\n private static void Wld(double d, string format)\n {\n Wl(d.ToString(format, CultureInfo.InvariantCulture));\n }\n\n #endregion\n }\n}", "lang": "MS C#", "bug_code_uid": "6d5b3932bb570db2488b0c1dd46b7e27", "src_uid": "fc5765b9bd18dc7555fa76e91530c036", "apr_id": "1fdaaa5746b1f9e34a63a39e16be8503", "difficulty": 1100, "tags": ["dp"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9862160960426857, "equal_cnt": 4, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 4, "bug_source_code": "using System;\nusing System.Text;\n\nnamespace CP\n{\n class Program\n {\n static void Main(string[] args)\n {\n char dir = Convert.ToChar(Console.ReadLine());\n string message = Console.ReadLine();\n string keyboard = \"qwertyuiopasdfghjkl;zxcvbnm,./\";\n StringBuilder sb = new StringBuilder();\n if(dir == 'L')\n {\n for(int i = 0 ; i 0) {\n if (tmp % 10 == 4 || tmp % 10 == 7) { mask += m * (tmp % 10); m*=10; }\n tmp /= 10;\n }\n if (mask == b) { Console.Write(a); return; }\n }\n }\n}\n ", "lang": "MS C#", "bug_code_uid": "373e6208c37cf0fbf9950b97ffc202a2", "src_uid": "e5e4ea7a5bf785e059e10407b25d73fb", "apr_id": "50fb5b7e0627ebde5bf65441544f1bbc", "difficulty": 1300, "tags": ["brute force", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9224869898657901, "equal_cnt": 30, "replace_cnt": 21, "delete_cnt": 6, "insert_cnt": 2, "fix_ops_cnt": 29, "bug_source_code": "\n\n\n\nusing System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Text.RegularExpressions;\nnamespace ConsoleApplication1\n{\n class Program\n {\n\n static int[] divN=new int[3];\n static int[] divK=new int[3];\n public static void Main(string[] args)\n {\n string[] s = Console.ReadLine().Split(' ');\n int n, k;\n n = int.Parse(s[0]);\n k = int.Parse(s[1]);\n if (n == k)\n {\n Console.WriteLine(0);\n return;\n }\n if (calcolaDivN(n) && calcolaDivK(k))\n {\n int ris = 0;\n for (int i = 0; i < 3; i++)\n {\n ris += Math.Abs(divN[i] - divK[i]);\n }\n Console.WriteLine(ris);\n \n }\n \n else\n {\n Console.WriteLine(-1);\n \n }\n \n }\n static bool calcolaDivN(int i)\n {\n while (i % 2 == 0)\n {\n i /= 2;\n divN[0]++;\n }\n while (i % 3 == 0)\n {\n divN[1]++;\n i /= 3;\n }\n while (i % 5 == 0)\n {\n divN[2]++;\n i /= 5;\n }\n return i == 1;\n }\n static bool calcolaDivK(int i)\n {\n while (i % 2 == 0)\n {\n i /= 2;\n divK[0]++;\n }\n while (i % 3 == 0)\n {\n divK[1]++;\n i /= 3;\n }\n while (i % 5 == 0)\n {\n divK[2]++;\n i /= 5;\n }\n return i == 1;\n }\n\n }\n}", "lang": "MS C#", "bug_code_uid": "e326c6e743e78400df1d3bb49fb81454", "src_uid": "75a97f4d85d50ea0e1af0d46f7565b49", "apr_id": "599391b6084785207545ed7c15128f5b", "difficulty": 1300, "tags": ["math", "number theory"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9772978959025471, "equal_cnt": 10, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 7, "fix_ops_cnt": 10, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Text.RegularExpressions;\nnamespace ConsoleApplication1\n{\n class Program\n {\n\n static int[] divN=new int[3];\n static int[] divK=new int[3];\n static int n, k;\n public static void Main(string[] args)\n {\n string[] s = Console.ReadLine().Split(' ');\n int n, k;\n n = int.Parse(s[0]);\n k = int.Parse(s[1]);\n if(n==k)\n {\n Console.WriteLine(0);\n return;\n }\n int ris = 0;\n calcolaDivK();\n calcolaDivN();\n if (n == k)\n {\n for (int i = 0; i < 3; i++)\n {\n ris += Math.Abs(divK[i] - divN[i]);\n }\n Console.WriteLine(ris);\n }\n else\n {\n Console.WriteLine(-1);\n }\n \n }\n static void calcolaDivN()\n {\n while (n % 2 == 0)\n {\n n /= 2;\n divN[0]++;\n }\n while (n % 3 == 0)\n {\n divN[1]++;\n n /= 3;\n }\n while (n % 5 == 0)\n {\n divN[2]++;\n n /= 5;\n }\n \n }\n static void calcolaDivK()\n {\n while (k % 2 == 0)\n {\n k /= 2;\n divK[0]++;\n }\n while (k % 3 == 0)\n {\n divK[1]++;\n k /= 3;\n }\n while (k % 5 == 0)\n {\n divK[2]++;\n k /= 5;\n }\n \n }\n\n }\n}", "lang": "MS C#", "bug_code_uid": "d6de0b31d141ef5c55ac62958bf4ad8a", "src_uid": "75a97f4d85d50ea0e1af0d46f7565b49", "apr_id": "599391b6084785207545ed7c15128f5b", "difficulty": 1300, "tags": ["math", "number theory"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.9944649446494465, "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.Text;\nusing System.Threading.Tasks;\nusing System.Text.RegularExpressions;\nusing System.IO;\nusing System.Numerics;\nusing System.Globalization;\nusing System.Threading;\n\n\nnamespace probleme {\n class Program {\n static void Main(string[] args) {\n //Console.SetIn(new StreamReader(\"file.txt\"));\n int n = int.Parse(Console.ReadLine());\n Console.Write((n - 2) * (n - 2));\n //Console.ReadKey();\n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "da16c59596164eb25b188023d6107acb", "src_uid": "efa8e7901a3084d34cfb1a6b18067f2b", "apr_id": "184a0ce5302a5e836f07d51bf9719eaa", "difficulty": 1100, "tags": ["math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.5812619502868069, "equal_cnt": 10, "replace_cnt": 7, "delete_cnt": 3, "insert_cnt": 0, "fix_ops_cnt": 10, "bug_source_code": "using System;\nusing System.Collections;\nusing System.Collections.Generic;\n\nnamespace Codeforces\n{\n class Program\n {\n\n #region input\n\n static long readLong() {\n long num;\n long.TryParse(Console.ReadLine(),out num);\n return num;\n }\n\n static int readInt() {\n int num;\n int.TryParse(Console.ReadLine(),out num);\n return num;\n }\n\n static bool readBool() {\n int num;\n int.TryParse(Console.ReadLine(),out num);\n return num != 0;\n }\n\n static long[] readLongs() {\n string[] nums = Console.ReadLine().Split(new char[] { ' ' });\n long[] parsed = new long[nums.Length];\n for(int i = 0; i < nums.Length; i++) {\n long.TryParse(nums[i],out parsed[i]);\n }\n return parsed;\n }\n\n static int[] readInts() {\n string[] nums = Console.ReadLine().Split(new char[] { ' ' });\n int[] parsed = new int[nums.Length];\n for(int i = 0; i < nums.Length; i++) {\n int.TryParse(nums[i],out parsed[i]);\n }\n return parsed;\n }\n\n static BitArray readBools() {\n string[] nums = Console.ReadLine().Split(new char[] { ' ' });\n int parsed;\n BitArray bits = new BitArray(nums.Length);\n for(int i = 0; i < nums.Length; i++) {\n int.TryParse(nums[i],out parsed);\n if(parsed != 0) {\n bits[i] = true;\n }\n }\n return bits;\n }\n\n #endregion\n\n #region utility\n\n static long largeModolu(long a, long b, long m) {\n long prev = a;\n long sum = (b & 1) > 0 ? a : 1;\n int digits = (int)(Math.Ceiling(Math.Log(b,2)));\n for(int i = 1; i < digits; i++) {\n pusing System;\nusing System.Collections;\nusing System.Collections.Generic;\n\nnamespace Codeforces\n{\n class Program\n {\n\n #region input\n\n static long readLong() {\n long num;\n long.TryParse(Console.ReadLine(),out num);\n return num;\n }\n\n static int readInt() {\n int num;\n int.TryParse(Console.ReadLine(),out num);\n return num;\n }\n\n static bool readBool() {\n int num;\n int.TryParse(Console.ReadLine(),out num);\n return num != 0;\n }\n\n static long[] readLongs() {\n string[] nums = Console.ReadLine().Split(new char[] { ' ' });\n long[] parsed = new long[nums.Length];\n for(int i = 0; i < nums.Length; i++) {\n long.TryParse(nums[i],out parsed[i]);\n }\n return parsed;\n }\n\n static int[] readInts() {\n string[] nums = Console.ReadLine().Split(new char[] { ' ' });\n int[] parsed = new int[nums.Length];\n for(int i = 0; i < nums.Length; i++) {\n int.TryParse(nums[i],out parsed[i]);\n }\n return parsed;\n }\n\n static BitArray readBools() {\n string[] nums = Console.ReadLine().Split(new char[] { ' ' });\n int parsed;\n BitArray bits = new BitArray(nums.Length);\n for(int i = 0; i < nums.Length; i++) {\n int.TryParse(nums[i],out parsed);\n if(parsed != 0) {\n bits[i] = true;\n }\n }\n return bits;\n }\n\n #endregion\n\n #region utility\n\n static long largeModolu(long a, long b, long m) {\n long prev = a;\n long sum = (b & 1) > 0 ? a : 1;\n int digits = (int)(Math.Ceiling(Math.Log(b,2)));\n for(int i = 1; i < digits; i++) {\n prev = (prev * prev) % (m);\n if((b & (1l << i)) > 0) {\n sum = (sum * prev) % (m);\n }\n }\n return sum;\n }\n\n #endregion\n\n static void Main(string[] args) {\n Console.WriteLine((int)Math.Pow((readInt() - 2),2));\n }\n }\n}\nrev = (prev * prev) % (m);\n if((b & (1l << i)) > 0) {\n sum = (sum * prev) % (m);\n }\n }\n return sum;\n }\n\n #endregion\n\n static void Main(string[] args) {\n Console.WriteLine((int)Math.Pow((readInt() - 2),2));\n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "7cec9f2fa58b2e169f6d0ca6a63ca615", "src_uid": "efa8e7901a3084d34cfb1a6b18067f2b", "apr_id": "3dc6a8457593b5754bc3d94cf4e8050c", "difficulty": 1100, "tags": ["math"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9510196967055953, "equal_cnt": 5, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 4, "bug_source_code": "using System;\nusing System.IO;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\nnamespace FINDBESTHOUSE\n{\n class Program\n {\n static void Main(string[] args)\n {\n int[] SplitedInfo = Console.ReadLine().Split(new char[] {' ', '\\n'}).Select(Int32.Parse).ToArray();\n int AmoutofHouse = SplitedInfo[0];\n int GFLocation = SplitedInfo[1] - 1;\n int YourMoney = SplitedInfo[2];\n int[] Finding = new int[AmoutofHouse];\n for (var j = 0; j < AmoutofHouse; j++)\n {\n int test = SplitedInfo[3 + j];\n if (test == 0)\n {\n Finding[j] = 0;\n }\n else if (YourMoney > test)\n {\n Finding[j] = 1;\n }\n else\n {\n Finding[j] = 0;\n }\n }\n int Checker = 1;\n int get1 = 1, get2 = 1;\n int i = 0;\n do\n {\n i++;\n try\n {\n if (Finding[GFLocation - i] == 0)\n {\n continue;\n }\n else if (Finding[GFLocation - i] == 1)\n {\n get1 = i;\n break;\n }\n else\n {\n get1 = 0;\n }\n }\n catch\n {\n get1 = 0;\n break;\n }\n }\n while (Checker == 1);\n Checker = 1;\n i = 0;\n do\n {\n i++;\n try\n {\n if (Finding[GFLocation + i] == 0)\n {\n continue;\n }\n else if (Finding[GFLocation + i] == 1)\n {\n get2 = i;\n break;\n }\n else\n {\n get2 = 0;\n }\n }\n catch\n {\n get2 = 0;\n break;\n }\n }\n while (Checker == 1);\n int result = 0;\n if (get1 == 0)\n {\n result = get2;\n }\n else if (get2 == 0)\n {\n result = get1;\n }\n else\n {\n result = get1 > get2 ? get2 : get1;\n }\n Console.WriteLine(result * 10);\n\n }\n }\n}", "lang": "Mono C#", "bug_code_uid": "6f05fc7cd68c1347a3d410725d110f96", "src_uid": "57860e9a5342a29257ce506063d37624", "apr_id": "f19e6652b611c551787063f914a3c4f8", "difficulty": 800, "tags": ["brute force", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.937740468695348, "equal_cnt": 9, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 6, "fix_ops_cnt": 8, "bug_source_code": "using System;\nusing System.IO;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\nnamespace FINDBESTHOUSE\n{\n class Program\n {\n static void Main(string[] args)\n {\n int[] SplitedInfo = Console.ReadLine().Split(' ').Select(Int32.Parse).ToArray();\n int AmoutofHouse = SplitedInfo[0];\n int GFLocation = SplitedInfo[1] - 1;\n int YourMoney = SplitedInfo[2];\n int[] Finding = new int[AmoutofHouse];\n for (var j = 0; j < AmoutofHouse; j++)\n {\n int test = SplitedInfo[3 + j];\n if (test == 0)\n {\n Finding[j] = 0;\n }\n else if (YourMoney > test)\n {\n Finding[j] = 1;\n }\n else\n {\n Finding[j] = 0;\n }\n }\n int Checker = 1;\n int get1 = 1, get2 = 1;\n int i = 0;\n do\n {\n i++;\n try\n {\n if (Finding[GFLocation - i] == 0)\n {\n continue;\n }\n else if (Finding[GFLocation - i] == 1)\n {\n get1 = i;\n break;\n }\n else\n {\n get1 = 0;\n }\n }\n catch\n {\n get1 = 0;\n break;\n }\n }\n while (Checker == 1);\n Checker = 1;\n i = 0;\n do\n {\n i++;\n try\n {\n if (Finding[GFLocation + i] == 0)\n {\n continue;\n }\n else if (Finding[GFLocation + i] == 1)\n {\n get2 = i;\n break;\n }\n else\n {\n get2 = 0;\n }\n }\n catch\n {\n get2 = 0;\n break;\n }\n }\n int result = 0;\n while (Checker == 1);\n if (get1 == 0)\n {\n result = get2;\n }\n else if (get2 == 0)\n {\n result = get1;\n }\n else\n {\n result = get1 > get2 ? get2 : get1;\n }\n Console.WriteLine(result * 10);\n\n }\n }\n}", "lang": "Mono C#", "bug_code_uid": "8c9e1587c77c04e63c453e3798a65c3b", "src_uid": "57860e9a5342a29257ce506063d37624", "apr_id": "f19e6652b611c551787063f914a3c4f8", "difficulty": 800, "tags": ["brute force", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.9107358262967431, "equal_cnt": 8, "replace_cnt": 3, "delete_cnt": 1, "insert_cnt": 3, "fix_ops_cnt": 7, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\n//using System.Text;\n//using System.Threading.Tasks;\n\nnamespace Contest\n{\n class Program\n {\n static void Main(string[] args)\n {\n string line = Console.ReadLine();\n int a, b, c;\n a = Convert.ToInt32(line.Split(' ')[0]);\n b = Convert.ToInt32(line.Split(' ')[1]);\n c = Convert.ToInt32(line.Split(' ')[2]);\n List burutfors = new List();\n burutfors.Add(a * b * c);\n burutfors.Add(a * (b + c));\n burutfors.Add((a * b) + c);\n burutfors.Add((a + b) * c);\n burutfors.Add(a + (b * c));\n burutfors.Add(a + b + c);\n burutfors.Sort();\n\n\n\n Console.WriteLine(burutfors.ElementAt(5));\n\n \n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "bed0799e1971f18ec14d9e2d86bf4aff", "src_uid": "1cad9e4797ca2d80a12276b5a790ef27", "apr_id": "14146614983d9bab35805704d56465f2", "difficulty": 1000, "tags": ["math", "brute force"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.6935580975316075, "equal_cnt": 12, "replace_cnt": 9, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 11, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\n\nnamespace Codeforces\n{\n\tclass Program\n\t{\n\t\tstatic void Main(string[] args)\n\t\t{\n\t\t\tint x2 = int.Parse(Console.ReadLine());\n\t\t\tint px2 = Factorize(x2);\n\t\t\tint min = x2;\n\t\t\tint start2 = ((x2 / px2) - 1) * px2 + 1;\n\n\t\t\tfor (int x1 = start2; x1 <= x2; x1++)\n\t\t\t{\n\t\t\t\tint px1 = Factorize(x1);\n\t\t\t\tint start1 = ((x1 / px1) - 1) * px1 + 1;\n\t\t\t\tif (start1 > 2 && start1 < min)\n\t\t\t\t{\n\t\t\t\t\tmin = start1;\n\t\t\t\t}\n\t\t\t}\n\t\t\tConsole.WriteLine(min);\n\t\t\tConsole.ReadLine();\n\t\t}\n\n\t\t/// \n\t\t/// Разложение числа на простые множители O(n).\n\t\t/// \n\t\tpublic static int Factorize(int n)\n\t\t{\n\t\t\t//var res = new List();\n\t\t\tint cur = n;\n\t\t\tint m = 2;\n\t\t\tint res = 0;\n\t\t\twhile(cur != 1)\n\t\t\t{\n\t\t\t\tif (cur % m == 0)\n\t\t\t\t{\n\t\t\t\t\tcur /= m;\n\t\t\t\t\t//res.Add(m);\n\t\t\t\t\tres = m;\n\t\t\t\t}\n\t\t\t\telse m++;\n\t\t\t}\n\t\t\treturn res;\n\t\t}\n\t}\n}\n", "lang": "Mono C#", "bug_code_uid": "b9c53efac111ca596c8787ba8552c623", "src_uid": "43ff6a223c68551eff793ba170110438", "apr_id": "744e7a57baaa036ac0a62caae963e404", "difficulty": 1700, "tags": ["math", "number theory"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9993618379068283, "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 Codeforces\n{\n\tclass Program\n\t{\n\t\tstatic void Main(string[] args)\n\t\t{\n\t\t\tint x2 = int.Parse(Console.ReadLine());\n\t\t\tint px2 = maxPrimeDivs(x2);\n\t\t\tint min = x2;\n\t\t\tint start2 = ((x2 / px2) - 1) * px2 + 1;\n\n\t\t\tfor (int x1 = start2; x1 <= x2; x1++)\n\t\t\t{\n\t\t\t\tint px1 = maxPrimeDivs(x1);\n\t\t\t\tint start1 = ((x1 / px1) - 1) * px1 + 1;\n\t\t\t\tif (start1 > 2 && starta1 < min)\n\t\t\t\t{\n\t\t\t\t\tmin = start1;\n\t\t\t\t}\n\t\t\t}\n\t\t\tConsole.WriteLine(min);\n\t\t\tConsole.ReadLine();\n\t\t}\n\n\t\tprivate static int maxPrimeDivs(int n)\n\t\t{\n\t\t\tint d = 2;\n\t\t\tint result = 0;\n\n\t\t\twhile (d * d <= n)\n\t\t\t{\n\t\t\t\tif (n % d == 0)\n\t\t\t\t{\n\t\t\t\t\tn /= d;\n\t\t\t\t\tif (result < d)\n\t\t\t\t\t\tresult = d;\n\t\t\t\t}\n\t\t\t\telse d++;\n\t\t\t}\n\t\t\treturn Math.Max(result, n);\n\t\t}\n\n\t}\n}\n", "lang": "Mono C#", "bug_code_uid": "da59b4c55278abbf087ab5ec2de4185a", "src_uid": "43ff6a223c68551eff793ba170110438", "apr_id": "744e7a57baaa036ac0a62caae963e404", "difficulty": 1700, "tags": ["math", "number theory"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C#"} {"similarity_score": 0.99830220713073, "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.Text;\n\nnamespace ConsoleApp2\n{\n class Program\n {\n static void Main(string[] args)\n {\n string[] s = Console.ReadLine().Split();\n int n = int.Parse(s[0]);\n int d = int.Parse(s[1]);\n string st = Console.ReadLine();\n int pos = 0;\n int kol = 0;\n while (pos!=st.Length-1)\n {\n int len = Math.Min(d, st.Length - pos - 1);\n string ss = st.Substring(pos+1, len);\n int lastind = ss.LastIndexOf('1'); \n if (lastind == 0)\n {\n Console.WriteLine(-1);\n return;\n }\n pos += lastind+1;\n kol++;\n }\n Console.WriteLine(kol);\n }\n }\n}", "lang": ".NET Core C#", "bug_code_uid": "9d92536c92bb12c9540a9bd8c904283a", "src_uid": "c08d2ecdfc66cd07fbbd461b1f069c9e", "apr_id": "fc40e7c921b50edfcdcbdfdee5bd54b6", "difficulty": 800, "tags": ["dp", "greedy", "dfs and similar", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9153705397987191, "equal_cnt": 9, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 6, "fix_ops_cnt": 8, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Diagnostics;\nusing System.Globalization;\nusing System.IO.Pipes;\nusing System.Linq;\nusing System.Numerics;\nusing System.Runtime.InteropServices;\nusing System.Text;\nusing System.Threading;\n\nclass Test\n{\n static long MOD = 1000000007;\n static long[] fact = new long[500001];\n static long[] factInv = new long[500001];\n static List anss = new List();\n // Driver code \n public static void Main()\n {\n //int t = int.Parse(Console.ReadLine());\n // while (t > 0)\n {\n // t--;\n var input1 = Console.ReadLine().Split(' ').Select(xx => int.Parse(xx)).ToArray();\n var n = input1[0];\n var k = input1[1];\n\n var arr = Console.ReadLine();\n var ans = minJumps(arr, 0, n - 1, k);\n Console.WriteLine(ans==int.MaxValue?-1:ans);\n\n }\n }\n\n static int minJumps(string arr, int l, int h,int k)\n {\n if (h == l)\n return 0;\n if (arr[l] == '0')\n return int.MaxValue;\n\n int min = int.MaxValue;\n for (int i = l + 1; i <= h && i <= l + k; i++)\n {\n int jumps = minJumps(arr, i, h,k);\n if (jumps != int.MaxValue && jumps + 1 < min)\n min = jumps + 1;\n }\n return min;\n }\n\n\n\n public static long FastPower(long a, long b)\n {\n if (b == 0)\n return 1;\n\n var val = FastPower(a, b / 2);\n\n if (b % 2 == 0)\n return val * val % MOD;\n else\n return val * val % MOD * a % MOD;\n }\n\n public static void Fact()\n {\n fact[0] = 1;\n factInv[0] = FastPower(fact[0], MOD - 2);\n\n for (int i = 1; i <= 500000; i++)\n {\n fact[i] = i * fact[i - 1] % MOD;\n factInv[i] = FastPower(fact[i], MOD - 2);\n }\n\n\n }\n\n public static long NCR(long n, long r)\n {\n return fact[n] * factInv[r] % MOD * factInv[n - r] % MOD;\n }\n}\n\n\n\n\n\n\n\n\n\n\n\n", "lang": "Mono C#", "bug_code_uid": "c56b31f015e8c254664a5306f5221b2b", "src_uid": "c08d2ecdfc66cd07fbbd461b1f069c9e", "apr_id": "623532decc14081efa2491dbbca1e9e6", "difficulty": 800, "tags": ["dp", "greedy", "dfs and similar", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.9902312599681021, "equal_cnt": 8, "replace_cnt": 2, "delete_cnt": 1, "insert_cnt": 4, "fix_ops_cnt": 7, "bug_source_code": "#region Usings\nusing System;\nusing System.Collections.Generic;\nusing System.Globalization;\nusing System.IO;\nusing System.Linq;\n\nusing static System.Math;\n#endregion\n\n// https://codeforces.com/problemset/problem/910/A\npublic class A___The_Way_to_Home\n{\n static int n, d;\n static string s;\n private static void Solve()\n {\n n = ReadInt();\n d = ReadInt();\n s = Read();\n\n int result = Jump(0, 0, n);\n\n // If value still n, it never actually reached n.\n // You need n - 1 jumps to get there, so the value was not overriden.\n // If it was not overriden, it means minJumps was never assigned jumps.\n // So the (pos == n - 1) condition was never reached.\n Write(result == n ? -1 : result);\n }\n\n /// Current position\n /// Accumulated jumps so far\n /// Min jumps discovered to achieve n so far\n static int Jump(int pos, int jumps, int minJumps)\n {\n if (pos == n - 1)\n return jumps;\n\n // i = Jumping destination\n for (int i = pos + 1; i < Min(pos + d + 1, n); i++)\n {\n if (s[i] == '1')\n minJumps = Min(minJumps, Jump(i, jumps + 1, minJumps));\n }\n\n return minJumps;\n }\n\n #region Main\n\n private static TextReader reader;\n private static TextWriter writer;\n\n public static void Main()\n {\n#if DEBUG\n\n //reader = new StreamReader(\"C:\\\\Users\\\\Axel\\\\Desktop\\\\input.txt\");\n reader = new StreamReader(Console.OpenStandardInput());\n writer = Console.Out;\n\n //writer = new StreamWriter(\"..\\\\..\\\\output.txt\");\n#else\n reader = new StreamReader(Console.OpenStandardInput());\n writer = new StreamWriter(Console.OpenStandardOutput());\n\n //reader = new StreamReader(\"input.txt\");\n //writer = new StreamWriter(\"output.txt\");\n#endif\n try\n {\n Solve();\n\n //var thread = new Thread(new String_Task().Solve, 1024 * 1024 * 128);\n //thread.Start();\n //thread.Join();\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 Main\n\n #region Read / Write\n\n private static Queue currentLineTokens = new Queue();\n\n private static string[] ReadAndSplitLine()\n {\n return reader.ReadLine().Split(new[] { ' ', '\\t', }, StringSplitOptions.RemoveEmptyEntries);\n }\n\n public static string Read()\n {\n while (currentLineTokens.Count == 0) currentLineTokens = new Queue(ReadAndSplitLine()); return currentLineTokens.Dequeue();\n }\n\n public static int ReadInt()\n {\n return int.Parse(Read());\n }\n\n public static long ReadLong()\n {\n return long.Parse(Read());\n }\n\n public static double ReadDouble()\n {\n return double.Parse(Read(), CultureInfo.InvariantCulture);\n }\n\n public static int[] ReadIntArray()\n {\n return ReadAndSplitLine().Select(int.Parse).ToArray();\n }\n\n public static long[] ReadLongArray()\n {\n return ReadAndSplitLine().Select(long.Parse).ToArray();\n }\n\n public static double[] ReadDoubleArray()\n {\n return ReadAndSplitLine().Select(s => double.Parse(s, CultureInfo.InvariantCulture)).ToArray();\n }\n\n public static int[][] ReadIntMatrix(int numberOfRows)\n {\n int[][] matrix = new int[numberOfRows][]; for (int i = 0; i < numberOfRows; i++) matrix[i] = ReadIntArray(); return matrix;\n }\n\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]; }\n return ret;\n }\n\n public static string[] ReadLines(int quantity)\n {\n string[] lines = new string[quantity]; for (int i = 0; i < quantity; i++) lines[i] = reader.ReadLine().Trim(); return lines;\n }\n\n public static void WriteArray(IEnumerable array)\n {\n writer.WriteLine(string.Join(\" \", array));\n }\n\n public static void Write(params object[] array)\n {\n WriteArray(array);\n }\n\n public static void WriteLines(IEnumerable array)\n {\n foreach (var a in array) writer.WriteLine(a);\n }\n\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\n private static T[] Init(int size) where T : new()\n {\n var ret = new T[size]; for (int i = 0; i < size; i++) ret[i] = new T(); return ret;\n }\n\n #endregion Read / Write\n}", "lang": "Mono C#", "bug_code_uid": "a3fbfeb6d49a9618b81e39e14d271c60", "src_uid": "c08d2ecdfc66cd07fbbd461b1f069c9e", "apr_id": "e9a7572e3fe5fbfcad8fced44d868cbe", "difficulty": 800, "tags": ["dp", "greedy", "dfs and similar", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.7996902426432628, "equal_cnt": 22, "replace_cnt": 12, "delete_cnt": 2, "insert_cnt": 7, "fix_ops_cnt": 21, "bug_source_code": "/*\ncsc -debug C.cs && mono --debug C.exe <<< \"6 10\"\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\n\npublic class HelloWorld {\n public static void SolveCodeForces() {\n var a = cin.NextUlong();\n var b = cin.NextUlong();\n\n var bestAns = (a * b) / GCD(a, b);\n var bestK = 0ul;\n\n// System.Console.WriteLine(new {bestAns, bestK});\n\n var ans1 = (a + 1ul) * (b + 1ul) / GCD(a + 1ul, b + 1ul);\n if (ans1 < bestAns) {\n bestAns = ans1;\n bestK = 1ul;\n }\n\n// System.Console.WriteLine(new {bestAns, bestK, ans1});\n\n if (a > b) {\n var tmp = b;\n b = a;\n a = tmp;\n }\n // here a <= b;\n\n var d = b - a;\n\n if (2ul * a <= b) {\n var k = d;\n var ans = (a + k) * (b + k) / GCD(a + k, b + k);\n if (ans < bestAns) {\n bestAns = ans;\n bestK = k;\n }\n// System.Console.WriteLine(new {a, b, k, ans});\n }\n\n if (d != 0) {\n for (var z = 1ul; z <= d; z++)\n if (d % z == 0) {\n\n var k = z - a % z;\n var ans3 = (a + k) * (b + k) / GCD(a + k, b + k);\n if (ans3 < bestAns) {\n bestAns = ans3;\n bestK = k;\n }\n\n k = z - b % z;\n var ans4 = (a + k) * (b + k) / GCD(a + k, b + k);\n if (ans4 < bestAns) {\n bestAns = ans4;\n bestK = k;\n }\n\n }\n }\n\n System.Console.WriteLine(bestK);\n }\n\n private static ulong GCD(ulong a, ulong b) {\n while (a != 0 && b != 0)\n {\n if (a > b)\n a %= b;\n else\n b %= a;\n }\n\n return a == 0 ? b : a;\n }\n\n static Scanner cin = new Scanner();\n static StringBuilder cout = new StringBuilder();\n\n static public void Main () {\n SolveCodeForces();\n // System.Console.Write(cout.ToString());\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 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}\n\npublic class Scanner\n{\n private string[] line = new string[0];\n private int index = 0;\n\n public string Next() {\n if (line.Length <= index) {\n line = Console.ReadLine().Split(' ');\n index = 0;\n }\n var res = line[index];\n index++;\n return res;\n }\n\n public int NextInt() {\n return int.Parse(Next());\n }\n\n public long NextLong() {\n return long.Parse(Next());\n }\n\n public ulong NextUlong() {\n return ulong.Parse(Next());\n }\n\n public string[] Array() {\n line = Console.ReadLine().Split(' ');\n index = line.Length;\n return line;\n }\n\n public int[] IntArray(int emptyPrefixLen = 0) {\n var array = Array();\n var result = new int[emptyPrefixLen + array.Length];\n for (int i = 0; i < array.Length; i++)\n result[emptyPrefixLen + i] = int.Parse(array[i]);\n return result;\n }\n\n public long[] LongArray() {\n var array = Array();\n var result = new long[array.Length];\n for (int i = 0; i < array.Length; i++)\n result[i] = long.Parse(array[i]);\n return result;\n }\n\n public ulong[] UlongArray() {\n var array = Array();\n var result = new ulong[array.Length];\n for (int i = 0; i < array.Length; i++)\n result[i] = ulong.Parse(array[i]);\n return result;\n }\n}", "lang": "Mono C#", "bug_code_uid": "60101017e22aa40ea8c94784038f8abd", "src_uid": "414149fadebe25ab6097fc67663177c3", "apr_id": "8804c750759fa8277b608e4f901b88f1", "difficulty": 1800, "tags": ["math", "brute force", "number theory"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.7674965935835502, "equal_cnt": 22, "replace_cnt": 12, "delete_cnt": 2, "insert_cnt": 7, "fix_ops_cnt": 21, "bug_source_code": "/*\ncsc -debug C.cs && mono --debug C.exe <<< \"6 10\"\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\n\npublic class HelloWorld {\n public static void SolveCodeForces() {\n var a = cin.NextUlong();\n var b = cin.NextUlong();\n\n var bestAns = (a * b) / GCD(a, b);\n var bestK = 0ul;\n\n// System.Console.WriteLine(new {bestAns, bestK});\n\n var ans1 = (a + 1ul) * (b + 1ul) / GCD(a + 1ul, b + 1ul);\n if (ans1 < bestAns) {\n bestAns = ans1;\n bestK = 1ul;\n }\n\n// System.Console.WriteLine(new {bestAns, bestK, ans1});\n\n if (a > b) {\n var tmp = b;\n b = a;\n a = tmp;\n }\n // here a <= b;\n\n var d = b - a;\n\n if (2ul * a <= b) {\n var k = d;\n var ans = (a + k) * (b + k) / GCD(a + k, b + k);\n if (ans < bestAns) {\n bestAns = ans;\n bestK = k;\n }\n// System.Console.WriteLine(new {a, b, k, ans});\n }\n\n\n if (d != 0) {\n var done = new bool[d+1];\n done[0] = true;\n done[1] = true;\n for (var z = 1ul; z <= d; z++)\n if (d % z == 0) {\n\n var k = z - a % z;\n if (!done[k]) {\n var ans = (a + k) * (b + k) / GCD(a + k, b + k);\n if (ans < bestAns) {\n bestAns = ans;\n bestK = k;\n }\n done[k] = true;\n }\n\n k = z - b % z;\n if (!done[k]) {\n var ans = (a + k) * (b + k) / GCD(a + k, b + k);\n if (ans < bestAns) {\n bestAns = ans;\n bestK = k;\n }\n done[k] = true;\n }\n\n }\n }\n\n System.Console.WriteLine(bestK);\n }\n\n private static ulong GCD(ulong a, ulong b) {\n while (a != 0 && b != 0)\n {\n if (a > b)\n a %= b;\n else\n b %= a;\n }\n\n return a == 0 ? b : a;\n }\n\n static Scanner cin = new Scanner();\n static StringBuilder cout = new StringBuilder();\n\n static public void Main () {\n SolveCodeForces();\n // System.Console.Write(cout.ToString());\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 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}\n\npublic class Scanner\n{\n private string[] line = new string[0];\n private int index = 0;\n\n public string Next() {\n if (line.Length <= index) {\n line = Console.ReadLine().Split(' ');\n index = 0;\n }\n var res = line[index];\n index++;\n return res;\n }\n\n public int NextInt() {\n return int.Parse(Next());\n }\n\n public long NextLong() {\n return long.Parse(Next());\n }\n\n public ulong NextUlong() {\n return ulong.Parse(Next());\n }\n\n public string[] Array() {\n line = Console.ReadLine().Split(' ');\n index = line.Length;\n return line;\n }\n\n public int[] IntArray(int emptyPrefixLen = 0) {\n var array = Array();\n var result = new int[emptyPrefixLen + array.Length];\n for (int i = 0; i < array.Length; i++)\n result[emptyPrefixLen + i] = int.Parse(array[i]);\n return result;\n }\n\n public long[] LongArray() {\n var array = Array();\n var result = new long[array.Length];\n for (int i = 0; i < array.Length; i++)\n result[i] = long.Parse(array[i]);\n return result;\n }\n\n public ulong[] UlongArray() {\n var array = Array();\n var result = new ulong[array.Length];\n for (int i = 0; i < array.Length; i++)\n result[i] = ulong.Parse(array[i]);\n return result;\n }\n}", "lang": "Mono C#", "bug_code_uid": "076d5fe2a9201a5f891979f6b876b62b", "src_uid": "414149fadebe25ab6097fc67663177c3", "apr_id": "8804c750759fa8277b608e4f901b88f1", "difficulty": 1800, "tags": ["math", "brute force", "number theory"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.7800212539851222, "equal_cnt": 12, "replace_cnt": 3, "delete_cnt": 1, "insert_cnt": 7, "fix_ops_cnt": 11, "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()\n { \n string[] s = Console.ReadLine().Split(' ');\n int n = Convert.ToInt32(s[0]);\n int b = Convert.ToInt32(s[1]);\n int p = Convert.ToInt32(s[2]);\n\n \n int x = 0;\n int y = n*p;\n if (n % 2 == 1)\n {\n n--;\n x = b * 2 + 1;\n }\n while (n != 1)\n {\n x += n * b + (n/2);\n n /= 2;\n }\n Console.WriteLine(x.ToString() + \" \" + y.ToString()); \n\n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "ffea98cf54f04f4fc43e1faf620a7d49", "src_uid": "eb815f35e9f29793a120d120968cfe34", "apr_id": "ff6b17fde90b9d6da7cf1b32382b76c7", "difficulty": 1000, "tags": ["math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.9320583794665325, "equal_cnt": 9, "replace_cnt": 3, "delete_cnt": 4, "insert_cnt": 2, "fix_ops_cnt": 9, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\n\nnamespace ConsoleApplication1\n{\n class Program\n {\n\n static long Pow2(long m)\n {\n long temp = 0;\n while (System.Math.Pow(2, temp) < m)\n {\n temp++;\n }\n return (long) System.Math.Pow(2,temp-1) ;\n }\n static void Main()\n {\n long n, b, p;\n string test = Console.ReadLine();\n string[] splitString = test.Split(' ');\n long[] ints = new long[3];\n for (int i = 0; i < 3; i++)\n {\n long x;\n long.TryParse(splitString[i], out x);\n ints[i] = x;\n }\n\n n = ints[0];\n b = ints[1];\n p = ints[2];\n\n p = p * n;\n long but = 0;\n long temp;\n while (n > 1)\n {\n temp = Program.Pow2(n);\n but = but + n * b + temp / 2;\n n = temp / 2 + n - temp;\n }\n Console.WriteLine((but - n*b - 1) + \" \" + p);\n\n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "027a1e7dd9c3c411b3d0168ea80fd2c1", "src_uid": "eb815f35e9f29793a120d120968cfe34", "apr_id": "79b9d049d381ddfede39ddf1e6f33466", "difficulty": 1000, "tags": ["math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "C#"} {"similarity_score": 0.9968620559809213, "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.Text;\n\nnamespace Contest_59\n{\n class Program\n {\n static void A()\n {\n var s = Console.ReadLine();\n var a = new string[] { s.ToUpper(), s.ToLower() };\n int[] k = new int[2];\n\n for (int j = 0; j < 2; j++)\n {\n for (int i = 0; i < s.Length; i++)\n {\n if (s[i] == a[j][i])\n k[j]++;\n }\n }\n if (k[0] > k[1])\n Console.WriteLine(a[0]);\n else Console.WriteLine(a[1]);\n }\n\n static void B()\n {\n int n = int.Parse(Console.ReadLine());\n var t = Console.ReadLine().Split(' ');\n\n List a = new List();\n List b = new List();\n\n foreach (var s in t)\n {\n int k = int.Parse(s);\n if (k % 2 == 0)\n b.Add(k);\n else a.Add(k);\n }\n int sum = 0;\n int min = 0;\n if (a.Count == 0)\n {\n Console.WriteLine(0);\n return;\n }\n if (a.Count % 2 == 0)\n {\n min = a.Min();\n }\n\n foreach (var s in a)\n sum += s;\n foreach (var s in b)\n sum += s;\n sum -= min;\n Console.WriteLine(sum);\n }\n\n static void C()\n {\n int n = int.Parse(Console.ReadLine());\n char[] s = Console.ReadLine().ToCharArray();\n Dictionary d = new Dictionary();\n for (int i = 0; i < n; i++)\n d.Add((char)('a' + i), 0);\n int l = s.Length;\n bool ok = true;\n int needChar = 0;\n for (int i = 0, j = l - 1; i < l / 2; i++, j--)\n {\n if ((s[i] == '?') && (s[j] != '?')) { s[i] = s[j]; d[s[i]]++; }\n else if ((s[i] != '?') && (s[j] == '?'))\n {\n s[j] =\n s[i]; d[s[i]]++;\n }\n else if (s[i] != s[j])\n {\n ok = false;\n break;\n }\n else if (s[i] == '?') needChar++;\n else d[s[i]]++;\n }\n if (l % 2 == 1)\n {\n if (s[l / 2] == '?')\n needChar++;\n d[s[l / 2]]++;\n }\n int used = 0;\n List unused = new List();\n foreach (var e in d)\n {\n if ((e.Key < 'a' + n) && (e.Value > 0))\n used++;\n else unused.Add(e.Key);\n }\n\n if (n - used > needChar)\n ok = false;\n if (ok)\n {\n for (int i = 0, j = l - 1; i <= l / 2; i++, j--)\n {\n if (s[i] == '?')\n {\n if (needChar > unused.Count)\n {\n s[i] = 'a';\n s[j] = 'a';\n }\n else\n {\n s[i] = unused[0];\n s[j] = unused[0];\n if (unused.Count > 1)\n unused.RemoveAt(0);\n }\n needChar--;\n }\n }\n\n for (int i = 0; i < s.Length; i++)\n Console.Write(s[i]);\n }\n else\n {\n Console.Write(\"IMPOSSIBLE\");\n }\n Console.WriteLine();\n }\n\n static void Main(string[] args)\n {\n C();\n }\n }\n}", "lang": "Mono C#", "bug_code_uid": "0ee50a995c02c45dd27548b800c80ef9", "src_uid": "9d1dd9d722e5fe46823224334b3b208a", "apr_id": "614a57e5e5771a3fb8078203adfa6005", "difficulty": 1600, "tags": ["expression parsing"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.4274930472785062, "equal_cnt": 16, "replace_cnt": 7, "delete_cnt": 4, "insert_cnt": 5, "fix_ops_cnt": 16, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace _937B\n{\n class Program\n {\n static void Main(string[] args)\n {\n var input = Console.ReadLine();\n\n var parsedInput = input.Split(' ').Select(x => int.Parse(x)).ToList();\n int hoppers = parsedInput[0];\n int branches = parsedInput[1];\n\n List occupations = new List(branches);\n for (int i = 0; i <= branches; i++)\n {\n occupations.Add(false);\n }\n occupations[0] = true;\n occupations[1] = true;\n\n for (int i = 2; i <= hoppers; i++)\n {\n for (int j = i; j <= branches; j += i)\n {\n occupations[j] = true;\n }\n }\n\n int result = -1;\n for (int i = 0; i <= branches; i++)\n {\n if (!occupations[i])\n result = i;\n }\n\n Console.WriteLine(result);\n Console.ReadKey();\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "bb0c2fd0cb4a6ca675d31d70f3fff6bc", "src_uid": "b533203f488fa4caf105f3f46dd5844d", "apr_id": "9bbec80e03891a0ed7a989290b9e3ffc", "difficulty": 1400, "tags": ["math", "brute force", "number theory"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.4266984505363528, "equal_cnt": 16, "replace_cnt": 7, "delete_cnt": 4, "insert_cnt": 5, "fix_ops_cnt": 16, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace _937B\n{\n class Program\n {\n static void Main(string[] args)\n {\n var input = Console.ReadLine();\n var parsedInput = input.Split(' ').Select(x => int.Parse(x)).ToList();\n int hoppers = parsedInput[0];\n int branches = parsedInput[1];\n\n List occupations = new List(branches);\n for (int i = 0; i <= branches; i++)\n {\n occupations.Add(false);\n }\n occupations[0] = true;\n occupations[1] = true;\n\n for (int i = 2; i <= hoppers; i++)\n {\n for (int j = i; j <= branches; j += i)\n {\n occupations[j] = true;\n }\n }\n\n int result = -1;\n for (int i = 0; i <= branches; i++)\n {\n if (!occupations[i])\n result = i;\n }\n\n Console.WriteLine(result);\n Console.ReadLine();\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "065fbd051ca8e0d822640260311d27b7", "src_uid": "b533203f488fa4caf105f3f46dd5844d", "apr_id": "9bbec80e03891a0ed7a989290b9e3ffc", "difficulty": 1400, "tags": ["math", "brute force", "number theory"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.5145631067961165, "equal_cnt": 6, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 6, "bug_source_code": "using System;\nusing System.Collections;\nusing System.Collections.Generic;\nusing System.Diagnostics;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace _937B\n{\n class Program\n {\n static void Main(string[] args)\n {\n var input = Console.ReadLine();\n var timer = new Stopwatch();\n timer.Start();\n var parsedInput = input.Split(' ').Select(x => int.Parse(x)).ToList();\n int hoppers = parsedInput[0];\n int branches = parsedInput[1];\n\n BitArray occupations = new BitArray(branches + 1);\n occupations[0] = true;\n occupations[1] = true;\n\n int top = (int)Math.Sqrt(branches);\n for (int i = 2; i <= hoppers && i <= top; i++)\n {\n if (occupations[i])\n continue;\n\n int start = i * (int)Math.Ceiling((double)(hoppers + 1) / i);\n for (int j = start; j <= branches; j += i)\n {\n occupations[j] = true;\n }\n }\n\n int result = -1;\n for (int i = branches; i > hoppers; i--)\n {\n if (!occupations[i])\n {\n result = i;\n break;\n }\n }\n\n Console.WriteLine(result);\n timer.Stop();\n //Console.WriteLine(timer.ElapsedMilliseconds);\n Console.ReadLine();\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "e45fad2153573ed5daee534e498dee88", "src_uid": "b533203f488fa4caf105f3f46dd5844d", "apr_id": "9bbec80e03891a0ed7a989290b9e3ffc", "difficulty": 1400, "tags": ["math", "brute force", "number theory"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.39756900481134466, "equal_cnt": 18, "replace_cnt": 12, "delete_cnt": 4, "insert_cnt": 2, "fix_ops_cnt": 18, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Diagnostics;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace _937B\n{\n class Program\n {\n static void Main(string[] args)\n {\n var input = Console.ReadLine();\n var timer = new Stopwatch();\n timer.Start();\n var parsedInput = input.Split(' ').Select(x => int.Parse(x)).ToList();\n int hoppers = parsedInput[0];\n int branches = parsedInput[1];\n\n TightBoolList occupations = new TightBoolList(branches);\n occupations[0] = true;\n occupations[1] = true;\n\n int top = (int)Math.Sqrt(branches);\n for (int i = 2; i <= hoppers && i <= top; i++)\n {\n if (occupations[i])\n continue;\n\n int start = i * (int)Math.Ceiling((double)(hoppers + 1) / i);\n for (int j = start; j <= branches; j += i)\n {\n occupations[j] = true;\n }\n }\n\n //int result = -1;\n //for (int i = hoppers + 1; i <= branches; i++)\n //{\n // if (!occupations[i])\n // result = i;\n //}\n\n //Console.WriteLine(result);\n timer.Stop();\n Console.WriteLine(timer.ElapsedMilliseconds);\n Console.ReadLine();\n }\n\n private unsafe class TightBoolList\n {\n private List UnderlyingList;\n\n public int Size { get; private set; }\n\n public TightBoolList(int size)\n {\n Size = size;\n int capacity = (int)Math.Ceiling(size / 8d) + 1;\n UnderlyingList = new List(capacity);\n for (int i = 0; i < capacity; i++)\n {\n UnderlyingList.Add(0);\n }\n }\n\n public bool this[int i]\n {\n get\n {\n int index = i / 8;\n int innerIndex = i % 8;\n byte containing = UnderlyingList[index];\n return (containing & (1 << innerIndex)) > 0;\n }\n set\n {\n int index = i / 8;\n int innerIndex = i % 8;\n byte containing = UnderlyingList[index];\n UnderlyingList[index] = (byte)(containing | (1 << innerIndex));\n }\n }\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "e0201b0b1efdeecc34a3dd9fb98773e3", "src_uid": "b533203f488fa4caf105f3f46dd5844d", "apr_id": "9bbec80e03891a0ed7a989290b9e3ffc", "difficulty": 1400, "tags": ["math", "brute force", "number theory"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9876543209876543, "equal_cnt": 11, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 9, "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 KlonirovanijeIgrushek\n{\n class Program\n {\n static void Main(string[] args)\n {\n string[] s = Console.ReadLine().Split();\n int x = int.Parse(s[0]);\n int y = int.Parse(s[1]);\n\n if (y==1 && x>0)\n Console.Write(\"no\")\n else if ((x - y + 1) % 2 == 0 && (y-1<=x) && y>0)\n Console.Write(\"yes\");\n else\n Console.Write(\"no\");\n \n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "7287143270c4f3adfcc64b765ecb6f2f", "src_uid": "1527171297a0b9c5adf356a549f313b9", "apr_id": "f10c2c3572ffc6205a102a942d32e6d8", "difficulty": 1300, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.9653979238754326, "equal_cnt": 4, "replace_cnt": 2, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 3, "bug_source_code": "using System; using System.Linq;\n\nclass P {\n static void Main () { \n var s = Console.ReadLine().Split(' ').Select(int.Parse).ToArray();\n var a = s[0]; var b = s[1]; var c = s[1];\n var res = Enumerable.Range(0,1000000).Where(x => a*c <= b*(c+x)).First();\n Console.Write(res);\n }\n}", "lang": "MS C#", "bug_code_uid": "fb1b1fc83ea04278697c8e7f6a019a5b", "src_uid": "7dd098ec3ad5b29ad681787173eba341", "apr_id": "3627a43eb756a1e29b086b48e5fc5eef", "difficulty": 1000, "tags": ["math", "brute force", "binary search"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9930715935334873, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "\n\n\n\nusing System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\nusing System.Text.RegularExpressions;\nusing System.Xml.Linq;\nnamespace ConsoleApplication1\n{\n class Program\n {\n \n public static void Main(string[] args)\n {\n string[] s = Console.ReadLine().Split(' ');\n int speed, rate, length;\n speed = int.Parse(s[1]);\n rate = int.Parse(s[0]);\n length = int.Parse(s[2]);\n int size = rate * length;\n size -= length * speed;\n Console.WriteLine(size / speed+(size%rate!=0?1:0));\n }\n \n }\n}\n ", "lang": "MS C#", "bug_code_uid": "3339be641c06b28ba19988340881b88d", "src_uid": "7dd098ec3ad5b29ad681787173eba341", "apr_id": "055ce349530c63fa5ad42cac864585de", "difficulty": 1000, "tags": ["math", "brute force", "binary search"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.7306176084099869, "equal_cnt": 13, "replace_cnt": 7, "delete_cnt": 1, "insert_cnt": 4, "fix_ops_cnt": 12, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text.RegularExpressions;\n\nnamespace Rextester\n{\n public class Program\n {\n public static void Main(string[] args)\n {\n string str = Console.ReadLine();\n int countQ = 0, countA = 0, count = 0;\n for (int i = 0; i < str.Length; i++)\n {\n \n if (str[i] == 'A') countA++;\n if (str[i] == 'Q') countQ++;\n if (countA > 0 && countQ > 1 && str[i] == 'Q') count = countA*(countQ-1);\n }\n Console.Write(count);\n //Console.ReadKey();\n \n }\n }\n}", "lang": "MS C#", "bug_code_uid": "feaf2416592f9e3c7d1322224ffdb92f", "src_uid": "8aef4947322438664bd8610632fe0947", "apr_id": "26a4bff9a7c8d6177a3206ca22e8eabc", "difficulty": 800, "tags": ["dp", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9972313113516235, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "using System;\nusing System.Collections;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\n\nclass TEST{\n\tstatic void Main(){\n\t\tSol mySol =new Sol();\n\t\tmySol.Solve();\n\t}\n}\n\nclass Sol{\n\tpublic void Solve(){\n\t\t\n\t\tif(N == 1){\n\t\t\tConsole.WriteLine(0);\n\t\t}\n\t\tint H = 2;\n\t\tint W = N;\n\t\t\n\t\t\n\t\tint M = 1<<4;\n\t\tint[] c = new int[]{\n\t\t\t0xF - 1,\n\t\t\t0xF - 2,\n\t\t\t0xF - 4,\n\t\t\t0xF - 8,\n\t\t\t0\n\t\t};\n\t\tint[] dp = new int[M];\n\t\tfor(int i=0;i> 2;\n\t\t\t\t\tfor(int j=0;j<2;j++){\n\t\t\t\t\t\tst |= ((t + 2 < N && S[j][t + 2] == 'X') ? 1 : 0) << (2 + j);\n\t\t\t\t\t}\n//Console.WriteLine(\"i:{0}, b:{1}, st:{2}\",i, b, st);\n\t\t\t\t\tndp[st] = Math.Max(ndp[st], dp[i] + (b == 0 ? 0 : 1));\n\t\t\t\t}\n\t\t\t}\n\t\t\tdp = ndp;\n//Console.WriteLine(\"ndp:{0}\",String.Join(\" \",dp));\n\t\t}\n\t\t\n\t\tConsole.WriteLine(dp.Max());\n\t\t\n\t\t\n\t}\n\tint N;\n\tString[] S;\n\tpublic Sol(){\n\t\tS = new String[2];\n\t\tfor(int i=0;i<2;i++) S[i] = rs();\n\t\tN = S[0].Length;\n\t}\n\n\tstatic String rs(){return Console.ReadLine();}\n\tstatic int ri(){return int.Parse(Console.ReadLine());}\n\tstatic long rl(){return long.Parse(Console.ReadLine());}\n\tstatic double rd(){return double.Parse(Console.ReadLine());}\n\tstatic String[] rsa(char sep=' '){return Console.ReadLine().Split(sep);}\n\tstatic int[] ria(char sep=' '){return Array.ConvertAll(Console.ReadLine().Split(sep),e=>int.Parse(e));}\n\tstatic long[] rla(char sep=' '){return Array.ConvertAll(Console.ReadLine().Split(sep),e=>long.Parse(e));}\n\tstatic double[] rda(char sep=' '){return Array.ConvertAll(Console.ReadLine().Split(sep),e=>double.Parse(e));}\n}\n", "lang": "Mono C#", "bug_code_uid": "d1b551f9cd05b5c226e7bbc8550967bd", "src_uid": "e6b3e787919e96fc893a034eae233fc6", "apr_id": "847716963c0b19fe36b3faaf25de7a2a", "difficulty": 1500, "tags": ["dp", "greedy"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.9954072999758279, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "using System;\nusing System.Collections;\nusing System.Collections.Generic;\nusing System.Diagnostics;\nusing System.Globalization;\nusing System.IO;\nusing System.Linq;\nusing System.Text;\n\nnamespace Task\n{\n class Program\n {\n #region Read / Write\n protected static TextReader reader;\n protected static TextWriter writer;\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]; }\n 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\n public static bool NextPermutation(List perm)\n {\n for (int i = perm.Count - 2; i >= 0; i--)\n {\n if (perm[i] < perm[i + 1])\n {\n int min = i + 1;\n for (int j = min; j < perm.Count; j++)\n if (perm[j] > perm[i] && perm[j] < perm[min])\n min = j;\n\n int tmp = perm[i];\n perm[i] = perm[min];\n perm[min] = tmp;\n perm.Reverse(i + 1, perm.Count - i - 1);\n return true;\n }\n }\n\n return false;\n }\n\n static void Main(string[] args)\n {\n long i = 0;\n long ans = 0;\n reader = new StreamReader(Console.OpenStandardInput());\n writer = new StreamWriter(Console.OpenStandardOutput());\n\n var s = ReadLines(2);\n var mas = s.Select(it => it.Select(ch => ch == 'X' ? 1 : 0).ToArray()).ToArray();\n\n int n = mas[0].Length;\n if (n < 2)\n {\n Write(0);\n }\n else\n {\n for (i = 0; i < n - 1; i++)\n {\n int ones = mas[0][i] + mas[0][i + 1] + mas[1][i] + mas[1][i + 1];\n if (ones == 1)\n {\n ans++;\n mas[0][i] = mas[0][i + 1] = mas[1][i] = mas[1][i + 1] = 1;\n }\n else if (ones == 0)\n {\n ans++;\n mas[0][i] = mas[0][i + 1] = mas[1][i] = 1;\n }\n }\n }\n Write(ans);\n\n reader.Close();\n writer.Close();\n }\n }\n}", "lang": "Mono C#", "bug_code_uid": "bcd1dcb58dc7a98dbb43b3d7bbdeb5a1", "src_uid": "e6b3e787919e96fc893a034eae233fc6", "apr_id": "36f9a4d50a46d85e04ae3e4af1fb8ac5", "difficulty": 1500, "tags": ["dp", "greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "C#"} {"similarity_score": 0.9718875502008032, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 3, "bug_source_code": "using System;\nusing System.Linq;\nusing System.Text;\nusing System.Collections.Generic;\n\nnamespace NetExperiment\n{\n class Program\n {\n static void Main(string[] args)\n {\n StringBuilder sb = new StringBuilder(Console.ReadLine());\n\n if (sb.Length == 1)\n {\n Console.WriteLine(sb.ToString());\n return;\n }\n\n int l = sb.Length / 2 - 1;\n int r = l;\n bool right = true;\n StringBuilder res = new StringBuilder();\n res.Append(sb[l]);\n while(l - 1 >= 0 || r + 1 < sb.Length)\n { \n if (right)\n {\n res.Append(sb[++r]);\n }\n else\n {\n res.Append(sb[--l]);\n }\n \n right = !right;\n }\n Console.WriteLine(res.ToString());\n }\n }\n}", "lang": "Mono C#", "bug_code_uid": "bf94b41e45e4b007077d37ae76645051", "src_uid": "992ae43e66f1808f19c86b1def1f6b41", "apr_id": "13d2fc6e004ec42d62efa6401b028aab", "difficulty": 800, "tags": ["strings", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.030782761653474055, "equal_cnt": 26, "replace_cnt": 16, "delete_cnt": 5, "insert_cnt": 6, "fix_ops_cnt": 27, "bug_source_code": "\nMicrosoft Visual Studio Solution File, Format Version 12.00\n# Visual Studio 15\nVisualStudioVersion = 15.0.28307.106\nMinimumVisualStudioVersion = 10.0.40219.1\nProject(\"{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}\") = \"Tech1\", \"Tech1\\Tech1.csproj\", \"{1EB1A4F0-0118-4CCD-BF17-D608A682C2B4}\"\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{1EB1A4F0-0118-4CCD-BF17-D608A682C2B4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{1EB1A4F0-0118-4CCD-BF17-D608A682C2B4}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{1EB1A4F0-0118-4CCD-BF17-D608A682C2B4}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{1EB1A4F0-0118-4CCD-BF17-D608A682C2B4}.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 = {C3620269-6E19-4EA1-ABB1-CD478D85838E}\n\tEndGlobalSection\nEndGlobal\n", "lang": "Mono C#", "bug_code_uid": "77dd3f5c5e5722aac508db2487cf7599", "src_uid": "992ae43e66f1808f19c86b1def1f6b41", "apr_id": "f1a59a8ab3594a809804358cea34a25b", "difficulty": 800, "tags": ["strings", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9933333333333333, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "using System;\nstatic class P {\n static void Main() {\n string s = \"\", r = \"YES\"; int i = 0;\n for (; i < 3; ++i) { s += Console.ReadLine(); }\n i = 0; int j = s.Length - 1;\n while (i < j) { if (s[i++] != s[j++]) { r = \"NO\"; break; } }\n Console.WriteLine(r);\n }\n}", "lang": "MS C#", "bug_code_uid": "2bc7da0b08f0226c1768b75f7168bcbc", "src_uid": "6a5fe5fac8a4e3993dc3423180cdd6a9", "apr_id": "4837e90eb4eda7a6f30dad0d7550d55f", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.998632759092152, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "#if DEBUG\nusing System.Reflection;\nusing System.Threading.Tasks;\n#endif\n\nusing System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\nusing System.Text;\nusing System.Numerics;\nusing System.Globalization;\n\n\nnamespace b12a\n{\n class Program\n {\n static string _inputFilename = \"input.txt\";\n static string _outputFilename = \"output.txt\";\n static bool _useFileInput = false;\n\n\n static void Main(string[] args)\n {\n StreamWriter file = null;\n#if DEBUG\n\t\t\tConsole.SetIn(getInput());\n#else\n if (_useFileInput)\n {\n Console.SetIn(File.OpenText(_inputFilename));\n file = new StreamWriter(_outputFilename);\n Console.SetOut(file);\n }\n#endif\n\n try\n {\n solution();\n }\n finally\n {\n if (_useFileInput)\n {\n file.Close();\n }\n }\n }\n\n static void solution()\n {\n #region SOLUTION\n var a = new int[3, 3];\n for (int i = 0; i < 3; i++)\n {\n var d = Console.ReadLine();\n for (int j = 0; j < 3; j++)\n {\n if (d[j] == 'X')\n {\n a[i, j] = 1;\n }\n }\n }\n\n for (int i = 0; i < 3; i++)\n {\n for (int j = 0; j < 3; j++)\n {\n if (i == j)\n {\n continue;\n }\n\n var y = -1;\n var x = -1;\n if (i == 0)\n {\n y = 2;\n }\n else if (i == 1)\n {\n y = 1;\n }\n else if (i == 2)\n {\n y = 0;\n }\n\n if (j == 0)\n {\n x = 2;\n }\n else if (j == 1)\n {\n x = 1;\n }\n else if (j == 2)\n {\n x = 0;\n }\n\n if (a[i, j] != a[y, x])\n {\n Console.WriteLine(\"NO\");\n return;\n }\n }\n }\n\n Console.WriteLine(\"YES\");\n \n\n //var n = readInt();\n //var m = readInt();\n\n //var a = readIntArray();\n //var b = readIntArray();\n #endregion\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[] readIntArray()\n {\n return Console.ReadLine().Split(' ').Where(i => !string.IsNullOrEmpty(i)).Select(i => int.Parse(i)).ToArray();\n }\n\n static long[] readLongArray()\n {\n return Console.ReadLine().Split(' ').Where(i => !string.IsNullOrEmpty(i)).Select(i => long.Parse(i)).ToArray();\n }\n\n#if DEBUG\n\t\tstatic StreamReader getInput()\n\t\t{\n\t\t\tvar resName = Assembly.GetCallingAssembly().GetManifestResourceNames()[0];\n\t\t\tvar resource = Assembly.GetCallingAssembly().GetManifestResourceStream(resName);\n\n\t\t\treturn new StreamReader(resource);\n\t\t}\n#endif\n }\n}\n", "lang": "MS C#", "bug_code_uid": "e5ae8655b864bf468d774418dd8b179c", "src_uid": "6a5fe5fac8a4e3993dc3423180cdd6a9", "apr_id": "f3006aed76450db0ba5a8b9d9ff9f72d", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.9456066945606695, "equal_cnt": 9, "replace_cnt": 1, "delete_cnt": 3, "insert_cnt": 5, "fix_ops_cnt": 9, "bug_source_code": "using System;\n\nclass Program\n{\n\tstatic void Main(string[] args)\n\t{\n\t\tint count=0;\n\t\tint k=0;\n\t\tstring []tmp1 = Console.ReadLine().Split(' ');\n \tstring []tmp2 = Console.ReadLine().Split(' ');\n\t\t\n\t\tif(int.Parse(tmp2[0])!=0)\n\t\tfor (int i=0;iint.Parse(tmp1[1]))\n\t\t {\n\t\t count1++;\n\t\t k++;\n\t\t }\n\t\t else\n\t\t break;\n\t\t \n\t\t}\n\t\t\n\t\t\n\t\twhile(countint.Parse(tmp1[1]) && k= r)\n return l;\n\n long mid = (l + r) / 2;\n\n if (a[mid] >= k)\n return bs(a, l, mid - 1, k);\n\n return bs(a, mid + 1, r, k);\n }\n\n\n static long getMin(long v, long x, long k)\n {\n return v + (x * (k - 1));\n }\n\n static long getMax(long v, long x, long k)\n {\n return v + (x * k + 1);\n }\n\n\n static void Main(string[] args)\n {\n var s = Console.ReadLine().Split(' ').Select(int.Parse).ToArray();\n\n var n = s[0];\n var d = s[1];\n\n\n var a = Console.ReadLine().Split(' ').Select(int.Parse).ToArray();\n\n a = a.OrderBy(x=>x).ToArray();\n\n int l = 0;\n int r = a.Count() - 1;\n\n var max = backtest(a, l, r, d);\n\n Console.WriteLine(a.Count() - max);\n }\n\n\n static int backtest(int[] arr, int l, int r, int d)\n {\n if (arr[r] - arr[l] <= d) { return r - l + 1; }\n else\n {\n return Math.Max(backtest(arr, l + 1, r, d), backtest(arr, l, r - 1, d));\n }\n }\n}\n\n", "lang": "Mono C#", "bug_code_uid": "5306470efbe3e0df561298d806818c3a", "src_uid": "6bcb324c072f796f4d50bafea5f624b2", "apr_id": "6367700f8dcefb14db2b9e15aa4e4c6b", "difficulty": 1200, "tags": ["greedy", "brute force", "sortings"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.4828193832599119, "equal_cnt": 19, "replace_cnt": 6, "delete_cnt": 3, "insert_cnt": 11, "fix_ops_cnt": 20, "bug_source_code": "string num = Console.ReadLine();\n string txt = Console.ReadLine();\n int count = 0;\n for (int i = 0; i posled = new List();\n Console.WriteLine(\"Введите a\");\n a =int.Parse(Console.ReadLine().ToString());\n Console.WriteLine(\"Введите b\");\n b = int.Parse(Console.ReadLine().ToString());\n int tempVar = b;\n while (tempVar > a) \n {\n posled.Add(tempVar);\n if (tempVar % 2 > 0)\n {\n tempVar = (tempVar - 1) / 10;\n }\n else\n {\n tempVar = tempVar / 2;\n }\n\n if (tempVar < 1)\n {\n Result = \"NO\";\n break;\n }\n }\n if (tempVar == a)\n {\n Result = \"YES\";\n };\n posled.Add(a);\n \n\n Console.WriteLine(Result);\n if (Result == \"YES\")\n {\n Console.WriteLine(posled.Count());\n for (int i = posled.Count() - 1; i >= 0; i--)\n {\n Console.Write(posled[i] + \" \");\n }\n\n }", "lang": "Mono C#", "bug_code_uid": "d6de1983b5d6ac2e3826a70de7341bf6", "src_uid": "fc3adb1a9a7f1122b567b4d8afd7b3f3", "apr_id": "176a4bb55b186e652b0aa9f603dfbce6", "difficulty": 1000, "tags": ["brute force", "math", "dfs and similar"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.9269581931763575, "equal_cnt": 10, "replace_cnt": 5, "delete_cnt": 1, "insert_cnt": 3, "fix_ops_cnt": 9, "bug_source_code": "using System;\nusing System.Collections;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Runtime.InteropServices;\nusing System.Text;\n\nnamespace Achill\n{\n class Program\n {\n static void Main(string[] args)\n {\n List recipe = Console.ReadLine().Select(item => item).ToList();\n int[] ingr = new int[3];\n recipe.ForEach(item => ingr[item == 'B' ? 0 : item == 'S' ? 1 : 2]++);\n long[] n = Console.ReadLine().Split().Select(item => long.Parse(item)).ToArray();\n long[] p = Console.ReadLine().Split().Select(item => long.Parse(item)).ToArray();\n long r = long.Parse(Console.ReadLine());\n long res = long.MaxValue;\n long cost = 0;\n for (int i = 0; i < 3; ++i)\n {\n if (ingr[i] != 0)\n res = Math.Min(res, n[i] / ingr[i]);\n }\n for (int i = 0; i < 3; ++i)\n {\n if (ingr[i] != 0)\n {\n n[i] -= res * Convert.ToInt64(ingr[i]);\n cost += p[i] * ingr[i];\n }\n }\n while (true)\n {\n long need = 0;\n for (int i = 0; i < 3; ++i)\n {\n if (ingr[i] != 0)\n {\n need += Math.Max((ingr[i] - Math.Max(n[i], 0)) * p[i], 0);\n n[i] -= Convert.ToInt64(ingr[i]);\n }\n }\n if (r >= need)\n {\n res += 1;\n r -= need;\n }\n else\n {\n break;\n }\n if(n.Aggregate((it, jt)=>Math.Max(it, 0) + Math.Max(jt, 0)) == 0)\n {\n break;\n }\n }\n res += r / cost;\n Console.WriteLine(res);\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "540f7080825bb72b7f0ce25981ea4027", "src_uid": "8126a4232188ae7de8e5a7aedea1a97e", "apr_id": "d6f748db00c595357877420ead8ecf01", "difficulty": 1600, "tags": ["brute force", "binary search"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9207096875490658, "equal_cnt": 19, "replace_cnt": 7, "delete_cnt": 3, "insert_cnt": 9, "fix_ops_cnt": 19, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\n\nnamespace ConsoleApp5\n{\n class Program\n {\n static BurgerPart bread = new BurgerPart { type = ('B') };\n static BurgerPart sausage = new BurgerPart { type = ('S') };\n static BurgerPart cheese = new BurgerPart { type = ('C') };\n static void Main(string[] args)\n {\n \n string recipe = Console.ReadLine();\n bread.needs = recipe.Count(e=>e=='B');\n sausage.needs = recipe.Count(e => e == 'S');\n cheese.needs = recipe.Count(e => e == 'C');\n var line = Console.ReadLine().Split(' ');\n bread.quantity = int.Parse(line[0]);\n sausage.quantity = int.Parse(line[1]);\n cheese.quantity = int.Parse(line[2]);\n line = Console.ReadLine().Split(' ');\n bread.price = int.Parse(line[0]);\n sausage.price = int.Parse(line[1]);\n cheese.price = int.Parse(line[2]);\n long money = long.Parse(Console.ReadLine());\n long result = 0;\n\n result = Equalize(ref money);\n result += (money / (bread.singleBurgerCost + sausage.singleBurgerCost + cheese.singleBurgerCost));\n Console.WriteLine(result);\n\n \n\n\n }\n\n static long Equalize(ref long money)\n {\n\n var parts = new BurgerPart[] { bread, sausage, cheese };\n var target = parts.Max(e => e.howManyBurgers + (e.quantity%e.needs==0?0:1 ));\n\n while (money > 0&&parts.Any(e=>e.howManyBurgers e.howManyBurgers).FirstOrDefault();\n\n var neededParts = part.needs - (part.quantity % part.needs);\n var neededMoney = neededParts * part.price;\n if (neededMoney >= money)\n {\n break;\n }\n part.quantity += neededParts;\n money -= neededMoney;\n\n\n }\n return parts.Min(e => e.howManyBurgers);\n \n\n\n\n //var orderedParts = parts.OrderBy(e => e.quantity / e.price);\n //var needed = orderedParts.ElementAt(1).howManyBurgers - orderedParts.First().howManyBurgers;\n //var part = orderedParts.First();\n //if (needed >= 1)\n //{\n // var canBuy = money / part.price;\n // var neededParts = (needed - 1) * part.needs + (part.needs-part.quantity%part.needs);\n // if (canBuy >= neededParts)\n // {\n // part.quantity += neededParts;\n // money -= neededParts * part.price;\n // }\n // //var parts\n //}\n\n\n }\n\n class BurgerPart\n {\n public char type;\n public long quantity;\n public long price;\n public long needs;\n public long singleBurgerCost { get { return quantity * price; } }\n public long howManyBurgers { get { return quantity / needs; } }\n \n }\n\n \n\n \n }\n}\n", "lang": "Mono C#", "bug_code_uid": "d0675f467af562c10af884d698175653", "src_uid": "8126a4232188ae7de8e5a7aedea1a97e", "apr_id": "2c3a63a0693ff7f4ac8d3cea12a3144a", "difficulty": 1600, "tags": ["brute force", "binary search"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.4508312200619893, "equal_cnt": 14, "replace_cnt": 12, "delete_cnt": 2, "insert_cnt": 0, "fix_ops_cnt": 14, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Text;\nusing System.IO;\n\n public class A\n {\n public static void Main(string[] args)\n {\n string s = find(); \n }\n\n private static string find()\n {\n string k1 = Console.ReadLine();\n int k = int.Parse(k1);\n string l1 = Console.ReadLine();\n int l = int.Parse(l1);\n string m1 = Console.ReadLine();\n int m = int.Parse(m1);\n string n1 = Console.ReadLine();\n int n = int.Parse(n1);\n string d1 = Console.ReadLine();\n int d = int.Parse(d1);\n\n int[] fg = new int[4];\n fg[0] = k;\n fg[1] = l;\n fg[2] = m;\n fg[3] = n;\n\n List fh = new List();\n bool lt = false;\n fh.Add(k);\n for (int v = 0; v < 4; v++)\n {\n lt = false;\n for (int v1 = v + 1; v1 < 4; v1++)\n {\n if (bol(fg[v], fg[v1]) == 1)\n lt = true;\n }\n\n if (!lt)\n fh.Add(fg[v]);\n }\n\n\n foreach (int kt in fg)\n {\n\n }\n\n List dr = new List();\n int kTotal = k;\n\n foreach (int drg in fh)\n {\n kTotal = drg;\n while (kTotal <= d)\n {\n if (dr.Contains(kTotal))\n {\n kTotal = kTotal + drg;\n continue;\n }\n dr.Add(kTotal);\n kTotal = kTotal + drg;\n } \n }\n\n \n int top = 0;\n foreach (int num in dr)\n {\n top = top + 1;\n }\n Console.WriteLine(top);\n return \"\";\n \n \n }\n\n private static int bol(int x,int y)\n {\n int k, k1;\n if (x < y)\n {\n k = y;\n k1 = x;\n }\n else\n {\n k = x;\n k1 = y;\n }\n int k2 = k1;\n while (k2 < k)\n {\n k2 = k2 + k1;\n }\n if (k2 == k)\n return 1;\n else\n return 0;\n\n }\n }\n\n", "lang": "Mono C#", "bug_code_uid": "bdcabce7be18d115b86aa41b31a0b3be", "src_uid": "46bfdec9bfc1e91bd2f5022f3d3c8ce7", "apr_id": "40840f3f4ec6b1512433a9cc669542e6", "difficulty": 800, "tags": ["math", "constructive algorithms", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.6977067407922168, "equal_cnt": 9, "replace_cnt": 4, "delete_cnt": 3, "insert_cnt": 2, "fix_ops_cnt": 9, "bug_source_code": "using System;\nusing System.Collections.Generic;\n\npublic class Test\n{\n\tpublic static void Main()\n\t{\n\t\tint a = int.Parse(Console.ReadLine());\n\t\tint b = int.Parse(Console.ReadLine());\n\t\tint c = int.Parse(Console.ReadLine());\n\t\tint d = int.Parse(Console.ReadLine());\n\t\tint tot = int.Parse(Console.ReadLine());\n\t\tList nums = new List();\n\t\tint res =0;\n\t\t\n\t\tif (a==1 || b==1 || c==1 || d==1)\n\t\t{\n\t\t\tres=tot;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tfor(int i=a; i<=tot; i+=a)\n\t\t\t{\n\t\t\t\tif(nums.IndexOf(i)<0)\n\t\t\t\t{\n\t\t\t\t\tnums.Add(i);\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor(int i=b; i<=tot; i+=b)\n\t\t\t{\n\t\t\t\tif(nums.IndexOf(i)<0)\n\t\t\t\t{\n\t\t\t\t\tnums.Add(i);\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor(int i=c; i<=tot; i+=c)\n\t\t\t{\n\t\t\t\tif(nums.IndexOf(i)<0)\n\t\t\t\t{\n\t\t\t\t\tnums.Add(i);\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor(int i=d; i<=tot; i+=d)\n\t\t\t{\n\t\t\t\tif(nums.IndexOf(i)<0)\n\t\t\t\t{\n\t\t\t\t\tnums.Add(i);\n\t\t\t\t}\n\t\t\t}\n\t\t\tres = nums.Count;\n\t\t}\n\t\t\n\t\tConsole.WriteLine(res);\n\t}\n}", "lang": "Mono C#", "bug_code_uid": "0e45caf1292fc27628ca9af1c6dd2761", "src_uid": "46bfdec9bfc1e91bd2f5022f3d3c8ce7", "apr_id": "f77f5c7d51eea16678814aa9c7945b1c", "difficulty": 800, "tags": ["math", "constructive algorithms", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.33354153653966273, "equal_cnt": 18, "replace_cnt": 13, "delete_cnt": 3, "insert_cnt": 2, "fix_ops_cnt": 18, "bug_source_code": "using System;\nusing System.Collections.Generic;\n\nnamespace CodeForces\n{\n class Program\n {\n static void Main(string[] args)\n {\n int k = int.Parse(Console.ReadLine());\n int l = int.Parse(Console.ReadLine());\n int m = int.Parse(Console.ReadLine());\n int n = int.Parse(Console.ReadLine());\n int d = int.Parse(Console.ReadLine());\n int[] c = { k, l, m, n };\n List molestedDragon = new List();\n\n for (int j = 0; j < 4; j++)\n {\n for (int i = 1; i <= d; i++)\n {\n if ((i % c[j] == 0) && !molestedDragon.Contains(i)) molestedDragon.Add(i);\n }\n }\n\n Console.WriteLine(molestedDragon.Count);\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "665526f4f984f35f7c3bd8a729a65661", "src_uid": "46bfdec9bfc1e91bd2f5022f3d3c8ce7", "apr_id": "cb037cb40e50100251df39fa4879707a", "difficulty": 800, "tags": ["math", "constructive algorithms", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9999428930386615, "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.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 Pi = Pair;\nclass Solver\n{\n public void Solve(Scanner sc)\n {\n int N, M;\n sc.Make(out N, out M);\n ModInt res = 0;\n res += ModInt.Pow(M, N);//空部分列\n ModInt.Build(100100);\n //iは部分列aの長さ\n for(int i = 1; i <= N; i++)\n {\n //部分列dp的に、任意のkに対してA[0,k)でaをとれる->j<=kであるようなものを数える\n res += ModInt.Pow(M, i) * ModInt.Pow(M-1, N - i) * ModInt.Comb(N, i - 1);\n }\n WriteLine(res);\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;//階乗\n private static ModInt[] inv;//逆数\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 { 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 { 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) { 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[] Shuffle(this IList A) { T[] rt = A.ToArray(); Random rnd = new Random(); for (int i = rt.Length - 1; i >= 1; i--) swap(ref rt[i], ref rt[rnd.Next(i + 1)]); 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(); 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 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 int MaxElement(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 void PopBack(this List A) => A.RemoveAt(A.Count - 1);\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 (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}\npublic class Pair : IComparable>\n{\n public T1 v1;\n public T2 v2;\n public Pair() { }\n public Pair(T1 v1, T2 v2)\n { this.v1 = v1; this.v2 = v2; }\n\n [MethodImpl(MethodImplOptions.AggressiveInlining)]\n public int CompareTo(Pair p)\n {\n var c = Comparer.Default.Compare(v1, p.v1);\n if (c == 0)\n c = Comparer.Default.Compare(v2, p.v2);\n return c;\n }\n public override string ToString() => $\"{v1.ToString()} {v2.ToString()}\";\n public void Deconstruct(out T1 a, out T2 b) { a = v1; b = v2; }\n}\n\npublic class Pair : Pair, IComparable>\n{\n public T3 v3;\n public Pair() : base() { }\n public Pair(T1 v1, T2 v2, T3 v3) : base(v1, v2)\n { this.v3 = v3; }\n\n [MethodImpl(MethodImplOptions.AggressiveInlining)]\n public int CompareTo(Pair p)\n {\n var c = base.CompareTo(p);\n if (c == 0)\n c = Comparer.Default.Compare(v3, p.v3);\n return c;\n }\n public override string ToString() => $\"{base.ToString()} {v3.ToString()}\";\n public void Deconstruct(out T1 a, out T2 b, out T3 c) { Deconstruct(out a, out b); c = v3; }\n}\n#endregion", "lang": "Mono C#", "bug_code_uid": "bf845f75dcbb37e2bea88237a9f704ee", "src_uid": "5b775f17b188c1d8a4da212ebb3a525c", "apr_id": "54c1e26e5388a1e4f1bdc793c8dea6a8", "difficulty": 2300, "tags": ["combinatorics"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.999163179916318, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "using System;\nusing System.Collections;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\nusing System.Text.RegularExpressions;\n\nnamespace Contest\n{\n class Program\n {\n static void Main(string[] args)\n {\n var ns = Array.ConvertAll(Console.ReadLine().Split(), Convert.ToInt32);\n int n = ns[0], s = ns[1];\n var a = Array.ConvertAll(Console.ReadLine().Split(), Convert.ToInt32);\n Array.Sort(a);\n Console.WriteLine(a.Take(n - 1).Sum() < s ? \"YES\" : \"NO\");\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "206ca3705c734fc4b3bd579c3017a51e", "src_uid": "496baae594b32c5ffda35b896ebde629", "apr_id": "162eadc4edbd3b90c336a9ac88d180a2", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.682069311903566, "equal_cnt": 8, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 6, "fix_ops_cnt": 8, "bug_source_code": "\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\n\nclass GFG\n{\n\n public static void Main()\n {\n\n var input = Console.ReadLine();\n\n var n = int.Parse(input);\n\n List lstnum = new List();\n int i = 1;\n while (true)\n {\n double num = (i * (i + 1)) / 2.0;\n if (num > n)\n break;\n lstnum.Add(num);\n i++;\n }\n\n foreach(var nn in lstnum)\n {\n if(lstnum.Contains(Math.Abs(n-nn)))\n {\n Console.Write(\"YES\");\n return;\n }\n }\n\n Console.Write(\"NO\");\n\n }\n}\n\n\n\n\n\n", "lang": "Mono C#", "bug_code_uid": "8f25fc59849d249fe57f2db97658f7c0", "src_uid": "245ec0831cd817714a4e5c531bffd099", "apr_id": "e220347022881dba09018a2c9901dea4", "difficulty": 1300, "tags": ["brute force", "implementation", "binary search"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.7464646464646465, "equal_cnt": 5, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 4, "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 int n = int.Parse(Console.ReadLine());\n List k = new List();\n k.Add(1);\n for (int i = 1; k[i - 1] + i + 1 < n; i++)\n {\n k.Add(k[i - 1] + i + 1);\n }\n for (int i = 0; i < k.Count; i++)\n for (int j = 0; j < k.Count; j++)\n if (k[i] + k[j] == n)\n {\n Console.WriteLine(\"YES\");\n return;\n }\n Console.WriteLine(\"NO\");\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "ad255c676fe55baf5076443d5d9e56ae", "src_uid": "245ec0831cd817714a4e5c531bffd099", "apr_id": "c3890c45e9242966669762ac8f2a408f", "difficulty": 1300, "tags": ["brute force", "implementation", "binary search"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.5865751334858886, "equal_cnt": 11, "replace_cnt": 6, "delete_cnt": 2, "insert_cnt": 2, "fix_ops_cnt": 10, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\n\nnamespace triangnums\n{\n class Program\n {\n static void Main(string[] args)\n {\n long n = long.Parse(Console.ReadLine());\n bool pos = false;\n long[] mas = new long[(long)Math.Sqrt(2*n)];\n long i, j;\n for (i = 1; i <= Math.Sqrt(2*n); i++)\n mas[i-1] = i * (i + 1)/2;\n for (i = 0; i < Math.Sqrt(2 * n)-1; i++)\n for (j = (long)Math.Sqrt(2 * n) - 1; j >= 0; j--)\n if (mas[i] + mas[j] == n)\n {\n pos = true;\n j = -1;\n i = (long)Math.Sqrt(2 * n) + 1;\n }\n else if (mas[i] + mas[j] < n)\n break;\n if (pos)\n Console.WriteLine(\"YES\");\n else\n Console.WriteLine(\"NO\");\n }\n }\n}", "lang": "Mono C#", "bug_code_uid": "b94cf2247aae9e5dc23fac0766379f9b", "src_uid": "245ec0831cd817714a4e5c531bffd099", "apr_id": "853c17226d9202e350bb15f3f493ed65", "difficulty": 1300, "tags": ["brute force", "implementation", "binary search"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.998467667790377, "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;\n\nnamespace triangnums\n{\n class Program\n {\n public static long binsearch(long[] x, long n, long l, long r)\n {\n \n if (x.Length == 0)\n {\n return -1;\n } \n else if (x[0] > n)\n {\n return -1;\n } \n else if (x[x.Length-1] < n)\n {\n return -1;\n }\n long mid;\n while (l 0)\n {\n pos = true;\n break;\n }\n }\n if (pos)\n Console.WriteLine(\"YES\");\n else\n Console.WriteLine(\"NO\");\n }\n }\n}", "lang": "Mono C#", "bug_code_uid": "df68e2244be8696bc45ce2eb7c2900d9", "src_uid": "245ec0831cd817714a4e5c531bffd099", "apr_id": "853c17226d9202e350bb15f3f493ed65", "difficulty": 1300, "tags": ["brute force", "implementation", "binary search"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C#"} {"similarity_score": 0.63216011042098, "equal_cnt": 19, "replace_cnt": 7, "delete_cnt": 6, "insert_cnt": 6, "fix_ops_cnt": 19, "bug_source_code": "using System;\n\nnamespace Algorithm\n{\n class Program\n {\n static void Main()\n {\n int n = Convert.ToInt32(Console.ReadLine());\n int curr, temp1 = 1, temp2;\n \n for (int i = 2; temp1 < n; i++)\n {\n curr = n - temp1;\n temp2 = 1;\n for (int j = 2; temp2 < curr; j++)\n {\n temp2 = (j * (j + 1)) >> 1;\n }\n if (curr - temp2 == 0)\n {\n Console.WriteLine(\"YES\");\n return;\n }\n temp1 = (i * (i + 1)) >> 1;\n }\n\n Console.WriteLine(\"NO\");\n }\n }\n}", "lang": "Mono C#", "bug_code_uid": "83d009b7d237ec85b1f9f4ebb38afd25", "src_uid": "245ec0831cd817714a4e5c531bffd099", "apr_id": "d19c77c560001bffcc90442aa4725c81", "difficulty": 1300, "tags": ["brute force", "implementation", "binary search"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9734361610968295, "equal_cnt": 5, "replace_cnt": 0, "delete_cnt": 2, "insert_cnt": 2, "fix_ops_cnt": 4, "bug_source_code": "using System;\nusing Systenm.Linq;\n\nclass P {\n static void Main() {\n var s = Console.ReadLine().Split(' ').Select(int.Parse).ToArray();\n var a = s[0]; var x = s[1]; var y = s[2];\n if (y < a && y > 0) {\n Console.Write(2*Math.Abs(x) < a ? 1 : -1);\n return;\n }\n var add = y / (2*a);\n y %= 2*a;\n \n if (y < a && y > 0) {\n Console.Write(2*Math.Abs(x) < a ? 2+3*add : -1);\n return;\n }\n if (y < 2*a && y > a) {\n Console.Write(x != 0 && Math.Abs(x) < a ? 2+3*add+(x<0?1:2) : -1);\n return;\n }\n Console.Write(-1);\n }\n}\n \n", "lang": "MS C#", "bug_code_uid": "1d8656bd88ff163b219b4e348fb3fd28", "src_uid": "cf48ff6ba3e77ba5d4afccb8f775fb02", "apr_id": "f47ebde9fe42e36d0f1ae60275e9ba3c", "difficulty": 1400, "tags": ["geometry", "math"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C#"} {"similarity_score": 0.9940382805145905, "equal_cnt": 17, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 16, "fix_ops_cnt": 17, "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 long a, x, y, role, sqr;\n string str;\n string[] split = new string[3];\n str = Console.ReadLine();\n split = str.Split();\n a = Convert.ToInt32(split[0]);\n x = Convert.ToInt32(split[1]);\n y = Convert.ToInt32(split[2]);\n\n if (y % a == 0)\n Console.WriteLine(\"-1\");\n else\n {\n role = y / a + 1;\n if (y < a)\n {\n\n if (Math.Abs(x) < a / 2.0)\n Console.WriteLine(\"1\");\n else Console.WriteLine(\"-1\");\n }\n else\n {\n sqr = role % 2 + 1;\n if (sqr == 1)\n if (Math.Abs(x) < a / 2)\n Console.WriteLine((1 + (role - 2) / 2 * 3)+1);\n else Console.WriteLine(\"-1\");\n else\n if ((x>0)&&(x-a))\n Console.WriteLine((2 + (role - 3) / 2 * 3) + 1);\n else Console.WriteLine(\"-1\");\n\n // 2+(role-3)/2*3\n //1 + (role-2)/2*3\n }\n }\n\n }\n }\n}\n\n", "lang": "MS C#", "bug_code_uid": "b8f17ec3e19e03131b4a2f0347a2c869", "src_uid": "cf48ff6ba3e77ba5d4afccb8f775fb02", "apr_id": "bc416179a9ac71cc51bf10ecef1d50a9", "difficulty": 1400, "tags": ["geometry", "math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.9974929489188342, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "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 Pi = Pair;\n\nclass Solver\n{\n public Scanner sc;\n public void Solve()\n {\n int N, M;long K;\n sc.Make(out N, out M, out K);\n if (K < N) Fail($\"{K+1} {1}\");\n if (K == N) Fail($\"{K} {2}\");\n K -= N;\n long n = K / (M - 1);K /= M - 1;\n long m;\n if (n % 2 == 0) m = K + 2;\n else m = (M - K );\n n = N - n;\n Console.WriteLine($\"{n} {m}\");\n }\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 var sol = new Solver() { sc = new Scanner() };\n //var th = new Thread(sol.Solve, 1 << 26);th.Start();th.Join();\n sol.Solve();\n Console.Out.Flush();\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 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 int MaxElement(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}\npublic class Pair : IComparable>\n{\n public T1 v1;\n public T2 v2;\n public Pair() { }\n public Pair(T1 v1, T2 v2)\n { this.v1 = v1; this.v2 = v2; }\n\n [MethodImpl(MethodImplOptions.AggressiveInlining)]\n public int CompareTo(Pair p)\n {\n var c = Comparer.Default.Compare(v1, p.v1);\n if (c == 0)\n c = Comparer.Default.Compare(v2, p.v2);\n return c;\n }\n public override string ToString() => $\"{v1.ToString()} {v2.ToString()}\";\n public void Deconstruct(out T1 a, out T2 b) { a = v1; b = v2; }\n}\n\npublic class Pair : Pair, IComparable>\n{\n public T3 v3;\n public Pair() : base() { }\n public Pair(T1 v1, T2 v2, T3 v3) : base(v1, v2)\n { this.v3 = v3; }\n\n [MethodImpl(MethodImplOptions.AggressiveInlining)]\n public int CompareTo(Pair p)\n {\n var c = base.CompareTo(p);\n if (c == 0)\n c = Comparer.Default.Compare(v3, p.v3);\n return c;\n }\n public override string ToString() => $\"{base.ToString()} {v3.ToString()}\";\n public void Deconstruct(out T1 a, out T2 b, out T3 c) { Deconstruct(out a, out b); c = v3; }\n}\n#endregion", "lang": "Mono C#", "bug_code_uid": "f27423601e9a8b6146668292e1c2fcee", "src_uid": "e88bb7621c7124c54e75109a00f96301", "apr_id": "fbfaf0b673805eed1c613878b6c23aa8", "difficulty": 1300, "tags": ["math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.37027027027027026, "equal_cnt": 21, "replace_cnt": 13, "delete_cnt": 6, "insert_cnt": 2, "fix_ops_cnt": 21, "bug_source_code": "using System;\nusing System.Linq;\nusing System.Text;\nusing System.Collections;\nusing System.Collections.Generic;\nnamespace ConsoleApplication1\n{\n class Program\n {\n static void Main(string[] args)\n {\n string l = Console.ReadLine();\n long n = Convert.ToInt64(l.Split(' ')[0]);\n long m = Convert.ToInt64(l.Split(' ')[1]);\n long k = Convert.ToInt64(l.Split(' ')[2]);\n int x = 1, y = 1;\n bool snake = false;\n bool goRight = true;\n while(k > 0)\n {\n if (x == n)\n {\n snake = true;\n }\n //reached destination\n if (x == 1 && y == 2)\n {\n k = 0;\n break;\n }\n //going down along the left side\n else if (snake == false && x < n)\n {\n x++;\n k--;\n } \n else if(snake && goRight)\n {\n if (y < m)\n {\n k--;\n y++;\n }\n else if(y == m)\n {\n x--;\n k--;\n goRight = false;\n }\n }\n else if(snake && goRight == false)\n {\n if(y > 2)\n {\n y--;\n k--;\n }\n else if(y == 2)\n {\n k--;\n x--;\n goRight = true;\n }\n }\n //Console.WriteLine(x + \" \" + y);\n }\n Console.WriteLine(x + \" \" + y);\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "c9f1393efdd70fc0a198a04ba10143a8", "src_uid": "e88bb7621c7124c54e75109a00f96301", "apr_id": "c1bbecd7b8f087577d768a46682519d0", "difficulty": 1300, "tags": ["math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9055555555555556, "equal_cnt": 1, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "var x=Array.ConvertAll(Console.ReadLine().Split(), int.Parse);\n\t\tint a=x[0];\n\t\tint b=x[1];\n\t\tint n=x[2];\n\t\tint s=0, q=0;\n\t\t\n\t\twhile(n>0)\n\t\t{\n\t\t\tif(q==0)\n\t\t\t{\n\t\t\t s=gcd(a,n);\n\t\t\t n-=s;\n\t\t\t q=1;\t\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\ts=gcd(b,n);\n\t\t\t\tn-=s;\n\t\t\t\tq=0;\n\t\t\t}\n\t\t}\n\t\tConsole.WriteLine(q==0? \"1\":\"0\");\n\t\t\n\t}\n\tpublic static int gcd(int y, int z)\n\t{\n\t\twhile (y!= z)\n {\n if (y > z)\n y = y- z;\n\n if (z > y)\n z = z - y;\n }\n return y;\n }", "lang": "MS C#", "bug_code_uid": "8663e6013f45053b28016f8d5be9d0c3", "src_uid": "0bd6fbb6b0a2e7e5f080a70553149ac2", "apr_id": "cf174d14ac18f20a2c8f0d3b018b3280", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.9954384186517993, "equal_cnt": 8, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 7, "fix_ops_cnt": 7, "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\n\nclass PairVariable:IComparable\n{\n public int a, b;\n public PairVariable()\n {\n a = b = 0;\n }\n public PairVariable(string s)\n {\n string[] q = s.Split();\n a = int.Parse(q[0]);\n b = int.Parse(q[1]);\n }\n public PairVariable(int a, int b)\n {\n this.a = a;\n this.b = b;\n }\n public int CompareTo(PairVariable pv)\n {\n if (this.a > pv.a)\n {\n return 1;\n }\n else if (this.a < pv.a)\n {\n return -1;\n }\n else\n {\n if (this.b >= pv.b)\n {\n return 1;\n }\n else\n {\n return -1;\n }\n }\n }\n\n}\nnamespace ConsoleApplication252\n{\n\n class Program\n {\n\n static bool IsPrime(int n)\n {\n for (int i = 2; i <= Math.Sqrt(n); i++)\n {\n if (n % i == 0)\n {\n return false;\n }\n }\n return true;\n }\n\n static void Main()\n {\n string[] z = Console.ReadLine().Split();\n double a = double.Parse(z[0]);\n double b = double.Parse(z[1]);\n double c = double.Parse(z[2]);\n double d = double.Parse(z[3]);\n double ballMisha = Math.Max(3 * a / 10, a - ((a * c) / 25));\n double ballVasya = Math.Max(3 * b / 10, b - ((b * d) / 25));\n if (ballMisha > ballVasya)\n {\n Console.WriteLine(\"Misha\");\n }\n else if (ballVasya > ballMisha)\n {\n Console.WriteLine(\"Vasya\");\n }\n else\n {\n Console.WriteLine(\"Tie\");\n }\n\n\n }\n }\n}", "lang": "MS C#", "bug_code_uid": "94477029eae1c1594c9a21b19307f719", "src_uid": "95b19d7569d6b70bd97d46a8541060d0", "apr_id": "69ff59e07ac77857db5e1f6fb050c957", "difficulty": 900, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.020833333333333332, "equal_cnt": 21, "replace_cnt": 18, "delete_cnt": 2, "insert_cnt": 1, "fix_ops_cnt": 21, "bug_source_code": "\nMicrosoft Visual Studio Solution File, Format Version 11.00\n# Visual C# Express 2010\nProject(\"{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}\") = \"A.Contest\", \"A.Contest\\A.Contest.csproj\", \"{1E33F78A-68B3-42F4-A54D-07412C28A48F}\"\nEndProject\nGlobal\n\tGlobalSection(SolutionConfigurationPlatforms) = preSolution\n\t\tDebug|x86 = Debug|x86\n\t\tRelease|x86 = Release|x86\n\tEndGlobalSection\n\tGlobalSection(ProjectConfigurationPlatforms) = postSolution\n\t\t{1E33F78A-68B3-42F4-A54D-07412C28A48F}.Debug|x86.ActiveCfg = Debug|x86\n\t\t{1E33F78A-68B3-42F4-A54D-07412C28A48F}.Debug|x86.Build.0 = Debug|x86\n\t\t{1E33F78A-68B3-42F4-A54D-07412C28A48F}.Release|x86.ActiveCfg = Release|x86\n\t\t{1E33F78A-68B3-42F4-A54D-07412C28A48F}.Release|x86.Build.0 = Release|x86\n\tEndGlobalSection\n\tGlobalSection(SolutionProperties) = preSolution\n\t\tHideSolutionNode = FALSE\n\tEndGlobalSection\nEndGlobal\n", "lang": "MS C#", "bug_code_uid": "af6da5dd723aaa12460514697fb5ceba", "src_uid": "95b19d7569d6b70bd97d46a8541060d0", "apr_id": "fc5ccb35ec6b795790e35930cfdb629f", "difficulty": 900, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.3444857496902107, "equal_cnt": 16, "replace_cnt": 12, "delete_cnt": 3, "insert_cnt": 1, "fix_ops_cnt": 16, "bug_source_code": "using System;\n\nnamespace _122A\n{\n\tclass MainClass\n\t{\n\t\tprivate static char[] a = new char[] {'4', '7'};\n\t\tprivate static string res = \"NO\";\n\t\tpublic static void Main ( string[] args )\n\t\t{\n\t\t\tstring s = Console.ReadLine ( );\n\t\t\tint n;\n\t\t\tint.TryParse ( s , out n );\n\t\t\tTry ( 0 , \"\" , s.Length , n );\n\t\t\tConsole.Write ( res );\n\t\t}\n\n\t\tprivate static void Try(int i, string s, int length, int n)\n\t\t{\n\t\t\tif ( isLucky ( n ) )\n\t\t\t{\n\t\t\t\tres = \"YES\";\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tfor ( int j = 0 ; j < 2 ; ++j )\n\t\t\t{\n\t\t\t\tif ( res != \"YES\" )\n\t\t\t\t{\n\t\t\t\t\ts += a [ j ];\n\t\t\t\t\t++i;\n\t\t\t\t\tif ( i == length - 1 )\n\t\t\t\t\t{\n\t\t\t\t\t\tint x = int.Parse ( s );\n\t\t\t\t\t\tif ( x < n && n % x == 0 )\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tres = \"YES\";\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse Try ( i + 1 , s , length , n );\n\t\t\t\t\t--i;\n\t\t\t\t\ts.Remove ( i , 1 );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tprivate static bool isLucky(int n)\n\t\t{\n\t\t\tint x = n;\n\t\t\twhile ( x > 0 )\n\t\t\t{\n\t\t\t\tif ( x % 10 != 4 && x % 10 != 7 )\n\t\t\t\t\treturn false;\n\t\t\t\tx /= 10;\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\t}\n}\n", "lang": "MS C#", "bug_code_uid": "d08cb4f6e1771f8f70354ac22c38042b", "src_uid": "78cf8bc7660dbd0602bf6e499bc6bb0d", "apr_id": "65823fe184db4f084f4a1065b0b0b204", "difficulty": 1000, "tags": ["brute force", "number theory"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.017371163867979156, "equal_cnt": 12, "replace_cnt": 8, "delete_cnt": 0, "insert_cnt": 4, "fix_ops_cnt": 12, "bug_source_code": "\nMicrosoft Visual Studio Solution File, Format Version 11.00\n# Visual Studio 2010\nGlobal\n\tGlobalSection(SolutionProperties) = preSolution\n\t\tHideSolutionNode = FALSE\n\tEndGlobalSection\nEndGlobal\n", "lang": "Mono C#", "bug_code_uid": "d3f65ae34ac11b71d32ee7769bc6730e", "src_uid": "6aa83c2f6e095848bc63aba7d013aa58", "apr_id": "858752bec8d18bc4ebddc366713cfe0d", "difficulty": 1200, "tags": ["brute force", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.017677782241864202, "equal_cnt": 17, "replace_cnt": 14, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 17, "bug_source_code": "\nMicrosoft Visual Studio Solution File, Format Version 11.00\n# Visual Studio 2010\nProject(\"{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}\") = \"A\", \"A\\A.csproj\", \"{7C02893E-192C-4692-BDCC-E2D81901F781}\"\nEndProject\nGlobal\n\tGlobalSection(SolutionConfigurationPlatforms) = preSolution\n\t\tDebug|x86 = Debug|x86\n\t\tRelease|x86 = Release|x86\n\tEndGlobalSection\n\tGlobalSection(ProjectConfigurationPlatforms) = postSolution\n\t\t{7C02893E-192C-4692-BDCC-E2D81901F781}.Debug|x86.ActiveCfg = Debug|x86\n\t\t{7C02893E-192C-4692-BDCC-E2D81901F781}.Debug|x86.Build.0 = Debug|x86\n\t\t{7C02893E-192C-4692-BDCC-E2D81901F781}.Release|x86.ActiveCfg = Release|x86\n\t\t{7C02893E-192C-4692-BDCC-E2D81901F781}.Release|x86.Build.0 = Release|x86\n\tEndGlobalSection\n\tGlobalSection(SolutionProperties) = preSolution\n\t\tHideSolutionNode = FALSE\n\tEndGlobalSection\nEndGlobal\n", "lang": "Mono C#", "bug_code_uid": "b5c3f48a5765a08d2f9328505efe39bf", "src_uid": "6aa83c2f6e095848bc63aba7d013aa58", "apr_id": "858752bec8d18bc4ebddc366713cfe0d", "difficulty": 1200, "tags": ["brute force", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.995986085094996, "equal_cnt": 1, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "namespace CodeForces\n{\n class Program\n {\n static void Main(string[] args)\n {\n string[] input = Console.ReadLine().Split(' ');\n int[] akk = new int[3];\n for (int i = 0; i < 3; i++)\n {\n switch (input[i])\n {\n case \"C\": akk[i] = 0; break;\n case \"C#\": akk[i] = 1; break;\n case \"D\": akk[i] = 2; break;\n case \"D#\": akk[i] = 3; break;\n case \"E\": akk[i] = 4; break;\n case \"F\": akk[i] = 5; break;\n case \"F#\": akk[i] = 6; break;\n case \"G\": akk[i] = 7; break;\n case \"G#\": akk[i] = 8; break;\n case \"A\": akk[i] = 9; break;\n case \"B\": akk[i] = 10; break;\n case \"H\": akk[i] = 11; break;\n default: akk[i] = -1; break;\n }\n }\n int type = 0;\n for (int i = 0; i < 3; i++)\n {\n for (int j = 0; j < 3; j++)\n {\n int k = 3 - (i + j);\n if (d(akk[i], akk[j]) == 7)\n {\n if ((d(akk[i], akk[k]) == 4) & (d(akk[k], akk[j]) == 3)) { type = 1; break; }\n else if ((d(akk[i], akk[k]) == 3) & (d(akk[k], akk[j]) == 4)) type = -1;\n }\n }\n }\n switch (type)\n { \n case 1: Console.Write(\"major\"); break;\n case -1: Console.Write(\"minor\"); break;\n default: Console.Write(\"strange\"); break;\n }\n }\n static int d(int a1, int a2)\n {\n if (a2 >= a1) return a2 - a1; else return 12 - (a1 - a2);\n }\n }\n}", "lang": "Mono C#", "bug_code_uid": "1710854b11e0a7925718eabd13117de9", "src_uid": "6aa83c2f6e095848bc63aba7d013aa58", "apr_id": "30b19337b092dd0269be27198b29d24a", "difficulty": 1200, "tags": ["brute force", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.9512195121951219, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 3, "bug_source_code": "class Program\n {\n static void Main(string[] args)\n {\n Console.WriteLine(long.Parse(Console.ReadLine()) / 2520L);\n }\n }", "lang": "Mono C#", "bug_code_uid": "209cb138586924a5bb0435dea0cca769", "src_uid": "8551308e5ff435e0fc507b89a912408a", "apr_id": "0e91808b91741516e41b4f44d2aff360", "difficulty": 1100, "tags": ["math", "number theory"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.9931153184165232, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "using System;\nusing System.Collections;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Text.RegularExpressions;\n\nnamespace Contest\n{\n class Program\n {\n static void Main()\n {\n int b = Convert.ToInt32(Console.ReadLine());\n int g = Convert.ToInt32(Console.ReadLine());\n int n = Convert.ToInt32(Console.ReadLine());\n if (b + g == n) Console.WriteLine(1);\n else\n Console.WriteLine(Math.Min(b, Math.Min(g, Math.Min(Math.Max(n-g-b,0),n)))+1);\n }\n\n }\n\n\n}\n", "lang": "Mono C#", "bug_code_uid": "fba69b1f5f6022ce46e1b2bbc7f0bf5b", "src_uid": "9266a69e767df299569986151852e7b1", "apr_id": "541c2adfbfde296f69520bb0cb64717f", "difficulty": 1100, "tags": ["math", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9625984251968503, "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\nusing static System.Math;\nnamespace megaPolis\n{\n class Program\n {\n static void Main(string[] args)\n {\n int b = int.Parse(Console.ReadLine());\n int g = int.Parse(Console.ReadLine());\n int n = int.Parse(Console.ReadLine());\n\n Console.WriteLine(Min(n, g) - n + Min(n, b));\n // Console.ReadKey();\n\n\n\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "92791af2580f79d4c140ce737ef25560", "src_uid": "9266a69e767df299569986151852e7b1", "apr_id": "4b8684deb39b13e55dcbfa53f8ca3f7a", "difficulty": 1100, "tags": ["math", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.8047464940668824, "equal_cnt": 6, "replace_cnt": 5, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 5, "bug_source_code": "using System;\nusing System.Linq;\n\nnamespace tren\n{\n class Program\n {\n static void Main(string[] args)\n {\n int n = int.Parse(Console.ReadLine());\n int[] mass = Enumerable.Range(n, Math.Abs(n) + 10).ToArray();\n for(int i = 1; i < mass.Count(); i++)\n {\n if (mass[i].ToString().Contains('8')) { Console.Write(i); return; }\n }\n }\n }\n}", "lang": "MS C#", "bug_code_uid": "0c15449609fa514d154a59ca43569b38", "src_uid": "4e57740be015963c190e0bfe1ab74cb9", "apr_id": "4fe19331dace41c02b5cdf7bc8efdf21", "difficulty": 1100, "tags": ["brute force"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.8682101513802315, "equal_cnt": 6, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 4, "fix_ops_cnt": 5, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Collections;\n\nnamespace a2oj\n{\n class Program\n {\n static bool cheight(int num)\n {\n while(num>0)\n {\n if (num % 10 != 8)\n num /= 10;\n else\n return true;\n }\n return false;\n }\n \n static void Main(string[] args)\n {\n int n;\n int t;\n n = int.Parse(Console.ReadLine());\n t=n;\n //List val = new List();\n //string s= Console.ReadLine();\n //string []all=s.Split(' ');\n //foreach(string st in all)\n //{\n // val.Add(int.Parse(st));\n //}\n n++;\n while (!cheight(n))\n n++;\n Console.WriteLine(n - t);\n \n Console.ReadKey();\n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "fbb881bad126ffa8a13715e843ef7482", "src_uid": "4e57740be015963c190e0bfe1ab74cb9", "apr_id": "a45ffd5c50a8fad8a14526153087a09f", "difficulty": 1100, "tags": ["brute force"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.9992337164750957, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.IO;\nusing static System.Console;\nusing static System.Convert;\nusing static System.Math;\n//using static System.Globalization.CultureInfo;\nusing System.Text;\nclass Program\n{\n private static void chmin(ref T num, T val) where T : IComparable\n => num = num.CompareTo(val) == 1 ? val : num;\n private static void chmax(ref T num, T val) where T : IComparable\n => num = num.CompareTo(val) == -1 ? val : num;\n private static void swap(ref T v1,ref T v2)\n { var t = v2;v2 = v1;v1 = t; }\n static void Main(string[] args)\n {\n var pr = new Program();\n var sw = new StreamWriter(Console.OpenStandardOutput()) { AutoFlush = false };\n Console.SetOut(sw);\n pr.Solve();\n Console.Out.Flush();\n }\n void Solve()\n {\n int n, l, r;\n Input.Make(out n, out l, out r);\n var min = n - l + 1;\n var c = 1;\n for(var i=1;i ReadLine().Trim();\n public static int[] ar => read.Split(' ').Select(int.Parse).ToArray();\n public static int num => ToInt32(read);\n public static long[] arL => read.Split(' ').Select(long.Parse).ToArray();\n public static long numL => ToInt64(read);\n public static T[] create(int n, Func f)\n => Enumerable.Repeat(0, n).Select(f).ToArray();\n public static char[][] grid(int h)\n => create(h, _ => read.ToCharArray());\n public static int[] ar1D(int n)\n => create(n, _ => num);\n public static long[] arL1D(int n)\n => create(n, _ => numL);\n public static string[] strs(int n)\n => create(n, _ => read);\n public static int[][] ar2D(int n)\n => create(n, _ => ar);\n public static long[][] arL2D(int n)\n => create(n, _ => arL);\n public static List[] edge(int n)\n => create(n, _ => new List());\n public static T GetValue(string g)\n {\n var t = typeof(T);\n if (t == typeof(int))\n return (T)(object)int.Parse(g);\n if (t == typeof(long))\n return (T)(object)long.Parse(g);\n if (t == typeof(string))\n return (T)(object)g;\n if (t == typeof(char))\n return (T)(object)char.Parse(g);\n if (t == typeof(double))\n return (T)(object)double.Parse(g);\n if (t == typeof(bool))\n return (T)(object)bool.Parse(g);\n return default(T);\n }\n public static void Make(out T1 v1, out T2 v2)\n {\n v1 = Next();\n v2 = Next();\n }\n public static void Make(out T1 v1, out T2 v2, out T3 v3)\n {\n Make(out v1, out v2);\n v3 = Next();\n }\n public static void Make(out T1 v1, out T2 v2, out T3 v3, out T4 v4)\n {\n Make(out v1, out v2, out v3);\n v4 = Next();\n }\n public static void Make(out T1 v1, out T2 v2, out T3 v3, out T4 v4, out T5 v5)\n {\n Make(out v1, out v2, out v3, out v4);\n v5 = Next();\n }\n public static void Make(out T1 v1, out T2 v2, out T3 v3, out T4 v4, out T5 v5, out T6 v6)\n {\n Make(out v1, out v2, out v3, out v4, out v5);\n v6 = Next();\n }\n private static Queue sc;\n public static T Next(){ sc = sc ?? new Queue(); if (sc.Count == 0) foreach (var item in read.Split(' ')) sc.Enqueue(item);return GetValue(sc.Dequeue()); }\n public static void Next(ref T val) => val = Next(); \n public const long Inf = (long)1e18;\n public const double eps = 1e-6;\n public const string Alfa = \"abcdefghijklmnopqrstuvwxyz\";\n public const int MOD = 1000000007;\n}\n\npublic class Pair : IComparable>\n{\n public T1 v1 { get; set; }\n public T2 v2 { get; set; }\n public Pair() { v1 = Input.Next(); v2 = Input.Next(); }\n public Pair(T1 v1, T2 v2)\n { this.v1 = v1; this.v2 = v2; }\n\n public int CompareTo(Pair p)\n {\n var c = Comparer.Default.Compare(v1, p.v1);\n if (c == 0)\n c = Comparer.Default.Compare(v2, p.v2);\n return c;\n }\n public override string ToString()\n => $\"{v1.ToString()} {v2.ToString()}\";\n public override bool Equals(object obj)\n => this == (Pair)obj;\n public override int GetHashCode()\n => v1.GetHashCode() ^ v2.GetHashCode();\n public static bool operator ==(Pair p1, Pair p2)\n => p1.CompareTo(p2) == 0;\n public static bool operator !=(Pair p1, Pair p2)\n => p1.CompareTo(p2) != 0;\n public static bool operator >(Pair p1, Pair p2)\n => p1.CompareTo(p2) == 1;\n public static bool operator >=(Pair p1, Pair p2)\n => p1.CompareTo(p2) != -1;\n public static bool operator <(Pair p1, Pair p2)\n => p1.CompareTo(p2) == -1;\n public static bool operator <=(Pair p1, Pair p2)\n => p1.CompareTo(p2) != 1;\n}\n\npublic class Pair : Pair, IComparable>\n{\n public T3 v3 { get; set; }\n public Pair() : base() { v3 = Input.Next(); }\n public Pair(T1 v1, T2 v2, T3 v3) : base(v1, v2)\n { this.v3 = v3; }\n\n public int CompareTo(Pair p)\n {\n var c = base.CompareTo(p);\n if (c == 0)\n c = Comparer.Default.Compare(v3, p.v3);\n return c;\n }\n public override string ToString()\n => $\"{base.ToString()} {v3.ToString()}\";\n}", "lang": "Mono C#", "bug_code_uid": "486c99068556d217c70b80d08ffe211a", "src_uid": "ce220726392fb0cacf0ec44a7490084a", "apr_id": "505a86dfe8816a28c682019f2b16d243", "difficulty": 900, "tags": ["math", "greedy"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9644818747711461, "equal_cnt": 11, "replace_cnt": 5, "delete_cnt": 0, "insert_cnt": 5, "fix_ops_cnt": 10, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\n\nnamespace ConsoleApp41\n{\n class Program\n {\n static void Main(string[] args)\n {\n\n int[] x = Console.ReadLine().Split(' ').Select(int.Parse).ToArray();\n int min = x[1];\n int max = x[2];\n int max1 = max;\n int max2 = max;\n int n = x[0];\n int[] minSum = new int[n];\n minSum[0] = 1;\n int[] maxSum = new int[n];\n maxSum[0] = 1;\n int minSumma = 1;\n int maxSumma = 1;\n for(int i = 1; i < n; i++)\n {\n if( max1 > 0)\n {\n minSum[i] = 1;\n max1--;\n }\n else\n minSum[i] = minSum[i - 1] * 2;\n minSumma += minSum[i];\n }\n for(int i = 1; i < n; i++)\n {\n \n if (max2 > 1)\n {\n max2--;\n maxSum[i] = maxSum[i - 1] * 2;\n\n }\n else\n maxSum[i] = maxSum[i - 1];\n maxSumma += maxSum[i];\n \n }\n\n Console.WriteLine(minSumma + \" \" + maxSumma);\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "d2958764e001e61e88725302e360e6e1", "src_uid": "ce220726392fb0cacf0ec44a7490084a", "apr_id": "89ae6a7b242ef956d57a6e4c2948fc87", "difficulty": 900, "tags": ["math", "greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.23314065510597304, "equal_cnt": 19, "replace_cnt": 9, "delete_cnt": 3, "insert_cnt": 7, "fix_ops_cnt": 19, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Collections;\nnamespace ConsoleApplication1\n{\n class Program\n {\n static void Main(string[] args)\n {\n string[] Input = Console.ReadLine().Split(' ');\n int n = int.Parse(Console.ReadLine());\n int[] arr = new int[3];\n for (int i = 0; i < 3; i++) arr[i] = Convert.ToInt32(Input[i]);\n int[] brr = new int[3];\n for (int j = 0; j < 3; j++) brr[j] = Convert.ToInt32(Input[j]);\n int a, b, c;\n a = arr[0];\n b = arr[1];\n c = arr[2];\n while(n>0)\n {\n if (a + b + c == n) break;\n if (a < brr[0]) a++;\n if (b < brr[1]) b++;\n if (c < brr[2]) c++;\n }\n Console.WriteLine(a + \" \" + b +\" \"+ c );\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "a0318d401acc8774047463067151b669", "src_uid": "3cd092b6507079518cf206deab21cf97", "apr_id": "22e1ace8a18f064256c2b8ba63825f88", "difficulty": 1100, "tags": ["greedy", "math", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.998203377650018, "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.Collections;\nusing System.Threading.Tasks;\nusing System.IO;\nusing System.Globalization;\nnamespace ConsoleApplication1\n{\n class Program\n {\n static int ReadIntLine()\n {\n return int.Parse(Console.ReadLine());\n }\n static void Main( )\n {\n var init = int.Parse(Console.ReadLine());\n var line1 = Console.ReadLine().Split(' ').Select(int.Parse).ToArray();\n var line2 = Console.ReadLine().Split(' ').Select(int.Parse).ToArray();\n var line3 = Console.ReadLine().Split(' ').Select(int.Parse).ToArray();\n\n var max1 = line1[1];\n var max2 = line2[1];\n var max3 = line3[1];\n\n var min1 = line1[0];\n var min2 = line2[0];\n var min3 = line3[0];\n\n // var dip1 = Math.Min(init - min2 - min3, max1);\n //var dip2 = Math.Min(init - dip1 - min3, max2);\n //var dip3 = Math.Min(init - dip1 - dip2, max3);\n\n while (n>0)\n {\n if (min1 + min2 + min3 == n) break;\n if (min1 < max1) min1++;\n else if (min2 < max2) min2++;\n else if (min3 < max3) min3++;\n }\n\n Console.WriteLine(min1 + \" \" + min2 + \" \" + min3);\n\n\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "55079c70870b69547664bb03964f0225", "src_uid": "3cd092b6507079518cf206deab21cf97", "apr_id": "22e1ace8a18f064256c2b8ba63825f88", "difficulty": 1100, "tags": ["greedy", "math", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9768451519536903, "equal_cnt": 9, "replace_cnt": 1, "delete_cnt": 4, "insert_cnt": 3, "fix_ops_cnt": 8, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\n\nnamespace a\n{\n class MainClass\n {\n public static void Main (string[] args)\n {\n var n = int.Parse (Console.ReadLine ());\n var x = new List> ();\n for (var i = 0; i < 3; i++) {\n var line = Console.ReadLine ().Split (new char[]{ ' ' }, StringSplitOptions.RemoveEmptyEntries).Select (int.Parse).ToArray();\n x.Add (new Tuple (line [0], line [1]));\n }\n\n var result = new int[3];\n var remain = new int[3];\n for (var o = x [0].Item2; o >= x [0].Item1; o--) {\n result [0] = o;\n remain [0] = n - o;\n for (var p = Math.Min(remain [0], x[1].Item2); p >= x [1].Item1; p--) {\n result [1] = p;\n remain [1] = remain [0] - p;\n for (var q = Math.Min(remain [1], x[2].Item2); q >= x [2].Item1; q--) {\n result [2] = q;\n remain [2] = remain [1] - q;\n if (remain [2] == 0) {\n Console.WriteLine (result [0] + \" \" + result [1] + \" \" + result [2]);\n return;\n }\n }\n }\n }\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "982e8a7462ae185d7a6dbed895ed84c5", "src_uid": "3cd092b6507079518cf206deab21cf97", "apr_id": "35a9579cf1cf09ee1590f0e2fa7fede7", "difficulty": 1100, "tags": ["greedy", "math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "delete", "lang_cluster": "C#"} {"similarity_score": 0.9800034476814342, "equal_cnt": 8, "replace_cnt": 3, "delete_cnt": 2, "insert_cnt": 2, "fix_ops_cnt": 7, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Diagnostics;\nusing System.Globalization;\nusing System.IO;\nusing System.Linq;\nusing System.Text;\nusing System.Threading;\n\nnamespace ReadWriteTemplate\n{\n public static class Solver\n {\n private static void SolveCase()\n {\n long m = ReadLong();\n long a = ReadLong();\n long b = ReadLong();\n\n long[] f = Enumerable.Repeat(-1L, (int) a).ToArray();\n f[0] = 0;\n\n var queue = new Queue();\n queue.Enqueue(0);\n long inc = a * ((b + a - 1) / a);\n while (queue.Count > 0)\n {\n long cur = queue.Dequeue();\n long d = cur + inc;\n long t = d - b;\n while (t >= 0 && f[t % a] < 0)\n {\n f[t % a] = Math.Max(d, f[cur % a]);\n queue.Enqueue(t);\n t -= b;\n }\n }\n\n // WriteArray(f);\n\n long ans = 0;\n for (int i = 0; i < a; i++)\n {\n if (f[i] >= 0 && f[i] <= m)\n {\n long k = Calc(m, i, a) - Calc(f[i] - 1, i, a);\n // Writer.WriteLine($\"{i} : {k}\");\n ans += k;\n }\n }\n\n Writer.WriteLine(ans);\n }\n\n public static long Calc(long st, long k, long a)\n {\n long full = (st - k + 1) / a;\n long ans = a * full * (full + 1) / 2;\n ans += (st - k + 1) % a * (full + 1);\n return ans;\n }\n\n public static long Gcd(long a, long b)\n {\n return b == 0 ? a : Gcd(b, a % b);\n }\n\n public static void Solve()\n {\n#if DEBUG\n var sw = Stopwatch.StartNew();\n#endif\n\n SolveCase();\n\n /*int T = ReadInt();\n for (int i = 0; i < T; i++)\n {\n // Writer.Write(\"Case #{0}: \", 1 - t);\n SolveCase();\n }*/\n\n#if DEBUG\n sw.Stop();\n Console.WriteLine($\"{sw.ElapsedMilliseconds} ms\");\n#endif\n }\n\n public static void Main()\n {\n Thread.CurrentThread.CurrentCulture = CultureInfo.InvariantCulture;\n\n#if DEBUG\n // Reader = Console.In; Writer = Console.Out;\n Reader = File.OpenText(\"input.txt\"); Writer = File.CreateText(\"output.txt\");\n#else\n Reader = Console.In; Writer = Console.Out;\n#endif\n\n // Solve();\n Thread thread = new Thread(Solve, 64 * 1024 * 1024);\n thread.CurrentCulture = CultureInfo.InvariantCulture;\n thread.Start();\n thread.Join();\n\n Reader.Close();\n Writer.Close();\n }\n\n public static IOrderedEnumerable OrderByWithShuffle(this IEnumerable source, Func keySelector)\n {\n return source.Shuffle().OrderBy(keySelector);\n }\n\n public static T[] Shuffle(this IEnumerable source)\n {\n T[] result = source.ToArray();\n Shuffle(result);\n return result;\n }\n\n private static void Shuffle(IList array)\n {\n Random rnd = new Random();\n for (int i = array.Count - 1; i >= 1; i--)\n {\n int k = rnd.Next(i + 1);\n T tmp = array[k];\n array[k] = array[i];\n array[i] = tmp;\n }\n }\n\n #region Read/Write\n\n private static TextReader Reader;\n\n private static TextWriter Writer;\n\n private static Queue CurrentLineTokens = new Queue();\n\n private static string[] ReadAndSplitLine()\n {\n return Reader.ReadLine().Split(new[] { ' ', '\\t' }, StringSplitOptions.RemoveEmptyEntries);\n }\n\n public static string ReadToken()\n {\n while (CurrentLineTokens.Count == 0)\n CurrentLineTokens = new Queue(ReadAndSplitLine());\n return CurrentLineTokens.Dequeue();\n }\n\n public static string ReadLine()\n {\n return Reader.ReadLine();\n }\n\n public static int ReadInt()\n {\n return int.Parse(ReadToken());\n }\n\n public static long ReadLong()\n {\n return long.Parse(ReadToken());\n }\n\n public static double ReadDouble()\n {\n return double.Parse(ReadToken(), CultureInfo.InvariantCulture);\n }\n\n public static int[] ReadIntArray()\n {\n return ReadAndSplitLine().Select(int.Parse).ToArray();\n }\n\n public static long[] ReadLongArray()\n {\n return ReadAndSplitLine().Select(long.Parse).ToArray();\n }\n\n public static double[] ReadDoubleArray()\n {\n return ReadAndSplitLine().Select(s => double.Parse(s, CultureInfo.InvariantCulture)).ToArray();\n }\n\n public static int[][] ReadIntMatrix(int numberOfRows)\n {\n int[][] matrix = new int[numberOfRows][];\n for (int i = 0; i < numberOfRows; i++)\n matrix[i] = ReadIntArray();\n return matrix;\n }\n\n public static string[] ReadLines(int quantity)\n {\n string[] lines = new string[quantity];\n for (int i = 0; i < quantity; i++)\n lines[i] = Reader.ReadLine().Trim();\n return lines;\n }\n\n public static void WriteArray(IEnumerable array)\n {\n Writer.WriteLine(string.Join(\" \", array));\n }\n\n #endregion\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "f9338337fafe1dfc1ee135b5f2956ae6", "src_uid": "d6290b69eddfcf5f131cc9e612ccab76", "apr_id": "dff706aaf014c4b647d122df3fad9262", "difficulty": 2100, "tags": ["math", "dfs and similar", "number theory"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9252873563218391, "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.Text;\nusing System.IO;\n\nnamespace ConsoleApplication8\n{\n class Program\n {\n static void Main(string[] args)\n {\n\n string[] ms = Console.ReadLine().Split(' ');\n int n = int.Parse(ms[0]);\n int m = int.Parse(ms[1]);\n int min= int.Parse(ms[2]);\n int max = int.Parse(ms[3]);\n\n List M = Console.ReadLine().Split(' ').Select(x => int.Parse(x)).ToList();\n int ma = 2;\n if (min != max)\n {\n if (M.IndexOf(min) != -1)\n ma--;\n if (M.IndexOf(max) != -1)\n ma--;\n\n if (m <= n - ma)\n Console.WriteLine(\"Correct\");\n else\n Console.WriteLine(\"Incorrect\");\n }\n else\n {\n bool b = true;\n for (int i=0; i n)\n {\n b = m;\n l = n;\n }\n else\n {\n l = m;\n b = n;\n }\n int bFirst = b;\n while (b<=z)\n {\n if (b%l == 0)\n {\n ans++;\n }\n b+=bFirst;\n }\n Console.WriteLine(ans);\n }\n\n int BinarySearch(int[] arr, int q)\n {\n var l = 0;\n var r = arr.Length - 1;\n //int med = -1;\n while (l <= r)\n {\n var med = l + (r - l) / 2;\n if (arr[med] == q)\n {\n return med;\n }\n if (q < arr[med])\n {\n r = med - 1;\n }\n else\n {\n l = med + 1;\n }\n }\n return -1;\n }\n\n static void Main(string[] args)\n {\n var p = new Program();\n p.Solve();\n //Console.ReadLine();\n p.Dispose();\n }\n\n #region Helpers\n\n private static int ReadInt()\n {\n return int.Parse(textReader.ReadLine());\n }\n\n private static long ReadLong()\n {\n return long.Parse(textReader.ReadLine());\n }\n\n private static int[] ReadIntArray()\n {\n return textReader.ReadLine().Split(' ').Select(int.Parse).ToArray();\n }\n #endregion\n\n public void Dispose()\n {\n textReader.Close();\n textWriter.Close();\n }\n }\n }\n", "lang": "MS C#", "bug_code_uid": "8b23d8c33676503660c71f9b26b967ed", "src_uid": "e7ad55ce26fc8610639323af1de36c2d", "apr_id": "b87d427dc48e476e6877eb8761f74485", "difficulty": 800, "tags": ["math", "brute force", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C#"} {"similarity_score": 0.7609784851164162, "equal_cnt": 30, "replace_cnt": 20, "delete_cnt": 9, "insert_cnt": 1, "fix_ops_cnt": 30, "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 int potencia(int x, int n)\n {\n int y = 1;\n\n for (int i = 0; i < n; i = i + 1)\n {\n y = y * x;\n\n }\n\n return y;\n }\n static void Main(string[] args)\n {\n int input = int.Parse(Console.ReadLine());\n int drink = input;\n int resta = 5;\n int contador = 0;\n int personas = 0;\n\n for (resta = 5; drink > resta; resta = resta * 2)\n {\n drink = drink - resta;\n contador++;\n }\n //Console.WriteLine(drink);\n //Console.WriteLine(contador);\n personas = potencia(2, contador);\n //Console.WriteLine(personas);\n \n\n string[] fila = new string[personas * 5];\n for (int n = 0; n < personas * 5; n++)\n {\n if (n < personas)\n {\n fila[n] = \"Sheldon\";\n }\n else if (n >= personas && n < personas * 2)\n {\n fila[n] = \"Leonard\";\n }\n else if (n >= personas * 2 && n < personas * 3)\n {\n fila[n] = \"Penny\";\n }\n else if (n >= personas * 3 && n < personas * 4)\n {\n fila[n] = \"Rajesh\";\n }\n else\n {\n fila[n] = \"Howard\";\n }\n }\n Console.WriteLine(fila[drink - 1]);\n \n \n }\n }\n}", "lang": "Mono C#", "bug_code_uid": "9649ff86d7b042396009fa5a7d39d845", "src_uid": "023b169765e81d896cdc1184e5a82b22", "apr_id": "6d6ee9ca64732cc499f8aa35a1934770", "difficulty": 1100, "tags": ["math", "implementation"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.3180011357183419, "equal_cnt": 16, "replace_cnt": 11, "delete_cnt": 1, "insert_cnt": 4, "fix_ops_cnt": 16, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.IO;\nusing System.Diagnostics;\n\nnamespace Test1\n{\n public class Test1\n {\n public static string getName(int input, List names) \n {\n string output = \"\";\n for (int i = 0; i < input; i++) \n {\n if (i == input - 1) { output = names[i]; }\n else { names.Add(names[i]); names.Add(names[i]); }\n }\n return output;\n }\n\n public static void Main()\n {\n List queue = new List();\n queue.Add(\"Sheldon\");\n queue.Add(\"Leonard\");\n queue.Add(\"Penny\");\n queue.Add(\"Rajesh\");\n queue.Add(\"Howard\");\n Console.WriteLine(getName(Convert.ToInt32(Console.ReadLine()), queue));\n }\n }\n}\n\n", "lang": "Mono C#", "bug_code_uid": "6d1df69d58d80c683ab03c09d82b2daf", "src_uid": "023b169765e81d896cdc1184e5a82b22", "apr_id": "84d56e88567e6e797a8490d88f6b313b", "difficulty": 1100, "tags": ["math", "implementation"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.8329649510577833, "equal_cnt": 10, "replace_cnt": 8, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 9, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Globalization;\nusing System.Threading;\nusing System.Collections;\n\nnamespace AcmSolution\n{\n internal class Program\n {\n private static void Main(string[] args)\n {\n Thread.CurrentThread.CurrentCulture = CultureInfo.InvariantCulture;\n\n Do();\n\n Console.ReadLine();\n }\n\n private static void Do()\n {\n int n = GetInt();\n ArrayList list = new ArrayList();\n list.Add(\"Sheldon\");\n list.Add(\"Leonard\");\n list.Add(\"Penny\");\n list.Add(\"Rajesh\");\n list.Add(\"Howard\");\n\n string name = \"\";\n for (int i = 0; i < n; i++)\n {\n name = list[i].ToString();\n list.Add(name);\n list.Add(name);\n }\n Console.WriteLine(name);\n }\n \n \n\n #region Utils\n private const double Epsilon = 0.00000001;\n\n private static string GetStr()\n {\n return Console.ReadLine();\n }\n\n private static string[] GetStrs()\n {\n return GetStr().Split(new[] { ' ', '\\t' }, StringSplitOptions.RemoveEmptyEntries);\n }\n\n private static string[] GetStrs(int cnt)\n {\n var s = new string[cnt];\n for (var i = 0; i < cnt; ++i)\n s[i] = GetStr();\n return s;\n }\n\n private static int GetInt()\n {\n return int.Parse(GetStr());\n }\n\n private static void GetInts(out int a, out int b)\n {\n var q = GetInts();\n a = q[0];\n b = q[1];\n }\n\n private static void GetInts(out int a, out int b, out int c)\n {\n var q = GetInts();\n a = q[0];\n b = q[1];\n c = q[2];\n }\n\n private static int[] GetInts()\n {\n var s = GetStrs();\n var a = new int[s.Length];\n for (var i = 0; i < s.Length; ++i)\n a[i] = int.Parse(s[i]);\n return a;\n }\n\n private static long GetLong()\n {\n return long.Parse(GetStr());\n }\n\n private static IEnumerable GetLongs()\n {\n return GetStrs().Select(long.Parse);\n }\n\n private static void WriteDouble(T d)\n {\n Console.WriteLine(string.Format(\"{0:0.000000000}\", d).Replace(',', '.'));\n }\n\n private static void WL(T s)\n {\n Console.WriteLine(s);\n }\n\n private static void W(T s)\n {\n Console.Write(s);\n }\n\n private static void Assert(bool b)\n {\n if (!b) throw new Exception();\n }\n\n private static void Swap(ref T a, ref T b)\n {\n var temp = a;\n a = b;\n b = temp;\n }\n\n #endregion\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "ea9876204117c039e49cfb9d368930df", "src_uid": "023b169765e81d896cdc1184e5a82b22", "apr_id": "18d64da77f8f48a9a008bf4643972eec", "difficulty": 1100, "tags": ["math", "implementation"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.7611548556430446, "equal_cnt": 10, "replace_cnt": 5, "delete_cnt": 1, "insert_cnt": 3, "fix_ops_cnt": 9, "bug_source_code": "using System;\nusing System.Text;\nusing System.Collections.Generic;\nusing System.Collections;\nclass Problem\n{\n static void Main()\n {\n string[] str = Console.ReadLine().Split();\n int n = Convert.ToInt32( str[0] );\n int m = Convert.ToInt32( str[1] );\n int kq = n;\n while(n / m >= 1)\n {\n kq += n / m;\n if(n / m == 1 && kq % m == 0)\n {\n kq++;\n continue;\n }\n else\n n /= m;\n }\n Console.WriteLine( kq );\n }\n}", "lang": "Mono C#", "bug_code_uid": "78ecb730737600d164c273f6cc54a244", "src_uid": "42b25b7335ec01794fbb1d4086aa9dd0", "apr_id": "e016157cec6ebd2a924fc3f27b8dcb55", "difficulty": 900, "tags": ["math", "brute force", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9992479318124843, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "#if DEBUG\nusing System.Reflection;\nusing System.Threading.Tasks;\n#endif\n\nusing System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\nusing System.Text;\nusing System.Numerics;\nusing System.Globalization;\n\n\nnamespace _13d\n{\n class Program\n {\n static string _inputFilename = \"input.txt\";\n static string _outputFilename = \"output.txt\";\n static bool _useFileInput = false;\n\n\n static void Main(string[] args)\n {\n StreamWriter file = null;\n#if DEBUG\n\t\t\tConsole.SetIn(getInput());\n#else\n if (_useFileInput)\n {\n Console.SetIn(File.OpenText(_inputFilename));\n file = new StreamWriter(_outputFilename);\n Console.SetOut(file);\n }\n#endif\n\n try\n {\n solution();\n }\n finally\n {\n if (_useFileInput)\n {\n file.Close();\n }\n }\n }\n\n static int mod = 1000 * 1000 * 1000 + 7;\n static void mult(long[,] a, long[,] b, long[,] res, int n)\n {\n for (int i = 0; i < n; i++)\n {\n for (int j = 0; j < n; j++)\n {\n res[i, j] = 0;\n for (int k = 0; k < n; k++)\n {\n res[i, j] += a[i, k] * b[k, j] % mod;\n res[i, j] %= mod;\n }\n }\n }\n }\n\n static void copy(long[,] from, long[,] to, int n)\n {\n for (int i = 0; i < n; i++)\n {\n for (int k = 0; k < n; k++)\n {\n to[i, k] = from[i, k];\n }\n }\n }\n\n static void pow(long[,] a, long p, int n)\n {\n var temp = new long[n, n];\n var res = new long[n, n];\n for (int i = 0; i < n; i++)\n {\n res[i, i] = 1;\n }\n\n while (true)\n {\n var rem = p % 2;\n if (rem == 1)\n {\n mult(res, a, temp, n);\n copy(temp, res, n);\n }\n\n if (p == 1)\n {\n break;\n }\n\n p /= 2;\n mult(a, a, temp, n);\n copy(temp, a, n);\n }\n\n copy(res, a, n);\n }\n\n static void solution()\n {\n #region SOLUTION\n var d = readLongArray();\n var a = d[0];\n var b = d[1];\n var n = d[2];\n var x = d[3];\n\n var mm = new long[2, 2];\n mm[0, 0] = a;\n mm[0, 1] = b;\n mm[1, 0] = 0;\n mm[1, 1] = 1;\n\n pow(mm, n, 2);\n\n var res = x * mm[0, 0] % mod + mm[0, 1];\n Console.WriteLine(res);\n\n //var n = readInt();\n //var m = readInt();\n\n //var a = readIntArray();\n //var b = readIntArray();\n #endregion\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[] readIntArray()\n {\n return Console.ReadLine().Split(' ').Where(i => !string.IsNullOrEmpty(i)).Select(i => int.Parse(i)).ToArray();\n }\n\n static long[] readLongArray()\n {\n return Console.ReadLine().Split(' ').Where(i => !string.IsNullOrEmpty(i)).Select(i => long.Parse(i)).ToArray();\n }\n\n#if DEBUG\n\t\tstatic StreamReader getInput()\n\t\t{\n\t\t\tvar resName = Assembly.GetCallingAssembly().GetManifestResourceNames()[0];\n\t\t\tvar resource = Assembly.GetCallingAssembly().GetManifestResourceStream(resName);\n\n\t\t\treturn new StreamReader(resource);\n\t\t}\n#endif\n }\n}\n", "lang": "MS C#", "bug_code_uid": "1888620e0410425a9d72faeb36ed2de6", "src_uid": "e22a1fc38c8b2a4cc30ce3b9f893028e", "apr_id": "dd9b45480aa12d4449cb12910e6a2767", "difficulty": 1700, "tags": ["math", "number theory"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.9984976308794637, "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.Globalization;\nusing System.IO;\nusing System.Linq;\nusing System.Text;\nusing System.Threading;\n\n// (づ°ω°)づミe★゜・。。・゜゜・。。・゜☆゜・。。・゜゜・。。・゜\npublic class Solver\n{\n private const int MOD = 1000000007;\n\n long ModPow(long x, long p)\n {\n long ret = 1;\n while (p > 0)\n {\n if ((p & 1) == 1)\n ret = ret * x % MOD;\n x = x * x % MOD;\n p >>= 1;\n }\n return ret;\n }\n\n public void Solve()\n {\n int a = ReadInt();\n int b = ReadInt();\n long n = ReadLong();\n int x = ReadInt();\n\n if (a == 1)\n {\n Write((x + 1L * n * b) % MOD);\n return;\n }\n\n long ans = x * ModPow(a, n % (MOD - 1));\n ans += (ModPow(a, n % (MOD - 1)) + MOD - 1) % MOD * ModPow(a - 1, MOD - 2) % MOD * b;\n Write(ans % MOD);\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 new Solver().Solve();\n //var thread = new Thread(new Solver().Solve, 1024 * 1024 * 128);\n //thread.Start();\n //thread.Join();\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": "8e9f7fd97eb71796dfd45292dbbe9b94", "src_uid": "e22a1fc38c8b2a4cc30ce3b9f893028e", "apr_id": "94427c2507db4dceab144e4e2a6b7acc", "difficulty": 1700, "tags": ["math", "number theory"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.7857935627081021, "equal_cnt": 11, "replace_cnt": 4, "delete_cnt": 3, "insert_cnt": 3, "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 Jzzhu_and_Sequences\n{\n class Program\n {\n static void Main(string[] args)\n {\n string[] input = Console.ReadLine().Split(' ');\n int x = Int32.Parse(input[0]);\n int y = Int32.Parse(input[1]);\n int n = Int32.Parse(Console.ReadLine());\n int[] f = new int[6] { x, y, y - x, -x, -y, x - y };\n int res = n % 6;\n //Console.WriteLine(res);\n //Console.WriteLine(f[res - 1]);\n if (f[res - 1] >= 0)\n Console.WriteLine(f[res - 1] % (1000000007));\n else\n Console.WriteLine(1000000007 + (f[res - 1] % (1000000007)));\n Console.ReadLine();\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "59bea34658db152f3708d6a938139d57", "src_uid": "2ff85140e3f19c90e587ce459d64338b", "apr_id": "c94dd9c607a5278046b6e53aa19438e8", "difficulty": 1300, "tags": ["math", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9942047649710238, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "using System;\nusing System.Collections;\nusing System.Collections.Generic;\n \nclass TEST{\n\tstatic void Main(){\n\t\tSol mySol =new Sol();\n\t\tmySol.Solve();\n\t}\n}\n\nclass Sol{\n\tpublic void Solve(){\n\t\tvar d=rla();\n\t\tvar N=rl();\n\t\tmod=(long)1e9+7;\n\t\tif(N==1){\n\t\t\td[0]%=mod;\n\t\t\tif(d[0]<0)d[0]+=mod;\n\t\t\tConsole.WriteLine(\"{0}\",d[0]);\n\t\t\treturn;\n\t\t}\n\t\tif(N==2){\n\t\t\td[1]%=mod;\n\t\t\tif(d[1]<0)d[1]+=mod;\n\t\t\tConsole.WriteLine(\"{0}\",d[1]);\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t\n\t\tint M=1;\n\t\twhile(N>(0x1<>i )& 0x1)>0){\n\t\t\t\tlong[] DD=new long[4]{D[0],D[1],D[2],D[3]};\n\t\t\t\tD[0]=Arr[i][0]*DD[0]+Arr[i][1]*DD[2];\n\t\t\t\tD[1]=Arr[i][0]*DD[1]+Arr[i][1]*DD[3];\n\t\t\t\tD[2]=Arr[i][2]*DD[0]+Arr[i][3]*DD[2];\n\t\t\t\tD[3]=Arr[i][2]*DD[1]+Arr[i][3]*DD[3];\n\t\t\t\tD[0]%=mod;\n\t\t\t\tD[1]%=mod;\n\t\t\t\tD[2]%=mod;\n\t\t\t\tD[3]%=mod;\n\t\t\t\tif(D[0]<0)D[0]+=mod;\n\t\t\t\tif(D[1]<0)D[1]+=mod;\n\t\t\t\tif(D[2]<0)D[2]+=mod;\n\t\t\t\tif(D[3]<0)D[3]+=mod;\n\t\t\t}\n\t\t}\n\n\n\t\t\n\t\tlong ans=D[0]*d[1]+D[1]*d[0];\n\t\tans%=mod;\n\t\tif(ans<0)ans+=mod;\n\t\tConsole.WriteLine(ans);\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t}\n\tlong mod;\n\tpublic Sol(){\n\t}\n\n\n\n\n\tstatic String rs(){return Console.ReadLine();}\n\tstatic int ri(){return int.Parse(Console.ReadLine());}\n\tstatic long rl(){return long.Parse(Console.ReadLine());}\n\tstatic double rd(){return double.Parse(Console.ReadLine());}\n\tstatic String[] rsa(){return Console.ReadLine().Split(' ');}\n\tstatic int[] ria(){return Array.ConvertAll(Console.ReadLine().Split(' '),e=>int.Parse(e));}\n\tstatic long[] rla(){return Array.ConvertAll(Console.ReadLine().Split(' '),e=>long.Parse(e));}\n\tstatic double[] rda(){return Array.ConvertAll(Console.ReadLine().Split(' '),e=>double.Parse(e));}\n}\n", "lang": "Mono C#", "bug_code_uid": "86a60832a028534c3119eaa661bd7e8a", "src_uid": "2ff85140e3f19c90e587ce459d64338b", "apr_id": "0120dee20084b6fe9a55720866484c07", "difficulty": 1300, "tags": ["math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.6546139359698682, "equal_cnt": 19, "replace_cnt": 7, "delete_cnt": 4, "insert_cnt": 9, "fix_ops_cnt": 20, "bug_source_code": "namespace Jzzhu\n{\n class Program\n {\n static void Main(string[] args)\n {\n JzzhuSequence jzzhu = new JzzhuSequence();\n\n string text = Console.ReadLine();\n\n int x = int.Parse(text.Split(' ')[0]);\n int y = int.Parse(text.Split(' ')[1]);\n\n text = Console.ReadLine();\n int n = int.Parse(text);\n\n Console.Write(jzzhu.Module(jzzhu.Calculate(x, y, n), 1000000007));\n }\n }\n\n class JzzhuSequence\n {\n\n public int Calculate(int x, int y, int n)\n {\n if (n == 1)\n {\n return x;\n }\n else if (n == 2)\n {\n return y;\n }\n else\n {\n double rad = (n / 3) * Math.PI;\n\n double res = (x - y) * Math.Cos(rad) + (x + y) * Math.Sqrt(3) * Math.Sin(rad);\n\n return (int)res;\n\n //int i = Calculate(x, y, n - 1) - Calculate(x, y, n - 2);\n //return i;\n }\n }\n\n public int Module(int dividend, int divisor)\n {\n int remainder = 0;\n\n if(dividend < 0)\n {\n remainder = divisor + dividend;\n }\n else\n {\n remainder = dividend % divisor;\n }\n\n return remainder;\n }\n }\n \n \n}", "lang": "Mono C#", "bug_code_uid": "d6da298febb5e2da57ddede952ccb058", "src_uid": "2ff85140e3f19c90e587ce459d64338b", "apr_id": "3c6018381a99450fdfa2dab97ea19fa8", "difficulty": 1300, "tags": ["math", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.8527558152858944, "equal_cnt": 19, "replace_cnt": 11, "delete_cnt": 4, "insert_cnt": 3, "fix_ops_cnt": 18, "bug_source_code": "#define TRACE\n#undef DEBUG\n/*\nAuthor: w1ld [dog] inbox [dot] ru\n\n */\nusing System;\nusing System.Collections.Generic;\nusing System.Globalization;\nusing System.IO;\nusing System.Linq;\nusing System.Text;\nusing System.Threading;\nusing System.Diagnostics;\nusing static System.Math;\n\npublic class Solver\n{\n public void Solve()\n {\n int x = ReadInt();\n int y = ReadInt();\n int n = ReadInt();\n // f3 = f2 - f1\n // f4 = f3 - f2\n // f5 = f4 - f3\n // ...\n // fn = f{n-1} - f{n-2}\n // fn = f{n-2} - f{n-3} - (f{n-3} - f{n-4}) \n // fn = f{n-2} - 2*f{n-3} + f{n-4}\n // fn = f{n-3} - fn-4 - 2*(f{n-4} - fn-5) + f{n-5} - f(n-6)\n // fn = f{n-3} - fn-4 - 2*(f{n-4} - fn-5) + f{n-5} - f(n-6)\n //\n //\n\n n -= 2;\n const int MOD = (int)(1e9 + 7);\n y %= MOD;\n if (y < 0) y += MOD;\n while (n > 0)\n {\n int z = (y - x) % MOD;\n if (z < 0)\n z += MOD;\n x = y;\n y = z;\n n -= 1;\n }\n Write(y);\n }\n\n #region Main\n\n protected static TextReader reader;\n protected static TextWriter writer;\n static void Main()\n {\n Debug.Listeners.Clear();\n Debug.Listeners.Add(new ConsoleTraceListener());\n Trace.Listeners.Clear();\n Trace.Listeners.Add(new ConsoleTraceListener());\n\n reader = new StreamReader(Console.OpenStandardInput());\n writer = new StreamWriter(Console.OpenStandardOutput());\n new Solver().Solve();\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}\n", "lang": "Mono C#", "bug_code_uid": "ee248e63134c5c796037f31b694416e3", "src_uid": "2ff85140e3f19c90e587ce459d64338b", "apr_id": "e385fbaf30b6623c31edb750b4aa9d71", "difficulty": 1300, "tags": ["math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9951881014873141, "equal_cnt": 4, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Text;\nusing System.IO;\nusing System.Linq;\n\nclass Program\n{\n private static int Solve(int a, int b)\n {\n if (a < 1 || b < 1) return 0;\n\n if (dp[a, b] > 0) return dp[a, b];\n\n int answer = 1 + Math.Max(Solve(a + 1, b - 2), Solve(a - 2, b + 1));\n dp[a, b] = answer;\n return answer;\n }\n\n private static int[,] dp = new int[103, 103];\n static void Main(string[] args)\n {\n Console.Write(Solve(ReadInt(), ReadInt()));\n }\n\n private static List[] ReadGraph(int n, int m)\n {\n List[] g = new List[n + 1];\n for (int i = 0; i <= n; i++) g[i] = new List();\n for (int i = 0; i < m; i++)\n {\n var a = ReadInt();\n var b = ReadInt();\n\n g[a].Add(b);\n g[b].Add(a);\n }\n\n return g;\n }\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 << 12;\n private static readonly StreamReader consoleReader = new StreamReader(Console.OpenStandardInput(BufferSize), Encoding.ASCII, false, BufferSize);\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 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');\n\n List s = new List();\n //int pos = 0;\n do\n {\n s.Add((char)ans);\n ans = consoleReader.Read();\n } while (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');\n\n char[] s = new char[n];\n int pos = 0;\n do\n {\n s[pos++] = (char)ans;\n ans = consoleReader.Read();\n } while (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 while (true)\n {\n int ans = consoleReader.Read();\n if (ans >= '0' && ans <= '9')\n return (char)ans - (int)'0';\n }\n }\n\n private static char ReadAnyChar()\n {\n return (char)consoleReader.Read();\n }\n}", "lang": "MS C#", "bug_code_uid": "7f2a0e41debad55e776ef08b061ebe5e", "src_uid": "ba0f9f5f0ad4786b9274c829be587961", "apr_id": "cc03adbd8df9c4e3beeb9bc7faeba550", "difficulty": 1100, "tags": ["dp", "greedy", "math", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9450087963225696, "equal_cnt": 16, "replace_cnt": 11, "delete_cnt": 1, "insert_cnt": 3, "fix_ops_cnt": 15, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Diagnostics;\nusing System.IO;\nusing System.Linq;\nusing System.Numerics;\nusing System.Text;\n\nnamespace CodeforcesTemplate\n{\n public static class Permutation\n {\n private static bool Next(ref int[] arr)\n {\n int k, j, l;\n for (j = arr.Length - 2; (j >= 0) && (arr[j] >= arr[j + 1]); j--) { }\n if (j == -1)\n {\n arr = arr.OrderBy(c => c).ToArray();\n return false;\n }\n for (l = arr.Length - 1; (arr[j] >= arr[l]) && (l >= 0); l--) { }\n var tmp = arr[j];\n arr[j] = arr[l];\n arr[l] = tmp;\n for (k = j + 1, l = arr.Length - 1; k < l; k++, l--)\n {\n tmp = arr[k];\n arr[k] = arr[l];\n arr[l] = tmp;\n }\n return true;\n }\n public static IEnumerable AllPermutations(int[] arr)\n {\n do yield return arr;\n while (Next(ref arr));\n }\n }\n\n class Program\n {\n private const string FILENAME = \"distance4\";\n\n private const string INPUT = FILENAME + \".in\";\n\n private const string OUTPUT = FILENAME + \".out\";\n\n private static Stopwatch _stopwatch = new Stopwatch();\n\n private static StreamReader _reader = null;\n private static StreamWriter _writer = null;\n\n private static string[] _curLine;\n private static int _curTokenIdx;\n\n private static char[] _whiteSpaces = new char[] { ' ', '\\t', '\\r', '\\n' };\n\n static int Count(string source, string key)\n {\n\n\n List indices = new List();\n\n int index = source.IndexOf(key, 0);\n\n while (index > -1)\n {\n indices.Add(index);\n index = source.IndexOf(key, index + key.Length);\n }\n\n return indices.Count();\n }\n\n public static string Check(string s)\n {\n string letters = \"aeiouy\";\n\n while (true)\n {\n bool used = false;\n\n for (int i = 0; i < s.Length - 1; i++)\n {\n if (letters.Contains(s[i].ToString()) && letters.Contains(s[i + 1].ToString()))\n {\n s = s.Remove(i + 1, 1);\n\n used = true;\n }\n }\n\n if (!used)\n {\n return s;\n }\n }\n }\n\n private static string ReadNextToken()\n {\n if (_curTokenIdx >= _curLine.Length)\n {\n //Read next line\n string line = _reader.ReadLine();\n if (line != null)\n _curLine = line.Split(_whiteSpaces, StringSplitOptions.RemoveEmptyEntries);\n else\n _curLine = new string[] { };\n _curTokenIdx = 0;\n }\n\n if (_curTokenIdx >= _curLine.Length)\n return null;\n\n return _curLine[_curTokenIdx++];\n }\n\n private static int ReadNextInt()\n {\n return int.Parse(ReadNextToken());\n }\n\n private static void RunTimer()\n {\n#if (DEBUG)\n\n _stopwatch.Start();\n\n#endif\n }\n\n private static void Main(string[] args)\n {\n\n#if (DEBUG)\n double before = GC.GetTotalMemory(false);\n#endif\n int N = int.Parse(Console.ReadLine());\n\n string s = Console.ReadLine();\n\n int max = 0;\n\n for (int i = 1; i <= N; i++)\n {\n if (2 * i > N)\n {\n break;\n }\n \n if (s.Substring(0, i).Equals(s.Substring(i, 2 * i)))\n {\n max = i;\n }\n \n }\n\n Console.WriteLine(Math.Min((N - 2 * max) + max + 1, N));\n\n\n\n\n\n\n#if (DEBUG)\n _stopwatch.Stop();\n\n double after = GC.GetTotalMemory(false);\n\n double consumedInMegabytes = (after - before) / (1024 * 1024);\n\n Console.WriteLine($\"Time elapsed: {_stopwatch.Elapsed}\");\n\n Console.WriteLine($\"Consumed memory (MB): {consumedInMegabytes}\");\n\n Console.ReadKey();\n#endif\n\n\n }\n\n private static int CountLeadZeros(string source)\n {\n int countZero = 0;\n\n for (int i = source.Length - 1; i >= 0; i--)\n {\n if (source[i] == '0')\n {\n countZero++;\n }\n\n else\n {\n break;\n }\n\n }\n\n return countZero;\n }\n\n private static string ReverseString(string source)\n {\n char[] reverseArray = source.ToCharArray();\n\n Array.Reverse(reverseArray);\n\n string reversedString = new string(reverseArray);\n\n return reversedString;\n }\n\n\n private static int[] CopyOfRange(int[] src, int start, int end)\n {\n int len = end - start;\n int[] dest = new int[len];\n Array.Copy(src, start, dest, 0, len);\n return dest;\n }\n\n private static string StreamReader()\n {\n\n if (_reader == null)\n _reader = new StreamReader(INPUT);\n string response = _reader.ReadLine();\n if (_reader.EndOfStream)\n _reader.Close();\n return response;\n\n\n }\n\n private static void StreamWriter(string text)\n {\n\n if (_writer == null)\n _writer = new StreamWriter(OUTPUT);\n _writer.WriteLine(text);\n\n\n }\n\n\n\n\n\n private static int BFS(int start, int end, int[,] arr)\n {\n Queue> queue = new Queue>();\n List visited = new List();\n for (int i = 0; i < arr.GetLength(0); i++)\n {\n visited.Add(false);\n }\n\n queue.Enqueue(new KeyValuePair(start, 0));\n KeyValuePair node;\n int level = 0;\n bool flag = false;\n\n while (queue.Count != 0)\n {\n node = queue.Dequeue();\n if (node.Key == end)\n {\n return node.Value;\n }\n flag = false;\n for (int i = 0; i < arr.GetLength(0); i++)\n {\n\n if (arr[node.Key, i] == 1)\n {\n if (visited[i] == false)\n {\n if (!flag)\n {\n level = node.Value + 1;\n flag = true;\n }\n queue.Enqueue(new KeyValuePair(i, level));\n visited[i] = true;\n }\n }\n }\n\n }\n return 0;\n\n }\n\n\n\n private static void Write(string source)\n {\n File.WriteAllText(OUTPUT, source);\n }\n\n private static string ReadString()\n {\n return File.ReadAllText(INPUT);\n }\n\n private static void WriteStringArray(string[] source)\n {\n File.WriteAllLines(OUTPUT, source);\n }\n\n private static string[] ReadStringArray()\n {\n return File.ReadAllLines(INPUT);\n }\n\n private static int[] GetIntArray()\n {\n return ReadString().Split(' ').Select(int.Parse).ToArray();\n }\n\n private static double[] GetDoubleArray()\n {\n return ReadString().Split(' ').Select(double.Parse).ToArray();\n }\n\n private static int[,] ReadINT2XArray(List lines)\n {\n int[,] arr = new int[lines.Count, lines.Count];\n\n for (int i = 0; i < lines.Count; i++)\n {\n int[] row = lines[i].Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries).Select(int.Parse).ToArray();\n\n for (int j = 0; j < lines.Count; j++)\n {\n arr[i, j] = row[j];\n }\n }\n\n return arr;\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "8e19cefd212060eab100eea11f94a0ba", "src_uid": "ed8725e4717c82fa7cfa56178057bca3", "apr_id": "c7f6bbada78cd89cbfa936ac07568aa6", "difficulty": 1400, "tags": ["strings", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9541666666666667, "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.Text;\nusing System.Threading.Tasks;\n\nnamespace Codeforces\n{ \n class B\n {\n static void Main(string[] args)\n {\n int n = int.Parse(Console.ReadLine());\n string s = Console.ReadLine();\n \n int ans = n;\n int dup = 0;\n \n int up = (n%2==0)?n/2:(n-1)/2;\n string m1 = s[0] + \"\" + s[1];\n \n for(int i=2;i<=up;i++){\n string m2 = \"\";\n for(int j=i; ;j++){\n m2 += s[j]+\"\";\n if(m2.Length==i)break;\n }\n \n if(m2==m1){\n dup = Math.Max(dup,m2.Length);\n }\n\n m1 += s[i]+\"\";\n \n }\n \n if(dup>1){\n ans -= dup;\n ans++;\n }\n \n Console.WriteLine(ans);\n \n \n }\n }\n}\n \n\n", "lang": "Mono C#", "bug_code_uid": "97dd1ae136e7997225fc5710615cd54d", "src_uid": "ed8725e4717c82fa7cfa56178057bca3", "apr_id": "cdb994435f7b2763babe9b0cd1a42644", "difficulty": 1400, "tags": ["strings", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.4855813953488372, "equal_cnt": 13, "replace_cnt": 7, "delete_cnt": 3, "insert_cnt": 3, "fix_ops_cnt": 13, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Globalization;\nusing System.Linq;\n\nnamespace Achill\n{\n class Program\n {\n static void Main(string[] args)\n {\n int n = int.Parse(Console.ReadLine());\n int res = 0;\n for(int i = 1; i <= n; ++i)\n {\n res += i.ToString().Length;\n }\n Console.WriteLine(res);\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "728ec01d5121bd149ed822aa89b2b3ec", "src_uid": "4e652ccb40632bf4b9dd95b9f8ae1ec9", "apr_id": "7c56782131d8a190831eab43f4945677", "difficulty": 1200, "tags": ["math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9582689335394127, "equal_cnt": 4, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "using System;\nclass Program\n {\n static void Main(string[] args)\n {\n int[] db = {0, 9, 108, 1107, 11106, 111105, 1111104, 11111103, 111111102};\n string inpt = Console.ReadLine();\n Console.WriteLine(inpt.Length * int.Parse(inpt) - db[inpt.Length - 1]);\n }\n }", "lang": "Mono C#", "bug_code_uid": "b1bd1cf8927e33ce0e6a07e649752fae", "src_uid": "4e652ccb40632bf4b9dd95b9f8ae1ec9", "apr_id": "6a58180340a577a4284fc45990def75b", "difficulty": 1200, "tags": ["math", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.2888030888030888, "equal_cnt": 10, "replace_cnt": 7, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 9, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\n\nnamespace ConsoleApplication6\n{\n class Program\n {\n static void Main(string[] args)\n {\n int input = int.Parse(Console.ReadLine());\n int ans = 0;\n for (int i = 1; i <= input; i++)\n {\n ans += i.ToString().Count();\n }\n Console.WriteLine(ans);\n }\n }\n}", "lang": "Mono C#", "bug_code_uid": "e7299ffa2642bbe08512a294cd83e784", "src_uid": "4e652ccb40632bf4b9dd95b9f8ae1ec9", "apr_id": "5b433c2e7b6f44cf0ab23120ee0320db", "difficulty": 1200, "tags": ["math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9639786195677434, "equal_cnt": 13, "replace_cnt": 10, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 12, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\n\nnamespace ConsoleApplication6\n{\n class Program\n {\n static void Main(string[] args)\n {\n int input = int.Parse(Console.ReadLine());\n int ans = 0;\n\n if (input <= 9)\n {\n ans = input;\n }\n else if (input <= 99)\n {\n ans = 9 * 1 + (input - 9) * 2;\n }\n else if (input <= 999)\n {\n ans = 9 * 1 + (99 - 9) * 2 + (999 - 99) * 3;\n }\n else if (input <= 9999)\n {\n ans = 9 * 1 + (99 - 9) * 2 + (999 - 99) * 3 + (9999 - 999) * 4;\n }\n else if (input <= 99999)\n {\n ans = 9 * 1 + (99 - 9) * 2 + (999 - 99) * 3 + (9999 - 999) * 4 + (99999 - 9999) * 5;\n }\n else if (input <= 999999)\n {\n ans = 9 * 1 + (99 - 9) * 2 + (999 - 99) * 3 + (9999 - 999) * 4 + (99999 - 9999) * 5 + (999999 - 99999) * 6;\n }\n else if (input <= 9999999)\n {\n ans = 9 * 1 + (99 - 9) * 2 + (999 - 99) * 3 + (9999 - 999) * 4 + (99999 - 9999) * 5 + (999999 - 99999) * 6 + (9999999 - 999999) * 7;\n }\n else if (input <= 99999999)\n {\n ans = 9 * 1 + (99 - 9) * 2 + (999 - 99) * 3 + (9999 - 999) * 4 + (99999 - 9999) * 5 + (999999 - 99999) * 6 + (9999999 - 999999) * 7 + (99999999 - 9999999) * 8;\n }\n else if (input <= 999999999)\n {\n ans = 9 * 1 + (99 - 9) * 2 + (999 - 99) * 3 + (9999 - 999) * 4 + (99999 - 9999) * 5 + (999999 - 99999) * 6 + (9999999 - 999999) * 7 + (99999999 - 9999999) * 8 + (999999999 - 9999999) * 9;\n }\n else if (input == 1000000000)\n {\n ans = 9 * 1 + (99 - 9) * 2 + (999 - 99) * 3 + (9999 - 999) * 4 + (99999 - 9999) * 5 + (999999 - 99999) * 6 + (9999999 - 999999) * 7 + (99999999 - 9999999) * 8 + (999999999 - 9999999) * 9 + 10;\n }\n Console.WriteLine(ans);\n }\n }\n}", "lang": "Mono C#", "bug_code_uid": "a6f4841b8e123a181d759ec354307b32", "src_uid": "4e652ccb40632bf4b9dd95b9f8ae1ec9", "apr_id": "5b433c2e7b6f44cf0ab23120ee0320db", "difficulty": 1200, "tags": ["math", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.6022988505747127, "equal_cnt": 14, "replace_cnt": 10, "delete_cnt": 3, "insert_cnt": 1, "fix_ops_cnt": 14, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\n\nnamespace Codeforces_Proj\n{\n\tclass MainClass\n\t{\n\t\tpublic static void Main(string[] args){\n\t\t\tint answer = 0;\n\t\t\tint N = int.Parse(Console.ReadLine());\n\t\t\tfor (int i = 1; i <= N; i++)\n\t\t\t{\n\t\t\t\tanswer += (i.ToString()).Length;\n\t\t\t}\n\t\t\tConsole.WriteLine(answer); \n\t\t}\n\t}\n}", "lang": "Mono C#", "bug_code_uid": "c3ea0ae4bdb02a0186477bc6f79d1377", "src_uid": "4e652ccb40632bf4b9dd95b9f8ae1ec9", "apr_id": "d6a5a76fb214d8d9006c2d6026cc2bdc", "difficulty": 1200, "tags": ["math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9245773732119635, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "using System;\n\nclass Program\n{\n\tstatic void Main(string[] args)\n\t{\n\t var ss = Console.ReadLine().Trim().Split(' ');\n var n = int.Parse(ss[0]);\n var m = int.Parse(ss[1]);\n var GL = true;\n var HF = false;\n\t\tstring s = Console.ReadLine();\n\t\tfor (int i=0; i+m+1<=n; i++)\n\t\t{\n\t\t var ok = false;\n\t\t for (int j=0; j<=m; j++)\n\t if (s[i+j] != 'N')\n\t\t ok = true;\n\t\t\tif (!ok)\n\t\t\t GL = false;\n\t\t}\n\t\tfor (int i=0; i+m<=n; i++)\n\t\t{\n\t\t var ok = true;\n\t\t for (int j=0; j currentLineTokens = new Queue();\n private static string[] ReadAndSplitLine()\n {\n return Console.ReadLine().Split(new[] { ' ', '\\t' }, StringSplitOptions.RemoveEmptyEntries);\n }\n public int ReadNextInt()\n {\n return int.Parse(ReadToken());\n }\n public long ReadNextLong()\n {\n return long.Parse(ReadToken());\n }\n\n public int ReadInt()\n {\n return Convert.ToInt32(Console.ReadLine());\n }\n public long ReadLong()\n {\n return Convert.ToInt64(Console.ReadLine());\n }\n public string ReadStr()\n {\n return Console.ReadLine();\n }\n public string[] ReadStrArr()\n {\n return Console.ReadLine().Split(' ');\n }\n public int[] ReadIntArr()\n {\n return Array.ConvertAll(Console.ReadLine().Split(' '), s => int.Parse(s));\n }\n public long[] ReadLongArr()\n {\n return Array.ConvertAll(Console.ReadLine().Split(' '), s => long.Parse(s));\n }\n public void PutStr(string str)\n {\n Console.WriteLine(str);\n }\n public void PutStr(int str)\n {\n Console.WriteLine(str);\n }\n public void PutStr(long str)\n {\n Console.WriteLine(str);\n }\n\n public static string ReadToken()\n {\n while (currentLineTokens.Count == 0)\n currentLineTokens = new Queue(ReadAndSplitLine());\n return currentLineTokens.Dequeue();\n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "aff698fe599fc595150d54275ce369db", "src_uid": "b16f5f5c4eeed2a3700506003e8ea8ea", "apr_id": "0baf95a0b79d2bc172932d438566ecc3", "difficulty": 900, "tags": ["greedy", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.7324478178368121, "equal_cnt": 23, "replace_cnt": 11, "delete_cnt": 9, "insert_cnt": 2, "fix_ops_cnt": 22, "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 B\n {\n static void Main(string[] args)\n {\n string[] token = Console.ReadLine().Split();\n int l = int.Parse(token[0]);\n int r = int.Parse(token[1]);\n int x = int.Parse(token[2]);\n int y = int.Parse(token[3]); \n int k = int.Parse(token[4]);\n \n for(;l();\n foreach (var c in sc.ScanLine())\n h[c]++;\n var a = h.Select(x => x.Value).OrderBy(x => x).ToArray();\n if (a.Length == 1)//\n Printer.PrintLine(1);\n else if (a.Length == 2)\n {\n var min = a[0];\n if (min == 1)\n Printer.PrintLine(1);//\n else if (min == 2)\n Printer.PrintLine(2);//\n else if (min == 3)\n {\n throw new Exception();\n Printer.PrintLine(4);\n }\n }\n else if (a.Length == 3)\n {\n if (a[0] == 1)\n {\n if (a[1] == 1)\n Printer.PrintLine(2);\n else Printer.PrintLine(3);//\n }\n else\n Printer.PrintLine(6);//\n }\n else if (a.Length == 4)\n {\n if (a[3] == 3)\n Printer.PrintLine(5);//\n else Printer.PrintLine(8);//\n }\n else if (a.Length == 5)\n Printer.PrintLine(15);//\n else if (a.Length == 6)\n Printer.PrintLine(30);//\n\n\n }\n\n static void Main()\n {\n#if DEBUG\n var ostream = new System.IO.FileStream(\"debug.txt\", System.IO.FileMode.Create, System.IO.FileAccess.Write);\n var iStream = new System.IO.FileStream(\"input.txt\", System.IO.FileMode.Open, System.IO.FileAccess.Read, System.IO.FileShare.ReadWrite);\n Console.SetIn(new System.IO.StreamReader(iStream));\n System.Diagnostics.Debug.AutoFlush = true;\n System.Diagnostics.Debug.Listeners.Add(new System.Diagnostics.TextWriterTraceListener(new System.IO.StreamWriter(ostream, System.Text.Encoding.UTF8)));\n try\n {\n#endif\n var solver = new Solver();\n solver.Solve();\n#if DEBUG\n }\n catch (Exception ex)\n {\n Console.WriteLine(ex.Message);\n Console.WriteLine(ex.StackTrace);\n }\n Console.ReadKey(true);\n#endif\n }\n _Scanner sc = new _Scanner();\n\n}\nstatic public class Printer\n{\n static readonly private System.IO.TextWriter writer;\n static readonly private System.Globalization.CultureInfo info;\n static string Separator { get; set; }\n static Printer()\n {\n writer = Console.Out;\n info = System.Globalization.CultureInfo.InvariantCulture;\n Separator = \" \";\n }\n\n static public void Print(int num) { writer.Write(num.ToString(info)); }\n static public void Print(int num, string format) { writer.Write(num.ToString(format, info)); }\n static public void Print(long num) { writer.Write(num.ToString(info)); }\n static public void Print(long num, string format) { writer.Write(num.ToString(format, info)); }\n static public void Print(double num) { writer.Write(num.ToString(info)); }\n static public void Print(double num, string format) { writer.Write(num.ToString(format, info)); }\n static public void Print(string str) { writer.Write(str); }\n static public void Print(string format, params object[] arg) { writer.Write(format, arg); }\n static public void Print(IEnumerable sources) { writer.Write(sources.AsString()); }\n static public void Print(params object[] arg)\n {\n var res = new System.Text.StringBuilder();\n foreach (var x in arg)\n {\n res.AppendFormat(info, \"{0}\", x);\n if (!string.IsNullOrEmpty(Separator))\n res.Append(Separator);\n }\n writer.Write(res.ToString(0, res.Length - Separator.Length));\n }\n static public void Print(IEnumerable sources)\n {\n var res = new System.Text.StringBuilder();\n foreach (var x in sources)\n {\n res.AppendFormat(info, \"{0}\", x);\n if (string.IsNullOrEmpty(Separator))\n res.Append(Separator);\n }\n writer.Write(res.ToString(0, res.Length - Separator.Length));\n }\n static public void PrintLine(int num) { writer.WriteLine(num.ToString(info)); }\n static public void PrintLine(int num, string format) { writer.WriteLine(num.ToString(format, info)); }\n static public void PrintLine(long num) { writer.WriteLine(num.ToString(info)); }\n static public void PrintLine(long num, string format) { writer.WriteLine(num.ToString(format, info)); }\n static public void PrintLine(double num) { writer.WriteLine(num.ToString(info)); }\n static public void PrintLine(double num, string format) { writer.WriteLine(num.ToString(format, info)); }\n static public void PrintLine(string str) { writer.WriteLine(str); }\n static public void PrintLine(string format, params object[] arg) { writer.WriteLine(format, arg); }\n static public void PrintLine(IEnumerable sources) { writer.WriteLine(sources.AsString()); }\n static public void PrintLine(params object[] arg)\n {\n var res = new System.Text.StringBuilder();\n foreach (var x in arg)\n {\n res.AppendFormat(info, \"{0}\", x);\n if (!string.IsNullOrEmpty(Separator))\n res.Append(Separator);\n }\n writer.WriteLine(res.ToString(0, res.Length - Separator.Length));\n }\n static public void PrintLine(IEnumerable sources)\n {\n var res = new System.Text.StringBuilder();\n foreach (var x in sources)\n {\n res.AppendFormat(info, \"{0}\", x);\n if (!string.IsNullOrEmpty(Separator))\n res.Append(Separator);\n }\n writer.WriteLine(res.ToString(0, res.Length - Separator.Length));\n }\n}\npublic class _Scanner\n{\n readonly private System.Globalization.CultureInfo info;\n readonly System.IO.TextReader reader;\n string[] buffer = new string[0];\n int position;\n\n public char[] Separator { get; set; }\n public _Scanner(System.IO.TextReader reader = null, string separator = null, System.Globalization.CultureInfo info = null)\n {\n\n this.reader = reader ?? Console.In;\n if (string.IsNullOrEmpty(separator))\n separator = \" \";\n this.Separator = separator.ToCharArray();\n this.info = info ?? System.Globalization.CultureInfo.InvariantCulture;\n }\n public string Scan()\n {\n if (this.position < this.buffer.Length)\n return this.buffer[this.position++];\n this.buffer = this.reader.ReadLine().Split(this.Separator, StringSplitOptions.RemoveEmptyEntries);\n this.position = 0;\n return this.buffer[this.position++];\n }\n\n public string[] ScanToEndLine()\n {\n if (this.position >= this.buffer.Length)\n return this.reader.ReadLine().Split(this.Separator, StringSplitOptions.RemoveEmptyEntries);\n var size = this.buffer.Length - this.position;\n var ar = new string[size];\n Array.Copy(this.buffer, position, ar, 0, size);\n return ar;\n\n }\n\n public string ScanLine()\n {\n if (this.position >= this.buffer.Length)\n return this.reader.ReadLine();\n else\n {\n var sb = new System.Text.StringBuilder();\n for (; this.position < buffer.Length; this.position++)\n {\n sb.Append(this.buffer[this.position]);\n sb.Append(' ');\n }\n return sb.ToString();\n }\n }\n public string[] ScanArray(int length)\n {\n var ar = new string[length];\n for (int i = 0; i < length; i++)\n {\n ar[i] = this.Scan();\n }\n return ar;\n }\n\n public int Integer()\n {\n return int.Parse(this.Scan(), info);\n }\n public long Long()\n {\n return long.Parse(this.Scan(), info);\n }\n public double Double()\n {\n return double.Parse(this.Scan(), info);\n }\n\n public int[] IntArray(int length)\n {\n var a = new int[length];\n for (int i = 0; i < length; i++)\n a[i] = this.Integer();\n return a;\n }\n public long[] LongArray(int length)\n {\n var a = new long[length];\n for (int i = 0; i < length; i++)\n a[i] = this.Long();\n return a;\n }\n public double[] DoubleArray(int length)\n {\n var a = new double[length];\n for (int i = 0; i < length; i++)\n a[i] = this.Double();\n return a;\n }\n\n}\nstatic public partial class EnumerableEx\n{\n static public string AsString(this IEnumerable source)\n {\n return new string(source.ToArray());\n }\n static public IEnumerable Enumerate(this int count, Func selector)\n {\n return Enumerable.Range(0, count).Select(x => selector(x));\n }\n}\nclass 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//*/", "lang": "MS C#", "bug_code_uid": "6875ddbd8d307853bfdb44d4c406ccfa", "src_uid": "8176c709c774fa87ca0e45a5a502a409", "apr_id": "7e6077515d8dfa5bfcc18d9130ef213c", "difficulty": 1700, "tags": ["brute force"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9938472674629026, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "using 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 List karta = new List(); List itogi = new List();\n string stroka = \"\"; ; string konec = \"\"; int a = 2; int itog = 0; int kol = 0; int dnei = 0; long y = 1; long minut = 0; string konec2 = \"\"; long[] strochenka = { 0, 0 }; List str = new List();\n konec = Console.ReadLine(); \n string[] split = konec.Split(new Char[] { ' ' });\n foreach (string s in split)\n {\n karta.Add(Convert.ToInt32(s));\n }\n karta.Sort();\n itog = karta.Sum();\n dnei = karta.Sum();\n foreach (int e in karta)\n {\n foreach (int t in karta)\n {\n if (t == e)\n {\n a--;\n if(a>=0)\n itog -= t;\n }\n }\n if(a<1)\n itogi.Add(itog);\n a = 2;\n itog = karta.Sum();\n \n }\n if (itogi.Count > 0)\n dnei = itogi.Min();\n Console.WriteLine(dnei);\n \n }\n }\n}", "lang": "MS C#", "bug_code_uid": "7b0fa0c19aac5a46495f0478f7e4a463", "src_uid": "a9c17ce5fd5f39ffd70917127ce3408a", "apr_id": "9bce48aa1d502d13c47d1297a4fe4bae", "difficulty": 800, "tags": ["constructive algorithms", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.030574941841143236, "equal_cnt": 16, "replace_cnt": 14, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 16, "bug_source_code": "\nMicrosoft Visual Studio Solution File, Format Version 12.00\n# Visual Studio 14\nVisualStudioVersion = 14.0.24720.0\nMinimumVisualStudioVersion = 10.0.40219.1\nProject(\"{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}\") = \"ConsoleApplication1\", \"ConsoleApplication1\\ConsoleApplication1.csproj\", \"{CDB32670-23CF-4D55-8B01-E9508F2B3E5F}\"\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{CDB32670-23CF-4D55-8B01-E9508F2B3E5F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{CDB32670-23CF-4D55-8B01-E9508F2B3E5F}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{CDB32670-23CF-4D55-8B01-E9508F2B3E5F}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{CDB32670-23CF-4D55-8B01-E9508F2B3E5F}.Release|Any CPU.Build.0 = Release|Any CPU\n\tEndGlobalSection\n\tGlobalSection(SolutionProperties) = preSolution\n\t\tHideSolutionNode = FALSE\n\tEndGlobalSection\nEndGlobal\n", "lang": "MS C#", "bug_code_uid": "f13c4065bc0e03c95c3426e9747232c0", "src_uid": "a9c17ce5fd5f39ffd70917127ce3408a", "apr_id": "609ea94d00a47161081809cb95f1c14a", "difficulty": 800, "tags": ["constructive algorithms", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.3815859499733901, "equal_cnt": 42, "replace_cnt": 26, "delete_cnt": 6, "insert_cnt": 10, "fix_ops_cnt": 42, "bug_source_code": "using System;\n\nnamespace ConsoleApplication1\n{\n class Program\n {\n static void Main(string[] args)\n {\n string sayi = Console.ReadLine();\n \n Console.Write(toplam1(sayi));\n Console.ReadKey();\n \n\n }\n static int toplam1(string sayi)\n {\n int[] a = new int[5];\n int sayilartop = 0;\n int ds = 0;\n int sayac = 0;\n int sayac1 = 0;\n int t1 = 0;\n int t2 = 0;\n string[] sayilar = sayi.Split(' ');\n for (int i = 0; i < sayilar.Length; i++)\n {\n sayilartop = sayilartop + int.Parse(sayilar[i]);\n }\n for (int i = 0; i < 5; i++)\n {\n for (int j = i+1; j < 5; j++)\n {\n if (sayilar[i] == sayilar[j])\n { \n a[ds] = int.Parse(sayilar[i]);\n ds++;\n }\n }\n }\n Array.Sort(a);\n if (a.Length == 0)\n {\n return sayilartop;\n }\n do\n {\n if (a[sayac].Equals(a[sayac+1]))\n {\n sayac1++;\n if (sayac1 == 2)\n {\n t1 = sayilartop - a[2]*3;\n }\n }\n sayac++;\n } while (sayac < a.Length-1);\n \n t2 = Math.Min(sayilartop -a[a.Length-1]*2,sayilartop-a[0]*2);\n if (t1 == 0)\n {\n return t2;\n }\n return Math.Min(t1,t2); \n \n\n\n\n\n }\n }\n \n}\n", "lang": "MS C#", "bug_code_uid": "1062d461b448a5f19cc536f5c61b3825", "src_uid": "a9c17ce5fd5f39ffd70917127ce3408a", "apr_id": "609ea94d00a47161081809cb95f1c14a", "difficulty": 800, "tags": ["constructive algorithms", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.8058968058968059, "equal_cnt": 24, "replace_cnt": 3, "delete_cnt": 8, "insert_cnt": 13, "fix_ops_cnt": 24, "bug_source_code": "using System;\n\nnamespace ConsoleApplication1\n{\n class Program\n {\n static void Main(string[] args)\n {\n try\n {\n string sayi = Console.ReadLine();\n \n Console.Write(toplam1(sayi));\n Console.ReadKey();\n }\n catch \n {\n }\n \n \n\n }\n static int toplam1(string sayi)\n {\n int[] sayilar = new int[5];\n int[] a_sayi = new int[2];\n int x = 0;\n int sayilartop = 0;\n int i = 0;\n int sayac = 0;\n int t1 = 0;\n foreach (string sayi1 in sayi.Split(' '))\n {\n sayilar[i] = int.Parse(sayi1);\n }\n Array.Sort(sayilar);\n for (int j = 0; j < 5; j++)\n {\n sayilartop += sayilar[j];\n }\n \n while (sayac < sayilar.Length-1)\n {\n if (sayilar[sayac] == sayilar[sayac+1])\n {\n if (sayilar[sayac+1]== sayilar[sayac+2] && sayac != sayilar.Length-2)\n {\n t1 = sayilartop - (sayilar[sayac] * 3);\n }\n else\n {\n a_sayi[x] = sayilartop - (sayilar[sayac] * 2);\n x++;\n }\n \n \n }\n }\n Array.Sort(a_sayi);\n x = Math.Min(t1,a_sayi[0]);\n return Math.Min(x,sayilartop);\n\n\n\n\n\n\n\n\n}\n }\n \n}\n", "lang": "MS C#", "bug_code_uid": "2821297430c5012987c5c8f6706eb6dc", "src_uid": "a9c17ce5fd5f39ffd70917127ce3408a", "apr_id": "609ea94d00a47161081809cb95f1c14a", "difficulty": 800, "tags": ["constructive algorithms", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.9823659074210139, "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 ConsoleApp10\n{\n class Program\n {\n static void Main(string[] args)\n {\n int[] s = Console.ReadLine().Split().Select(int.Parse).ToArray();\n Array.Sort(s);\n int r1 = 0;\n int r2 = 0;\n int y1 = 0;\n int y2 = 0;\n for (int i = s.Length - 1; i > 1; i--)\n {\n if ((s[i]==s[i-1])&&(s[i-1]==s[i-2]))\n {\n r1 = s[i] + s[i - 1] + s[i - 2];\n y1 = i;\n \n break;\n }\n }\n \n for (int i = s.Length - 1; i >= 1; i--)\n {\n if ((s[i] == s[i - 1])&&s[i-1]!=s[i-2])\n {\n r2 = s[i] + s[i - 1];\n \n y2 = i;\n break;\n }\n }\n \n if ((r1>=r2)&&(r1>0))\n {\n s[y1] = s[y1 - 1] = s[y1 - 2] = 0;\n }\n else if((r2>r1)&&(r2>0))\n {\n s[y2] = s[y2 - 1] = 0;\n }\n \n Console.WriteLine(s.Sum());\n \n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "60dc6224388b894e5a3f75b970139f2e", "src_uid": "a9c17ce5fd5f39ffd70917127ce3408a", "apr_id": "37abe9f094a373cd00dee1ec869d80b2", "difficulty": 800, "tags": ["constructive algorithms", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9920472619859123, "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.Globalization;\nusing System.IO;\nusing System.Linq;\nusing System.Text;\n\n// (づ*ω*)づミ★゜・。。・゜゜・。。・゜☆゜・。。・゜゜・。。・゜\npublic class Solver\n{\n int BitCount(int x)\n {\n int ret = 0;\n while (x > 0)\n {\n ret++;\n x &= x - 1;\n }\n return ret;\n }\n\n public object Solve()\n {\n int n = ReadInt();\n var cards = new Tuple[n];\n for (int i = 0; i < n; i++)\n {\n var t = ReadToken();\n cards[i] = Tuple.Create(\"RGBYW\".IndexOf(t[0]) + 5, t[1] - '1');\n }\n\n int ans = 15;\n for (int k = 0; k < 2 << 10; k++)\n {\n bool ok = true;\n for (int i = 0; i < n && ok; i++)\n for (int j = i + 1; j < n && ok; j++)\n if (cards[i].ToString() != cards[j].ToString())\n {\n ok = false;\n if (cards[i].Item1 != cards[j].Item1 && ((k >> cards[i].Item1 & 1) == 1 || (k >> cards[j].Item1 & 1) == 1))\n ok = true;\n if (cards[i].Item2 != cards[j].Item2 && ((k >> cards[i].Item2 & 1) == 1 || (k >> cards[j].Item2 & 1) == 1))\n ok = true;\n }\n if (ok)\n ans = Math.Min(ans, BitCount(k));\n }\n\n return ans;\n }\n\n #region Main\n\n protected static TextReader reader;\n protected static TextWriter writer;\n\n static void Main()\n {\n#if DEBUG\n reader = new StreamReader(\"..\\\\..\\\\input.txt\");\n writer = Console.Out;\n //writer = new StreamWriter(\"..\\\\..\\\\output.txt\");\n#else\n reader = Console.In;\n writer = new StreamWriter(Console.OpenStandardOutput());\n#endif\n try\n {\n var ts = DateTime.Now;\n object result = new Solver().Solve();\n if (result != null)\n writer.WriteLine(result);\n }\n catch (Exception ex)\n {\n#if DEBUG\n Console.WriteLine(ex);\n#else\n throw;\n#endif\n }\n reader.Close();\n writer.Close();\n }\n\n #endregion\n\n #region Read/Write\n\n private static Queue currentLineTokens = new Queue();\n\n private static string[] ReadAndSplitLine()\n {\n return reader.ReadLine().Split(new[] { ' ', '\\t' }, StringSplitOptions.RemoveEmptyEntries);\n }\n\n public static string ReadToken()\n {\n while (currentLineTokens.Count == 0)\n currentLineTokens = new Queue(ReadAndSplitLine());\n return currentLineTokens.Dequeue();\n }\n\n public static int ReadInt()\n {\n return int.Parse(ReadToken());\n }\n\n public static long ReadLong()\n {\n return long.Parse(ReadToken());\n }\n\n public static double ReadDouble()\n {\n return double.Parse(ReadToken(), CultureInfo.InvariantCulture);\n }\n\n public static int[] ReadIntArray()\n {\n return ReadAndSplitLine().Select(int.Parse).ToArray();\n }\n\n public static long[] ReadLongArray()\n {\n return ReadAndSplitLine().Select(long.Parse).ToArray();\n }\n\n public static double[] ReadDoubleArray()\n {\n return ReadAndSplitLine().Select(s => double.Parse(s, CultureInfo.InvariantCulture)).ToArray();\n }\n\n public static int[][] ReadIntMatrix(int numberOfRows)\n {\n int[][] matrix = new int[numberOfRows][];\n for (int i = 0; i < numberOfRows; i++)\n matrix[i] = ReadIntArray();\n return matrix;\n }\n\n public static int[][] ReadAndTransposeIntMatrix(int numberOfRows)\n {\n int[][] matrix = ReadIntMatrix(numberOfRows);\n int[][] ret = new int[matrix[0].Length][];\n for (int i = 0; i < ret.Length; i++)\n {\n ret[i] = new int[numberOfRows];\n for (int j = 0; j < numberOfRows; j++)\n ret[i][j] = matrix[j][i];\n }\n return ret;\n }\n\n public static string[] ReadLines(int quantity)\n {\n string[] lines = new string[quantity];\n for (int i = 0; i < quantity; i++)\n lines[i] = reader.ReadLine().Trim();\n return lines;\n }\n\n public static void WriteArray(IEnumerable array)\n {\n writer.WriteLine(string.Join(\" \", array));\n }\n\n #endregion\n}", "lang": "MS C#", "bug_code_uid": "a76e1872d5c66bd903d1d9eb57dd9542", "src_uid": "3b12863997b377b47bae43566ec1a63b", "apr_id": "eeaff8bdd6fcf84e473c966f1f04ca60", "difficulty": 1700, "tags": ["bitmasks", "brute force", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.9152752009894867, "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.Text;\n\nnamespace Bsharp\n{\n class Program\n {\n static void Main(string[] args)\n {\n string time = Console.ReadLine();\n string h = time.Substring(0, 2);\n string m = time.Substring(3, 2);\n int mingr = 0;\n double hourdgr = 0;\n int hours = Int16.Parse(h);\n int mins = Int16.Parse(m);\n\n if (hours > 12) hours -= 12;\n if (hours == 12) hours =0;\n hourdgr = hours * 30 + mins / 2.0;\n h = hourdgr.ToString();\n h = h.Replace(',', '.');\n if (mins>0) mins = 60 - mins;\n mingr = mins * 6;\n mingr = Math.Min(mingr, 360 - mingr);\n\n\n\n\n Console.WriteLine(h + \" \" + mingr);\n\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "5d0bdf7b9ba240cee5aa36630f9314ab", "src_uid": "175dc0bdb5c9513feb49be6644d0d150", "apr_id": "83cd2b8976e8fe4a480a3d757e96c7d9", "difficulty": 1200, "tags": ["geometry", "math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9586919104991394, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "using System;\n\nnamespace consap1\n{\n class MainClass\n {\n public static void Main(string[] args)\n {\n String[] inp = Console.ReadLine().Split();\n long Ax = long.Parse(inp[0]), Ay = long.Parse(inp[1]),\n Bx = long.Parse(inp[2]), By = long.Parse(inp[3]),\n Cx = long.Parse(inp[4]), Cy = long.Parse(inp[5]);\n if ((Ax - Bx)*(Ax - Bx) + (Ay - By)*(Ay - By) == (Cx - Bx) * (Cx - Bx) + (Cy - By) * (Cy - By)) Console.WriteLine(\"Yes\");\n else Console.WriteLine(\"No\");\n }\n }\n}", "lang": "MS C#", "bug_code_uid": "3a25b867b39c7c2e24d25fa160c62a97", "src_uid": "05ec6ec3e9ffcc0e856dc0d461e6eeab", "apr_id": "7594ddbd35033c3d1c56382b9294625d", "difficulty": 1400, "tags": ["geometry", "math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.9922987423125935, "equal_cnt": 18, "replace_cnt": 8, "delete_cnt": 2, "insert_cnt": 7, "fix_ops_cnt": 17, "bug_source_code": "using System;\nusing System.IO;\nusing System.Linq;\nusing System.Text;\nusing System.Collections;\nusing System.Collections.Generic;\nusing System.Threading.Tasks;\n\n\n\nnamespace ConsoleApplication1.CodeForces\n{\n public class LowerBoundSortedSet : SortedSet\n {\n\n private ComparerDecorator _comparerDecorator;\n\n private class ComparerDecorator : IComparer\n {\n\n private IComparer _comparer;\n\n public T LowerBound { get; private set; }\n public T UpperBound { get; private set; }\n\n private bool _reset = true;\n\n public void Reset()\n {\n _reset = true;\n }\n\n public ComparerDecorator(IComparer comparer)\n {\n _comparer = comparer;\n }\n\n public int Compare(T x, T y)\n {\n int num = _comparer.Compare(x, y);\n if (_reset)\n {\n LowerBound = y;\n UpperBound = y;\n }\n if (num >= 0)\n {\n LowerBound = y;\n _reset = false;\n }\n if (num <= 0)\n {\n UpperBound = y;\n _reset = false;\n }\n return num;\n }\n }\n\n public LowerBoundSortedSet()\n : this(Comparer.Default) { }\n\n public LowerBoundSortedSet(IComparer comparer)\n : base(new ComparerDecorator(comparer))\n {\n _comparerDecorator = (ComparerDecorator)this.Comparer;\n }\n\n public T FindLowerBound(T key)\n {\n _comparerDecorator.Reset();\n this.Contains(key);\n return _comparerDecorator.LowerBound;\n }\n\n public T FindUpperBound(T key)\n {\n _comparerDecorator.Reset();\n this.Contains(key);\n return _comparerDecorator.UpperBound;\n }\n }\n public abstract class Heap : IEnumerable\n {\n private const int InitialCapacity = 0;\n private const int GrowFactor = 2;\n private const int MinGrow = 1;\n\n private int _capacity = InitialCapacity;\n private T[] _heap = new T[InitialCapacity];\n private int _tail = 0;\n\n public int Count { get { return _tail; } }\n public int Capacity { get { return _capacity; } }\n\n protected Comparer Comparer { get; private set; }\n protected abstract bool Dominates(T x, T y);\n\n protected Heap() : this(Comparer.Default)\n {\n }\n\n protected Heap(Comparer comparer) : this(Enumerable.Empty(), comparer)\n {\n }\n\n protected Heap(IEnumerable collection)\n : this(collection, Comparer.Default)\n {\n }\n\n protected Heap(IEnumerable collection, Comparer comparer)\n {\n if (collection == null) throw new ArgumentNullException(\"collection\");\n if (comparer == null) throw new ArgumentNullException(\"comparer\");\n\n Comparer = comparer;\n\n foreach (var item in collection)\n {\n if (Count == Capacity)\n Grow();\n\n _heap[_tail++] = item;\n }\n\n for (int i = Parent(_tail - 1); i >= 0; i--)\n BubbleDown(i);\n }\n\n public void Add(T item)\n {\n if (Count == Capacity)\n Grow();\n\n _heap[_tail++] = item;\n BubbleUp(_tail - 1);\n }\n\n private void BubbleUp(int i)\n {\n if (i == 0 || Dominates(_heap[Parent(i)], _heap[i]))\n return; //correct domination (or root)\n\n Swap(i, Parent(i));\n BubbleUp(Parent(i));\n }\n\n public T GetMin()\n {\n if (Count == 0) throw new InvalidOperationException(\"Heap is empty\");\n return _heap[0];\n }\n\n public T ExtractDominating()\n {\n if (Count == 0) throw new InvalidOperationException(\"Heap is empty\");\n T ret = _heap[0];\n _tail--;\n Swap(_tail, 0);\n BubbleDown(0);\n return ret;\n }\n\n private void BubbleDown(int i)\n {\n int dominatingNode = Dominating(i);\n if (dominatingNode == i) return;\n Swap(i, dominatingNode);\n BubbleDown(dominatingNode);\n }\n\n private int Dominating(int i)\n {\n int dominatingNode = i;\n dominatingNode = GetDominating(YoungChild(i), dominatingNode);\n dominatingNode = GetDominating(OldChild(i), dominatingNode);\n\n return dominatingNode;\n }\n\n private int GetDominating(int newNode, int dominatingNode)\n {\n if (newNode < _tail && !Dominates(_heap[dominatingNode], _heap[newNode]))\n return newNode;\n else\n return dominatingNode;\n }\n\n private void Swap(int i, int j)\n {\n T tmp = _heap[i];\n _heap[i] = _heap[j];\n _heap[j] = tmp;\n }\n\n private static int Parent(int i)\n {\n return (i + 1) / 2 - 1;\n }\n\n private static int YoungChild(int i)\n {\n return (i + 1) * 2 - 1;\n }\n\n private static int OldChild(int i)\n {\n return YoungChild(i) + 1;\n }\n\n private void Grow()\n {\n int newCapacity = _capacity * GrowFactor + MinGrow;\n var newHeap = new T[newCapacity];\n Array.Copy(_heap, newHeap, _capacity);\n _heap = newHeap;\n _capacity = newCapacity;\n }\n\n public IEnumerator GetEnumerator()\n {\n return _heap.Take(Count).GetEnumerator();\n }\n\n IEnumerator IEnumerable.GetEnumerator()\n {\n return GetEnumerator();\n }\n }\n\n public class MaxHeap : Heap\n {\n public MaxHeap()\n : this(Comparer.Default)\n {\n }\n\n public MaxHeap(Comparer comparer)\n : base(comparer)\n {\n }\n\n public MaxHeap(IEnumerable collection, Comparer comparer)\n : base(collection, comparer)\n {\n }\n\n public MaxHeap(IEnumerable collection) : base(collection)\n {\n }\n\n protected override bool Dominates(T x, T y)\n {\n return Comparer.Compare(x, y) >= 0;\n }\n }\n\n public class MinHeap : Heap\n {\n public MinHeap()\n : this(Comparer.Default)\n {\n }\n\n public MinHeap(Comparer comparer)\n : base(comparer)\n {\n }\n\n public MinHeap(IEnumerable collection) : base(collection)\n {\n }\n\n public MinHeap(IEnumerable collection, Comparer comparer)\n : base(collection, comparer)\n {\n }\n\n protected override bool Dominates(T x, T y)\n {\n return Comparer.Compare(x, y) <= 0;\n }\n }\n static class _4032123\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 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 class Node\n {\n public int Number { get; set; }\n public int Depth { get; set; }\n\n }\n static double Distance(double x1, double y1, double x2, double y2)\n {\n return Math.Sqrt((x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2));\n }\n static void Main(String[] args)\n {\n //var n = int.Parse(Console.ReadLine().TrimEnd());\n var data = Console.ReadLine().TrimEnd().Split(' ').Select(double.Parse).ToList();\n var x1 = data[0];\n var y1 = data[1];\n var x2 = data[2];\n var y2 = data[3];\n var x3 = data[4];\n var y3 = data[5];\n if (Distance(x1,y1,x2,y2) == Distance(x2,y2,x3,y3) && (y1-y2)* (x1 - x3) != (y1 - y3) * (x1 - x2))\n {\n writer.WriteLine(\"Yes\");\n } else\n {\n writer.WriteLine(\"No\");\n }\n \n writer.Flush();\n\n\n }\n }\n}", "lang": "MS C#", "bug_code_uid": "107ef76a65ca58aa584eb30cbafbee66", "src_uid": "05ec6ec3e9ffcc0e856dc0d461e6eeab", "apr_id": "5dcaded51684b27775a1d0280b2c1ff7", "difficulty": 1400, "tags": ["geometry", "math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.5196969696969697, "equal_cnt": 9, "replace_cnt": 6, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 8, "bug_source_code": "using System;\nclass Test {\n static void Main() {\n string [] str = Console.ReadLine().Split();\n int [] a = new int [3];\n for(int k=0 ; k<3 ; k++){\n a[k] = int.Parse(str[k]);\n }\n int i = 0;\n int n = 0;\n int ct = -1;\n while(n<3){\n if(i==3){\n i=0;\n }\n if(a[i]<=0){\n i++;\n ct++;\n continue;\n }\n a[i] -= 2;\n if(a[i]<=0){\n n++;\n }\n ct++;\n i++;\n }\n Console.WriteLine(30+ct);\n }\n}", "lang": "Mono C#", "bug_code_uid": "e84f6c91e65a15f0b98ee8342bafcfb2", "src_uid": "a45daac108076102da54e07e1e2a37d7", "apr_id": "52c8958942b1c387ac521c6a86b3a8a1", "difficulty": 1000, "tags": ["math", "greedy"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9937369519832986, "equal_cnt": 1, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "using System.Collections.Generic;\nusing System.Text;\nusing System.Text.RegularExpressions;\n\nnamespace Cableway\n{\n class Program\n {\n static void Main(string[] args)\n {\n string[] input = Console.ReadLine().Split(' ');\n int totalRed = (int.Parse(input[0]) + 1) / 2 - 1;\n int totalGreen = (int.Parse(input[1]) + 1) / 2 - 1;\n int totalBlue = (int.Parse(input[2]) + 1) / 2 - 1;\n int total = 30;\n if (totalBlue > totalGreen && totalBlue > totalRed)\n total += (3 * totalBlue) + 2;\n else if (totalGreen > totalBlue && totalGreen > totalRed)\n total += (3 * totalGreen) + 1;\n else if (totalRed > totalBlue && totalRed > totalGreen)\n total += (3 * totalRed);\n else\n {\n int max = Math.Max(totalRed, Math.Max(totalBlue, totalGreen));\n total += (3 * max);\n if (max == totalBlue)\n total += 2;\n else if (max == totalGreen)\n total++;\n }\n Console.WriteLine(total);\n Console.ReadLine();\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "f4d75f812e1782c57dbab78473ca2be7", "src_uid": "a45daac108076102da54e07e1e2a37d7", "apr_id": "416933b92f5362be8c249760c37344d7", "difficulty": 1000, "tags": ["math", "greedy"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C#"} {"similarity_score": 0.9895833333333334, "equal_cnt": 5, "replace_cnt": 1, "delete_cnt": 3, "insert_cnt": 0, "fix_ops_cnt": 4, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\n\npublic class NewYearsEve : ISolution\n {\n public override void Solve()\n {\n ulong[] NandK = ReadArrString().Select(ulong.Parse).ToArray();\n ulong result;\n if(NandK[1]==1) \n {\n Console.Write(NandK[0]);\n return;\n }\n while (NandK[0]>=0)\n {\n result = 2*result + 1;\n NandK[0]>>=1;\n }\n Console.Write(result);\n }\n }\n \n public abstract class ISolution\n {\n public static Func ReadInt = () => int.Parse(Console.ReadLine().Trim());\n public static Func ReadShort = () => short.Parse(Console.ReadLine().Trim());\n public static Func ReadString = () => Console.ReadLine().Trim();\n public static Func ReadByte = () => byte.Parse(Console.ReadLine().Trim());\n public static StringBuilder output = new StringBuilder();\n public static Func ReadArrString = () => ReadString().Split(' ').ToArray();\n public abstract void Solve();\n }\n \n class Solution\n {\n static void Main(string[] args)\n {\n new NewYearsEve().Solve();\n Console.ReadLine();\n }\n }", "lang": "MS C#", "bug_code_uid": "8288e670035cb58c7f3399a93bfca5b6", "src_uid": "16bc089f5ef6b68bebe8eda6ead2eab9", "apr_id": "a4cb2759bc54bdb329c61d4c6c293148", "difficulty": 1300, "tags": ["bitmasks", "constructive algorithms", "number theory"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C#"} {"similarity_score": 0.9996278377372534, "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;\nusing System.Text;\n\npublic class NewYearsEve : ISolution\n {\n public override void Solve()\n {\n long[] NandK = ReadArrString().Select(long.Parse).ToArray();\n long result=0;\n if(NandK[1]==1) \n {\n Console.Write(NandK[0]);\n return;\n }\n while (NandK[0]>=0)\n {\n result = 2*result + 1;\n NandK[0]>>=1;\n }\n Console.Write(result);\n }\n }\n \n public abstract class ISolution\n {\n public static Func ReadInt = () => int.Parse(Console.ReadLine().Trim());\n public static Func ReadShort = () => short.Parse(Console.ReadLine().Trim());\n public static Func ReadString = () => Console.ReadLine().Trim();\n public static Func ReadByte = () => byte.Parse(Console.ReadLine().Trim());\n public static StringBuilder output = new StringBuilder();\n public static Func ReadArrString = () => ReadString().Split(' ').ToArray();\n public abstract void Solve();\n }\n \n class Solution\n {\n static void Main(string[] args)\n {\n new NewYearsEve().Solve();\n Console.ReadLine();\n }\n }", "lang": "MS C#", "bug_code_uid": "350ed876633dbd4b64178dc5d794acd9", "src_uid": "16bc089f5ef6b68bebe8eda6ead2eab9", "apr_id": "a4cb2759bc54bdb329c61d4c6c293148", "difficulty": 1300, "tags": ["bitmasks", "constructive algorithms", "number theory"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "delete", "lang_cluster": "C#"} {"similarity_score": 0.8547717842323651, "equal_cnt": 6, "replace_cnt": 5, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 5, "bug_source_code": "using System;\nusing System.Linq;\n\nnamespace B_NewYearsEve\n{\n class Program\n {\n static void Main(string[] args)\n {\n var having = Console.ReadLine().Split(' ').Select(long.Parse).ToArray();\n\n long pow = 1;\n while(pow *2 <= having[0])\n {\n pow *= 2;\n }\n\n long result = 0;\n for(int i=0;i< having[1]; ++i)\n {\n result += pow;\n pow /= 2;\n }\n\n Console.WriteLine(result);\n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "790e39c3d1fd3c38217c50c0fadb0ea2", "src_uid": "16bc089f5ef6b68bebe8eda6ead2eab9", "apr_id": "15523c7dd107b5b6c3f54c59bba9c802", "difficulty": 1300, "tags": ["bitmasks", "constructive algorithms", "number theory"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.8317307692307693, "equal_cnt": 8, "replace_cnt": 1, "delete_cnt": 5, "insert_cnt": 2, "fix_ops_cnt": 8, "bug_source_code": "using System;\nusing System.Linq;\nusing System.Text;\n\nnamespace ConsoleApp2\n{\n class Program\n {\n static void Main(string[] args)\n {\n long[] nk = Console.ReadLine().Split(' ').Select(long.Parse).ToArray();\n long n = nk[0];\n long k = nk[1];\n string s = Convert.ToString(n, 2);\n StringBuilder strB = new StringBuilder(s);\n bool start = false;\n for (int i = 0; i < s.Length; i++)\n {\n if (strB[i] == '1' && !start) {\n start = true;\n continue;\n }\n if (start && --k > 0) {\n strB[i] = '1';\n }\n }\n s = strB.ToString();\n long ans = Convert.ToInt32(s, 2);\n Console.WriteLine(ans);\n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "5cc32154205599ec9612cf708a46c26d", "src_uid": "16bc089f5ef6b68bebe8eda6ead2eab9", "apr_id": "e97715d5efe764a3d20c1c635ae313bf", "difficulty": 1300, "tags": ["bitmasks", "constructive algorithms", "number theory"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C#"} {"similarity_score": 0.9792735481223066, "equal_cnt": 6, "replace_cnt": 2, "delete_cnt": 2, "insert_cnt": 1, "fix_ops_cnt": 5, "bug_source_code": "using System;\nusing System.Collections;\nusing System.Collections.Generic;\nusing System.Globalization;\nusing System.Linq;\nusing System.Text;\nusing System.Text.RegularExpressions;\nusing System.Threading;\n\nnamespace Codeforces\n{\n class A\n {\n private static ThreadStart s_threadStart = new A().Go;\n private static bool s_time = false;\n private static double s_eps = 1e-16;\n\n HashSet[] adj;\n\n private void Go()\n {\n long n = GetInt();\n long m = GetInt();\n\n adj = new HashSet[n];\n for (int i = 0; i < n; i++)\n {\n adj[i] = new HashSet();\n }\n\n for (int i = 0; i < m; i++)\n {\n long x = GetInt() - 1;\n long y = GetInt() - 1;\n adj[x].Add(y);\n adj[y].Add(x);\n }\n\n int[] visited = new int[n];\n\n for (int i = 0; i < n; i++)\n {\n if (adj[i].Count == n - 1)\n visited[i] = -1;\n }\n\n int compCount = 0;\n\n for (int i = 0; i < n; i++)\n {\n if (visited[i] == 0)\n {\n Queue> q = new Queue>();\n q.Enqueue(new Tuple(i, 1));\n visited[i] = ++compCount;\n while (q.Count > 0)\n {\n var node = q.Dequeue();\n long x = node.Item1;\n int level = node.Item2;\n foreach (long child in adj[x])\n {\n if (visited[child] == 0)\n {\n q.Enqueue(new Tuple(child, level));\n visited[child] = level;\n }\n }\n }\n }\n }\n\n if (compCount > 2)\n {\n Wl(\"No\");\n return;\n }\n\n for (int i = 0; i < n; i++)\n {\n for (int j = 0; j < n; j++)\n {\n if (i != j && !adj[i].Contains(j) && (visited[i] + visited[j]) != 3)\n {\n Wl(\"No\");\n return;\n }\n }\n }\n\n Wl(\"Yes\");\n StringBuilder sb = new StringBuilder();\n for (int i = 0; i < n; i++)\n {\n if (visited[i] == -1) sb.Append('b');\n else if (visited[i] == 1) sb.Append('a');\n else sb.Append('c');\n }\n Wl(sb.ToString());\n }\n\n #region Template\n\n public static void Main(string[] args)\n {\n System.Diagnostics.Stopwatch timer = new System.Diagnostics.Stopwatch();\n Thread main = new Thread(new ThreadStart(s_threadStart), 200 * 1024 * 1024);\n timer.Start();\n main.Start();\n main.Join();\n timer.Stop();\n if (s_time)\n Wl(timer.ElapsedMilliseconds);\n }\n\n private static IEnumerator ioEnum;\n private static string GetString()\n {\n while (ioEnum == null || !ioEnum.MoveNext())\n {\n ioEnum = Console.ReadLine().Split().AsEnumerable().GetEnumerator();\n }\n\n return ioEnum.Current;\n }\n\n private static int GetInt()\n {\n return int.Parse(GetString(), CultureInfo.InvariantCulture);\n }\n\n private static long GetLong()\n {\n return long.Parse(GetString(), CultureInfo.InvariantCulture);\n }\n\n private static double GetDouble()\n {\n return double.Parse(GetString(), CultureInfo.InvariantCulture);\n }\n\n private static List GetIntArr(int n)\n {\n List ret = new List(n);\n for (int i = 0; i < n; i++)\n {\n ret.Add(GetInt());\n }\n return ret;\n }\n\n private static void Wl(T o)\n {\n if (o is double)\n {\n Wld((o as double?).Value, \"\");\n }\n else if (o is float)\n {\n Wld((o as float?).Value, \"\");\n }\n else\n Console.WriteLine(o.ToString());\n }\n\n private static void Wl(IEnumerable enumerable)\n {\n Wl(string.Join(\" \", enumerable.Select(e => e.ToString()).ToArray()));\n }\n\n private static void Wld(double d, string format)\n {\n Wl(d.ToString(format, CultureInfo.InvariantCulture));\n }\n\n #endregion\n }\n}", "lang": "MS C#", "bug_code_uid": "ac17a06dc1bedb052cdc0baf40e72018", "src_uid": "e71640f715f353e49745eac5f72e682a", "apr_id": "0a634831f60f3148c8c8c3243ed97c79", "difficulty": 1800, "tags": ["graphs", "constructive algorithms"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.978328173374613, "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.IO;\nusing System.Text;\nusing System.Linq;\n\nclass Program\n{\n private static bool Go(int v, int value)\n {\n if (ans[v] != 0)\n {\n return (ans[v] == value);\n }\n\n ans[v] = value;\n for (int i = 1; i <= n; i++)\n if (i != v && g[i, v] == 0)\n {\n if (!Go(i, 3 - value))\n return false;\n }\n\n return true;\n }\n\n private static int[] ans;\n private static int[,] g;\n private static int n;\n static void Main(string[] args)\n {\n n = ReadInt();\n int m = ReadInt();\n g = ReadGraphAsMatrix(n, m);\n ans = new int[n + 1];\n\n\n for (int i = 1; i <= n; i++)\n if (ans[i] == 0)\n for (int j = i + 1; j <= n; j++)\n if (g[i, j] == 0)\n {\n if (!Go(i, 1))\n {\n Console.WriteLine(\"No\");\n return;\n }\n break;\n }\n\n Console.WriteLine(\"Yes\");\n char[] map = new char[] { 'b', 'a', 'c' };\n for (int i = 1; i <= n; i++)\n Console.Write(map[ans[i]]);\n }\n\n private static List[] ReadGraph(int n, int m)\n {\n List[] g = new List[n + 1];\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();\n int b = ReadInt();\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 readonly StreamReader consoleReader = new StreamReader(Console.OpenStandardInput(BufferSize), Encoding.ASCII, false, BufferSize);\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');\n\n List s = new List();\n do\n {\n s.Add((char)ans);\n ans = consoleReader.Read();\n } while (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');\n\n char[] s = new char[n];\n int pos = 0;\n do\n {\n s[pos++] = (char)ans;\n ans = consoleReader.Read();\n } while (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 while (true)\n {\n return ReadDigit() - (int)'0';\n }\n }\n\n private static char ReadAnyChar()\n {\n return (char)consoleReader.Read();\n }\n}", "lang": "MS C#", "bug_code_uid": "339e1da84d24a4d1bef7dbbade509689", "src_uid": "e71640f715f353e49745eac5f72e682a", "apr_id": "35e4057b8dd41003d946b5a39821002b", "difficulty": 1800, "tags": ["graphs", "constructive algorithms"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.9957194599934146, "equal_cnt": 7, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 6, "fix_ops_cnt": 6, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\n\nnamespace ConsoleApplication4\n{\n class Program\n {\n static void Main(string[] args)\n {\n string burg = Console.ReadLine();\n string [] EstMas = Console.ReadLine().Split(new char[]{' '});\n string [] MagMas = Console.ReadLine().Split(new char[] { ' ' });\n long nb = long.Parse(EstMas[0]);\n long ns = long.Parse(EstMas[1]);\n long nc = long.Parse(EstMas[2]);\n long pb = long.Parse(MagMas[0]);\n long ps = long.Parse(MagMas[1]);\n long pc = long.Parse(MagMas[2]);\n long deneg = long.Parse(Console.ReadLine());\n long b = 0, s = 0, c = 0;\n for (int i = 0; i < burg.Length; i++)\n {\n if (burg[i] == 'B')\n {\n b++;\n }\n else if (burg[i] =='S')\n {\n s++;\n }\n else if (burg[i] == 'C')\n {\n c++;\n }\n }\n\n long res=0;\n long bb = b == 0 ? long.MaxValue : nb / b;\n long cc = c == 0 ? long.MaxValue : nc / c;\n long ss = s == 0 ? long.MaxValue : ns / s;\n long min = Math.Min(Math.Min(bb, cc), ss);\n res+=min;\n nb -= min*b;\n ns -= min*s;\n nc -= min*c;\n\n while (true)\n {\n long nadodeneg = 0;\n if (nb == 0 && nc == 0 && ns == 0)\n {\n nadodeneg = pb * b + pc * c + ps * s;\n res += deneg / nadodeneg;\n break;\n }\n \n if (nb < b)\n {\n nadodeneg+=(b-nb)*pb;\n }\n if (nc < c)\n {\n nadodeneg += (c - nc) * pc;\n \n }\n if (ns < s)\n {\n nadodeneg += (s - ns) * ps;\n\n }\n if (nadodeneg <= deneg)\n {\n res++;\n deneg -= nadodeneg;\n if (nb >= b)\n {\n nb -= b;\n }\n else {\n nb = 0;\n }\n if (nc >= c)\n {\n nc -= c;\n }\n else {\n nc = 0;\n }\n if (ns >= s)\n {\n ns -= s;\n\n }\n else {\n ns = 0;\n }\n }\n else \n {\n break;\n }\n }\n Console.WriteLine(res);\n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "a85b3e639618aa6ffb5b46a99c046823", "src_uid": "8126a4232188ae7de8e5a7aedea1a97e", "apr_id": "49221fba6de5d8be1ebb4f9a7c4201ff", "difficulty": 1600, "tags": ["brute force", "binary search"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.55, "equal_cnt": 14, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 11, "fix_ops_cnt": 13, "bug_source_code": "using System;\n\nnamespace L\n{\n class Program\n {\n static void Main(string[] args)\n {\n char[]c = Console.ReadLine().ToCharArray();\n int n = 10000 * (Convert.ToInt32(c[0]) - '0') + 1000 * (Convert.ToInt32(c[2]) - '0') + 100 * (Convert.ToInt32(c[4]) - '0') + 10 * (Convert.ToInt32(c[3]) - '0') + (Convert.ToInt32(c[1]) - '0'), a = n;\n for (int i = 0; i < 4; i++)\n {\n char[]f = Convert.ToString(n * a).ToCharArray();\n a = 10000 * (Convert.ToInt32(f[f.Length - 5]) - '0') + 1000 * (Convert.ToInt32(f[f.Length - 4]) - '0') + 100 * (Convert.ToInt32(f[f.Length - 3]) - '0') + 10 * (Convert.ToInt32(f[f.Length - 2]) - '0') + (Convert.ToInt32(f[f.Length - 1]) - '0');\n }\n Console.Write(a);\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "dee1e626e4bde76fe731f40b7f14241c", "src_uid": "51b1c216948663fff721c28d131bf18f", "apr_id": "ba2b986f975e9890bbaad42baf1abdde", "difficulty": 1400, "tags": ["math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.6129271916790491, "equal_cnt": 5, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 4, "fix_ops_cnt": 4, "bug_source_code": "using System;\n\nnamespace L\n{\n class Program\n {\n static void Main(string[] args)\n {\n char[]c = Console.ReadLine().ToCharArray();\n ulong n = 10000 * (Convert.ToUInt32(c[0]) - '0') + 1000 * (Convert.ToUInt32(c[2]) - '0') + 100 * (Convert.ToUInt32(c[4]) - '0') + 10 * (Convert.ToUInt32(c[3]) - '0') + (Convert.ToUInt32(c[1]) - '0'), a = n;\n for (int i = 0; i < 4; i++)\n {\n char[]f = Convert.ToString(n * a).ToCharArray();\n a = 10000 * (Convert.ToUInt32(f[f.Length - 5]) - '0') + 1000 * (Convert.ToUInt32(f[f.Length - 4]) - '0') + 100 * (Convert.ToUInt32(f[f.Length - 3]) - '0') + 10 * (Convert.ToUInt32(f[f.Length - 2]) - '0') + (Convert.ToUInt32(f[f.Length - 1]) - '0');\n }\n Console.Write(a);\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "927a057828fced7439ae77887ec554f3", "src_uid": "51b1c216948663fff721c28d131bf18f", "apr_id": "ba2b986f975e9890bbaad42baf1abdde", "difficulty": 1400, "tags": ["math", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.7037643207855974, "equal_cnt": 24, "replace_cnt": 9, "delete_cnt": 3, "insert_cnt": 11, "fix_ops_cnt": 23, "bug_source_code": "using System;\nusing System.IO;\nusing System.Linq;\nusing System.Text;\n\nnamespace Once_Again\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 int T = Next();\n\n var nn = new int[n];\n for (int i = 0; i < n; i++)\n {\n nn[i] = Next();\n }\n\n var max1 = new int[nn.Max() + 1];\n\n for (int i = 0; i < n; i++)\n {\n int m = 0;\n for (int j = 0; j <= nn[i]; j++)\n {\n if (m < max1[j])\n m = max1[j];\n }\n max1[nn[i]] = m + 1;\n }\n\n if (T == 1)\n {\n writer.WriteLine(max1.Max());\n writer.Flush();\n return;\n }\n\n var max2 = (int[]) max1.Clone();\n\n for (int i = 0; i < n; i++)\n {\n int m = 0;\n for (int j = 0; j <= nn[i]; j++)\n {\n if (m < max2[j])\n m = max2[j];\n }\n max2[nn[i]] = m + 1;\n }\n\n if (T == 2)\n {\n writer.WriteLine(max2.Max());\n writer.Flush();\n return;\n }\n\n var max3 = (int[]) max2.Clone();\n\n for (int i = 0; i < n; i++)\n {\n int m = 0;\n for (int j = 0; j <= nn[i]; j++)\n {\n if (m < max3[j])\n m = max3[j];\n }\n max3[nn[i]] = m + 1;\n }\n if (T == 3)\n {\n writer.WriteLine(max3.Max());\n writer.Flush();\n return;\n }\n\n int m3max = max3.Max();\n int delta = m3max - max2.Max();\n\n writer.WriteLine(m3max + delta*(T - 3));\n\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": "7eef401a6e165bd9957a6e8d8c793f0b", "src_uid": "26cf484fa4cb3dc2ab09adce7a3fc9b2", "apr_id": "61e16857b7594c75709129083a7439fd", "difficulty": 1900, "tags": ["matrices", "dp", "constructive algorithms"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.9185223997904113, "equal_cnt": 30, "replace_cnt": 13, "delete_cnt": 4, "insert_cnt": 13, "fix_ops_cnt": 30, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Text;\nusing System.Threading.Tasks;\nusing static Codeforces.IO;\nusing static System.Linq.Enumerable;\n\nnamespace Codeforces\n{\n static class IO\n {\n static StringBuilder builder = new StringBuilder();\n static Dummy dummy = new Dummy();\n class Dummy\n {\n ~Dummy()\n {\n Console.Write(builder);\n }\n }\n public static void Write(object obj)\n {\n builder.Append(obj);\n }\n public static void WriteLine(object obj)\n {\n builder.AppendLine(obj.ToString());\n }\n public static void Write(params object[] objs)\n {\n if (objs.Length != 0)\n {\n Write(objs[0]);\n for (var i = 1; i < objs.Length; ++i)\n {\n Write(\" \");\n Write(objs[i]);\n }\n }\n }\n public static void WriteLine(params object[] objs)\n {\n Write(objs);\n WriteLine();\n }\n\n public static void WriteLine()\n {\n builder.AppendLine();\n }\n\n public static string ReadLine()\n {\n return Console.ReadLine();\n }\n public static T ReadLine(Func parser)\n {\n return parser(ReadLine());\n }\n public static T[] ReadArray(Func parser)\n {\n return ReadLine().Split(' ').Select(parser).ToArray();\n }\n public static string[] ReadArray()\n {\n return ReadLine().Split(' ');\n }\n public static (T, T) ReadTuple2(Func parser)\n {\n var ar = ReadArray(parser);\n return (ar[0], ar[1]);\n }\n public static (string, string) ReadTuple2()\n {\n var ar = ReadArray();\n return (ar[0], ar[1]);\n }\n public static (T, T, T) ReadTuple3(Func parser)\n {\n var ar = ReadArray(parser);\n return (ar[0], ar[1], ar[2]);\n }\n public static (string, string, string) ReadTuple3()\n {\n var ar = ReadArray();\n return (ar[0], ar[1], ar[2]);\n }\n }\n\n static class Program\n {\n static int? Min(int? a,int? b)\n {\n return \n !a.HasValue ? b :\n !b.HasValue ? a :\n a.Value < b.Value ? a : b;\n }\n static void Main(string[] args)\n {\n var N = ReadLine(int.Parse);\n var ar = ReadArray(int.Parse);\n if (N == 1)\n {\n WriteLine(0);\n return;\n }\n var set = new SortedSet(Range(1, N));\n foreach(var v in ar)\n {\n if (v != 0)\n {\n set.Remove(v);\n }\n }\n var odd = 0;\n var even = 0;\n foreach(var v in set)\n {\n if (v % 2 == 0)\n {\n ++even;\n }\n else\n {\n ++odd;\n }\n }\n var dp = new int?[odd + 1, even + 1, 2];\n if (ar[0] != 0)\n {\n dp[odd, even, ar[0] % 2] = 0;\n }\n else\n {\n if (odd != 0)\n {\n dp[odd - 1, even, 1] = 0;\n }\n if (even != 0)\n {\n dp[odd, even - 1, 0] = 0;\n }\n }\n foreach(var i in Range(1, N - 2))\n {\n var next = new int?[odd + 1, even + 1, 2];\n if (ar[i] != 0)\n {\n foreach (var a in Range(0, odd + 1))\n {\n foreach (var b in Range(0, even + 1))\n {\n next[a, b, ar[i] % 2] = Min(\n dp[a, b, 0] + ar[i] % 2,\n dp[a, b, 1] + 1 - (ar[i] % 2));\n }\n }\n }\n else\n {\n foreach(var a in Range(1, odd))\n {\n next[a - 1, 0, 1] = Min(dp[a, 0, 0] + 1, dp[a, 0, 1] + 0);\n }\n foreach(var b in Range(1,even))\n {\n next[0, b - 1, 0] = Min(dp[0, b, 0], dp[0, b, 1] + 1);\n }\n foreach (var a in Range(1, odd))\n {\n foreach (var b in Range(1, even))\n {\n next[a - 1, b, 1] = Min(dp[a, b, 0] + 1, dp[a, b, 1]);\n next[a, b - 1, 0] = Min(dp[a, b, 0], dp[a, b, 1] + 1);\n }\n }\n }\n dp = next;\n }\n if (ar[N - 1] != 0)\n {\n WriteLine(Min(\n dp[0, 0, 0] + ar[N - 1] % 2,\n dp[0, 0, 1] + 1 - (ar[N - 1] % 2)));\n }\n else\n {\n WriteLine(Min(\n Min(dp[0, 1, 0], dp[1, 0, 0] + 1),\n Min(dp[0, 1, 1] + 1, dp[1, 0, 1])));\n }\n }\n }\n}", "lang": "Mono C#", "bug_code_uid": "e37cf331ead531127bbb670f8528759a", "src_uid": "90db6b6548512acfc3da162144169dba", "apr_id": "4478f563bc80799f5183f4d78f3af020", "difficulty": 1800, "tags": ["dp", "greedy", "sortings"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.852760736196319, "equal_cnt": 18, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 15, "fix_ops_cnt": 17, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\n\nnamespace ConsoleApplication2\n{\n class Program\n {\n static void Main(string[] args)\n {\n\n string[] tokens = Console.ReadLine().Split(' ');\n\n int n = int.Parse(tokens[0]);\n int k = int.Parse(tokens[1]);\n int t = int.Parse(tokens[2]);\n\n int s = 0;\n \n\n for (int i = 0; i <=t;i++)\n {\n\n if (i > 0)\n {\n s = s + 1;\n if ((i > k) & (k <= n))\n {\n s = s - 1;\n }\n if (i > n) s = s - 1;\n }\n\n if (i == t)\n { \n Console.WriteLine(s);\n break;\n }\n \n }\n // while (Console.ReadKey().Key != ConsoleKey.Enter) { }\n\n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "cb252117e1d5d903efbc86ca4349ab55", "src_uid": "7e614526109a2052bfe7934381e7f6c2", "apr_id": "b27d57a2f208da2d1a4271e65ddcd2ba", "difficulty": 800, "tags": ["math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.8346263781135157, "equal_cnt": 7, "replace_cnt": 6, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 6, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace ConsProg\n{\n class Program\n {\n static void Main(string[] args)\n {\n int[] data = Console.ReadLine().Split(' ').Select(x => x.ToInt()).ToArray();\n int n = data[0], k = data[1], t = data[2], count = 0;\n int[] moments = new int[n + k];\n for(int i = 1; i < moments.Length; i++)\n {\n if (i <= k)\n count++;\n else if (i > n)\n count--;\n moments[i] = count;\n }\n Console.WriteLine(moments[t]);\n }\n static int ReadInt()\n {\n return Console.ReadLine().ToInt();\n }\n static int[] ReadIntArray()\n {\n return Console.ReadLine().Split(' ').Select(x => x.ToInt()).ToArray();\n }\n \n }\n //Extensions\n public static class Extension\n {\n public static int ToInt(this object str)\n {\n return Convert.ToInt32(str);\n }\n public static void PrintArray(this T[] arr)\n {\n for (int i = 0; i < arr.Length; i++)\n Console.WriteLine(arr[i]);\n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "36ad59f39cffeb01e7fea2959bac7a6b", "src_uid": "7e614526109a2052bfe7934381e7f6c2", "apr_id": "aaa606e7ef60d2363955c986018929b6", "difficulty": 800, "tags": ["math", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.4918032786885246, "equal_cnt": 10, "replace_cnt": 4, "delete_cnt": 4, "insert_cnt": 2, "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 TestPlace\n{\n class Program\n {\n static void Main(string[] args)\n {\n var value = Convert.ToInt64(Console.ReadLine());\n Console.WriteLine(Mahmut(value,0));\n\n }\n static long Mahmut(long value, long result)\n {\n long m;\n if (value == -1)\n return result;\n else if (value % 2 == 1)\n {\n m = -1;\n result = result + m * value;\n return Mahmut(value - 1, result);\n }\n\n else\n {\n m = 1;\n result = result + m * value;\n return Mahmut(value - 1, result);\n\n }\n }\n }\n}\n\n", "lang": "Mono C#", "bug_code_uid": "41a31f4058adf71aa8a04d68326c86ae", "src_uid": "689e7876048ee4eb7479e838c981f068", "apr_id": "d7273f643c60092ce20d21c6d03dcbbd", "difficulty": 800, "tags": ["math", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.8545931758530184, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "using System;\nusing System.Linq;\n\nclass Program\n{\n static void Main()\n {\n string str = Console.ReadLine();\n int n = int.Parse(str);\n\n var squares = new int[n, 4];\n\n int minX = -1, maxX = -1, minY = -1, maxY = -1;\n\n for (int i = 0; i < n; i++)\n {\n str = Console.ReadLine();\n var q = str.Split(new char[] {' '});\n\n squares[i, 0] = int.Parse(q[0]);\n squares[i, 1] = int.Parse(q[1]);\n squares[i, 2] = int.Parse(q[2]);\n squares[i, 3] = int.Parse(q[3]);\n\n if (i == 0)\n {\n minX = squares[i, 0];\n minY = squares[i, 1];\n maxX = squares[i, 2];\n maxY = squares[i, 3];\n }\n\n\n if (minX > squares[i, 0]) minX = squares[i, 0];\n if (minY > squares[i, 1]) minY = squares[i, 1];\n if (maxX < squares[i, 2]) maxX = squares[i, 2];\n if (maxY < squares[i, 3]) maxY = squares[i, 3];\n // Console.WriteLine(str);\n }\n\n Console.WriteLine(\"min X: {0}\", minX);\n Console.WriteLine(\"min Y: {0}\", minY);\n Console.WriteLine(\"max X: {0}\", maxX);\n Console.WriteLine(\"max Y: {0}\", maxY);\n\n // 31400, 0 ≤ y1 < y2 ≤ 31400\n var a = new byte[31401, 31401];\n\n for (int i = 0; i < n; i++)\n {\n for (int x = squares[i, 0]; x < squares[i, 2]; x++)\n {\n for (int y = squares[i, 1]; y < squares[i, 3]; y++)\n {\n a[x, y] = 1;\n }\n }\n }\n\n if (maxX - minX != maxY - minY)\n {\n Console.WriteLine(\"NO\");\n return;\n }\n\n int square1 = (maxX - minX) * (maxY - minY);\n int square2 = 0;\n\n for (int i = 0; i < n; i++)\n {\n square2 += (squares[i, 2] - squares[i, 0]) * (squares[i, 3] - squares[i, 1]);\n }\n\n if (square1 != square2)\n {\n // Console.WriteLine(\"NO 2 1: {0} 2: {1}\", square1, square2);\n Console.WriteLine(\"NO\");\n return;\n }\n\n Console.WriteLine(\"YES\");\n }\n}", "lang": "MS C#", "bug_code_uid": "198604569e6b1217fed2458615f9dde2", "src_uid": "f63fc2d97fd88273241fce206cc217f2", "apr_id": "65033351b22bad302a44eb733e934ae0", "difficulty": 1500, "tags": ["implementation"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "delete", "lang_cluster": "C#"} {"similarity_score": 0.9979818365287588, "equal_cnt": 3, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "using System;\n\nnamespace task124D\n{\n class Program\n {\n static void Main(string[] args)\n {\n string[] splitStr = Console.ReadLine().Split(' ');\n int a = Convert.ToInt32(splitStr[0]);\n int b = Convert.ToInt32(splitStr[1]);\n int x1 = Convert.ToInt32(splitStr[2]);\n int y1 = Convert.ToInt32(splitStr[3]);\n int x2 = Convert.ToInt32(splitStr[4]);\n int y2 = Convert.ToInt32(splitStr[5]);\n int x, y;\n x = x1;\n y = y1;\n x1 = x + y;\n y1 = y - x;\n x = x2;\n y = y2;\n x2 = x + y;\n y2 = y - x;\n a *= 2;\n b *= 2;\n x1 = x1 / a + ((x1 > 0) ? 1 : 0);\n x2 = x2 / a + ((x2 > 0) ? 1 : 0);\n y1 = y1 / a + ((y1 > 0) ? 1 : 0);\n y2 = y2 / a + ((y2 > 0) ? 1 : 0);\n Console.WriteLine(Math.Max(Math.Abs(y2-y1), Math.Abs(x2-x1)));\n }\n }\n}", "lang": "Mono C#", "bug_code_uid": "424efac55f44b9792698c6078128681b", "src_uid": "7219d1837c83b5920992aee5a60dc0d9", "apr_id": "90a55967d4e541a6a9b3f5ee6e22d831", "difficulty": 1800, "tags": ["brute force", "constructive algorithms", "number theory"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.12350597609561753, "equal_cnt": 32, "replace_cnt": 22, "delete_cnt": 5, "insert_cnt": 5, "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 cases_mark_0\n{\n class Program\n {\n static void Main(string[] args)\n {\n Move move = new Move();\n int x = move.counter;\n string inOut = Convert.ToString(Console.ReadLine());\n string[] bufSplit = inOut.Split(' ');\n int a = Int32.Parse(bufSplit[0]);\n int b = Int32.Parse(bufSplit[1]);\n int x1 = Int32.Parse(bufSplit[2]);\n int y1 = Int32.Parse(bufSplit[3]);\n int x2 = Int32.Parse(bufSplit[4]);\n int y2 = Int32.Parse(bufSplit[5]);\n if (x1 == x2 && y1 == y2)\n {\n Console.WriteLine(0);\n }\n else if ((x1 < x2) && (y1 < y2))//вверх вправо \n {\n y1 = move.MoveUp(a, b, y1, y2, x1);\n x1 = move.MoveRight(a, b, x1, x2, y1);\n if (x1 == x2 && y1 == y2)\n Console.WriteLine(move.counter);\n }\n else if (x1 > x2 && y1 < y2)//право низ \n {\n x1 = move.MoveLeft(a, b, x1, x2, y1);\n y1 = move.MoveUp(a, b, y1, y2, x1);\n if (x1 == x2 && y1 == y2)\n Console.WriteLine(move.counter);\n }\n else if (x1 > x2 && y1 > y2)//низ лево \n {\n y1 = move.MoveDown(a, b, y1, y2, x1);\n x1 = move.MoveLeft(a, b, x1, x2, y1);\n if (x1 == x2 && y1 == y2)\n Console.WriteLine(move.counter);\n }\n else if (x1 < x2 && y1 > y2)//верх лево \n {\n y1 = move.MoveUp(a, b, y1, y2, x1);\n x1 = move.MoveLeft(a, b, x1, x2, y1);\n if (x1 == x2 && y1 == y2)\n Console.WriteLine(move.counter);\n }\n else if (x1 == x2 && y1 > y2)//низ \n {\n y1 = move.MoveDown(a, b, y1, y2, x1);\n if (x1 == x2 && y1 == y2)\n Console.WriteLine(move.counter);\n }\n else if (x1 == x2 && y1 < y2)//верх \n {\n y1 = move.MoveUp(a, b, y1, y2, x1);\n if (x1 == x2 && y1 == y2)\n Console.WriteLine(move.counter);\n }\n else if (x1 > x2 && y1 == y2)//лево \n {\n x1 = move.MoveLeft(a, b, x1, x2, y1);\n if (x1 == x2 && y1 == y2)\n Console.WriteLine(move.counter);\n }\n else //право \n {\n x1 = move.MoveRight(a, b, x1, x2, y1);\n if (x1 == x2 && y1 == y2)\n Console.WriteLine(move.counter);\n }\n }\n\n\n class Move\n {\n public int counter = 0;\n public int MoveUp(int a, int b, int y1, int y2, int x1)\n {\n int numY1 = y1;\n for (int i = 0; i < y2 - numY1; i++)\n {\n if ((Math.Abs((x1 + y1)) % (2 * a)) == 0 || (Math.Abs((x1 - y1)) % (2 * b)) == 0)\n counter++;\n y1++;\n }\n return y1;\n }\n public int MoveDown(int a, int b, int y1, int y2, int x1)\n {\n int numY1 = y1;\n for (int i = 0; i < numY1 - y2; i++)\n {\n if ((Math.Abs((x1 + y1)) % (2 * a)) == 0 || (Math.Abs((x1 - y1)) % (2 * b)) == 0)\n counter++;\n y1--;\n }\n return y1;\n }\n public int MoveLeft(int a, int b, int x1, int x2, int y1)\n {\n int numX1 = x1;\n for (int i = 0; i < numX1 - x2; i++)\n {\n if ((Math.Abs((x1 + y1)) % (2 * a)) == 0 || (Math.Abs((x1 - y1)) % (2 * b)) == 0)\n counter++;\n x1--;\n }\n return x1;\n }\n public int MoveRight(int a, int b, int x1, int x2, int y1)\n {\n int numX1 = x1;\n for (int i = 0; i < x2 - numX1; i++)\n {\n if ((Math.Abs((x1 + y1)) % (2 * a)) == 0 || (Math.Abs((x1 - y1)) % (2 * b)) == 0)\n counter++;\n x1++;\n }\n return x1;\n }\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "07e5df81afd5623e80a18267598605c7", "src_uid": "7219d1837c83b5920992aee5a60dc0d9", "apr_id": "8ef853c9bf6940c29609821aa8e896ca", "difficulty": 1800, "tags": ["brute force", "constructive algorithms", "number theory"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.6650326797385621, "equal_cnt": 13, "replace_cnt": 3, "delete_cnt": 4, "insert_cnt": 5, "fix_ops_cnt": 12, "bug_source_code": "using System;\nusing System.Linq;\nclass Oo\n{\n internal static void Main(string[] arg)\n {\n int ans = 0;\n int[] a = Array.ConvertAll(arg[1].Split(), int.Parse);\n Func IsWin = x => x[0] == x.Max() & x.Count(k => k == x.Max()) == 1;\n while(!IsWin(a))\n {\n ans++;\n a[0]++;\n int m = a.Max();\n for (int i = 1; i < a.Length; i++)\n {\n if (a[i] != m) continue;\n a[i]--;\n break;\n }\n } \n Console.WriteLine(ans);\n }\n}", "lang": "MS C#", "bug_code_uid": "291421d2a6f7288b9064777f29a98326", "src_uid": "aa8fabf7c817dfd3d585b96a07bb7f58", "apr_id": "694fe05e1a0bd136518118a4e985c4cb", "difficulty": 1200, "tags": ["greedy", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.9733201581027668, "equal_cnt": 7, "replace_cnt": 6, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 6, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace zadacha2\n{\n class Program\n {\n static void Main()\n {\n byte n, answer = 0, bear = 0;\n byte[] a = new byte[0];\n n = Convert.ToByte(Console.ReadLine());\n string[] Data = Console.ReadLine().Split(' ');\n bear = Convert.ToByte(Data[0]);\n\n for (byte i = 0; i < n - 1; i++ )\n {\n Array.Resize(ref a, a.Length + 1);\n a[i] = Convert.ToByte(Data[i + 1]);\n }\n for (long i = 1; ; i++)\n {\n Array.Sort(a);\n if (a[n - 2] >= bear)\n {\n a[n - 2]--;\n bear++;\n answer++;\n }\n else\n {\n break;\n }\n }\n Console.WriteLine(answer);\n }\n }\n}", "lang": "MS C#", "bug_code_uid": "10bc559db949191bf97128d0932df2d1", "src_uid": "aa8fabf7c817dfd3d585b96a07bb7f58", "apr_id": "27626ced59ee3c337fa432beaf73d5f6", "difficulty": 1200, "tags": ["greedy", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9916805324459235, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "using System;\nclass Test {\n static void Main() {\n int d = int.Parse(Console.ReadLine()) - 10;\n if(d>11){\n Console.WriteLine(0);\n }else{\n int [] n = new int[12]{0, 4, 4, 4, 4, 4, 4, 4, 4, 4, 15, 4};\n Console.WriteLine(n[d]);\n }\n }\n}", "lang": "Mono C#", "bug_code_uid": "ecee127fc3ae6a2f00194d28b33533f4", "src_uid": "5802f52caff6015f21b80872274ab16c", "apr_id": "8c456a2013fb18a33a345705b313e30f", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.948429164196799, "equal_cnt": 6, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 6, "fix_ops_cnt": 6, "bug_source_code": "using System;\nusing System.IO;\nclass Program\n {\n static void Main(string[] args)\n {\n int n = 0;\n int res = 0;\n using (StreamReader sr = new StreamReader(\"standard input\"))\n {\n n = int.Parse(sr.ReadLine());\n };\n if (n < 20 && n > 10 || n==21) res = 4;\n else\n if (n == 10) res = 0;\n else\n if (n > 21) res = 0;\n else \n if (n==20) res = 15;\n\n if (File.Exists(\"standard output\")) File.Delete(\"standard output\");\n using (StreamWriter sw = new StreamWriter(\"standard output\"))\n {\n sw.WriteLine(res);\n sw.Flush();\n };\n\n }\n }", "lang": "Mono C#", "bug_code_uid": "2aa769e189524487ffdaaa2323c1ef04", "src_uid": "5802f52caff6015f21b80872274ab16c", "apr_id": "3660333b3b8deb02aaf608aac10fa108", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.8937027707808565, "equal_cnt": 11, "replace_cnt": 2, "delete_cnt": 7, "insert_cnt": 2, "fix_ops_cnt": 11, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Collections;\nusing System.Linq;\n\nnamespace ProjectContest\n{\n class Test\n {\n static void Main()\n {\n var nm = Array.ConvertAll(Console.ReadLine().Split(), Convert.ToInt32);\n int n = nm[0], m = nm[1];\n var t= Array.ConvertAll(Console.ReadLine().Split(), Convert.ToInt32);\n List a = new List();\n for(int i = 0; i < t.Length; i++)\n {\n a.Add(t[i]);\n a.Sort((x, y) => y - x);\n if (a.Sum() <= m) Console.Write(0+\" \");\n else\n {\n int sum = a.Sum();\n int kq = 0;\n while (true)\n {\n sum -= a[kq];\n kq++;\n if (sum < m) { Console.Write(kq+\" \"); break; }\n }\n }\n }\n\n }\n }\n}", "lang": "Mono C#", "bug_code_uid": "f4611592395ecc2741236364aa865b8e", "src_uid": "d3c1dc3ed7af2b51b4c49c9b5052c346", "apr_id": "47302303012399973c881f317fb7fcad", "difficulty": 1200, "tags": ["greedy", "sortings"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "C#"} {"similarity_score": 0.8226950354609929, "equal_cnt": 8, "replace_cnt": 3, "delete_cnt": 3, "insert_cnt": 1, "fix_ops_cnt": 7, "bug_source_code": "using System;\nusing System.IO;\nusing System.Collections;\nusing System.Collections.Generic;\n\nnamespace ConsoleApplication\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 //string[] s = Console.ReadLine().Split(' ');\n //List list = new List();\n string str = \"\";\n\n for (int i = 0; i <= s.Length - 1; i++)\n {\n switch (s[i])\n {\n case '>':\n {\n str += \"1000\";\n break;\n }\n case '<':\n {\n str += \"1001\";\n break;\n }\n case '+':\n {\n str += \"1010\";\n break;\n }\n case '-':\n {\n str += \"1011\";\n break;\n }\n case '.':\n {\n str += \"1100\";\n break;\n }\n case ',':\n {\n str += \"1101\";\n break;\n }\n case '[':\n {\n str += \"1110\";\n break;\n }\n case ']':\n {\n str += \"1111\";\n break;\n }\n }\n }\n int _int = Convert.ToInt32(str, 2) % 1000003;\n\n Console.Write(\"{0}\", _int); \n }\n }\n}", "lang": "Mono C#", "bug_code_uid": "f044f889bfcb047d1c8fc0e9012056a2", "src_uid": "04fc8dfb856056f35d296402ad1b2da1", "apr_id": "f61fa04f3d45e9027db7f06e009ad925", "difficulty": 1200, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9984457569163817, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "using System;\nusing System.IO;\nusing System.Text;\n\nnamespace Permutations\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 long m = Next() - 1;\n\n var nn = new int[2*n + 1];\n nn[n] = n;\n int l = n;\n int r = n;\n\n\n for (int i = n - 1; i > 0; i--)\n {\n if ((m & 1) == 1)\n {\n nn[++r] = i;\n }\n else\n {\n nn[--l] = i;\n }\n m >>= 1;\n }\n\n for (int i = l; i <= r; i++)\n {\n writer.Write(nn[i]);\n writer.Write(' ');\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": "94554d2779e2fb7799c8718db4cda0a0", "src_uid": "a8da7cbd9ddaec8e0468c6cce884e7a2", "apr_id": "1e5752320ef3f66ebeeedbcbad799ad3", "difficulty": 1800, "tags": ["divide and conquer", "math", "bitmasks"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.396873120865905, "equal_cnt": 18, "replace_cnt": 11, "delete_cnt": 3, "insert_cnt": 4, "fix_ops_cnt": 18, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace CodeForcesPractice\n{\n class CF513B2\n {\n private static int n;\n private static int m;\n\n private static void Execute(string[] args)\n {\n var input = args.Select(s => Int32.Parse(s)).ToList();\n\n n = input[0];\n m = input[1];\n\n var permutations = MaxFp(Enumerable.Range(1, n).ToList());\n\n var result = permutations.Skip(m - 1).First();\n\n foreach (var i in result)\n {\n Console.Write(i + \" \");\n }\n }\n\n private static IEnumerable> MaxFp(List elements)\n {\n if (elements.Count == 1)\n {\n yield return elements;\n yield break;\n }\n\n int smallest = elements[0];\n var smallestExcluded = FirstExcluded(elements);\n var tail = MaxFp(smallestExcluded).ToList();\n\n foreach (var p in tail)\n {\n yield return ElementIncluded(p,smallest,0); \n }\n\n foreach (var p in tail)\n {\n yield return ElementIncluded(p, smallest, p.Count); \n } \n }\n\n private static List FirstExcluded(List list)\n {\n var smallestExcluded = list.ToList();\n smallestExcluded.RemoveAt(0);\n return smallestExcluded;\n }\n\n private static List ElementIncluded(List list, int element, int index)\n {\n var result = list.ToList();\n result.Insert(index, element);\n return result;\n }\n\n static void Main(string[] args)\n {\n var input = Console.ReadLine().Split(' ');\n Execute(input);\n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "8a33fe44694bae2f97bd49751521fa8b", "src_uid": "a8da7cbd9ddaec8e0468c6cce884e7a2", "apr_id": "3fb585ae0a38020185b2b73900b4f621", "difficulty": 1800, "tags": ["divide and conquer", "math", "bitmasks"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.354916067146283, "equal_cnt": 6, "replace_cnt": 4, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 6, "bug_source_code": "using System;\nusing System.Linq;\nclass Demo{\nstatic void Main(string[] args){\nint[] a =args.Cast().ToArray();\nConsole.WriteLine(Math.Ceiling(a[0] * a[2] / 100D) - a[1]);\n}}", "lang": "MS C#", "bug_code_uid": "45a5c03d8ed8cd87a6c93ea5f54acab7", "src_uid": "7038d7b31e1900588da8b61b325e4299", "apr_id": "d7159d7c8c44618c5dc7fea546d3e79a", "difficulty": 900, "tags": ["math", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.729050279329609, "equal_cnt": 7, "replace_cnt": 3, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 6, "bug_source_code": "using System;\n\nnamespace CF610A\n{\n class Program\n {\n static void Main(string[] args)\n {\n long n = long.Parse(Console.ReadLine());\n long c = 0;\n\n for(long i = 1; i <= n/4; i++)\n {\n if (i != (n - 2 * i) / 2) c++;\n }\n\n Console.WriteLine(c);\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "51abcd256113c40eefdc1eef28219cdf", "src_uid": "32b59d23f71800bc29da74a3fe2e2b37", "apr_id": "f0a4a26f5531cf7777f75a2d71743ce1", "difficulty": 1000, "tags": ["math", "combinatorics"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9554705432287681, "equal_cnt": 11, "replace_cnt": 0, "delete_cnt": 3, "insert_cnt": 7, "fix_ops_cnt": 10, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Web;\nusing System.IO;\nusing System.Text;\n\nnamespace Main_Problem_Template\n{\n class Program\n {\n\n const string input = \"input.txt\";\n const string output = \"output.txt\";\n\n\n static void Main(string[] args)\n {\n List inputInt = new List();\n List inputChar = new List();\n \n //ReadData(input, inputInt, inputChar);\n ReadConsole(inputInt, inputChar);\n string outputS = F1(inputChar);\n WriteConsole(inputInt, inputChar, outputS);\n //WriteData(output,inputInt,inputChar,outputS);\n\n }\n\n static string F1(List inputChar)\n {\n int fails = 0;\n int n = inputChar.Count();\n\n if (n % 2 == 0)\n {\n for (int i = 0; i <= n/2; i++)\n {\n if (inputChar[i] != inputChar[n - i])\n {\n fails++;\n }\n }\n }\n else {\n for (int i = 0; i <= (n-1)/2; i++)\n {\n if (inputChar[i] != inputChar[n-1 - i])\n {\n fails++;\n }\n }\n }\n if (fails < 2)\n {\n return \"YES\";\n }\n else\n {\n return \"NO\";\n }\n }\n\n static void ReadConsole(List inputInt, List inputChar)\n {\n string line = Console.ReadLine();\n inputChar.AddRange(line);\n }\n\n static void WriteConsole(List outputInt, List outputChar, string outputS)\n {\n Console.WriteLine(outputS);\n }\n\n static void ReadData(string file, List inputInt, List inputChar)\n {\n string line;\n\n using (StreamReader reader = new StreamReader(@file))\n {\n //k = int.Parse(reader.ReadLine());\n line = reader.ReadLine();\n //string[] parts = line.Split(' ');\n for (int i = 0; i < line.Length; i++)\n {\n inputChar.Add(line[i]);\n }\n\n }\n }\n\n static void WriteData(string fv, List outputInt, List outputChar,string outputS)\n {\n using (var file = new System.IO.StreamWriter(fv, false))\n {\n //file.Write();\n //file.WriteLine();\n //file.WriteLine(count);\n /*\n foreach (char x in outputChar)\n {\n file.Write(x);\n Console.Write(x);\n }\n */\n file.Write(outputS);\n Console.Write(outputS);\n }\n Console.WriteLine();\n }\n\n\n }\n}\n", "lang": "MS C#", "bug_code_uid": "9517fe9a219b5332911f82c09c1a15bc", "src_uid": "fe74313abcf381f6c5b7b2057adaaa52", "apr_id": "2a6e6ffa1d8f057a473d5bf4ac54551a", "difficulty": 1000, "tags": ["brute force", "constructive algorithms", "strings"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.9531802120141343, "equal_cnt": 7, "replace_cnt": 5, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 6, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Globalization;\nusing System.IO;\nusing System.Linq;\nusing System.Text;\nusing System.Text.RegularExpressions;\nusing System.Threading;\nusing static System.Math;\n\nnamespace Olymp\n{\n public class ProblemSolver\n {\n private Tokenizer input;\n\n public void Solve()\n {\n var k = input.ReadInt();\n var p = input.ReadInt();\n Console.Write(Zcy().Take(k).Sum() % p);\n }\n\n private static IEnumerable Zcy()\n {\n for (int i = 0; ; i++)\n if (IsZcy(i))\n yield return i;\n }\n\n private static bool IsZcy(int n)\n {\n string s = n.ToString();\n int m = s.Length / 2;\n return m > 0 && s.Take(m).SequenceEqual(s.Skip(m));\n }\n\n public ProblemSolver(TextReader input)\n {\n this.input = new Tokenizer(input);\n }\n\n #region Service functions\n\n private static int GCD(int a, int b)\n {\n while (b != 0)\n {\n a %= b;\n int t = b;\n b = a;\n a = t;\n }\n return a;\n }\n\n #endregion\n }\n\n #region Service classes\n\n public class Tokenizer\n {\n private TextReader reader;\n\n public int ReadInt()\n {\n var c = SkipWS();\n if (c == -1)\n throw new EndOfStreamException();\n bool isNegative = false;\n if (c == '-' || c == '+')\n {\n isNegative = c == '-';\n c = this.reader.Read();\n if (c == -1)\n throw new InvalidOperationException();\n }\n if (!char.IsDigit((char)c))\n throw new InvalidOperationException();\n int result = (char)c - '0';\n c = this.reader.Read();\n while (c > 0 && !char.IsWhiteSpace((char)c))\n {\n if (!char.IsDigit((char)c))\n throw new InvalidOperationException();\n result = result * 10 + (char)c - '0';\n c = this.reader.Read();\n }\n if (isNegative)\n result = -result;\n return result;\n }\n\n public string ReadLine()\n {\n return reader.ReadLine();\n }\n\n public long ReadLong()\n {\n return long.Parse(this.ReadToken());\n }\n\n public double ReadDouble()\n {\n return double.Parse(this.ReadToken(), CultureInfo.InvariantCulture);\n }\n\n public int[] ReadIntArray(int n)\n {\n int[] a = new int[n];\n for (int i = 0; i < n; i++)\n a[i] = ReadInt();\n return a;\n }\n\n public long[] ReadLongArray(int n)\n {\n long[] a = new long[n];\n for (int i = 0; i < n; i++)\n a[i] = ReadLong();\n return a;\n }\n\n public double[] ReadDoubleArray(int n)\n {\n double[] a = new double[n];\n for (int i = 0; i < n; i++)\n a[i] = ReadDouble();\n return a;\n }\n\n public string ReadToken()\n {\n var c = SkipWS();\n if (c == -1)\n return null;\n var sb = new StringBuilder();\n while (c > 0 && !char.IsWhiteSpace((char)c))\n {\n sb.Append((char)c);\n c = this.reader.Read();\n }\n return sb.ToString();\n }\n\n private int SkipWS()\n {\n int c = this.reader.Read();\n if (c == -1)\n return c;\n while (c > 0 && char.IsWhiteSpace((char)c))\n c = this.reader.Read();\n return c;\n }\n\n public Tokenizer(TextReader reader)\n {\n this.reader = reader;\n }\n }\n\n class Program\n {\n public static void Main(string[] args)\n {\n var solver = new ProblemSolver(Console.In);\n solver.Solve();\n }\n }\n\n #endregion\n}", "lang": "MS C#", "bug_code_uid": "a8b34d85e9d774c4c2291baa66043b3b", "src_uid": "00e90909a77ce9e22bb7cbf1285b0609", "apr_id": "3c988a93d1f1682d8920fd1a59ecd8b1", "difficulty": 1300, "tags": ["brute force"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.999198717948718, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "using System;\n\nnamespace OlympicAAAAA\n{\n class Program\n {\n static void Main(string[] args)\n {\n int n = int.Parse(Console.ReadLine());\n string[] s = Console.ReadLine().Split(' ');\n byte q = 0;\n int curr = 0;\n for(int i = 0; i < n; i++)\n {\n switch(q)\n {\n case 0:\n if (int.Parse(s[i]) < curr) q = 2;\n else if (int.Parse(s[1]) == curr) q = 1;\n break;\n case 1:\n if (int.Parse(s[i]) > curr)\n {\n Console.WriteLine(\"NO\");\n return;\n }\n else if (int.Parse(s[i]) < curr) q = 2;\n break;\n case 2:\n if(int.Parse(s[i]) >= curr)\n {\n Console.WriteLine(\"NO\");\n return;\n }\n break;\n }\n curr = int.Parse(s[i]);\n }\n Console.WriteLine(\"YES\");\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "b64bce411a516fcaada6e44047da991c", "src_uid": "5482ed8ad02ac32d28c3888299bf3658", "apr_id": "bdbe2a49a352abf198af94bc39ca7f14", "difficulty": 1000, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.5774647887323944, "equal_cnt": 8, "replace_cnt": 5, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 8, "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 string[] str = Console.ReadLine().Split(' ');\n long n = Convert.ToInt64(str[0]);\n long k = Convert.ToInt64(str[1]);\n\n\n //Console.WriteLine(\"S={0}, N={1}\", SCount, NCount);\n long count = n;\n\n bool STurn = true;\n\n int SCount = 0;\n int NCount = 0;\n\n while (true)\n {\n if (count < k) { break; }\n count -= k;\n if (STurn) { SCount++; STurn = false; } else { NCount++; STurn = true; }\n }\n //Console.WriteLine(\"S={0}, N={1}\", SCount, NCount);\n if (SCount > NCount) { Console.WriteLine(\"YES\"); } else { Console.WriteLine(\"NO\"); }\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "82c08b1f137f7609688f4d3ebcaa00f4", "src_uid": "05fd61dd0b1f50f154eec85d8cfaad50", "apr_id": "882b956d1b0dc17bd410b08969f6d081", "difficulty": 800, "tags": ["math", "games"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9273661041819515, "equal_cnt": 5, "replace_cnt": 2, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 4, "bug_source_code": "using System;\n\n\nnamespace homes\n{\n class Program\n {\n static void Main(string[] args)\n {\n int count = Int32.Parse(Console.ReadLine().Split(' ')[0]);\n int number = Int32.Parse(Console.ReadLine().Split(' ')[1]);\n int sec = 1;\n if(number % 2 == 0)\n {\n for(int i = count; i != number; i-=2)\n {\n sec++;\n }\n }\n else\n {\n for (int i = 1; i != number; i+=2)\n {\n sec++;\n }\n }\n Console.WriteLine(sec);\n \n\n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "53a785b02041a99a901924d9428393bb", "src_uid": "aa62dcdc47d0abbba7956284c1561de8", "apr_id": "3ca4fb0550506a7b561165f1ddecff06", "difficulty": 1100, "tags": ["math", "constructive algorithms"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.011976047904191617, "equal_cnt": 9, "replace_cnt": 9, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 9, "bug_source_code": "\nMicrosoft Visual Studio Solution File, Format Version 12.00\n# Visual Studio 2013\nVisualStudioVersion = 12.0.21005.1\nMinimumVisualStudioVersion = 10.0.40219.1\nProject(\"{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}\") = \"Doma\", \"Doma\\Doma.csproj\", \"{A9B7035C-8A7C-4EAC-8F58-4E6B7809A1D7}\"\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{A9B7035C-8A7C-4EAC-8F58-4E6B7809A1D7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{A9B7035C-8A7C-4EAC-8F58-4E6B7809A1D7}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{A9B7035C-8A7C-4EAC-8F58-4E6B7809A1D7}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{A9B7035C-8A7C-4EAC-8F58-4E6B7809A1D7}.Release|Any CPU.Build.0 = Release|Any CPU\n\tEndGlobalSection\n\tGlobalSection(SolutionProperties) = preSolution\n\t\tHideSolutionNode = FALSE\n\tEndGlobalSection\nEndGlobal\n", "lang": "MS C#", "bug_code_uid": "7e61ceee1b9c875cc626061907d08803", "src_uid": "aa62dcdc47d0abbba7956284c1561de8", "apr_id": "3a64061ef6b8e6b92ae362002e889717", "difficulty": 1100, "tags": ["math", "constructive algorithms"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9611137782045127, "equal_cnt": 4, "replace_cnt": 0, "delete_cnt": 3, "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 ConsoleApplication1\n{\n class Program\n {\n static void Main(string[] args)\n {\n int i, x = 0;\n xx:\n Console.WriteLine(\"enter n, a \");\n string[] tokens = Console.ReadLine().Split();\n\n //Parse element 0\n int n = int.Parse(tokens[0]);\n\n //Parse element 1\n int a = int.Parse(tokens[1]);\n \n if (a > n || (n % 2) != 0 || a>100000||n>100000)\n {\n goto xx;\n }\n if (a % 2 != 0)\n {\n for (i = 0; i < a; i = i + 2)\n {\n x = x + 1;\n }\n }\n else\n {\n for (i = a; i <= n; i = i + 2)\n {\n x = x + 1;\n }\n }\n\n \n Console.WriteLine(\"number=\"+x);\n x = 0;\n goto xx;\n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "ceac1ba289145fd4f2fdb63ef409006f", "src_uid": "aa62dcdc47d0abbba7956284c1561de8", "apr_id": "3f64dd9cb716b0e2d9090d8664f7f29d", "difficulty": 1100, "tags": ["math", "constructive algorithms"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C#"} {"similarity_score": 0.9893752656183595, "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.Text;\nusing System.Threading.Tasks;\n\nnamespace _526A\n{\n class Program\n {\n static void Main(string[] args)\n {\n int n = int.Parse(Console.ReadLine());\n string input = Console.ReadLine();\n bool[] a = new bool[n];\n for (int i = 0; i < n; i++) a[i] = input[i] == '*';\n\n bool result = false;\n for (int i = 0; i < n - 4 && !result; i++)\n {\n for (int step = 1; step < (int)Math.Ceiling(n / 4D); step++)\n {\n int jumps = 0;\n while (jumps <= 4)\n {\n if (!a[i + jumps * step])\n break;\n else\n jumps++;\n }\n\n if (jumps == 5)\n {\n result = true;\n break;\n }\n }\n }\n\n Console.WriteLine(result ? \"yes\" : \"no\");\n //Console.ReadLine();\n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "ff49bf791696ec32566c7eb885d86f34", "src_uid": "12d451eb1b401a8f426287c4c6909e4b", "apr_id": "5eee7673360f6c7bc6023380fad4f619", "difficulty": 1300, "tags": ["brute force", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.9971804511278195, "equal_cnt": 6, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 5, "bug_source_code": "using System;\nusing System.Linq;\nusing System.Collections.Generic;\nusing System.Diagnostics;\nusing Debug = System.Diagnostics.Trace;\nusing SB = System.Text.StringBuilder;\nusing System.Numerics;\nusing static System.Math;\nusing Number = System.Int32;\nnamespace Program {\n\tpublic class Solver {\n\t\tRandom rnd = new Random(1);\n\t\tpublic void Solve() {\n\t\t\tvar n = ri;\n\t\t\tvar m = ri;\n\n\t\t\t//i-j が正にならないようなやつ\n\t\t\tvar pat = new ModInt[n + 5, m + 5];\n\t\t\tpat[0, 0] = 1;\n\t\t\tfor (int i = 0; i <= n; i++)\n\t\t\t\tfor (int j = 0; j <= m; j++) {\n\t\t\t\t\tif (i < j) pat[i + 1, j] += pat[i, j];\n\t\t\t\t\tpat[i, j + 1] += pat[i, j];\n\t\t\t\t}\n\t\t\tModInt ans = 0;\n\t\t\tfor (int i = 0; i <= n; i++)\n\t\t\t\tfor (int j = 0; j <= m; j++) {\n\t\t\t\t\tif (i - j <= 0) continue;\n\t\t\t\t\t//Debug.WriteLine($\"{i} {j} {pat[j, i]} {pat[n - i, m - j]}\");\n\t\t\t\t\tans += (i - j) * pat[n - i, m - j] * pat[j, i - 1];\n\t\t\t\t}\n\t\t\t//\n\t\t\t//+--+\n\t\t\t//+-+-\n\n\t\t\tConsole.WriteLine(ans);\n\n\t\t}\n\t\tconst long INF = 1L << 60;\n\t\tstatic int[] dx = { -1, 0, 1, 0 };\n\t\tstatic int[] dy = { 0, 1, 0, -1 };\n\t\tint ri { get { return sc.Integer(); } }\n\t\tlong rl { get { return sc.Long(); } }\n\t\tdouble rd { get { return sc.Double(); } }\n\t\tstring rs { get { return sc.Scan(); } }\n\t\tpublic IO.StreamScanner sc = new IO.StreamScanner(Console.OpenStandardInput());\n\n\t\tstatic T[] Enumerate(int n, Func f) {\n\t\t\tvar a = new T[n];\n\t\t\tfor (int i = 0; i < a.Length; ++i) a[i] = f(i);\n\t\t\treturn a;\n\t\t}\n\t\tstatic public void Swap(ref T a, ref T b) { var tmp = a; a = b; b = tmp; }\n\t}\n}\n\n#region main\nstatic class Ex {\n\tstatic public string AsString(this IEnumerable ie) { return new string(ie.ToArray()); }\n\tstatic public string AsJoinedString(this IEnumerable ie, string st = \" \") {\n\t\treturn string.Join(st, ie);\n\t}\n\tstatic public void Main() {\n\t\tConsole.SetOut(new Program.IO.Printer(Console.OpenStandardOutput()) { AutoFlush = false });\n\t\tvar solver = new Program.Solver();\n\t\tvar t = new System.Threading.Thread(solver.Solve, 50000000);\n\t\tt.Start();\n\t\tt.Join();\n\t\t//solver.Solve();\n\t\tConsole.Out.Flush();\n\t}\n}\n#endregion\n#region Ex\nnamespace Program.IO {\n\tusing System.IO;\n\tusing System.Text;\n\tusing System.Globalization;\n\n\tpublic class Printer : StreamWriter {\n\t\tpublic override IFormatProvider FormatProvider { get { return CultureInfo.InvariantCulture; } }\n\t\tpublic Printer(Stream stream) : base(stream, new UTF8Encoding(false, true)) { }\n\t}\n\n\tpublic class StreamScanner {\n\t\tpublic StreamScanner(Stream stream) { str = stream; }\n\n\t\tpublic readonly Stream str;\n\t\tprivate readonly byte[] buf = new byte[1024];\n\t\tprivate int len, ptr;\n\t\tpublic bool isEof = false;\n\t\tpublic bool IsEndOfStream { get { return isEof; } }\n\n\t\tprivate byte read() {\n\t\t\tif (isEof) return 0;\n\t\t\tif (ptr >= len) {\n\t\t\t\tptr = 0;\n\t\t\t\tif ((len = str.Read(buf, 0, 1024)) <= 0) {\n\t\t\t\t\tisEof = true;\n\t\t\t\t\treturn 0;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn buf[ptr++];\n\t\t}\n\n\t\tpublic char Char() {\n\t\t\tbyte b = 0;\n\t\t\tdo b = read(); while ((b < 33 || 126 < b) && !isEof);\n\t\t\treturn (char)b;\n\t\t}\n\t\tpublic string Scan() {\n\t\t\tvar sb = new StringBuilder();\n\t\t\tfor (var b = Char(); b >= 33 && b <= 126; b = (char)read()) sb.Append(b);\n\t\t\treturn sb.ToString();\n\t\t}\n\t\tpublic string ScanLine() {\n\t\t\tvar sb = new StringBuilder();\n\t\t\tfor (var b = Char(); b != '\\n' && b != 0; b = (char)read()) if (b != '\\r') sb.Append(b);\n\t\t\treturn sb.ToString();\n\t\t}\n\t\tpublic long Long() { return isEof ? long.MinValue : long.Parse(Scan()); }\n\t\tpublic int Integer() { return isEof ? int.MinValue : int.Parse(Scan()); }\n\t\tpublic double Double() { return isEof ? double.NaN : double.Parse(Scan(), CultureInfo.InvariantCulture); }\n\t}\n}\n\n#endregion\n\n#region ModInt\n/// \n/// [0,) までの値を取るような数\n/// \npublic struct ModInt {\n\t/// \n\t/// 剰余を取る値.\n\t/// \n\tpublic const long Mod = (int)998244853;\n\n\t/// \n\t/// 実際の数値.\n\t/// \n\tpublic long num;\n\t/// \n\t/// 値が であるようなインスタンスを構築します.\n\t/// \n\t/// インスタンスが持つ値\n\t/// パフォーマンスの問題上,コンストラクタ内では剰余を取りません.そのため, ∈ [0,) を満たすような を渡してください.このコンストラクタは O(1) で実行されます.\n\tpublic ModInt(long n) { num = n; }\n\t/// \n\t/// このインスタンスの数値を文字列に変換します.\n\t/// \n\t/// [0,) の範囲内の整数を 10 進表記したもの.\n\tpublic override string ToString() { return num.ToString(); }\n\tpublic static ModInt operator +(ModInt l, ModInt r) { l.num += r.num; if (l.num >= Mod) l.num -= Mod; return l; }\n\tpublic static ModInt operator -(ModInt l, ModInt r) { l.num -= r.num; if (l.num < 0) l.num += Mod; return l; }\n\tpublic static ModInt operator *(ModInt l, ModInt r) { return new ModInt(l.num * r.num % Mod); }\n\tpublic static implicit operator ModInt(long n) { n %= Mod; if (n < 0) n += Mod; return new ModInt(n); }\n\n\t/// \n\t/// 与えられた 2 つの数値からべき剰余を計算します.\n\t/// \n\t/// べき乗の底\n\t/// べき指数\n\t/// 繰り返し二乗法により O(N log N) で実行されます.\n\tpublic static ModInt Pow(ModInt v, long k) { return Pow(v.num, k); }\n\n\t/// \n\t/// 与えられた 2 つの数値からべき剰余を計算します.\n\t/// \n\t/// べき乗の底\n\t/// べき指数\n\t/// 繰り返し二乗法により O(N log N) で実行されます.\n\tpublic static ModInt Pow(long v, long k) {\n\t\tlong ret = 1;\n\t\tfor (k %= Mod - 1; k > 0; k >>= 1, v = v * v % Mod)\n\t\t\tif ((k & 1) == 1) ret = ret * v % Mod;\n\t\treturn new ModInt(ret);\n\t}\n\t/// \n\t/// 与えられた数の逆元を計算します.\n\t/// \n\t/// 逆元を取る対象となる数\n\t/// 逆元となるような値\n\t/// 法が素数であることを仮定して,フェルマーの小定理に従って逆元を O(log N) で計算します.\n\tpublic static ModInt Inverse(ModInt v) { return Pow(v, Mod - 2); }\n}\n#endregion\n#region Binomial Coefficient\npublic class BinomialCoefficient {\n\tpublic ModInt[] fact, ifact;\n\tpublic BinomialCoefficient(int n) {\n\t\tfact = new ModInt[n + 1];\n\t\tifact = new ModInt[n + 1];\n\t\tfact[0] = 1;\n\t\tfor (int i = 1; i <= n; i++)\n\t\t\tfact[i] = fact[i - 1] * i;\n\t\tifact[n] = ModInt.Inverse(fact[n]);\n\t\tfor (int i = n - 1; i >= 0; i--)\n\t\t\tifact[i] = ifact[i + 1] * (i + 1);\n\t\tifact[0] = ifact[1];\n\t}\n\tpublic ModInt this[int n, int r] {\n\t\tget {\n\t\t\tif (n < 0 || n >= fact.Length || r < 0 || r > n) return 0;\n\t\t\treturn fact[n] * ifact[n - r] * ifact[r];\n\t\t}\n\t}\n\tpublic ModInt RepeatedCombination(int n, int k) {\n\t\tif (k == 0) return 1;\n\t\treturn this[n + k - 1, k];\n\t}\n}\n#endregion\n", "lang": "Mono C#", "bug_code_uid": "4e69ceb659d0c61773608fe33ccbc9a2", "src_uid": "a2fcad987e9b2bb3e6395654cd4fcfbb", "apr_id": "57bc19fb70b960e37d82c27d5edcd284", "difficulty": 2300, "tags": ["dp", "math", "combinatorics", "number theory"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.9995311034698343, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "using System;\nusing System.Linq;\nusing System.Collections.Generic;\nusing System.Diagnostics;\nusing Debug = System.Diagnostics.Trace;\nusing SB = System.Text.StringBuilder;\nusing System.Numerics;\nusing static System.Math;\nusing Number = System.Int32;\nnamespace Program {\n\tpublic class Solver {\n\t\tRandom rnd = new Random(1);\n\t\tpublic void Solve() {\n\t\t\tvar n = ri;\n\t\t\tvar m = ri;\n\n\t\t\tvar max = Max(n, m);\n\t\t\t//i-j が正にならないようなやつ\n\t\t\tvar pat = new ModInt[max + 5, max + 5];\n\t\t\tpat[0, 0] = 1;\n\t\t\tfor (int i = 0; i <= n; i++)\n\t\t\t\tfor (int j = 0; j <= m; j++) {\n\t\t\t\t\tif (i < j) pat[i + 1, j] += pat[i, j];\n\t\t\t\t\tpat[i, j + 1] += pat[i, j];\n\t\t\t\t}\n\t\t\tModInt ans = 0;\n\t\t\tfor (int i = 0; i <= n; i++)\n\t\t\t\tfor (int j = 0; j <= m; j++) {\n\t\t\t\t\tif (i - j <= 0) continue;\n\t\t\t\t\t//Debug.WriteLine($\"{i} {j} {pat[j, i]} {pat[n - i, m - j]}\");\n\t\t\t\t\tans += (i - j) * pat[n - i, m - j] * pat[j, i - 1];\n\t\t\t\t}\n\t\t\t//\n\t\t\t//+--+\n\t\t\t//+-+-\n\n\t\t\tConsole.WriteLine(ans);\n\n\t\t}\n\t\tconst long INF = 1L << 60;\n\t\tstatic int[] dx = { -1, 0, 1, 0 };\n\t\tstatic int[] dy = { 0, 1, 0, -1 };\n\t\tint ri { get { return sc.Integer(); } }\n\t\tlong rl { get { return sc.Long(); } }\n\t\tdouble rd { get { return sc.Double(); } }\n\t\tstring rs { get { return sc.Scan(); } }\n\t\tpublic IO.StreamScanner sc = new IO.StreamScanner(Console.OpenStandardInput());\n\n\t\tstatic T[] Enumerate(int n, Func f) {\n\t\t\tvar a = new T[n];\n\t\t\tfor (int i = 0; i < a.Length; ++i) a[i] = f(i);\n\t\t\treturn a;\n\t\t}\n\t\tstatic public void Swap(ref T a, ref T b) { var tmp = a; a = b; b = tmp; }\n\t}\n}\n\n#region main\nstatic class Ex {\n\tstatic public string AsString(this IEnumerable ie) { return new string(ie.ToArray()); }\n\tstatic public string AsJoinedString(this IEnumerable ie, string st = \" \") {\n\t\treturn string.Join(st, ie);\n\t}\n\tstatic public void Main() {\n\t\tConsole.SetOut(new Program.IO.Printer(Console.OpenStandardOutput()) { AutoFlush = false });\n\t\tvar solver = new Program.Solver();\n\t\tvar t = new System.Threading.Thread(solver.Solve, 50000000);\n\t\tt.Start();\n\t\tt.Join();\n\t\t//solver.Solve();\n\t\tConsole.Out.Flush();\n\t}\n}\n#endregion\n#region Ex\nnamespace Program.IO {\n\tusing System.IO;\n\tusing System.Text;\n\tusing System.Globalization;\n\n\tpublic class Printer : StreamWriter {\n\t\tpublic override IFormatProvider FormatProvider { get { return CultureInfo.InvariantCulture; } }\n\t\tpublic Printer(Stream stream) : base(stream, new UTF8Encoding(false, true)) { }\n\t}\n\n\tpublic class StreamScanner {\n\t\tpublic StreamScanner(Stream stream) { str = stream; }\n\n\t\tpublic readonly Stream str;\n\t\tprivate readonly byte[] buf = new byte[1024];\n\t\tprivate int len, ptr;\n\t\tpublic bool isEof = false;\n\t\tpublic bool IsEndOfStream { get { return isEof; } }\n\n\t\tprivate byte read() {\n\t\t\tif (isEof) return 0;\n\t\t\tif (ptr >= len) {\n\t\t\t\tptr = 0;\n\t\t\t\tif ((len = str.Read(buf, 0, 1024)) <= 0) {\n\t\t\t\t\tisEof = true;\n\t\t\t\t\treturn 0;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn buf[ptr++];\n\t\t}\n\n\t\tpublic char Char() {\n\t\t\tbyte b = 0;\n\t\t\tdo b = read(); while ((b < 33 || 126 < b) && !isEof);\n\t\t\treturn (char)b;\n\t\t}\n\t\tpublic string Scan() {\n\t\t\tvar sb = new StringBuilder();\n\t\t\tfor (var b = Char(); b >= 33 && b <= 126; b = (char)read()) sb.Append(b);\n\t\t\treturn sb.ToString();\n\t\t}\n\t\tpublic string ScanLine() {\n\t\t\tvar sb = new StringBuilder();\n\t\t\tfor (var b = Char(); b != '\\n' && b != 0; b = (char)read()) if (b != '\\r') sb.Append(b);\n\t\t\treturn sb.ToString();\n\t\t}\n\t\tpublic long Long() { return isEof ? long.MinValue : long.Parse(Scan()); }\n\t\tpublic int Integer() { return isEof ? int.MinValue : int.Parse(Scan()); }\n\t\tpublic double Double() { return isEof ? double.NaN : double.Parse(Scan(), CultureInfo.InvariantCulture); }\n\t}\n}\n\n#endregion\n\n#region ModInt\n/// \n/// [0,) までの値を取るような数\n/// \npublic struct ModInt {\n\t/// \n\t/// 剰余を取る値.\n\t/// \n\tpublic const long Mod = (int)998244853;\n\n\t/// \n\t/// 実際の数値.\n\t/// \n\tpublic long num;\n\t/// \n\t/// 値が であるようなインスタンスを構築します.\n\t/// \n\t/// インスタンスが持つ値\n\t/// パフォーマンスの問題上,コンストラクタ内では剰余を取りません.そのため, ∈ [0,) を満たすような を渡してください.このコンストラクタは O(1) で実行されます.\n\tpublic ModInt(long n) { num = n; }\n\t/// \n\t/// このインスタンスの数値を文字列に変換します.\n\t/// \n\t/// [0,) の範囲内の整数を 10 進表記したもの.\n\tpublic override string ToString() { return num.ToString(); }\n\tpublic static ModInt operator +(ModInt l, ModInt r) { l.num += r.num; if (l.num >= Mod) l.num -= Mod; return l; }\n\tpublic static ModInt operator -(ModInt l, ModInt r) { l.num -= r.num; if (l.num < 0) l.num += Mod; return l; }\n\tpublic static ModInt operator *(ModInt l, ModInt r) { return new ModInt(l.num * r.num % Mod); }\n\tpublic static implicit operator ModInt(long n) { n %= Mod; if (n < 0) n += Mod; return new ModInt(n); }\n\n\t/// \n\t/// 与えられた 2 つの数値からべき剰余を計算します.\n\t/// \n\t/// べき乗の底\n\t/// べき指数\n\t/// 繰り返し二乗法により O(N log N) で実行されます.\n\tpublic static ModInt Pow(ModInt v, long k) { return Pow(v.num, k); }\n\n\t/// \n\t/// 与えられた 2 つの数値からべき剰余を計算します.\n\t/// \n\t/// べき乗の底\n\t/// べき指数\n\t/// 繰り返し二乗法により O(N log N) で実行されます.\n\tpublic static ModInt Pow(long v, long k) {\n\t\tlong ret = 1;\n\t\tfor (k %= Mod - 1; k > 0; k >>= 1, v = v * v % Mod)\n\t\t\tif ((k & 1) == 1) ret = ret * v % Mod;\n\t\treturn new ModInt(ret);\n\t}\n\t/// \n\t/// 与えられた数の逆元を計算します.\n\t/// \n\t/// 逆元を取る対象となる数\n\t/// 逆元となるような値\n\t/// 法が素数であることを仮定して,フェルマーの小定理に従って逆元を O(log N) で計算します.\n\tpublic static ModInt Inverse(ModInt v) { return Pow(v, Mod - 2); }\n}\n#endregion\n#region Binomial Coefficient\npublic class BinomialCoefficient {\n\tpublic ModInt[] fact, ifact;\n\tpublic BinomialCoefficient(int n) {\n\t\tfact = new ModInt[n + 1];\n\t\tifact = new ModInt[n + 1];\n\t\tfact[0] = 1;\n\t\tfor (int i = 1; i <= n; i++)\n\t\t\tfact[i] = fact[i - 1] * i;\n\t\tifact[n] = ModInt.Inverse(fact[n]);\n\t\tfor (int i = n - 1; i >= 0; i--)\n\t\t\tifact[i] = ifact[i + 1] * (i + 1);\n\t\tifact[0] = ifact[1];\n\t}\n\tpublic ModInt this[int n, int r] {\n\t\tget {\n\t\t\tif (n < 0 || n >= fact.Length || r < 0 || r > n) return 0;\n\t\t\treturn fact[n] * ifact[n - r] * ifact[r];\n\t\t}\n\t}\n\tpublic ModInt RepeatedCombination(int n, int k) {\n\t\tif (k == 0) return 1;\n\t\treturn this[n + k - 1, k];\n\t}\n}\n#endregion\n", "lang": "Mono C#", "bug_code_uid": "b156790679fc6e0f2adf95aa409ee0f0", "src_uid": "a2fcad987e9b2bb3e6395654cd4fcfbb", "apr_id": "57bc19fb70b960e37d82c27d5edcd284", "difficulty": 2300, "tags": ["dp", "math", "combinatorics", "number theory"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.48931466470154755, "equal_cnt": 10, "replace_cnt": 6, "delete_cnt": 2, "insert_cnt": 2, "fix_ops_cnt": 10, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\nclass Solution\n{\n\n static int Main(String[] args)\n {\n var z = Console.ReadLine().Split().Select(long.Parse).ToList();\n long n = z[0], x = z[1], y = z[2];\n long[] d = new long[(long)Math.Pow(10,7)];\n d[1] = x; d[2] = x + y;\n for (int i = 2; i <= n ; i++)\n {\n if (i % 2 != 0)\n d[i] = Math.Min(d[i - 1] + x, d[i + 1] + x);\n else\n d[i] = Math.Min(d[i - 1] + x, d[i / 2] + y);\n d[2 * i] = d[i] + y;\n }\n Console.WriteLine(d[n]);\n Console.Read();\n return 0;\n }\n}\n", "lang": "MS C#", "bug_code_uid": "870b89e981a306f838c025d751c71be1", "src_uid": "0f270af00be2a523515d5e7bd66800f6", "apr_id": "6bf1617f276615adaefa1e61e65a61b8", "difficulty": 2000, "tags": ["dp", "dfs and similar"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.5697356426618049, "equal_cnt": 13, "replace_cnt": 3, "delete_cnt": 5, "insert_cnt": 4, "fix_ops_cnt": 12, "bug_source_code": "using System;\nusing System.Linq;\n\nnamespace ConsoleApplication1\n{\n class Program\n {\n\n static void Main(string[] args)\n {\n string[] arg = Console.ReadLine().Split();\n Int64 requested = Convert.ToInt64(arg[0]);\n Int64 spd1 = Convert.ToInt64(arg[1]);\n Int64 spd2 = Convert.ToInt64(arg[2]);\n Int64[] minimize = new Int64[100000000];\n Int64[] temp = new Int64[4];\n minimize[1] = spd1;\n for (int i = 2; i <= requested; i++)\n {\n temp = new Int64[4] { minimize[i - 1] + spd1, minimize[Convert.ToInt32(Math.Ceiling(Convert.ToDecimal(i) / 2))] + spd2 + spd1 * (i % 2), i * spd1, minimize[Convert.ToInt32(Math.Round(Convert.ToDecimal(i) / 2))] + spd2 + spd1 * (i % 2)};\n minimize[i] = temp.Min();\n }\n Console.WriteLine(minimize[requested]);\n //Console.ReadKey();\n\n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "c303b0a704765c1bb7b0cca7a315a9f7", "src_uid": "0f270af00be2a523515d5e7bd66800f6", "apr_id": "4bfca848b4bd21115615a883ee1c423f", "difficulty": 2000, "tags": ["dp", "dfs and similar"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "delete", "lang_cluster": "C#"} {"similarity_score": 0.6808118081180812, "equal_cnt": 13, "replace_cnt": 5, "delete_cnt": 3, "insert_cnt": 4, "fix_ops_cnt": 12, "bug_source_code": "using System;\nusing System.Linq;\n\nnamespace ConsoleApplication1\n{\n class Program\n {\n\n static void Main(string[] args)\n {\n string[] arg = Console.ReadLine().Split();\n Int64 requested = Convert.ToInt64(arg[0]);\n Int64 spd1 = Convert.ToInt64(arg[1]);\n Int64 spd2 = Convert.ToInt64(arg[2]);\n Int64[] minimize = new Int64[requested + 1];\n Int64[] temp = new Int64[4];\n minimize[1] = spd1;\n long num2 = 0;\n for (int i = 2; i <= requested; i++)\n {\n num2 = spd2 + spd1 * (i % 2);\n minimize[i] = new[] { minimize[i - 1] + spd1, i * spd1, minimize[Convert.ToInt32(Math.Ceiling(Convert.ToDecimal(i) / 2))] + num2, minimize[Convert.ToInt32(Math.Round(Convert.ToDecimal(i) / 2))] + num2 }.Min();\n }\n Console.WriteLine(minimize[requested]);\n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "a99c862c40f6e13ab0738cae841f0aa1", "src_uid": "0f270af00be2a523515d5e7bd66800f6", "apr_id": "4bfca848b4bd21115615a883ee1c423f", "difficulty": 2000, "tags": ["dp", "dfs and similar"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.55, "equal_cnt": 22, "replace_cnt": 14, "delete_cnt": 3, "insert_cnt": 5, "fix_ops_cnt": 22, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\n\nnamespace codeforces3621a\n{\n\tclass Program\n\t{\n\t\tstatic long write, copy;\n\t\tstatic void Main(string[] args)\n\t\t{\n#if DEBUG\n\t\t\tTextReader reader = new StreamReader(\"..\\\\..\\\\input.txt\");\n#else\n\t\t\tTextReader reader = new StreamReader(Console.OpenStandardInput());\n#endif\n\t\t\tTextWriter writer = new StreamWriter(Console.OpenStandardOutput());\n\n\t\t\tvar data = reader.ReadLine().Split(' ').Select(x => long.Parse(x)).ToArray();\n\n\t\t\tvar n = data[0];\n\t\t\twrite = data[1];\n\t\t\tcopy = data[2];\n\n\t\t\tvar result = f(n);\n\n\t\t\twriter.WriteLine(result);\n\n\t\t\treader.Close();\n\t\t\twriter.Close();\n\t\t}\n\n\t\tprivate static long f(long n)\n\t\t{\n\t\t\tif (n == 1)\n\t\t\t\treturn write;\n\n\t\t\tif (n % 2 == 0)\n\t\t\t{\n\t\t\t\tvar result = Math.Min(copy, n / 2 * write) + f(n / 2); // 1111110 -> 111111\n\n\t\t\t\tvar t0 = n0(n);\n\t\t\t\tvar p0 = powerOf2(t0);\n\t\t\t\tif ((p0 * write + copy) < result)\n\t\t\t\t{\n\t\t\t\t\tvar up = p0 * write + copy + f((n + p0) / 2); // 1111110 -> 1000000\n\t\t\t\t\tresult = Math.Min(result, up);\n\t\t\t\t}\n\t\t\t\treturn result;\n\t\t\t} \n\t\t\telse \n\t\t\t{\n\t\t\t\tvar result = write + copy + f((n + 1) / 2);\n\n\t\t\t\t//var t1 = n1(n);\n\t\t\t\t//var writing1 = powerOf2(t1) - 1;\n\n\t\t\t\t//if (writing1 * write < result)\n\t\t\t\t//{\n\t\t\t\t//\tvar down1 = writing1 * write + f(n - writing1);\n\t\t\t\t//\tresult = Math.Min(down1, result);\n\t\t\t\t//}\n\n\t\t\t\tvar down1 = write + f(n - 1);\n\t\t\t\tresult = Math.Min(down1, result);\n\t\t\t\treturn result;\n\t\t\t}\n\t\t}\n\n\t\tprivate static long powerOf2(int n)\n\t\t{\n\t\t\tif (n == 0)\n\t\t\t\treturn 1;\n\t\t\treturn Enumerable.Range(1, n).Select(x => 2).Aggregate(1, (next, s) => next * s);\n\t\t}\n\n\t\tprivate static long Usual(long n)\n\t\t{\n\t\t\tvar result = 0L;\n\t\t\twhile (n > 0)\n\t\t\t{\n\t\t\t\tif (n % 2 == 0)\n\t\t\t\t{\n\t\t\t\t\tvar down = Math.Min(copy, write * n / 2);\n\t\t\t\t\tresult += down;\n\t\t\t\t\tn /= 2;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tresult += write;\n\t\t\t\t\tn--;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn result;\n\t\t}\n\n\t\tprivate static int n1(long m)\n\t\t{\n\t\t\tvar result = 0;\n\t\t\twhile (m % 2 == 1)\n\t\t\t{\n\t\t\t\tresult++;\n\t\t\t\tm /= 2;\n\t\t\t}\n\t\t\treturn result;\n\t\t}\n\n\t\tprivate static int n0(long m)\n\t\t{\n\t\t\tvar result = 0;\n\t\t\twhile (m % 2 == 0)\n\t\t\t{\n\t\t\t\tresult++;\n\t\t\t\tm /= 2;\n\t\t\t}\n\t\t\treturn result;\n\t\t}\n\n\t\tprivate static long Power2(long m)\n\t\t{\n\t\t\tvar result = 1L;\n\t\t\twhile (result < m)\n\t\t\t\tresult *= 2;\n\t\t\treturn result;\n\t\t}\n\t}\n}\n", "lang": "MS C#", "bug_code_uid": "ae46e1d03679f3679e9bb30efdebe139", "src_uid": "0f270af00be2a523515d5e7bd66800f6", "apr_id": "2cbf314e88618f2f6e3a9cc56e2b1c5b", "difficulty": 2000, "tags": ["dp", "dfs and similar"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.8095499116876789, "equal_cnt": 10, "replace_cnt": 6, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 9, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Text;\nusing System.Linq;\nusing System.Globalization;\n\nclass Program\n{\n static void Main(string[] args)\n {\n PushTestData(@\"10000000 1 177\");\n int n = RI();\n long x = RL();\n long y = RL();\n n = n + n + 1;\n long[] dp = new long[n];\n for (int i = 1; i < n; i++)\n dp[i] = dp[i - 1] + x;\n\n bool updated = true;\n while (updated)\n {\n updated = false;\n\n for (int i = 1; i < n; i++)\n {\n if (i + i < n && dp[i + i] > dp[i] + y)\n {\n dp[i + i] = dp[i] + y;\n updated = true;\n }\n\n if (i + 1 < n && dp[i + 1] > dp[i] + x)\n {\n dp[i + 1] = dp[i] + x;\n updated = true;\n }\n }\n\n for (int i = n - 1; i > 1; i--)\n if (dp[i - 1] > dp[i] + x)\n {\n dp[i - 1] = dp[i] + x;\n updated = true;\n }\n }\n\n Console.Write(dp[n / 2]);\n }\n\n\n #region Data Read\n private static char ReadSign()\n {\n while (true)\n {\n int ans = consoleReader.Read();\n if (ans == '?' || ans == '+' || ans == '-')\n return (char)ans;\n }\n }\n\n private static long GCD(long a, long b)\n {\n if (a % b == 0) return b;\n return GCD(b, a % b);\n }\n\n private static int Mod = 1000000007;\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 = RI() - 1;\n int b = RI() - 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 = RI();\n int b = RI();\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 RI()\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 RUL()\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 RL()\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[] RIA(int n)\n {\n int[] ans = new int[n];\n for (int i = 0; i < n; i++)\n ans[i] = RI();\n return ans;\n }\n\n private static long[] RLA(int n)\n {\n long[] ans = new long[n];\n for (int i = 0; i < n; i++)\n ans[i] = RL();\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[] ReadStringLine()\n {\n int ans;\n\n do\n {\n ans = consoleReader.Read();\n } while (ans == 10 || ans == 13);\n\n List s = new List();\n\n do\n {\n s.Add((char)ans);\n ans = consoleReader.Read();\n } while (ans != 10 && ans != 13);\n\n return s.ToArray();\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 private static char ReadNonLetter()\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 private static double DoubleFromString(string x)\n {\n return double.Parse(x, 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 TOLYAN_TEST\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 #endregion\n}", "lang": "MS C#", "bug_code_uid": "6984c8412e25589164efb6165a3c4301", "src_uid": "0f270af00be2a523515d5e7bd66800f6", "apr_id": "73da1a8b20418142d647f0a74f751cb1", "difficulty": 2000, "tags": ["dp", "dfs and similar"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.23162134944612287, "equal_cnt": 19, "replace_cnt": 14, "delete_cnt": 2, "insert_cnt": 3, "fix_ops_cnt": 19, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace Even_Odds\n{\n class Program\n {\n static void Main(string[] args)\n {\n long[] Numbers = Array.ConvertAll(Console.ReadLine().Split(' '), long.Parse);\n\n List Lista = new List();\n\n for (int i = 1; i <= Numbers[0]; i += 2)\n Lista.Add(i);\n for (int i = 2; i < Numbers[0]; i+=2)\n Lista.Add(i);\n\n var zdenek = Convert.ToInt32(Numbers[1]-1);\n\n Console.WriteLine(Lista[zdenek]);\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "df2c789da94daa45a38ffc8279314aee", "src_uid": "1f8056884db00ad8294a7cc0be75fe97", "apr_id": "f194896f9d38bda1ecf0c8ec1575c0b2", "difficulty": 900, "tags": ["math"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.859395532194481, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "namespace ZTCodeforces\n{\n using System;\n using System.Collections.Generic;\n using System.IO;\n using System.Linq;\n using System.Text;\n using System.Threading.Tasks;\n\n public static class Program\n {\n public static void Main(string[] args)\n {\n Console.WriteLine(new MischievousMessMakers().Solve(new TextInputHelper(Console.In)));\n }\n }\n\n internal class MischievousMessMakers : ISolver\n {\n public string Solve(InputHelper input)\n {\n int n = input.ReadInt(), k = input.ReadInt();\n k = Math.Min(k, n / 2);\n long result = 0, cur = n - 1;\n for (int i = 0; i < k; ++i)\n {\n result += cur + cur - 1;\n cur -= 2;\n }\n return result.ToString();\n }\n }\n\n internal interface ISolver\n {\n string Solve(InputHelper input);\n }\n\n internal abstract class InputHelper\n {\n private Queue tokens;\n private IEnumerator current;\n\n public InputHelper()\n {\n this.tokens = new Queue();\n }\n\n public int ReadInt()\n {\n ThrowIfNoNext();\n return int.Parse(this.tokens.Dequeue());\n }\n\n public long ReadLong()\n {\n ThrowIfNoNext();\n return long.Parse(this.tokens.Dequeue());\n }\n\n public string ReadString()\n {\n ThrowIfNoNext();\n return this.tokens.Dequeue();\n }\n\n public bool HasNext()\n {\n return this.tokens.Count == 0 ? this.EnsureData() : true;\n }\n\n /// \n /// Gets the next group of tokens. Returns null if no more groups are available.\n /// \n /// Next group or null.\n protected abstract IEnumerable GetNextGroup();\n\n private void ThrowIfNoNext()\n {\n if (!this.HasNext())\n {\n throw new InvalidOperationException(\"no more data\");\n }\n }\n\n private bool EnsureData()\n {\n if (this.tokens.Count == 0)\n {\n while (this.current == null || !this.current.MoveNext())\n {\n var next = this.GetNextGroup();\n\n if (next == null)\n {\n return false;\n }\n else\n {\n this.current = next.GetEnumerator();\n }\n }\n\n this.tokens.Enqueue(this.current.Current);\n }\n\n return true;\n }\n }\n\n internal class TextInputHelper : InputHelper\n {\n private TextReader reader;\n\n public TextInputHelper(TextReader reader)\n {\n this.reader = reader;\n }\n\n protected override IEnumerable GetNextGroup()\n {\n if (this.reader == null)\n {\n return null;\n }\n else\n {\n var cur = this.reader;\n this.reader = null;\n return cur.ReadWordsToEnd();\n }\n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "300e932f3a696b76d09c9076920a9734", "src_uid": "ea36ca0a3c336424d5b7e1b4c56947b0", "apr_id": "03f62754a86678fb3a71f9f5c3fc6e6f", "difficulty": 1200, "tags": ["math", "greedy"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.9987878787878788, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "using Systetm;\nusing System.Linq;\n\nclass Program\n{\npublic static string GetAnswer(int[] digits1, int[] digits2)\n{\n Array.Sort(digits1);\n Array.Sort(digits2);\n \n var comp = digits1[0].CompareTo(digits2[0]);\n if(comp == 0)\n return \"NO\"\n for(int i = 1; i < digits1.Length; i++) {\n var c = digits1[i].CompareTo(digits2[i]) * comp; \n if(c <= 0) {\n return \"NO\";\n }\n } \n \n return \"YES\";\n}\n\npublic static void Main()\n{\n var n = int.Parse(Console.ReadLine());\n var s = Console.ReadLine();\n var digits1 = s.Substring(0,n).ToCharArray().Select((c) => int.Parse(c.ToString())).ToArray(); \n var digits2 = s.Substring(n,n).ToCharArray().Select((c) => int.Parse(c.ToString())).ToArray();\n \n Console.WriteLine(GetAnswer(digits1, digits2));\n}\n}", "lang": "Mono C#", "bug_code_uid": "51ed40caa8ffb1d37dfa9451401d3655", "src_uid": "e4419bca9d605dbd63f7884377e28769", "apr_id": "cc7d018bd7daf29c9ebf9a58d3ea846f", "difficulty": 1100, "tags": ["greedy", "sortings"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C#"} {"similarity_score": 0.9926247288503254, "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;\nusing System.IO;\nusing System.Text;\n\nnamespace ConsoleApplication3\n{\n class Program\n {\n public void Run(TextReader tr, TextWriter tw)\n {\n int n = int.Parse(tr.ReadLine());\n string bilet = tr.ReadLine();\n int[] left = new int[n];\n int[] right = new int[n];\n for(int i = 0; i < n; i++)\n {\n left[i] = (int)(bilet[i] - '0');\n right[i] = (int)(bilet[i + n] - '0');\n }\n Array.Sort(left);\n Array.Sort(right);\n bool ls = true;\n bool gr = true;\n for (int i = 0; i < n; i++)\n {\n if (left[i]<=right[i])\n {\n gr = false;\n }\n if (left[i] >= right[i])\n {\n ls = false;\n }\n }\n tw.WriteLine(((ls || gr)?\"YES\":\"NO\"));\n }\n\n static void Main(string[] args)\n {\n new Program().Run(new StreamReader(Console.In, Console.Out);\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "adb78c8caabca5284758209cb7c12686", "src_uid": "e4419bca9d605dbd63f7884377e28769", "apr_id": "a69bd993a04d6f8354212724f161f00d", "difficulty": 1100, "tags": ["greedy", "sortings"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C#"} {"similarity_score": 0.9612868047982552, "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.Text;\n\nnamespace _292C\n{\n class Program\n {\n static void Main(string[] args)\n {\n string[] input = Console.ReadLine().Split(' ');\n long t = long.Parse(input[0]);\n long w = long.Parse(input[1]);\n long b = long.Parse(input[2]);\n\n long min = (w > b) ? b : w;\n if (t < min)\n Console.WriteLine(\"1/1\");\n else\n {\n long nok = NOK(w, b, t+1);\n long extra = (t / nok) * nok + min - t - 1;\n if ((extra < 0) || (nok == 1))\n extra = 0;\n long count = (t / nok + 1) * min - 1 - extra;\n\n long NOD = NOD_Evclid(t, count);\n t /= NOD;\n count /= NOD;\n\n Console.WriteLine(count.ToString() + \"/\" + t.ToString());\n Console.ReadLine();\n\n }\n }\n static long NOK(long a, long b, long def)\n {\n long min, max;\n if (a > b)\n {\n min = b;\n max = a;\n }\n else\n {\n min = a;\n max = b;\n }\n\n a = min / NOD_Evclid(max, min);\n if (def / max >= a)\n return a * max;\n else\n return def;\n }\n static long NOD_Evclid(long a, long b) // a>b !\n {\n //https://ru.wikipedia.org/wiki/Алгоритм_Евклида\n long r = a % b;\n while (r != 0)\n {\n a = b;\n b = r;\n r = a % b;\n }\n return b;\n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "be529be568642913ba6b72593b16cd73", "src_uid": "7a1d8ca25bce0073c4eb5297b94501b5", "apr_id": "77ee21206e6f05ad14564b2a4539aff2", "difficulty": 1800, "tags": ["math"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.8503734226113829, "equal_cnt": 11, "replace_cnt": 6, "delete_cnt": 0, "insert_cnt": 4, "fix_ops_cnt": 10, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\n\nnamespace _292C\n{\n class Program\n {\n static void Main(string[] args)\n {\n string[] input = Console.ReadLine().Split(' ');\n long t = long.Parse(input[0]);\n long w = long.Parse(input[1]);\n long b = long.Parse(input[2]);\n\n long min = (w > b) ? b : w;\n if (t < min)\n Console.WriteLine(\"1/1\");\n else\n {\n long nok = NOK(w, b);\n long extra = (t / nok) * nok + min - t;\n if ((extra < 0) || (nok == 1))\n extra = 0;\n long count = (t / nok + 1) * min - 1 - extra;\n\n long NOD = NOD_Evclid(t, count);\n t /= NOD;\n count /= NOD;\n\n Console.WriteLine(count.ToString() + \"/\" + t.ToString());\n Console.ReadLine();\n\n }\n }\n static long NOK(long a, long b)\n {\n long min, max;\n if (a > b)\n {\n min = b;\n max = a;\n }\n else\n {\n min = a;\n max = b;\n }\n\n long i = 2;\n long NOK = 1;\n while (i <= min)\n {\n if ((min % i == 0) && (max % i == 0))\n {\n min /= i;\n max /= i;\n NOK *= i;\n }\n else\n i++;\n }\n NOK *= min * max;\n return NOK;\n }\n static long NOD_Evclid(long a, long b) // a>b !\n {\n //https://ru.wikipedia.org/wiki/Алгоритм_Евклида\n long r = a % b;\n while (r != 0)\n {\n a = b;\n b = r;\n r = a % b;\n }\n return b;\n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "b45b0158629c47b3cdfe0a91faff62d5", "src_uid": "7a1d8ca25bce0073c4eb5297b94501b5", "apr_id": "77ee21206e6f05ad14564b2a4539aff2", "difficulty": 1800, "tags": ["math"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9991796554552912, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "#if DEBUG\nusing System.Reflection;\nusing System.Threading.Tasks;\n#endif\n\nusing System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\nusing System.Text;\nusing System.Numerics;\nusing System.Globalization;\n\n\nnamespace _438b\n{\n class Program\n {\n static string _inputFilename = \"input.txt\";\n static string _outputFilename = \"output.txt\";\n static bool _useFileInput = false;\n\n\n static void Main(string[] args)\n {\n StreamWriter file = null;\n#if DEBUG\n\t\t\tConsole.SetIn(getInput());\n#else\n if (_useFileInput)\n {\n Console.SetIn(File.OpenText(_inputFilename));\n file = new StreamWriter(_outputFilename);\n Console.SetOut(file);\n }\n#endif\n\n try\n {\n solution();\n }\n finally\n {\n if (_useFileInput)\n {\n file.Close();\n }\n }\n }\n\n static void solution()\n {\n #region SOLUTION\n\n var d = readIntArray();\n var h = d[0];\n var m = d[1];\n var s = d[2];\n var t1 = d[3];\n var t2 = d[4];\n\n var count = 60 * 60;\n var inm = count / 5;\n var ins = inm / 60;\n\n var hs = (h * count + m * 60 + s) % (12 * count);\n var ms = m * inm + s * ins;\n var ss = s;\n\n var hm = hs;\n var t1m = (t1 * count) % (12 * count);\n var t2m = (t2 * count) % (12 * count);\n var all = new int[] { hs, ms, ss };\n //var hc = (5L / 60L) / 60L;\n\n if (t1m > t2m)\n {\n if (!all.Any(t => t < t1m && t > t2m))\n {\n Console.WriteLine(\"YES\");\n return;\n }\n\n if (!all.Any(t => t > t1m || t < t2m || t == 0))\n {\n Console.WriteLine(\"YES\");\n return;\n }\n }\n else\n {\n if (!all.Any(t => t > t1m && t < t2m))\n {\n Console.WriteLine(\"YES\");\n return;\n }\n\n if (!all.Any(t => t < t1m || t > t2m || t == 0))\n {\n Console.WriteLine(\"YES\");\n return;\n }\n }\n\n Console.WriteLine(\"NO\");\n //var n = readInt();\n //var m = readInt();\n\n //var a = readIntArray();\n //var b = readIntArray();\n #endregion\n }\n\n //static Tuple hToM(int h, int m, int s)\n //{\n \n\n // return (h * 5) % 60;\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[] readIntArray()\n {\n return Console.ReadLine().Split(' ').Where(i => !string.IsNullOrEmpty(i)).Select(i => int.Parse(i)).ToArray();\n }\n\n static long[] readLongArray()\n {\n return Console.ReadLine().Split(' ').Where(i => !string.IsNullOrEmpty(i)).Select(i => long.Parse(i)).ToArray();\n }\n\n#if DEBUG\n\t\tstatic StreamReader getInput()\n\t\t{\n\t\t\tvar resName = Assembly.GetCallingAssembly().GetManifestResourceNames()[0];\n\t\t\tvar resource = Assembly.GetCallingAssembly().GetManifestResourceStream(resName);\n\n\t\t\treturn new StreamReader(resource);\n\t\t}\n#endif\n }\n}\n", "lang": "MS C#", "bug_code_uid": "6e81f36a35dc4150636874e2e5a6c527", "src_uid": "912c8f557a976bdedda728ba9f916c95", "apr_id": "51cc193be8338ee60ad4fff4445b3220", "difficulty": 1400, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.8265424912689173, "equal_cnt": 16, "replace_cnt": 7, "delete_cnt": 1, "insert_cnt": 7, "fix_ops_cnt": 15, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\n\n\nnamespace ConsoleApplication3\n{\n class Program\n {\n static void Main(string[] args)\n {\n string s = Console.ReadLine();\n int[] a = new int[s.Length];\n for (int i = 0; i < s.Length;i++ )\n { a[i] = Convert.ToInt32(s[i]); }\n int k = 0; bool t = true;\n for(int i=0;i= 7) { t = true; break; }\n }\n else { k = 0; t = false; }\n }\n if (t == false) { Console.WriteLine(\"NO\"); }\n else Console.WriteLine(\"YES\");\n \n \n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "cb912e238b47dab9e8eba35ad476796c", "src_uid": "ed9a763362abc6ed40356731f1036b38", "apr_id": "7777de38b4dbc5a8bbcecc6bd182f060", "difficulty": 900, "tags": ["strings", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.5813692480359147, "equal_cnt": 19, "replace_cnt": 7, "delete_cnt": 3, "insert_cnt": 8, "fix_ops_cnt": 18, "bug_source_code": "using System;\n\npublic class Test\n{\n public static void Main()\n {\n int n,k;\n string l =Console.ReadLine();\n n = int.Parse(l.Split(' ')[0]);\n k = int.Parse(l.Split(' ')[1]);\n\n string s = \"#\" + Console.ReadLine() + \"#\";\n\n int t = 0;\n for (int i = n-k; i > 0; i--)\n {\n t = 0;\n if (s[i-1] == 'N' || s[i+k] == 'N')\n continue;\n for (int j = 0; j < k; j++)\n if (s[i+j]=='Y')\n {\n t = 1;\n break;\n }\n if (t == 0) \n {\n // Console.WriteLine(i);\n break;\n }\n }\n \n \n if (t == 0)\n {\n for (int i = 1; i <= n; i++)\n if (s[i] == 'N') t++;\n else \n {\n if (t > k)\n {\n t = -1;\n break;\n }\n t = 0;\n }\n if (t == -1 || t > k) Console.WriteLine(\"NO\");\n else Console.WriteLine(\"YES\");\n }\n else Console.WriteLine(\"NO\");\n }\n}\n\n", "lang": "Mono C#", "bug_code_uid": "f63ac7af06eacd8f7f223b21fc954a09", "src_uid": "5bd578d3da5837c259b222336a194d12", "apr_id": "86efc99d7f7c563e5d3a5b972a817cff", "difficulty": 2000, "tags": ["dp"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.9332669322709163, "equal_cnt": 6, "replace_cnt": 2, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 5, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Text.RegularExpressions;\nusing System.IO;\n\n// ~\n\nnamespace CF {\n class Program {\n static void Main(string[] args) {\n\n#if DEBUG\n TextReader reader = new StreamReader(\"../../input.txt\");\n TextWriter writer = Console.Out;\n#else\n\t\t\tTextReader reader = new StreamReader(\"input.txt\");\n TextWriter writer = new StreamWriter(\"output.txt\");\n#endif\n\n for (int i = 0; i < 8; i++) {\n var line = reader.ReadLine().ToCharArray();\n for (int j = 1; j < line.Length; j++) {\n if (line[j - 1] == line[j]) {\n writer.WriteLine(\"NO\");\n writer.Close();\n return;\n }\n }\n }\n \n \n writer.WriteLine(\"YES\");\n writer.Close();\n#if DEBUG\n Console.ReadKey();\n#endif\n }\n }\n}", "lang": "Mono C#", "bug_code_uid": "40dd074121047c50751fd286f7429f86", "src_uid": "ca65e023be092b2ce25599f52acc1a67", "apr_id": "d4b1ece9f3000bb4b361047eb96f49d2", "difficulty": 1000, "tags": ["brute force", "strings"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9994931576279777, "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.Text;\nusing System.Text.RegularExpressions;\nusing System.IO;\n\n// ~\n\nnamespace CF {\n class Program {\n static void Main(string[] args) {\n\n#if DEBUG\n TextReader reader = new StreamReader(\"../../input.txt\");\n TextWriter writer = Console.Out;\n#else\n\t\t\tTextReader reader = Console.In\n TextWriter writer = Console.Out;\n#endif\n\n for (int i = 0; i < 8; i++) {\n var line = reader.ReadLine().ToCharArray();\n for (int j = 1; j < line.Length; j++) {\n if (line[j - 1] == line[j]) {\n writer.WriteLine(\"NO\");\n //writer.Close();\n return;\n }\n }\n }\n \n \n writer.WriteLine(\"YES\");\n //writer.Close();\n#if DEBUG\n Console.ReadKey();\n#endif\n }\n }\n}", "lang": "Mono C#", "bug_code_uid": "fea6ca61242053ac11393467991766f1", "src_uid": "ca65e023be092b2ce25599f52acc1a67", "apr_id": "d4b1ece9f3000bb4b361047eb96f49d2", "difficulty": 1000, "tags": ["brute force", "strings"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.027439024390243903, "equal_cnt": 10, "replace_cnt": 9, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 11, "bug_source_code": "//\n// main.cpp\n// CodeForces\n//\n// Created by Dakota Raymond on 1/12/17.\n// Copyright © 2017 Dakota Raymond. All rights reserved.\n//\n\n#include \n#include \n\nint main(){\n int damage1;\n int damage2;\n int damage3;\n \n std::cin >> damage1 >> damage2 >> damage3;\n \n int mod1 = damage3 % damage1;\n int mod2 = damage3 % damage2;\n mod1 = mod1 % damage2;\n mod2 = mod2 % damage1;\n if (mod1 == 0 || mod2 == 0) {\n std::cout << \"Yes\" << std::endl;\n } else {\n std::cout << \"No\" << std::endl;\n }\n \n \n return 0;\n}\n", "lang": "MS C#", "bug_code_uid": "821d507daf1a1c944d957da1a262fde9", "src_uid": "e66ecb0021a34042885442b336f3d911", "apr_id": "df38143e9d50087e6c9c26283995539d", "difficulty": 1100, "tags": ["math", "brute force", "number theory"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9232581317386971, "equal_cnt": 11, "replace_cnt": 6, "delete_cnt": 3, "insert_cnt": 1, "fix_ops_cnt": 10, "bug_source_code": "using System;\nusing System.Linq;\nusing System.Collections.Generic;\nusing Debug = System.Diagnostics.Debug;\nusing StringBuilder = System.Text.StringBuilder;\nusing System.Numerics;\nnamespace Program\n{\n public class Solver\n {\n public void Solve()\n {\n var len = sc.Integer();\n var k = sc.Integer();\n var d = sc.Integer();\n\n var dp = Enumerate(len + 2, x => new ModInteger[k + 2]);\n\n Func dfs = null;\n dfs = (cur, max) =>\n {\n if (cur < 0)\n return 0;\n //Debug.WriteLine(\"{0} {1}\", cur, max);\n if (cur == 0)\n {\n if (max >= d)\n return dp[cur][max] = 1;\n else return 0;\n }\n if (dp[cur][max].num > 0)\n return dp[cur][max];\n ModInteger ret = 0;\n for (int i = 1; i <= k; i++)\n ret += dfs(cur - i, Math.Max(max, i));\n return dp[cur][max] = ret;\n };\n dfs(len, 0);\n IO.Printer.Out.WriteLine(dp[len][0]);\n }\n\n\n\n public IO.StreamScanner sc = new IO.StreamScanner(Console.OpenStandardInput());\n static T[] Enumerate(int n, Func f) { var a = new T[n]; for (int i = 0; i < n; ++i) a[i] = f(i); return a; }\n\n }\n\n}\n\n#region Ex\nnamespace Program.IO\n{\n using System.IO;\n using System.Text;\n using System.Globalization;\n public class Printer : StreamWriter\n {\n static Printer() { Out = new Printer(Console.OpenStandardOutput()) { AutoFlush = false }; }\n public static Printer Out { get; set; }\n public override IFormatProvider FormatProvider { get { return CultureInfo.InvariantCulture; } }\n public Printer(System.IO.Stream stream) : base(stream, new UTF8Encoding(false, true)) { }\n public Printer(System.IO.Stream stream, Encoding encoding) : base(stream, encoding) { }\n public void Write(string format, IEnumerable source) { base.Write(format, source.OfType().ToArray()); }\n public void WriteLine(string format, IEnumerable source) { base.WriteLine(format, source.OfType().ToArray()); }\n }\n public class StreamScanner\n {\n public StreamScanner(Stream stream) { str = stream; }\n private readonly Stream str;\n private readonly byte[] buf = new byte[1024];\n private int len, ptr;\n public bool isEof = false;\n public bool IsEndOfStream { get { return isEof; } }\n private byte read()\n {\n if (isEof) return 0;\n if (ptr >= len) { ptr = 0; if ((len = str.Read(buf, 0, 1024)) <= 0) { isEof = true; return 0; } }\n return buf[ptr++];\n }\n public char Char() { byte b = 0; do b = read(); while (b < 33 || 126 < b); return (char)b; }\n\n public string Scan()\n {\n var sb = new StringBuilder();\n for (var b = Char(); b >= 33 && b <= 126; b = (char)read())\n sb.Append(b);\n return sb.ToString();\n }\n public long Long()\n {\n if (isEof) return long.MinValue;\n long ret = 0; byte b = 0; var ng = false;\n do b = read();\n while (b != '-' && (b < '0' || '9' < b));\n if (b == '-') { ng = true; b = read(); }\n for (; true; b = read())\n {\n if (b < '0' || '9' < b)\n return ng ? -ret : ret;\n else ret = ret * 10 + b - '0';\n }\n }\n public int Integer() { return (isEof) ? int.MinValue : (int)Long(); }\n public double Double() { return double.Parse(Scan(), CultureInfo.InvariantCulture); }\n private T[] enumerate(int n, Func f)\n {\n var a = new T[n];\n for (int i = 0; i < n; ++i) a[i] = f();\n return a;\n }\n\n public char[] Char(int n) { return enumerate(n, Char); }\n public string[] Scan(int n) { return enumerate(n, Scan); }\n public double[] Double(int n) { return enumerate(n, Double); }\n public int[] Integer(int n) { return enumerate(n, Integer); }\n public long[] Long(int n) { return enumerate(n, Long); }\n }\n}\nstatic class Ex\n{\n static public string AsString(this IEnumerable ie) { return new string(System.Linq.Enumerable.ToArray(ie)); }\n static public string AsJoinedString(this IEnumerable ie, string st = \" \") { return string.Join(st, ie); }\n static public void Main()\n {\n var solver = new Program.Solver();\n solver.Solve();\n Program.IO.Printer.Out.Flush();\n }\n}\n#endregion\n#region ModNumber\npublic struct ModInteger\n{\n public const long Mod = (long)1e9 + 7;\n public long num;\n public ModInteger(long n) : this() { num = n % Mod; }\n public override string ToString() { return num.ToString(); }\n public static ModInteger operator +(ModInteger l, ModInteger r) { var n = l.num + r.num; if (n >= Mod)n -= Mod; return new ModInteger(n); }\n public static ModInteger operator -(ModInteger l, ModInteger r) { var n = l.num - r.num; if (n < 0)n += Mod; return new ModInteger(n); }\n public static ModInteger operator *(ModInteger l, ModInteger r) { return new ModInteger((l.num * r.num) % Mod); }\n public static implicit operator ModInteger(long n) { return new ModInteger(n); }\n}\n#endregion", "lang": "MS C#", "bug_code_uid": "64aa3afd7b9842607f305df6e92db8ec", "src_uid": "894a58c9bba5eba11b843c5c5ca0025d", "apr_id": "d329aef4a721e872032a34d7afcca723", "difficulty": 1600, "tags": ["trees", "dp", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.7246224095539164, "equal_cnt": 15, "replace_cnt": 5, "delete_cnt": 2, "insert_cnt": 7, "fix_ops_cnt": 14, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Globalization;\n\nnamespace codeforces\n{\n class Program\n {\n static int[, ,] answer;\n static int modulo = 1000000007;\n static int k;\n static int ds;\n static void Main(string[] args)\n {\n var n = ReadIntArray();\n k = n[1];\n ds = n[2];\n Console.Write(Solve(n[0], n[2], false)%modulo);\n // Console.ReadKey();\n }\n static long Solve(int n, int d, bool used)\n {\n if (n - d < 0 && used)\n {\n d = 0;\n if (n < 0) return 0;\n }\n if (n - d < 0 && !used)\n {\n return 0;\n }\n if (n - d == 0)\n return 1;\n long ret = 0;\n for (int i = ds; i <= k; i++)\n {\n ret += Solve(n - i, ds, true);\n }\n for (int i = 1; i <= k; i++)\n {\n ret += Solve(n - i, ds, used);\n }\n return ret;\n \n }\n static int Find(int n, int[] a)\n {\n for (int i = 0; i < a.Length; i++)\n {\n if (a[i] == n)\n return i;\n }\n return -1;\n }\n static bool isPrime(int n)\n {\n for (int i = 2; i <= Math.Sqrt(n); i++)\n {\n if (n % i == 0)\n return false;\n }\n return true;\n }\n static int ReadInt()\n {\n return int.Parse(Console.ReadLine()); \n }\n static int[] ReadIntArray()\n {\n return Console.ReadLine().Split(' ').Select(int.Parse).ToArray();\n }\n static int[][] ReadIntMatrix(int rows)\n {\n int[][] result = new int[rows][];\n for (int i = 0; i < rows; i++)\n {\n result[i] = ReadIntArray();\n }\n return result;\n }\n static int GCD(int a, int b)\n {\n if (Max(a,b) % Min(a,b) == 0)\n return Min(a,b);\n return GCD(Min(a,b), Max(a,b) % Min(a,b));\n }\n static int Min(int a, int b)\n {\n return a <= b ? a : b;\n }\n static int Max(int a, int b)\n {\n return a >= b ? a : b;\n }\n static double Distance(Point a, Point b)\n {\n return Math.Sqrt((a.x - b.x) * (a.x - b.x) + (a.y - b.y) * (a.y - b.y));\n }\n }\n struct Point\n {\n public double x, y;\n public Point(int x, int y)\n {\n this.x = x;\n this.y = y;\n }\n }\n}", "lang": "MS C#", "bug_code_uid": "be3666ac1eede7375d86b666836b7cbf", "src_uid": "894a58c9bba5eba11b843c5c5ca0025d", "apr_id": "ed102954c699a8b10cc0fe1e217916a6", "difficulty": 1600, "tags": ["trees", "dp", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.4880541544996018, "equal_cnt": 23, "replace_cnt": 13, "delete_cnt": 2, "insert_cnt": 8, "fix_ops_cnt": 23, "bug_source_code": "#region Usings\nusing System;\nusing System.Collections;\nusing System.Collections.Generic;\nusing System.Diagnostics;\nusing System.IO;\nusing System.Linq;\nusing System.Reflection;\nusing System.Runtime.CompilerServices;\nusing System.Text;\nusing System.Threading;\nusing static System.Array;\nusing static System.Math;\n\n// ReSharper disable InconsistentNaming\n#pragma warning disable CS0675\n#endregion\n\npartial class Solution\n{\n\t#region Variables\n\tconst int MOD = 1000000007;\n\tconst int FactCache = 1000;\n\tconst long BIG = long.MaxValue >> 15;\n\n\t#endregion\n\n\tpublic void Solve()\n\t{\n\t\tint n = Ni();\n\t\tint k = Ni();\n\n\t\tvar y = new List();\n\t\tlong sum = 0;\n\t\ty.Add(sum);\n\t\tfor (int i = 0; i <= k; i++)\n\t\t{\n\t\t\tsum = (sum + ModPow(i + 1, k));\n\t\t\tif (sum >= MOD) sum -= MOD;\n\t\t\ty.Add(sum);\n\t\t}\n\n\t\tif (n < y.Count)\n\t\t\tWriteLine(y[n]);\n\t\telse\n\t\t\tWriteLine(Lagrange(y, n));\n\t}\n\n\tlong Lagrange(List y, long x)\n\t{\n\t\tlong ans = 0;\n\t\tlong k = 1;\n\t\tfor (int j = 1; j < y.Count; j++)\n\t\t{\n\t\t\tk = (k * (x - j)) % MOD;\n\t\t\tk = MOD - Div(k, j);\n\t\t}\n\n\t\tfor (int i = 0; i < y.Count; i++)\n\t\t{\n\t\t\tans = (ans + y[i] * k) % MOD;\n\t\t\tif (i + 1 >= y.Count) break;\n\t\t\tk = k * Div(x - i, x - (i + 1)) % MOD * Div(i - y.Count + 1, i + 1) % MOD;\n\t\t}\n\n\t\treturn Fix(ans);\n\t}\n\n\n\t#region Library\n\t#region Mod Math\n\n\tstatic int[] _inverse;\n\tstatic long Inverse(long n)\n\t{\n\t\tlong result;\n\n\t\tif (_inverse == null)\n\t\t\t_inverse = new int[1000];\n\n\t\tif (n >= 0 && n < _inverse.Length && (result = _inverse[n]) != 0)\n\t\t\treturn result - 1;\n\n\t\tresult = InverseDirect((int)n);\n\t\tif (n >= 0 && n < _inverse.Length)\n\t\t\t_inverse[n] = (int)(result + 1);\n\t\treturn result;\n\t}\n\n\tpublic static int InverseDirect(int a)\n\t{\n\t\tif (a < 0) return -InverseDirect(-a);\n\t\tint t = 0, r = MOD, t2 = 1, r2 = a;\n\t\twhile (r2 != 0)\n\t\t{\n\t\t\tvar q = r / r2;\n\t\t\tt -= q * t2;\n\t\t\tr -= q * r2;\n\n\t\t\tif (r != 0)\n\t\t\t{\n\t\t\t\tq = r2 / r;\n\t\t\t\tt2 -= q * t;\n\t\t\t\tr2 -= q * r;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tr = r2;\n\t\t\t\tt = t2;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\treturn r <= 1 ? (t >= 0 ? t : t + MOD) : -1;\n\t}\n\n\tstatic long Mult(long left, long right) =>\n\t\t(left * right) % MOD;\n\n\tstatic long Div(long left, long divisor) =>\n\t\tleft * Inverse(divisor) % MOD;\n\n\tstatic long Add(long x, long y) =>\n\t\t(x += y) >= MOD ? x - MOD : x;\n\n\tstatic long Subtract(long x, long y) => (x -= y) < 0 ? x + MOD : x;\n\n\tstatic long Fix(long n) => (n %= MOD) >= 0 ? n : n + MOD;\n\n\tstatic long ModPow(long n, long p, long mod = MOD)\n\t{\n\t\tlong b = n;\n\t\tlong result = 1;\n\t\twhile (p != 0)\n\t\t{\n\t\t\tif ((p & 1) != 0)\n\t\t\t\tresult = (result * b) % mod;\n\t\t\tp >>= 1;\n\t\t\tb = (b * b) % mod;\n\t\t}\n\t\treturn result;\n\t}\n\n\tstatic List _fact;\n\n\tstatic long Fact(int n)\n\t{\n\t\tif (_fact == null) _fact = new List(FactCache) { 1 };\n\t\tfor (int i = _fact.Count; i <= n; i++)\n\t\t\t_fact.Add(Mult(_fact[i - 1], i));\n\t\treturn _fact[n];\n\t}\n\n\tstatic long[] _ifact = new long[0];\n\tstatic long InverseFact(int n)\n\t{\n\t\tlong result;\n\t\tif (n < _ifact.Length && (result = _ifact[n]) != 0)\n\t\t\treturn result;\n\n\t\tvar inv = Inverse(Fact(n));\n\t\tif (n >= _ifact.Length) Resize(ref _ifact, _fact.Capacity);\n\t\t_ifact[n] = inv;\n\t\treturn inv;\n\t}\n\n\tstatic long Fact(int n, int m)\n\t{\n\t\tvar fact = Fact(n);\n\t\tif (m < n) fact = fact * InverseFact(n - m) % MOD;\n\t\treturn fact;\n\t}\n\n\tstatic long Comb(int n, int k)\n\t{\n\t\tif (k <= 1) return k == 1 ? n : k == 0 ? 1 : 0;\n\t\treturn Mult(Mult(Fact(n), InverseFact(k)), InverseFact(n - k));\n\t}\n\n\tpublic static long Combinations(long n, int k)\n\t{\n\t\tif (k <= 0) return k == 0 ? 1 : 0; // Note: n<0 -> 0 unless k=0\n\t\tif (k + k > n) return Combinations(n, (int)(n - k));\n\n\t\tvar result = InverseFact(k);\n\t\tfor (long i = n - k + 1; i <= n; i++) result = result * i % MOD;\n\t\treturn result;\n\t}\n\t#endregion\n\n\t#region Common\n\tpartial void TestData();\n\n\tstatic void Swap(ref T a, ref T b)\n\t{\n\t\tvar tmp = a;\n\t\ta = b;\n\t\tb = tmp;\n\t}\n\n\tstatic int Bound(T[] array, T value, bool upper = false)\n\t\twhere T : IComparable\n\t{\n\t\tint left = 0;\n\t\tint right = array.Length - 1;\n\n\t\twhile (left <= right)\n\t\t{\n\t\t\tint mid = left + (right - left >> 1);\n\t\t\tint cmp = value.CompareTo(array[mid]);\n\t\t\tif (cmp > 0 || cmp == 0 && upper)\n\t\t\t\tleft = mid + 1;\n\t\t\telse\n\t\t\t\tright = mid - 1;\n\t\t}\n\t\treturn left;\n\t}\n\n\tpublic static int Gcd(int n, int m)\n\t{\n\t\twhile (true)\n\t\t{\n\t\t\tif (m == 0) return n >= 0 ? n : -n;\n\t\t\tn %= m;\n\t\t\tif (n == 0) return m >= 0 ? m : -m;\n\t\t\tm %= n;\n\t\t}\n\t}\n\n\t[MethodImpl(MethodImplOptions.AggressiveInlining)]\n\tstatic unsafe int Log2(long value)\n\t{\n\t\tdouble f = unchecked((ulong)value); // +.5 -> -1 for zero\n\t\treturn (((int*)&f)[1] >> 20) - 1023;\n\t}\n\n\t[MethodImpl(MethodImplOptions.AggressiveInlining)]\n\tstatic int BitCount(long y)\n\t{\n\t\tvar x = unchecked((ulong)y);\n\t\tx -= (x >> 1) & 0x5555555555555555;\n\t\tx = (x & 0x3333333333333333) + ((x >> 2) & 0x3333333333333333);\n\t\tx = (x + (x >> 4)) & 0x0f0f0f0f0f0f0f0f;\n\t\treturn unchecked((int)((x * 0x0101010101010101) >> 56));\n\t}\n\n\t[MethodImpl(MethodImplOptions.AggressiveInlining)]\n\tstatic int HighestOneBit(int n) => n != 0 ? 1 << Log2(n) : 0;\n\t/*static unsafe int HighestOneBit(int x) // sometimes doesn't work\n\t{\n\t\tdouble f = unchecked((uint)x);\n return unchecked(1 << (((int*)&f)[1] >> 20) - 1023 & ~((x - 1 & -x - 1) >> 31));\n\t}*/\n\n\t[MethodImpl(MethodImplOptions.AggressiveInlining)]\n\tstatic unsafe long HighestOneBit(long x)\n\t{\n\t\tdouble f = unchecked((ulong)x);\n\t\treturn unchecked(1L << (((int*)&f)[1] >> 20) - 1023 & ~(x - 1 >> 63 & -x - 1 >> 63));\n\t}\n\t#endregion\n\n\t#region Fast IO\n\t#region Input\n\tstatic Stream inputStream;\n\tstatic int inputIndex, bytesRead;\n\tstatic byte[] inputBuffer;\n\tstatic StringBuilder builder;\n\tconst int MonoBufferSize = 4096;\n\tconst char EOL = (char)10, DASH = (char)45, ZERO = (char)48;\n\n\tstatic void InitInput(Stream input = null, int stringCapacity = 16)\n\t{\n\t\tbuilder = new StringBuilder(stringCapacity);\n\t\tinputStream = input ?? Console.OpenStandardInput();\n\t\tinputIndex = bytesRead = 0;\n\t\tinputBuffer = new byte[MonoBufferSize];\n\t}\n\n\tstatic void ReadMore()\n\t{\n\t\tif (bytesRead < 0) throw new FormatException();\n\t\tinputIndex = 0;\n\t\tbytesRead = inputStream.Read(inputBuffer, 0, inputBuffer.Length);\n\t\tif (bytesRead > 0) return;\n\t\tbytesRead = -1;\n\t\tinputBuffer[0] = (byte)EOL;\n\t}\n\n\tstatic int Read()\n\t{\n\t\tif (inputIndex >= bytesRead) ReadMore();\n\t\treturn inputBuffer[inputIndex++];\n\t}\n\n\tstatic T[] Na(int n, Func func, int z = 0)\n\t{\n\t\tn += z;\n\t\tvar list = new T[n];\n\t\tfor (int i = z; i < n; i++) list[i] = func();\n\t\treturn list;\n\t}\n\n\tstatic int[] Ni(int n, int z = 0) => Na(n, Ni, z);\n\n\tstatic long[] Nl(int n, int z = 0) => Na(n, Nl, z);\n\n\tstatic string[] Ns(int n, int z = 0) => Na(n, Ns, z);\n\n\tstatic int Ni() => checked((int)Nl());\n\n\tstatic long Nl()\n\t{\n\t\tvar c = SkipSpaces();\n\t\tbool neg = c == DASH;\n\t\tif (neg) { c = Read(); }\n\n\t\tlong number = c - ZERO;\n\t\twhile (true)\n\t\t{\n\t\t\tvar d = Read() - ZERO;\n\t\t\tif (unchecked((uint)d > 9)) break;\n\t\t\tnumber = number * 10 + d;\n\t\t\tif (number < 0) throw new FormatException();\n\t\t}\n\t\treturn neg ? -number : number;\n\t}\n\n\tstatic char[] Nc(int n)\n\t{\n\t\tvar list = new char[n];\n\t\tfor (int i = 0, c = SkipSpaces(); i < n; i++, c = Read()) list[i] = (char)c;\n\t\treturn list;\n\t}\n\n\tstatic string Ns()\n\t{\n\t\tvar c = SkipSpaces();\n\t\tbuilder.Clear();\n\t\twhile (true)\n\t\t{\n\t\t\tif (unchecked((uint)c - 33 >= (127 - 33))) break;\n\t\t\tbuilder.Append((char)c);\n\t\t\tc = Read();\n\t\t}\n\t\treturn builder.ToString();\n\t}\n\n\tstatic int SkipSpaces()\n\t{\n\t\tint c;\n\t\tdo c = Read(); while (unchecked((uint)c - 33 >= (127 - 33)));\n\t\treturn c;\n\t}\n\n\tstatic List[] NewGraph(int n, int m = 0, int off = 0)\n\t{\n\t\tn += 1 + off;\n\t\tvar g = new List[n];\n\t\tfor (int i = 0; i < n; i++)\n\t\t\tg[i] = new List();\n\n\t\tfor (int i = 0; i < m; i++)\n\t\t{\n\t\t\tint u = Ni() + off, v = Ni() + off;\n\t\t\tg[u].Add(v);\n\t\t\tg[v].Add(u);\n\t\t}\n\n\t\treturn g;\n\t}\n\n\tstatic string ReadLine()\n\t{\n\t\tbuilder.Clear();\n\t\twhile (true)\n\t\t{\n\t\t\tint c = Read();\n\t\t\tif (c < 32) { if (c == 10 || c <= 0) break; continue; }\n\t\t\tbuilder.Append((char)c);\n\t\t}\n\t\treturn builder.ToString();\n\t}\n\t#endregion\n\n\t#region Output\n\tstatic Stream outputStream;\n\tstatic byte[] outputBuffer;\n\tstatic int outputIndex;\n\n\tstatic void InitOutput(Stream output = null)\n\t{\n\t\toutputStream = output ?? Console.OpenStandardOutput();\n\t\toutputIndex = 0;\n\t\toutputBuffer = new byte[65535];\n\t}\n\n\tstatic void WriteLine(object obj = null)\n\t{\n\t\tWrite(obj);\n\t\tWrite(EOL);\n\t}\n\n\tstatic void WriteLine(long number)\n\t{\n\t\tWrite(number);\n\t\tWrite(EOL);\n\t}\n\n\tstatic void Write(long signedNumber)\n\t{\n\t\tulong number = unchecked((ulong)signedNumber);\n\t\tif (signedNumber < 0)\n\t\t{\n\t\t\tWrite(DASH);\n\t\t\tnumber = unchecked((ulong)(-signedNumber));\n\t\t}\n\n\t\tReserve(20 + 1); // 20 digits + 1 extra for sign\n\t\tint left = outputIndex;\n\t\tdo\n\t\t{\n\t\t\toutputBuffer[outputIndex++] = (byte)(ZERO + number % 10);\n\t\t\tnumber /= 10;\n\t\t}\n\t\twhile (number > 0);\n\n\t\tint right = outputIndex - 1;\n\t\twhile (left < right)\n\t\t{\n\t\t\tbyte tmp = outputBuffer[left];\n\t\t\toutputBuffer[left++] = outputBuffer[right];\n\t\t\toutputBuffer[right--] = tmp;\n\t\t}\n\t}\n\n\tstatic void Write(object obj)\n\t{\n\t\tif (obj == null) return;\n\n\t\tvar s = obj.ToString();\n\t\tReserve(s.Length);\n\t\tfor (int i = 0; i < s.Length; i++)\n\t\t\toutputBuffer[outputIndex++] = (byte)s[i];\n\t}\n\n\tstatic void Write(char c)\n\t{\n\t\tReserve(1);\n\t\toutputBuffer[outputIndex++] = (byte)c;\n\t}\n\n\tstatic void Write(byte[] array, int count)\n\t{\n\t\tReserve(count);\n\t\tCopy(array, 0, outputBuffer, outputIndex, count);\n\t\toutputIndex += count;\n\t}\n\n\tstatic void Reserve(int n)\n\t{\n\t\tif (outputIndex + n <= outputBuffer.Length)\n\t\t\treturn;\n\n\t\tDump();\n\t\tif (n > outputBuffer.Length)\n\t\t\tResize(ref outputBuffer, Max(outputBuffer.Length * 2, n));\n\t}\n\n\tstatic void Dump()\n\t{\n\t\toutputStream.Write(outputBuffer, 0, outputIndex);\n\t\toutputIndex = 0;\n\t}\n\n\tstatic void Flush()\n\t{\n\t\tDump();\n\t\toutputStream.Flush();\n\t}\n\n\t#endregion\n\t#endregion\n\n\t#region Main\n\n\tpublic static void Main()\n\t{\n\t\tAppDomain.CurrentDomain.UnhandledException += (sender, arg) =>\n\t\t{\n\t\t\tFlush();\n\t\t\tvar e = (Exception)arg.ExceptionObject;\n\t\t\tConsole.Error.WriteLine(e);\n\t\t\tvar line = new StackTrace(e, true).GetFrames()\n\t\t\t\t.Select(x => x.GetFileLineNumber()).FirstOrDefault(x => x != 0);\n\t\t\tvar wait = line % 300 * 10 + 5;\n\t\t\tvar process = Process.GetCurrentProcess();\n\t\t\twhile (process.TotalProcessorTime.TotalMilliseconds > wait && wait < 3000) wait += 1000;\n\t\t\twhile (process.TotalProcessorTime.TotalMilliseconds < Min(wait, 3000)) ;\n\t\t\tEnvironment.Exit(1);\n\t\t};\n\n\t\tInitInput(Console.OpenStandardInput());\n\t\tInitOutput(Console.OpenStandardOutput());\n#if __MonoCS__ && !C7\n var thread = new System.Threading.Thread(()=>new Solution().Solve());\n var f = BindingFlags.NonPublic | BindingFlags.Instance;\n var t = thread.GetType().GetField(\"internal_thread\", f).GetValue(thread);\n t.GetType().GetField(\"stack_size\", f).SetValue(t, 32 * 1024 * 1024);\n thread.Start();\n thread.Join();\n#else\n\t\tnew Solution().Solve();\n#endif\n\t\tFlush();\n\t\tConsole.Error.WriteLine(Process.GetCurrentProcess().TotalProcessorTime);\n\t}\n\t#endregion\n\t#endregion\n}\n", "lang": "Mono C#", "bug_code_uid": "0d08e9e0c198cc98458a3d8919901c77", "src_uid": "6f6fc42a367cdce60d76fd1914e73f0c", "apr_id": "7da7aac2da63de8704ebdebdabe7e773", "difficulty": 2600, "tags": ["math"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.6683804627249358, "equal_cnt": 6, "replace_cnt": 3, "delete_cnt": 2, "insert_cnt": 0, "fix_ops_cnt": 5, "bug_source_code": "using System;\nusing System.Linq;\nusing System.Collections.Generic;\nusing System.Globalization;\n\t\t\t\npublic class Program\n{\n\tpublic static void Main()\n\t{\n\t\tvar x=Array.ConvertAll(Console.ReadLine().Split(), ulong.Parse);\n\t\tint s=0,d=0;\n\t\t\n\t\tfor(int i=1; i<=int.MaxValue; i++)\n\t\t{\n\t\t\tif(i%2!=0)\n\t\t\t{\n\t\t\t\tif(x[0]>=x[1]) { x[0]-=x[1]; s++;}\n\t\t\t\telse break;\n\t\t\t}\n\t\t\telse if(i%2==0)\n\t\t\t{\n\t\t\t\tif(x[0]>=x[1]) { x[0]-=x[1]; d++;}\n\t\t\t\telse break;\n\t\t\t}\n\t\t}\n\t\tConsole.WriteLine(s>d ? \"YES\": \"NO\");\n\t}\n}\n\n\n\n", "lang": "MS C#", "bug_code_uid": "b6fe137faf1414d4cc902a4d84ece9f8", "src_uid": "05fd61dd0b1f50f154eec85d8cfaad50", "apr_id": "d2c4705f86e54f76e2b99e6980169293", "difficulty": 800, "tags": ["math", "games"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.6239144956579826, "equal_cnt": 10, "replace_cnt": 6, "delete_cnt": 3, "insert_cnt": 0, "fix_ops_cnt": 9, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace ConsoleApplication28\n{\n class Program\n {\n static void Main(string[] args)\n {\n string[] o = Console.ReadLine().Split();\n long n = long.Parse(o[0]);\n long k = long.Parse(o[1]);\n long sa = 0, ho = 0;\n for (int i = 1; i <= n; i++)\n {\n if (i%2!=0)\n {\n sa += k;\n n = n - k;\n }\n else\n {\n ho += k;\n n = n - k;\n }\n if (nho)\n {\n Console.WriteLine(\"YES\");\n }\n else\n {\n Console.WriteLine(\"NO\");\n }\n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "866eb9b0ab6c9e303b8529d38831c71a", "src_uid": "05fd61dd0b1f50f154eec85d8cfaad50", "apr_id": "62bf1b896883c960697ed26ef56ef99e", "difficulty": 800, "tags": ["math", "games"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.982646420824295, "equal_cnt": 3, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "using System;\nusing System.Text;\nusing System.Collections.Generic;\n\n//\n\nnamespace CodeForces\n{\n\n class Program\n {\n\n void solve()\n {\n int[] nk = Array.ConvertAll(Console.ReadLine().Split(' '), Int32.Parse);\n Console.WriteLine((nk[0] / nk[1]) % 2 == 0 ? \"NO\" : \"YES\");\n }\n\n static void Main()\n {\n new Program().solve();\n#if DEBUG\n Console.ReadKey(true);\n#endif\n }\n }\n}", "lang": "MS C#", "bug_code_uid": "d55afa36fbd8ca65833d3015436dcbbf", "src_uid": "05fd61dd0b1f50f154eec85d8cfaad50", "apr_id": "bf10f78c023e8d456bc90e04c615a48f", "difficulty": 800, "tags": ["math", "games"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.7401086113266098, "equal_cnt": 4, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 3, "bug_source_code": "using System;\n\nnamespace taskA\n{\n class Program\n {\n static void Main(string[] args)\n {\n string str = Console.ReadLine();\n int i = str.IndexOf(' ');\n long n = Math.Max(long.Parse(str.Substring(0, i)), 1L);\n long k = Math.Min(long.Parse(str.Substring(i)), 1000000000000000000L);\n\n if (k > n)\n k = n;\n\n int i2 = 0;\n i = 0;\n while (n >= k)\n {\n i++;\n n -= k;\n if (n >= k)\n {\n i2++;\n n -= k;\n }\n }\n\n str = (i > i2) ? \"YES\" : \"NO\";\n\n Console.WriteLine(str);\n }\n }\n}", "lang": "MS C#", "bug_code_uid": "75f6f6e6064dcda04581b74735b03282", "src_uid": "05fd61dd0b1f50f154eec85d8cfaad50", "apr_id": "925dae1018fa84998b9354fc2ec770d1", "difficulty": 800, "tags": ["math", "games"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.7301775147928994, "equal_cnt": 10, "replace_cnt": 3, "delete_cnt": 4, "insert_cnt": 2, "fix_ops_cnt": 9, "bug_source_code": "using System;\nusing System.Linq;\nusing System.Collections.Generic;\n\nclass Program\n{\n\tstatic void Main()\n\t{\n\t\tint n = int.Parse(Console.ReadLine()), g = n;\n\t\tint max = 0, changes = 0, ans = 0, minN = 1;\n\t\tbool[] simple = new bool[n + 1];\n\t\tif (n == 1)\n\t\t{\n\t\t\tConsole.WriteLine(\"1 0\");\n\t\t\treturn;\n\t\t}\n\t\tfor (int i = 2; i <= n; i++)\n\t\t\tif (!simple[i])\n\t\t\t{\n\t\t\t\tfor (int j = i * i; j <= n; j += i)\n\t\t\t\t\tsimple[j] = true;\n\t\t\t\tint st = 0;\n\t\t\t\twhile (g % i == 0)\n\t\t\t\t{\n\t\t\t\t\tg /= i;\n\t\t\t\t\tst++;\n\t\t\t\t}\n\t\t\t\tif (st > 0)\n\t\t\t\t\tminN *= i;\n\t\t\t\tif (max != st)\n\t\t\t\t\tchanges++;\n\t\t\t\tif (max < st)\n\t\t\t\t\tmax = st;\n\t\t\t\tif (g == 1)\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\tif (Math.Pow(2, Math.Floor(Math.Log(max, 2))) != (double)max)\n\t\t{\n\t\t\tConsole.WriteLine(minN + \" \" + ((int)Math.Ceiling(Math.Log(max, 2)) + 1));\n\t\t\treturn;\n\t\t}\n\t\tif (changes > 1)\n\t\t\tans++;\n\t\tConsole.WriteLine(minN + \" \" + ((int)Math.Log(max, 2) + ans));\n\t\tConsole.ReadLine();\n\t}\n}", "lang": "Mono C#", "bug_code_uid": "627935b900bc5199221cf6c5e0c156dc", "src_uid": "212cda3d9d611cd45332bb10b80f0b56", "apr_id": "f9a680e8b15baea6823be0c2d1179e1e", "difficulty": 1500, "tags": ["greedy", "math", "number theory"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C#"} {"similarity_score": 0.6129329645726327, "equal_cnt": 12, "replace_cnt": 4, "delete_cnt": 3, "insert_cnt": 4, "fix_ops_cnt": 11, "bug_source_code": "using System;\nusing System.Collections;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\nusing System.Xml;\nusing System.Text.RegularExpressions;\n\n\n\n\nnamespace ProjectEuler\n{\n class Program\n {\n static void Main(string[] args)\n {\n int n = int.Parse(Console.ReadLine());\n\n IList primeFactors = new List();\n int byebye = 0;\n if (isprime(n))\n {\n Console.WriteLine(\"{0} {1}\", n, 0);\n\n }\n else\n {\n for (int i = 0; i <= n / 2; i++)\n {\n if (isprime(i) && n % i == 0)\n {\n primeFactors.Add(i);\n }\n }\n\n IList powers = new List();\n int numberOfFactors = primeFactors.Count;\n int counter = 0;\n\n for (int j = 0; j < numberOfFactors; j++)\n {\n do\n {\n counter++;\n n = n / primeFactors[j];\n\n } while (n % primeFactors[j] == 0);\n powers.Add(counter);\n counter = 0;\n }\n\n int max = powers.Max();\n int output = 0;\n if (max > 1)\n {\n output = PowerOfTwo(max);\n }\n\n int redflag = 0;\n foreach (var item in powers)\n {\n if (!IsPowerOfTwo(item))\n {\n redflag = 1;\n }\n }\n int min = 1;\n foreach (var item in primeFactors)\n {\n min *= item;\n }\n if (redflag == 1)\n {\n Console.WriteLine(\"{0} {1}\", min, output + 1);\n }\n else\n {\n Console.WriteLine(\"{0} {1}\", min, output);\n\n }\n }\n\n \n \n } \n\n public static int PowerOfTwo(int n)\n {\n int counter = 0;\n int tmp = n;\n\n while(n > 1)\n {\n counter++;\n n = n / 2;\n }\n\n if ((int)Math.Pow(2,counter) == tmp)\n {\n return counter;\n }\n else\n {\n return counter + 1;\n }\n \n }\n\n public static bool IsPowerOfTwo(int a)\n {\n int flag = 0;\n for (int i = 1; i < a; i++)\n {\n if (Math.Pow(2, i) == a)\n {\n flag = 1;\n }\n }\n if (flag != 0)\n {\n return true;\n }\n else\n {\n return false;\n }\n }\n\n // FOR GCD OF TWO INTS\n public static int gcd(int a, int b)\n {\n int GCD=0;\n while (b != 0)\n {\n GCD = b;\n b = a % b;\n a = GCD;\n }\n return GCD;\n }\n\n // For PRIME Numbers\n static bool isprime(double number)\n {\n if (number < 2) return false;\n if (number % 2 == 0) return (number == 2);\n int root = (int)Math.Sqrt((double)number);\n for (int i = 3; i <= root; i += 2)\n {\n if (number % i == 0) return false;\n }\n return true;\n }\n\n \n }\n}", "lang": "Mono C#", "bug_code_uid": "11403fa255ef4bd1195acec277a95ea3", "src_uid": "212cda3d9d611cd45332bb10b80f0b56", "apr_id": "aa1435e6b1d957403536d249058b3b93", "difficulty": 1500, "tags": ["greedy", "math", "number theory"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9803843074459567, "equal_cnt": 7, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 6, "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 Codeforces\n{\n class Program\n {\n \n static List Primes(int n)\n {\n\n bool[] is_prime = new bool[n + 1];\n\n for (int i = 0; i <= n; i++)\n {\n\n is_prime[i] = true;\n\n }\n\n is_prime[0] = false;\n is_prime[1] = false;\n\n List primes = new List();\n\n for (int i = 2; i <= (int)Math.Sqrt(1.0 * n); i++)\n {\n\n if (is_prime[i])\n {\n \n for (int j = 2 * i; j <= n; j += i)\n {\n\n is_prime[j] = false;\n\n }\n\n }\n\n }\n\n for (int i = 2; i <= n; i++)\n {\n\n primes.Add(i);\n\n }\n\n return primes;\n\n }\n \n static void Main(string[] args)\n {\n\n //Math\n\n int n = int.Parse(Console.ReadLine());\n\n int t = n, cnt = 0;\n\n while (Math.Sqrt(1.0 * t) == (int)Math.Sqrt(1.0 * t))\n {\n\n t = (int)Math.Sqrt(1.0 * t);\n\n cnt++;\n\n }\n\n List primes = Primes(n);\n\n int min_pow = int.MaxValue, max_pow = int.MinValue;\n\n int temp = 1;\n\n foreach (int x in primes)\n {\n\n if (t == 1) break;\n\n int c = 0;\n\n if (t % x == 0)\n {\n\n temp *= x;\n \n }\n\n while (t % x == 0)\n {\n\n t /= x;\n\n c++;\n\n }\n\n if (c > 0)\n {\n\n min_pow = Math.Min(min_pow, c);\n max_pow = Math.Max(max_pow, c);\n\n }\n\n }\n\n bool b = false;\n\n while (Math.Log10(1.0 * max_pow) / Math.Log10(2.0)\n != (int)(Math.Log10(1.0 * max_pow) / Math.Log10(2.0)))\n {\n\n b = true;\n\n max_pow++;\n\n }\n \n if (b || min_pow != max_pow) cnt++;\n\n cnt += (int)(Math.Log10(1.0 * max_pow) / Math.Log10(2.0));\n \n Console.WriteLine(temp + \" \" + cnt);\n\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "beb88c896d392513c449a0b4551f6402", "src_uid": "212cda3d9d611cd45332bb10b80f0b56", "apr_id": "be88071321d8c2b44178424710939672", "difficulty": 1500, "tags": ["greedy", "math", "number theory"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.90744920993228, "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 int N = int.Parse(Console.ReadLine());\n Console.WriteLine(N / 5 + (N % 5 == 0 ? 0 : 1));\n }\n }", "lang": "MS C#", "bug_code_uid": "520975d790b053e0acc79272077b95ed", "src_uid": "4b3d65b1b593829e92c852be213922b6", "apr_id": "d619d843586ae53bd19c3bfd70768d8c", "difficulty": 800, "tags": ["math"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.9981401115933044, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "/*\ncsc -debug C.cs && mono --debug C.exe <<< \"2 3\"\n*/\n\nusing System;\nusing System.Collections;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading;\nusing System.Reflection;\n\npublic class HelloWorld {\n const ulong MOD = 1000000007ul;\n public static void SolveCodeForces() {\n var n = cin.NUL();\n var m = cin.NUL();\n\n var Fib = new ulong[Math.Max(n, m) + 10];\n Fib[0] = 0;\n Fib[1] = 1;\n Fib[2] = 2;\n for (var i = 3; i < Fib.Length; i++)\n Fib[i] = (Fib[i - 1] + Fib[i - 2]) % MOD;\n\n ulong ans;\n\n if (n == 1)\n ans = 2ul * Fib[m];\n\n else if (m == 1)\n ans = 2ul * Fib[n];\n\n else {\n var row = Fib[m] + MOD - 1;\n var col = Fib[n];\n ans = 2ul * (row + col) % MOD;\n }\n\n System.Console.WriteLine(ans);\n }\n\n static Scanner cin = new Scanner();\n static StringBuilder cout = new StringBuilder();\n\n public static void Main () {\n SolveCodeForces();\n // IncreaseStack(SolveCodeForces);\n // System.Console.Write(cout.ToString());\n }\n\n public static void IncreaseStack(ThreadStart action, int stackSize = 128000000)\n {\n var thread = new Thread(action, stackSize);\n thread.Start();\n thread.Join();\n }\n}\n\npublic static class Helpers {\n public static string Join(this IEnumerable arr, string sep = \" \") {\n return string.Join(sep, arr);\n }\n\n public static void Swap(ref T a, ref T b) {\n var tmp = a;\n a = b;\n b = tmp;\n }\n\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\npublic class Scanner\n{\n private string[] line = new string[0];\n private int index = 0;\n\n public string Next() {\n if (line.Length <= index) {\n line = Console.ReadLine().Split(' ');\n index = 0;\n }\n var res = line[index];\n index++;\n return res;\n }\n\n public int NI() {\n return int.Parse(Next());\n }\n\n public long NL() {\n return long.Parse(Next());\n }\n\n public ulong NUL() {\n return ulong.Parse(Next());\n }\n\n public string[] Array() {\n line = Console.ReadLine().Split(' ');\n index = line.Length;\n return line;\n }\n\n public int[] NIA(int emptyPrefixLen = 0) {\n var array = Array();\n var result = new int[emptyPrefixLen + array.Length];\n for (int i = 0; i < array.Length; i++)\n result[emptyPrefixLen + i] = int.Parse(array[i]);\n return result;\n }\n\n public long[] NLA() {\n var array = Array();\n var result = new long[array.Length];\n for (int i = 0; i < array.Length; i++)\n result[i] = long.Parse(array[i]);\n return result;\n }\n\n public ulong[] NULA() {\n var array = Array();\n var result = new ulong[array.Length];\n for (int i = 0; i < array.Length; i++)\n result[i] = ulong.Parse(array[i]);\n return result;\n }\n}", "lang": "Mono C#", "bug_code_uid": "28a2665dcc009f5ef1e37dedc2747407", "src_uid": "0f1ab296cbe0952faa904f2bebe0567b", "apr_id": "41caadbea2c31c9d73a71ca62cad5151", "difficulty": 1700, "tags": ["dp", "math", "combinatorics"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.9537459283387623, "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;\n\nnamespace ConsoleApplication26\n{\n class Program\n {\n static void Main(string[] args)\n {\n int[] c = Console.ReadLine().Split().Select(int.Parse).ToArray();\n int i = 1;\n int r = c[0] % 10;\n if (c[0] % 5 == 0 && c[1] != 5)\n {\n while (r != 0)\n {\n i++;\n r = c[0] * i % 10;\n }\n }\n else\n while (r != c[1])\n {\n i++;\n r = c[0] * i % 10;\n }\n Console.WriteLine(i);\n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "a87a116d7bdbec5dead5ff27054cfb93", "src_uid": "18cd1cd809df4744bb7bcd7cad94e2d3", "apr_id": "28f958046b66743aa1d6bd8f0b0a7062", "difficulty": 800, "tags": ["brute force", "math", "constructive algorithms", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.9680998613037448, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 0, "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 ConsoleApplication6\n{\n class Program\n {\n static void Main(string[] args)\n {\n string stroka = Console.ReadLine();\n string[] splet = stroka.Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries);\n\n\n int k = Convert.ToInt32(splet[0]);\n int r = Convert.ToInt32(splet[1]);\n int i = 0; int sum = i * k;\n do\n {\n i++;\n sum = i * k;\n }\n while (sum % 10 != r);\n Console.WriteLine(i);\n \n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "31ba42fef2aaead35cba97688df6500f", "src_uid": "18cd1cd809df4744bb7bcd7cad94e2d3", "apr_id": "f042ef6d810c888615cc325b5719b9bd", "difficulty": 800, "tags": ["brute force", "math", "constructive algorithms", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.9897048730267674, "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.Text;\nusing System.Threading.Tasks;\n\nnamespace ConsoleApplication1\n{\n class Program\n {\n static void Main(string[] args)\n {\n int count = 1;\n\n string[] s = Console.ReadLine().Split(' ');\n\n int k = Convert.ToInt32(s[0]);\n int r = Convert.ToInt32(s[1]);\n if (k < 1 || k > 1000 || r < 1 || r > 9)\n return;\n\n int x = k;\n while (true)\n {\n if (x % 10 == r)\n break;\n\n count++;\n x = k * count;\n }\n Console.WriteLine(count);\n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "ed497fb838e7d7cb2ca2b4ce141f38b4", "src_uid": "18cd1cd809df4744bb7bcd7cad94e2d3", "apr_id": "3c4590e1134afa5431968744350eac03", "difficulty": 800, "tags": ["brute force", "math", "constructive algorithms", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.021971496437054632, "equal_cnt": 14, "replace_cnt": 13, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 15, "bug_source_code": "\n\n \n \n Debug\n AnyCPU\n {834994D1-E68F-4AA0-BB0D-BB4BF7004EDF}\n Exe\n Properties\n ConsoleApplication15\n ConsoleApplication15\n v4.5.2\n 512\n true\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 \n", "lang": "MS C#", "bug_code_uid": "fbe87b46bd0715357610c0a952f4312d", "src_uid": "18cd1cd809df4744bb7bcd7cad94e2d3", "apr_id": "d401eeac827bc6c1cc6cf4f7298ac0be", "difficulty": 800, "tags": ["brute force", "math", "constructive algorithms", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9281997918834547, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "using System;\n\n\nnamespace _732A.Buy_a_Shovel\n{\n class Program\n {\n static void Main(string[] args)\n {\n string line = Console.ReadLine();\n string[] tok = line.Split(' ');\n int k = int.Parse(tok[0]), r = int.Parse(tok[1]);\n int count = 1;\n while ((count*k-r)%10!=0)\n {\n count++;\n }\n Console.WriteLine(count);\n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "5d22ad5eb4f5f06749d10c255ec7e1e6", "src_uid": "18cd1cd809df4744bb7bcd7cad94e2d3", "apr_id": "81b167baa455c935694361413e5b33ef", "difficulty": 800, "tags": ["brute force", "math", "constructive algorithms", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "delete", "lang_cluster": "C#"} {"similarity_score": 0.2591298825023817, "equal_cnt": 28, "replace_cnt": 21, "delete_cnt": 2, "insert_cnt": 5, "fix_ops_cnt": 28, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace Alyona_copybooks\n{\n class Program\n {\n static void Main(string[] args)\n {\n long a, b, c, n = 0;\n\n String all_nums = Console.ReadLine();\n\n String[] numbers = new String[4];\n //StringBuilder[] numbers = new StringBuilder[4];\n numbers = all_nums.Split(' ');\n\n n = long.Parse(numbers[0]);\n a = long.Parse(numbers[1]);\n b = long.Parse(numbers[2]);\n c = long.Parse(numbers[3]);\n\n long copybooks,min=0,money;\n \n long to_buy = 4 - ((n) % 4);\n \n min = 4000000000;\n \n for (int i = 0; i <= 3; i++)\n {\n for (int j = 0; j <= 3; j++)\n {\n for (int k = 0; k <= 3; k++)\n {\n copybooks = n + (i) + (j*2) + (k*3);\n \n if(copybooks%4==0)\n {\n\n money = a*(i) + b*(j) + c*(k);\n if (money < min)\n min = money;\n }\n }\n }\n }\n\n Console.WriteLine(min);\n Console.ReadLine();\n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "2f291fe02599b1b53ffbea33a5f83aed", "src_uid": "18cd1cd809df4744bb7bcd7cad94e2d3", "apr_id": "cfcf94e314b5f42458d86a112b113c15", "difficulty": 800, "tags": ["brute force", "math", "constructive algorithms", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.886021505376344, "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.Text;\n\nnamespace ConsoleApplication2\n{\n class Program\n {\n static void Main(string[] args)\n {\n int k = Convert.ToInt32(Console.ReadLine());\n int r = Convert.ToInt32(Console.ReadLine());\n int a=1;\n if (k % 10 == 0 || k % 10 == r)\n {\n Console.WriteLine(1); \n Console.ReadKey();\n return;\n }\n int k2 = k;\n while (k2 % 10 != 0 && k2 % 10 != r)\n {\n k2+=k;\n a++;\n }\n Console.WriteLine(a);\n Console.ReadKey();\n\n\n }\n }\n}", "lang": "MS C#", "bug_code_uid": "b47c28c610b8e11b11ef6ae7bec3ab98", "src_uid": "18cd1cd809df4744bb7bcd7cad94e2d3", "apr_id": "345cead22e3ac433393e219901059322", "difficulty": 800, "tags": ["brute force", "math", "constructive algorithms", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.5728952772073922, "equal_cnt": 25, "replace_cnt": 7, "delete_cnt": 10, "insert_cnt": 8, "fix_ops_cnt": 25, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\nusing TopCoder;\n\nnamespace CodeForces\n{\n class Program\n {\n static void Main(string[] args)\n {\n\n string input = Console.ReadLine();\n string[] tokens = input.Split(' ');\n \n Int64 a = long.Parse(tokens[0]);\n Int64 b = long.Parse(tokens[1]);\n\n Console.WriteLine(Solve(a, b));\n\n }\n\n public static Int64 Solve(Int64 a, Int64 b)\n {\n\n\n Int64 cnt = 0;\n\n\n while (a != b && a > 0 && b > 0)\n {\n if (a < b)\n {\n cnt += b / a;\n b = b - b / a;\n\n }\n\n else\n {\n cnt += a / b;\n\n a = a - a / b;\n }\n }\n\n return cnt;\n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "4330e26f4da54cdbb5cf55623a0437c9", "src_uid": "ce698a0eb3f5b82de58feb177ce43b83", "apr_id": "1bf0088ba2b3fac1e50168d21fae675e", "difficulty": 1100, "tags": ["math", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C#"} {"similarity_score": 0.7166900420757363, "equal_cnt": 10, "replace_cnt": 5, "delete_cnt": 0, "insert_cnt": 4, "fix_ops_cnt": 9, "bug_source_code": "using System;\n\nnamespace Codeforces\n{\n class Class527A\n {\n static void Main(string[] args)\n {\n Int64 qty = 0;\n string[] cc = Console.ReadLine().Split(' ');\n Int64 a = Int64.Parse(cc[0]);\n Int64 b = Int64.Parse(cc[1]);\n Int64 ac = 0;\n\n while (a > 0 && b > 0 && (a - b) >= 0)\n {\n qty++;\n if ((a - b) >= b)\n {\n a = a - b;\n }\n else\n {\n ac = a;\n a = b;\n b = ac - b;\n }\n }\n\n Console.WriteLine(qty);\n }\n }\n}", "lang": "MS C#", "bug_code_uid": "9a4195eb6f696417f958c2ffbf8ab253", "src_uid": "ce698a0eb3f5b82de58feb177ce43b83", "apr_id": "717feb49ba130f20b4199a07074560c4", "difficulty": 1100, "tags": ["math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.5702380952380952, "equal_cnt": 16, "replace_cnt": 10, "delete_cnt": 0, "insert_cnt": 5, "fix_ops_cnt": 15, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\n\nnamespace ConsoleApplication11\n{\n class Program\n {\n static void Main(string[] args)\n {\n var intnumbers = Console.ReadLine().Split().Select(Int64.Parse).ToArray();\n\n var a = intnumbers[0];\n var b = intnumbers[1];\n\n long count = 0;\n\n while (a != 1 && b != 1)\n {\n if (a >= b)\n a = a - b;\n else\n b = b - a;\n count++;\n }\n\n if (a == 1)\n count += b;\n else if (b == 1)\n count += a;\n\n Console.WriteLine(count);\n Console.ReadLine();\n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "2b48757f6533c83296d5670a57433203", "src_uid": "ce698a0eb3f5b82de58feb177ce43b83", "apr_id": "a86acca3064532483e6e713bc7538cfc", "difficulty": 1100, "tags": ["math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9535918626827717, "equal_cnt": 4, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\n\nnamespace ConsoleApplication2\n{\n class Program\n {\n static void Main(string[] args)\n {\n string[] s = (Console.ReadLine()).Split();\n long a = Convert.ToInt64(s[0]);\n long b = Convert.ToInt64(s[1]);\n int c=0;\n while(a>0 && b>0)\n {\n if (a > b)\n {\n a = a + b;\n b = a - b;\n a = a - b;\n \n }\n c++;\n b = b - a;\n }\n Console.WriteLine(c);\n //Console.ReadLine();\n\n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "3e5ffb93f61e1a4cadac625b143401fc", "src_uid": "ce698a0eb3f5b82de58feb177ce43b83", "apr_id": "ea710713d6de8da7a4cab50f0dc889d8", "difficulty": 1100, "tags": ["math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.691970802919708, "equal_cnt": 8, "replace_cnt": 4, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 7, "bug_source_code": "using System;\nclass Program\n{\n static void Main()\n {\n long[] a = Array.ConvertAll(Console.ReadLine().Split(), long.Parse);\n int ans = 1;\n while (a[0] + a[1] != 2)\n {\n if (a[0] > a[1]) a[0] -= a[1];\n else a[1] -= a[0];\n ans++;\n }\n Console.WriteLine(ans);\n }\n}", "lang": "MS C#", "bug_code_uid": "9571be6fa68e9f2c402f1fbdf9140f56", "src_uid": "ce698a0eb3f5b82de58feb177ce43b83", "apr_id": "9d09bed7a1a43f705c22d6aa02672fdf", "difficulty": 1100, "tags": ["math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.45415472779369626, "equal_cnt": 15, "replace_cnt": 9, "delete_cnt": 1, "insert_cnt": 4, "fix_ops_cnt": 14, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\n\nnamespace ConsoleApplication77\n{\n class Program\n {\n static void Main(string[] args)\n {\n var e = Console.ReadLine().Split().Select(q => double.Parse(q)).ToArray();\n int k=1;\n while (e[0]!=e[1]&&(e[0] != 0&&e[1]!=0))\n {\n if (e[0] > e[1])\n {\n e[0] = e[0] - e[1];\n k++;\n }\n else\n {\n swap(ref e[0],ref e[1]);\n }\n }\n Console.WriteLine(k);\n \n }\n static void swap(ref double x,ref double y)\n {\n\n double tempswap = x;\n x = y;\n y = tempswap;\n } \n }\n}\n", "lang": "MS C#", "bug_code_uid": "412216fe38d8278188ac211478b3ca31", "src_uid": "ce698a0eb3f5b82de58feb177ce43b83", "apr_id": "41f31af7df9c00da86fa33b9b729e4bb", "difficulty": 1100, "tags": ["math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.6292993630573248, "equal_cnt": 12, "replace_cnt": 9, "delete_cnt": 3, "insert_cnt": 0, "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 CleanCode\n{\n class Program\n {\n static void Main(string[] args)\n {\n string x = Console.ReadLine();\n string[] y = x.Split(' ');\n double a = Convert.ToDouble(y[0]);\n double b = Convert.ToDouble(y[1]);\n int i = 0;\n if (1 <= b && b < a && a <= Math.Pow(10, 12))\n {\n while (b <= a)\n {\n double temp = a - b;\n a = temp < b ? b : temp;\n b = b < a ? b : temp;\n i++;\n if (b == 0)\n break;\n }\n }\n Console.WriteLine(i.ToString());\n }\n }\n}", "lang": "MS C#", "bug_code_uid": "df74e9f028e6f5a3742a654abaf0d3e9", "src_uid": "ce698a0eb3f5b82de58feb177ce43b83", "apr_id": "d0a8efff00b1aa2d906587bb07d3fda2", "difficulty": 1100, "tags": ["math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.8369325694138386, "equal_cnt": 10, "replace_cnt": 5, "delete_cnt": 3, "insert_cnt": 1, "fix_ops_cnt": 9, "bug_source_code": "using System;\nusing System.IO;\n\nnamespace Issue_527A\n{\n class Program\n {\n public static void Main(string[] args) {\n var width = IO.Read();\n var height = IO.Read();\n \n long count = 0;\n\n while (width > 0) {\n if (height > width)\n Swap(ref height, ref width);\n\n if (width % height == 0) {\n count += width / height;\n break;\n }\n\n width -= height;\n count++;\n }\n\n Console.WriteLine(count);\n }\n\n private static void Swap(ref long a, ref long b) {\n var temp = a;\n a = b;\n b = temp;\n }\n }\n\n public static class IO {\n static IO() {\n Reader = new StreamReader(\n Console.OpenStandardInput(sizeof(long)),\n System.Text.Encoding.ASCII,\n false, \n sizeof(long),\n false);\n }\n\n public static StreamReader Reader { get; set; }\n\n public static long Read() {\n const int zeroCode = (int) '0';\n\n long result = 0;\n int digit;\n long cache1;\n long cache2;\n\n var isNegative = false;\n var symbol = Reader.Read();\n\n while (symbol == ' ') {\n symbol = Reader.Read();\n }\n\n if (symbol == '-') {\n isNegative = true;\n symbol = Reader.Read();\n }\n\n for ( ;\n (symbol != -1) && (symbol != ' ');\n symbol = Reader.Read()\n ) {\n digit = symbol - zeroCode;\n \n if (digit < 10 && digit >= 0) {\n cache1 = result << 1;\n cache2 = cache1 << 2;\n result = cache1 + cache2 + digit;\n } else {\n if (symbol == 13) // if symbol == \\n\n Reader.Read(); // skip next \\r symbol\n break;\n }\n }\n\n return isNegative ? ~result + 1 : result;\n }\n\n public static string Line() {\n return Reader.ReadLine();\n }\n }\n}", "lang": "MS C#", "bug_code_uid": "75cbd7481eadc0b985210866accbdb55", "src_uid": "ce698a0eb3f5b82de58feb177ce43b83", "apr_id": "caa53ba7e1e52b8fcec099bfb81875c6", "difficulty": 1100, "tags": ["math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.593226137529935, "equal_cnt": 14, "replace_cnt": 3, "delete_cnt": 7, "insert_cnt": 3, "fix_ops_cnt": 13, "bug_source_code": "using System;\n\nnamespace ConsoleApplication1\n{\n class Program\n {\n static void Main(string[] args)\n {\n string[] input = Console.ReadLine().Split(' ');\n double a = Convert.ToDouble(input[0]);\n double b = Convert.ToDouble(input[1]);\n\n double answer = 0;\n \n while (a != b)\n {\n if (a > b)\n {\n if (a % b == 0)\n {\n answer += a / b;\n Console.WriteLine(answer);\n return;\n }\n a = a - b;\n }\n else\n {\n if (b % a == 0)\n {\n answer += b / a;\n Console.WriteLine(answer);\n return;\n }\n b = b - a;\n }\n\n answer++;\n }\n\n //answer++; // a == b\n\n Console.WriteLine(answer);\n }\n }\n} ", "lang": "MS C#", "bug_code_uid": "c4ed92ffdb39488c413756d77a24e2c5", "src_uid": "ce698a0eb3f5b82de58feb177ce43b83", "apr_id": "74dbdc719a44287faff79700212dfb95", "difficulty": 1100, "tags": ["math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "delete", "lang_cluster": "C#"} {"similarity_score": 0.9615784008307373, "equal_cnt": 8, "replace_cnt": 5, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 7, "bug_source_code": "using System;\n\nclass A714 {\n public static void Main() {\n var line = Console.ReadLine().Split();\n var l1 = int.Parse(line[0]);\n var r1 = int.Parse(line[1]);\n var l2 = int.Parse(line[2]);\n var r2 = int.Parse(line[3]);\n var k = int.Parse(line[4]);\n var l = Math.Max(l1, l2);\n var r = Math.Min(r1, r2);\n var ans = Math.Max(0, r - l + 1);\n if (l <= k && k <= r) --ans;\n Console.WriteLine(ans);\n }\n}\n", "lang": "MS C#", "bug_code_uid": "2b0723f50fdde0223c323eb50de07e6b", "src_uid": "9a74b3b0e9f3a351f2136842e9565a82", "apr_id": "1c2dc1f650dd8c16185dc11f9068d4fb", "difficulty": 1100, "tags": ["math", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.007430340557275541, "equal_cnt": 9, "replace_cnt": 9, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 10, "bug_source_code": "\n\n \n \n Debug\n AnyCPU\n {2EAAF829-089B-443C-A985-B1AB48407DE9}\n Exe\n Properties\n Task_01\n Task_01\n v4.5.2\n 512\n true\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 \n", "lang": "MS C#", "bug_code_uid": "5ddf2a19a96c6947809d7cc1702b70a9", "src_uid": "9a74b3b0e9f3a351f2136842e9565a82", "apr_id": "d85c036d2b08191a9c643b4703b70871", "difficulty": 1100, "tags": ["math", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.01808863430810974, "equal_cnt": 16, "replace_cnt": 15, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 16, "bug_source_code": "\n\n \n \n Debug\n AnyCPU\n {6E9044DB-BA15-4CBE-AC2A-7ABAA7C39024}\n Exe\n Properties\n FiljaISonja\n FiljaISonja\n v4.5\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": "MS C#", "bug_code_uid": "85f47470c5009d0529bc1609d9abccd3", "src_uid": "9a74b3b0e9f3a351f2136842e9565a82", "apr_id": "2b1fdf507a1658e46f73ea813321c4db", "difficulty": 1100, "tags": ["math", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.99033594109526, "equal_cnt": 4, "replace_cnt": 3, "delete_cnt": 0, "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 CodeforcesB\n{\n class Program\n {\n static void Main(string[] args)\n {\n var input = Console.ReadLine().Split(' ').Select(int.Parse).ToArray();\n\n int start = 0;\n int end = 0;\n\n if (input[0] < input[2])\n {\n start = input[2];\n } else\n {\n start = input[0];\n }\n\n if (input[1] < input[3])\n {\n end = input[1];\n }\n else\n {\n end = input[3];\n }\n\n if (end < start)\n {\n Console.WriteLine(0);\n } else\n {\n if (input[4] >= start && input[4] <= end)\n {\n\n } else\n {\n end++;\n }\n Console.WriteLine(end - start);\n }\n //Console.ReadLine();\n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "2b719afeeb55eb337a7a53b0a8d94878", "src_uid": "9a74b3b0e9f3a351f2136842e9565a82", "apr_id": "654bc33d1a9d7cbe9fe116f05830978e", "difficulty": 1100, "tags": ["math", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.5763842561707805, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "using System;\nusing System.Collections;\nusing System.Collections.Generic;\n\nnamespace CodeForces\n{\n class Program\n {\n static void Main(string[] args)\n {\n string str = Console.ReadLine();\n string[] strArray = str.Split(' ');\n long n = long.Parse(strArray[0]);\n long k = long.Parse(strArray[1]) - 1;\n\n List arr = new List();\n for (int i = 0; i < n; i++)\n {\n if ((i + 1) % 2 == 1)\n arr.Add(i + 1);\n }\n for (int i = 0; i < n; i++)\n {\n if ((i + 1) % 2 == 0)\n arr.Add(i + 1);\n }\n Console.WriteLine(arr[(int)k]);\n\n //Console.ReadKey();\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "0e7e9292583a12fa7756aa3dfd47d90a", "src_uid": "1f8056884db00ad8294a7cc0be75fe97", "apr_id": "04efdafc0906031a337a49eaa51a7dd2", "difficulty": 900, "tags": ["math"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9940420194418313, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "using System;\nusing System.IO;\nusing System.Collections.Generic;\npublic class dp_cut_ribbon_189A\n {\n Dictionary dp = new Dictionary();\n private int max(int a, int b, int c)\n {\n return Math.Max(a, Math.Max(b, c));\n }\n private int rec(int n, int a, int b, int c)\n {\n if (dp.ContainsKey(n))\n return dp[n];\n if (n < 0)\n return -1;\n if (n == 0)\n return 0;\n int x = rec(n - a, a, b, c), y = rec(n - b, a, b, c), z = rec(n - c, a, b, c);\n if (x >= 0 || y >= 0 || z >= 0)\n dp[n] = max(x, y, z) + 1;\n else\n dp[n] = -1;\n return dp[n];\n }\n public int solve(int n, int a, int b, int c)\n {\n return rec(n, a, b, c);\n }\n }\n class main\n {\n private static void print(string s = \"\")\n {\n Console.Write(s);\n }\n private static void print(int s)\n {\n Console.Write(s);\n }\n private static void printL(string s = \"\")\n {\n Console.WriteLine(s);\n }\n private static void printL(int s)\n {\n Console.WriteLine(s);\n }\n static void Main(string[] args)\n {\n int[] input = Console.ReadLine().Split(' ').Select(int.Parse).ToArray();\n\n dp_cut_ribbon_189A obj = new dp_cut_ribbon_189A();\n\n printL(obj.solve(input[0],input[1],input[2],input[3]));\n\n }\n }", "lang": "Mono C#", "bug_code_uid": "beae53f103e9e738f4a5f2b9e9851e3f", "src_uid": "062a171cc3ea717ea95ede9d7a1c3a43", "apr_id": "4a2e8ad2fa5d58d667d68f4a705b6e1e", "difficulty": 1300, "tags": ["dp", "brute force"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.8890221955608878, "equal_cnt": 5, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 4, "fix_ops_cnt": 5, "bug_source_code": "public class Test\n {\n public static void Main(string[] args)\n {\n string[] input = Console.ReadLine().Split(' ');\n int n = int.Parse(input[0]);\n int a = int.Parse(input[1]); \n int b = int.Parse(input[2]);\n int c = int.Parse(input[3]);\n\n int[] div = new int[n + 1];\n\n div[0] = 0;\n for (int i = Math.Min(a, Math.Min(b, c)); i <= n; ++i)\n {\n if (i >= a)\n div[i] = div[i - a] + 1;\n if (i >= b)\n div[i] = Math.Max(div[i], div[i - b] + 1);\n if(i >= c)\n div[i] = Math.Max(div[i], div[i - c] + 1);\n }\n\n Console.WriteLine(div[n]);\n }\n }", "lang": "Mono C#", "bug_code_uid": "6b06eaa8ae149108170d9f7f2836cae4", "src_uid": "062a171cc3ea717ea95ede9d7a1c3a43", "apr_id": "e1e9523f5c66ccbf1e6bbf34fdedf856", "difficulty": 1300, "tags": ["dp", "brute force"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.594714353536952, "equal_cnt": 18, "replace_cnt": 12, "delete_cnt": 6, "insert_cnt": 1, "fix_ops_cnt": 19, "bug_source_code": "\nusing System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace AlgoTraining.Codeforces.C_s\n{\n public class FastScanner : StreamReader\n {\n private string[] _line;\n private int _iterator;\n\n public FastScanner(Stream stream) : base(stream)\n {\n _line = null;\n _iterator = 0;\n }\n public string NextToken()\n {\n if (_line == null || _iterator >= _line.Length)\n {\n _line = base.ReadLine().Split(' ');\n _iterator = 0;\n }\n if (_line.Count() == 0) throw new IndexOutOfRangeException(\"Input string is empty\");\n return _line[_iterator++];\n }\n public int NextInt()\n {\n return Convert.ToInt32(NextToken());\n }\n public long NextLong()\n {\n return Convert.ToInt64(NextToken());\n }\n public float NextFloat()\n {\n return float.Parse(NextToken());\n }\n public double NextDouble()\n {\n return Convert.ToDouble(NextToken());\n }\n }\n class Array53\n {\n public static void Main(string[] args)\n {\n using (FastScanner fs = new FastScanner(new BufferedStream(Console.OpenStandardInput())))\n using (StreamWriter writer = new StreamWriter(new BufferedStream(Console.OpenStandardOutput())))\n {\n int n = fs.NextInt();\n long mod = 1000000007;\n if (n == 1)\n {\n writer.WriteLine(1);\n return;\n }\n long[,] factor = new long[n, n];\n long[,] initial = new long[1, n];\n for (int i = 0; i < n; i++)\n {\n initial[0, i] = n - i;\n for (int j = 0; j <= i; j++)\n {\n factor[i, j] = 1;\n }\n }\n factor = BinPowMatrixMod(factor, n - 1, mod);\n long[,] ans = MatrixProductMod(initial, factor, mod);\n writer.WriteLine((ans[0, 0] * 2 - n) % mod);\n }\n }\n public static long[,] BinPowMatrixMod(long[,] a, long p, long mod) // p >= 1\n {\n if (a.GetLength(0) != a.GetLength(1))\n {\n throw new Exception(\"Not a square matrix\");\n }\n\n if (p == 1) return a;\n if ((p & 1) == 0)\n {\n long[,] t = BinPowMatrixMod(a, p / 2, mod);\n return MatrixProductMod(t, t, mod);\n }\n else\n {\n return MatrixProductMod(a, BinPowMatrixMod(a, p - 1, mod), mod);\n }\n }\n private static long[,] MatrixProductMod(long[,] matrixA, long[,] matrixB, long mod)\n {\n int aRows = matrixA.GetLength(0); int aCols = matrixA.GetLength(1);\n int bRows = matrixB.GetLength(0); int bCols = matrixB.GetLength(1);\n if (aCols != bRows)\n throw new Exception(\"Can't multiply because of incompatible sizes\");\n\n long[,] result = new long[aRows, bCols];\n\n Parallel.For(0, aRows, i =>\n {\n for (int j = 0; j < bCols; ++j) // each col of B\n for (int k = 0; k < aCols; ++k) // could use k < bRows\n result[i, j] = (result[i, j] + matrixA[i, k] * matrixB[k, j]) % mod;\n });\n\n return result;\n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "a5e113d43f76b92a039581a2c02e4bdc", "src_uid": "13a9ffe5acaa79d97df88a069fc520b9", "apr_id": "26693c382f6851a32e10913360f8f05b", "difficulty": 1900, "tags": ["math", "combinatorics"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9981357196122297, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 2, "insert_cnt": 2, "fix_ops_cnt": 4, "bug_source_code": "\nusing System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace AlgoTraining.Codeforces.C_s\n{\n public class FastScanner : StreamReader\n {\n private string[] _line;\n private int _iterator;\n\n public FastScanner(Stream stream) : base(stream)\n {\n _line = null;\n _iterator = 0;\n }\n public string NextToken()\n {\n if (_line == null || _iterator >= _line.Length)\n {\n _line = base.ReadLine().Split(' ');\n _iterator = 0;\n }\n if (_line.Count() == 0) throw new IndexOutOfRangeException(\"Input string is empty\");\n return _line[_iterator++];\n }\n public int NextInt()\n {\n return Convert.ToInt32(NextToken());\n }\n public long NextLong()\n {\n return Convert.ToInt64(NextToken());\n }\n public float NextFloat()\n {\n return float.Parse(NextToken());\n }\n public double NextDouble()\n {\n return Convert.ToDouble(NextToken());\n }\n }\n class Array53\n {\n public static void Main(string[] args)\n {\n using (FastScanner fs = new FastScanner(new BufferedStream(Console.OpenStandardInput())))\n using (StreamWriter writer = new StreamWriter(new BufferedStream(Console.OpenStandardOutput())))\n {\n int n = fs.NextInt();\n int mod = 1000000007;\n if (n == 1)\n {\n writer.WriteLine(1);\n return;\n }\n long ans = (FactorialMod(2 * n - 1, mod) * 1L * BinPowMod((FactorialMod(n - 1, mod) * 1L * FactorialMod(n, mod)) % mod, mod - 2, mod)) % mod;\n writer.WriteLine(ans * 2 - n);\n }\n }\n\n public static int FactorialMod(int n, int mod)\n {\n long res = 1;\n while (n > 0)\n {\n for (int i = 2, m = n % mod; i <= m; i++)\n res = (res * i) % mod;\n if ((n /= mod) % 2 > 0)\n res = mod - res;\n }\n return (int)res;\n }\n\n public static long BinPowMod(long a, long p, long mod)\n {\n if (p == 0) return 1;\n if ((p & 1) == 0)\n {\n long t = BinPowMod(a, p / 2, mod);\n return (t * t) % mod;\n }\n else\n {\n return (a % mod * BinPowMod(a, p - 1, mod)) % mod;\n }\n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "eb96d65d2951cf436fa37729b0a6d26a", "src_uid": "13a9ffe5acaa79d97df88a069fc520b9", "apr_id": "26693c382f6851a32e10913360f8f05b", "difficulty": 1900, "tags": ["math", "combinatorics"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "C#"} {"similarity_score": 0.9540893348725691, "equal_cnt": 51, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 47, "fix_ops_cnt": 50, "bug_source_code": "#if DEBUG\nusing System.Reflection;\nusing System.Threading.Tasks;\n#endif\n\nusing System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\nusing System.Text;\nusing System.Numerics;\nusing System.Globalization;\n\n#if DEBUG\nusing System.Diagnostics;\n#endif\n\nnamespace _489с\n{\n class Program\n {\n static string _inputFilename = \"input.txt\";\n static string _outputFilename = \"output.txt\";\n static bool _useFileInput = false;\n const string _delim = \"!\";\n\n\n static void Main(string[] args)\n {\n StreamWriter file = null;\n#if DEBUG\n var testNumber = 0;\n var timer = new Stopwatch();\n foreach (var test in GetTests())\n {\n\n timer.Start();\n\n var defaultColor = Console.ForegroundColor;\n Console.ForegroundColor = ConsoleColor.DarkYellow;\n Console.WriteLine($\"\");\n Console.ForegroundColor = defaultColor;\n Console.SetIn(test);\n\n\n#else\n if (_useFileInput)\n {\n Console.SetIn(File.OpenText(_inputFilename));\n file = new StreamWriter(_outputFilename);\n Console.SetOut(file);\n }\n#endif\n\n try\n {\n#if DEBUG\n Solution(testNumber);\n#else\n Solution(0);\n#endif\n }\n finally\n {\n#if DEBUG\n#else\n if (_useFileInput)\n {\n file.Close();\n }\n#endif\n }\n\n#if DEBUG\n timer.Stop();\n\n Console.ForegroundColor = ConsoleColor.DarkYellow;\n Console.WriteLine($\"\");\n Console.ForegroundColor = defaultColor;\n\n timer.Reset();\n testNumber++;\n }\n#endif\n }\n\n static long mod = 1000 * 1000 * 1000 + 7;\n\n static void Solution(int testNumber)\n {\n #region SOLUTION\n var d = ReadLongArray();\n var x = d[0];\n var k = d[1];\n\n if (x == 0)\n {\n Console.WriteLine(0);\n return;\n }\n\n k++;\n var kp = Pow(2, k);\n kp *= x;\n kp %= mod;\n\n var next = 1L;\n if (k == 2)\n {\n next = -1;\n }\n else if (k == 1)\n {\n next = 0;\n }\n else if (k > 2)\n {\n //var gp = (1 - Pow(2, k - 2)) / (1 - 2);\n next = -Pow(2, k - 1) + 1;\n }\n\n var res = kp + next;\n res %= mod;\n\n Console.WriteLine(res);\n //var n = readInt();\n //var m = readInt();\n\n //var a = readIntArray();\n //var b = readIntArray();\n #endregion\n }\n\n static long Pow(long a, long pp)\n {\n var res = 1L;\n while (true)\n {\n if (pp % 2 == 1)\n {\n res *= a;\n res %= mod;\n pp--;\n }\n else\n {\n pp /= 2;\n a *= a;\n\n a %= mod;\n }\n\n if (pp == 0)\n {\n break;\n }\n }\n\n return res;\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[] ReadIntArray()\n {\n return Console.ReadLine().Split(' ').Where(i => !string.IsNullOrEmpty(i)).Select(i => int.Parse(i)).ToArray();\n }\n\n static long[] ReadLongArray()\n {\n return Console.ReadLine().Split(' ').Where(i => !string.IsNullOrEmpty(i)).Select(i => long.Parse(i)).ToArray();\n }\n\n#if DEBUG\n static IEnumerable GetTests()\n {\n var tests = new List();\n var resName = Assembly.GetCallingAssembly().GetManifestResourceNames()[0];\n using (var resource = new StreamReader(Assembly.GetCallingAssembly().GetManifestResourceStream(resName)))\n {\n while (true)\n {\n var nextText = new StringBuilder();\n var endOfFile = false;\n while (true)\n {\n var line = resource.ReadLine();\n\n endOfFile = line == null;\n if (endOfFile)\n {\n break;\n }\n\n if (line.StartsWith(_delim, StringComparison.Ordinal))\n {\n break;\n }\n\n nextText.AppendLine(line);\n }\n\n yield return new StringReader(nextText.ToString());\n\n if (endOfFile)\n {\n break;\n }\n }\n }\n }\n#endif\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "3e762e3d1d5aa6a921bce1cd59cb07dc", "src_uid": "e0e017e8c8872fc1957242ace739464d", "apr_id": "0c5f76e1609945f5200f9e2008180694", "difficulty": 1600, "tags": ["math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.9977785372522214, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "#if DEBUG\nusing System.Reflection;\nusing System.Threading.Tasks;\n#endif\n\nusing System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\nusing System.Text;\nusing System.Numerics;\nusing System.Globalization;\n\n#if DEBUG\nusing System.Diagnostics;\n#endif\n\nnamespace _489с\n{\n class Program\n {\n static string _inputFilename = \"input.txt\";\n static string _outputFilename = \"output.txt\";\n static bool _useFileInput = false;\n const string _delim = \"!\";\n\n\n static void Main(string[] args)\n {\n StreamWriter file = null;\n#if DEBUG\n var testNumber = 0;\n var timer = new Stopwatch();\n foreach (var test in GetTests())\n {\n\n timer.Start();\n\n var defaultColor = Console.ForegroundColor;\n Console.ForegroundColor = ConsoleColor.DarkYellow;\n Console.WriteLine($\"\");\n Console.ForegroundColor = defaultColor;\n Console.SetIn(test);\n\n\n#else\n if (_useFileInput)\n {\n Console.SetIn(File.OpenText(_inputFilename));\n file = new StreamWriter(_outputFilename);\n Console.SetOut(file);\n }\n#endif\n\n try\n {\n#if DEBUG\n Solution(testNumber);\n#else\n Solution(0);\n#endif\n }\n finally\n {\n#if DEBUG\n#else\n if (_useFileInput)\n {\n file.Close();\n }\n#endif\n }\n\n#if DEBUG\n timer.Stop();\n\n Console.ForegroundColor = ConsoleColor.DarkYellow;\n Console.WriteLine($\"\");\n Console.ForegroundColor = defaultColor;\n\n timer.Reset();\n testNumber++;\n }\n#endif\n }\n\n static long mod = 1000 * 1000 * 1000 + 7;\n\n static void Solution(int testNumber)\n {\n checked\n {\n #region SOLUTION\n var d = ReadLongArray();\n var x = d[0];\n var k = d[1];\n\n if (x == 0)\n {\n Console.WriteLine(0);\n return;\n }\n\n k++;\n var kp = Pow(2, k);\n kp *= x;\n kp %= mod;\n\n var next = 1L;\n if (k == 2)\n {\n next = -1;\n }\n else if (k == 1)\n {\n next = 0;\n }\n else if (k > 2)\n {\n //var gp = (1 - Pow(2, k - 2)) / (1 - 2);\n next = -Pow(2, k - 1) + 1;\n next %= mod;\n }\n\n var res = kp + next;\n if (res < 0)\n {\n res += mod;\n }\n res %= mod;\n\n Console.WriteLine(res);\n }\n //var n = readInt();\n //var m = readInt();\n\n //var a = readIntArray();\n //var b = readIntArray();\n #endregion\n }\n\n static long Pow(long a, long pp)\n {\n checked\n {\n var res = 1L;\n while (true)\n {\n if (pp % 2 == 1)\n {\n res *= a;\n res %= mod;\n pp--;\n }\n else\n {\n pp /= 2;\n a *= a;\n\n a %= mod;\n }\n\n if (pp == 0)\n {\n break;\n }\n }\n\n return res;\n }\n \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[] ReadIntArray()\n {\n return Console.ReadLine().Split(' ').Where(i => !string.IsNullOrEmpty(i)).Select(i => int.Parse(i)).ToArray();\n }\n\n static long[] ReadLongArray()\n {\n return Console.ReadLine().Split(' ').Where(i => !string.IsNullOrEmpty(i)).Select(i => long.Parse(i)).ToArray();\n }\n\n#if DEBUG\n static IEnumerable GetTests()\n {\n var tests = new List();\n var resName = Assembly.GetCallingAssembly().GetManifestResourceNames()[0];\n using (var resource = new StreamReader(Assembly.GetCallingAssembly().GetManifestResourceStream(resName)))\n {\n while (true)\n {\n var nextText = new StringBuilder();\n var endOfFile = false;\n while (true)\n {\n var line = resource.ReadLine();\n\n endOfFile = line == null;\n if (endOfFile)\n {\n break;\n }\n\n if (line.StartsWith(_delim, StringComparison.Ordinal))\n {\n break;\n }\n\n nextText.AppendLine(line);\n }\n\n yield return new StringReader(nextText.ToString());\n\n if (endOfFile)\n {\n break;\n }\n }\n }\n }\n#endif\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "a68083b33f8d6e86fc5d380fdbf933b7", "src_uid": "e0e017e8c8872fc1957242ace739464d", "apr_id": "0c5f76e1609945f5200f9e2008180694", "difficulty": 1600, "tags": ["math"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.9590288315629742, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "using System;\nusing System.Linq;\nclass DELETEME\n{\n static void Main()\n {\n var d = Console.ReadLine().Split().Select(Int32.Parse).ToArray();\n int r = d[1], k = d[0];\n var result = 1;\n while ((result * k - r) % 10 != 0)\n result++;\n Console.WriteLine(result);\n }\n}-", "lang": "Mono C#", "bug_code_uid": "f52a2d2d6bcb848fe7a127ef76d4c747", "src_uid": "18cd1cd809df4744bb7bcd7cad94e2d3", "apr_id": "ab0186bbec327a23d823c9211cc58b67", "difficulty": 800, "tags": ["brute force", "math", "constructive algorithms", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C#"} {"similarity_score": 0.9927007299270073, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "using System;\nusing System.Linq;\nclass DELETEME\n{\n static void Main()\n {\n var d = Console.ReadLine().Split().Select(Int32.Parse).ToArray();\n int r = d[1], k = d[0];\n var result = 1;\n while ((result * k - r) % 10 != 0 || (result * k) % 10 != 0)\n result++;\n Console.WriteLine(result);\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "08336fa292eb7529d9cd66171629e194", "src_uid": "18cd1cd809df4744bb7bcd7cad94e2d3", "apr_id": "ab0186bbec327a23d823c9211cc58b67", "difficulty": 800, "tags": ["brute force", "math", "constructive algorithms", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9423475736209042, "equal_cnt": 5, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 4, "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 Int64 n=Int64.Parse(Console.ReadLine());\n string[]s=Console.ReadLine().Split(' ');\n int[]a=new int[n];\n for(int i=0;i0)\n {\n if(a[0]<=15)\n {\n for(int i=1;i15)\n {\n Console.WriteLine(a[i-1]+15);\n d=true;\n break;\n }\n }\n if(d==false)\n Console.WriteLine(90);\n }\n else\n Console.WriteLine(15);\n }\n else\n {\n if(a[0]<=15)\n Console.WriteLine(a[0]+15);\n else\n Cosnole.WriteLine(15);\n }\n }\n \n }\n}", "lang": "Mono C#", "bug_code_uid": "24eb5b094bcf7a789fcba6f740ae4d60", "src_uid": "5031b15e220f0ff6cc1dd3731ecdbf27", "apr_id": "3a6873ecae0f0ba2d897647e2569b806", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.8869653767820774, "equal_cnt": 8, "replace_cnt": 2, "delete_cnt": 1, "insert_cnt": 5, "fix_ops_cnt": 8, "bug_source_code": "class Program\n{\n static void Main(string[] args) \n { \n int mins2 = Console.ReadLine();\n string minsList = Console.ReadLine();\n string[] mins = minsList.Split(' ');\n int[] finalMins = new int[mins.Length];\n for(int i = 0;i<= mins.Length - 1;i++)\n finalMins[i] = (int) mins[i];\n if(finalMins[0] > 15)\n Console.WriteLine(15);\n else\n {\n int result = 0;\n for(int j = 0;j<= finalMins.Length - 1;j++)\n {\n if(result + 15 >= finalMins[j] && result < 90)\n {\n result = finalMins[j];\n }\n else\n {\n result = result + 15;\n break;\n }\n \n }\n result = result > 90 ? 90 : result;\n Console.WriteLine(90);\n }\n \n \n }\n}", "lang": "Mono C#", "bug_code_uid": "e767209f8a9944238ed4584328d3fd31", "src_uid": "5031b15e220f0ff6cc1dd3731ecdbf27", "apr_id": "935274a9b45e59985dd149762438e19a", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.5199386503067485, "equal_cnt": 8, "replace_cnt": 4, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 7, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\n\nnamespace C\n{\n class Program\n {\n static void Main(string[] args)\n {\n long n = long.Parse(Console.ReadLine());\n long d = 1000000007;\n long p = 1;\n for (int i = 0; i < n; i++)\n {\n p = p << 1;\n p %= d;\n }\n long res = (p * p + p) / 2;\n res %= d; \n Console.WriteLine(res);\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "0f1f504017d8532783235f632d70f415", "src_uid": "782b819eb0bfc86d6f96f15ac09d5085", "apr_id": "4c8c400445d73377fa47cc2c9376a0aa", "difficulty": 1300, "tags": ["matrices", "dp", "math", "number theory"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9949776785714286, "equal_cnt": 4, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 3, "bug_source_code": "using System;\n\nnamespace GrassPlant\n{\n class Matrix\n {\n public long A11\n {\n get;\n set;\n }\n public long A12\n {\n get;\n set;\n }\n public long A21\n {\n get;\n set;\n }\n public long A22\n {\n get;\n set;\n }\n }\n\n class Program\n {\n private static int p = 1000000007;\n\n private static int n;\n\n private static Matrix m = new Matrix{A11 = 3, A12 = 1, A21 = 1, A22 = 3};\n\n static void Main(string[] args)\n {\n n = Convert.ToInt32(Console.ReadLine());\n\n long result = Solve();\n Console.Out.WriteLine(result);\n }\n\n private static long Solve()\n {\n return Power(n).A11;\n }\n\n static Matrix Power(long power)\n {\n if (power == 0)\n {\n return new Matrix{A11 = 1, A22 = 1, A12 = 0, A21 = 0};\n }\n if (power == 1)\n {\n return m;\n }\n\n long remainder = power % 2;\n Matrix result = Power(power / 2);\n result = Multiply(result, result);\n\n if (remainder == 1)\n {\n result = Multiply(result, m);\n }\n\n return result;\n }\n\n static Matrix Multiply(Matrix m1, Matrix m2)\n {\n return new Matrix\n {\n A11 = ((m1.A11 * m2.A11) % p + (m1.A12 * m2.A21) % p) % p, A12 = ((m1.A11 * m2.A12) % p + (m1.A12 * m2.A22) % p) % p,\n A21 = ((m1.A21 * m2.A11) % p + (m1.A22 * m2.A21) % p) % p, A22 = ((m1.A21 * m2.A12) % p + (m1.A22 * m2.A22) % p) % p\n };\n }\n }\n}", "lang": "Mono C#", "bug_code_uid": "4eaec242c08dfa5a45dfe1af5d3b1c38", "src_uid": "782b819eb0bfc86d6f96f15ac09d5085", "apr_id": "26fa3e32747c764cfbe953025ba85fd8", "difficulty": 1300, "tags": ["matrices", "dp", "math", "number theory"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9985350131848814, "equal_cnt": 4, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 1, "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 D.Polyline\n{\n class Program\n {\n static void Main(string[] args)\n {\n long[][] p = new long[3][];\n for (var i = 0; i < 3; ++i)\n p[i] = new long[2];\n for(var i = 0; i < 3; ++i) {\n var nm = Console.ReadLine().Split();\n p[i][0] = long.Parse(nm[0]);\n p[i][1] = long.Parse(nm[1]);\n }\n Console.WriteLine(function(p));\n }\n static long function(long[][] p)\n {\n long[] x = p[0];\n long[] y = p[1];\n long[] z = p[2];\n long _x = x[0];\n long _y = y[0];\n\n if (x[0] == y[0] && y[0] == z[0])\n return 1;\n\n if (x[1] == y[1] && y[1] == z[1])\n return 1;\n if (check(x, y, z) || check(x, z, y) || check(y, x, z))\n return 2;\n return 3;\n\n }\n static bool check(long[] p1, long[] p2, long[] p3)\n {\n if ((p1[0] == p2[0] || p2[0] == p3[0]) && belongX(p1, p2, p3))\n return true;\n if ((p1[1] == p2[1] || p2[1] == p3[1]) && belongY(p1, p2, p3))\n return true;\n return false;\n }\n static bool belongX(long[] p1, long[] p2, long[] p3)\n {\n return Math.Min(p1[0], p3[0]) <= p2[0] && p2[0] <= Math.Max(p1[0], p3[0]);\n }\n static bool belongY(long[] p1, long[] p2, long[] p3)\n {\n return Math.Min(p1[1], p3[1]) <= p2[1] && p2[1] <= Math.Max(p1[1], p3[1]);\n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "97d77058ba183d8fd1b9dfcf507404ed", "src_uid": "36fe960550e59b046202b5811343590d", "apr_id": "9bd9a4e3bf2eaef2cce06c199567ebdf", "difficulty": 1700, "tags": ["constructive algorithms", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9789800767684153, "equal_cnt": 5, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 4, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Text;\nusing System.Linq;\n\nclass Program\n{\n public class Point\n {\n public int X;\n public int Y;\n }\n\n public static Point ReadPoint()\n {\n var p = new Point();\n p.X = ReadInt();\n p.Y = ReadInt();\n\n return p;\n }\n\n private static int Count(Point a, Point b, Point c)\n {\n if (a.X == b.X && a.X == c.X) return 1;\n if (a.Y == b.Y && a.Y == c.Y) return 1;\n\n if (a.X == b.X) return 2;\n if (a.Y == b.Y) return 2;\n\n return 3;\n }\n\n static void Main(string[] args)\n {\n var a = ReadPoint();\n var b = ReadPoint();\n var c = ReadPoint();\n\n int[] ans = new int[6];\n ans[0] = Count(a, b, c);\n ans[1] = Count(a, c, b);\n ans[2] = Count(b, a, c);\n ans[3] = Count(b, c, a);\n ans[4] = Count(c, a, b);\n ans[5] = Count(c, b, a);\n\n Console.WriteLine(ans.Min());\n }\n\n private static List[] ReadGraph(int n, int m)\n {\n List[] g = new List[n + 1];\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();\n int b = ReadInt();\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 readonly StreamReader consoleReader = new StreamReader(Console.OpenStandardInput(BufferSize), Encoding.ASCII, false, BufferSize);\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');\n\n List s = new List();\n do\n {\n s.Add((char)ans);\n ans = consoleReader.Read();\n } while (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');\n\n char[] s = new char[n];\n int pos = 0;\n do\n {\n s[pos++] = (char)ans;\n ans = consoleReader.Read();\n } while (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 while (true)\n {\n return ReadDigit() - (int)'0';\n }\n }\n\n private static char ReadAnyChar()\n {\n return (char)consoleReader.Read();\n }\n}", "lang": "MS C#", "bug_code_uid": "2cd5bcd2c3c7b34b04e3e581e173b743", "src_uid": "36fe960550e59b046202b5811343590d", "apr_id": "c84fdd47566e4993bd3748c274b75aa4", "difficulty": 1700, "tags": ["constructive algorithms", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9793233082706767, "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.Text;\nusing System.Threading.Tasks;\n\nnamespace _742A__Сложный_экзамен_Arpa_и_наивный_чит_Mehrdad\n{\n class Program\n {\n static void Main(string[] args)\n {\n int n = int.Parse(Console.ReadLine());\n int[] res = { 8, 4, 2, 6 };\n if (n == 0)\n Console.WriteLine(1);\n else\n {\n Console.WriteLine(res[n % 4 - 1]);\n }\n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "6891041e96435e8d018b3462a31892f0", "src_uid": "4b51b99d1dea367bf37dc5ead08ca48f", "apr_id": "02dbb368257ecf574990ce3c09137db6", "difficulty": 1000, "tags": ["number theory", "math", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.825531914893617, "equal_cnt": 5, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 4, "bug_source_code": "using System;\n\t\t\t\t\t\npublic class Program\n{\n\tpublic static void Main()\n\t{\n\t\tint[] s = { 8, 4, 2, 6};\n\t long n = long.Parse(Console.ReadLine());\n\t\tn = (n % 4)-1 ;\n\t\tConsole.WriteLine(s[n]);\n\t}\n}", "lang": "MS C#", "bug_code_uid": "e8da9f916c3b90c631d514570e173345", "src_uid": "4b51b99d1dea367bf37dc5ead08ca48f", "apr_id": "b70a8ca02e0fdd35e13c109d9b47c467", "difficulty": 1000, "tags": ["number theory", "math", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.9986033519553073, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 3, "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 Scanner sc = new Scanner();\n //\n\n public void Solve()\n {\n int n, p, l, r;\n sc.Make(out n, out p, out l, out r);\n if (l == 1 && r == n) Fail(0);\n else if (l == 1) Fail(Abs(r - p) + 1);\n else if (r == n) Fail(Abs(l - p) + 1);\n WriteLine(r - l + Min(r - p, p - l) + 2);\n }\n}\n\n#region Template\npublic class Template\n{\n static void Main(string[] args)\n {\n Console.SetOut(new StreamWriter(Console.OpenStandardOutput()) { AutoFlush = false });\n new Solver().Solve();\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 void Fail(T s) { Console.WriteLine(s); Console.Out.Close(); Environment.Exit(0); }\n}\n\npublic class Scanner\n{\n public string Str => 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 public Pair PairMake() => new Pair(Next(), Next());\n public Pair PairMake() => new Pair(Next(), Next(), Next());\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}\n\npublic class Pair : IComparable>\n{\n public T1 v1;\n public T2 v2;\n public Pair() { }\n public Pair(T1 v1, T2 v2)\n { this.v1 = v1; this.v2 = v2; }\n\n [MethodImpl(MethodImplOptions.AggressiveInlining)]\n public int CompareTo(Pair p)\n {\n var c = Comparer.Default.Compare(v1, p.v1);\n if (c == 0)\n c = Comparer.Default.Compare(v2, p.v2);\n return c;\n }\n public override string ToString() => $\"{v1.ToString()} {v2.ToString()}\";\n public void Tie(out T1 a, out T2 b) { a = v1; b = v2; }\n}\n\npublic class Pair : Pair, IComparable>\n{\n public T3 v3;\n public Pair() : base() { }\n public Pair(T1 v1, T2 v2, T3 v3) : base(v1, v2)\n { this.v3 = v3; }\n\n [MethodImpl(MethodImplOptions.AggressiveInlining)]\n public int CompareTo(Pair p)\n {\n var c = base.CompareTo(p);\n if (c == 0)\n c = Comparer.Default.Compare(v3, p.v3);\n return c;\n }\n public override string ToString() => $\"{base.ToString()} {v3.ToString()}\";\n public void Tie(out T1 a, out T2 b, out T3 c) { Tie(out a, out b); c = v3; }\n}\n#endregion\n", "lang": "Mono C#", "bug_code_uid": "d9421ad9ab958308ae94c0dbae571b87", "src_uid": "5deaac7bd3afedee9b10e61997940f78", "apr_id": "03d94f57f8aae0237e55639c9437ba4e", "difficulty": 1300, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.9426086956521739, "equal_cnt": 3, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "using System;\nnamespace Contest\n{\nclass MainClass{\n public static void Main (string[] args){\n \n long a,b,k,s=0;\n string[] num = Console.ReadLine().Split(' ');\n a=long.Parse(num[0]);\n b=long.Parse(num[1]);\n while(((a%b)!=0)&&(a>0))\n { \n a-=b;\n s++;\n if(a _b && (_a - _ship * _b != 1))\n {\n _a = _a - _ship*_b;\n }\n else if (_a - _ship * _b == 1)\n {\n return _ship + _b;\n }\n else\n {\n return _ship;\n }\n }\n else\n {\n return _ship = _a/_b;\n }\n do\n {\n if ((_a - _b) > _b)\n {\n _ship += 1;\n _a = _a - _b;\n }\n else if ((_a - _b) < _b)\n {\n _ship += 1;\n var r = _b;\n _b = (_a - _b);\n _a = r;\n }\n else if ((_a - _b) == _b)\n {\n _ship += 2;\n _a = _a - _b;\n }\n else if ((_a - _b) == 0)\n {\n _ship += 1;\n }\n } while (_a - _b != 0);\n\n return _ship;\n }\n static void Main(string[] args)\n {\n Console.WriteLine(Count());\n //Console.ReadKey();\n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "86b9bce9b38df350a791121e8e6261ab", "src_uid": "ce698a0eb3f5b82de58feb177ce43b83", "apr_id": "28b16b4ab8d1a2fb84884ed5996ae1a0", "difficulty": 1100, "tags": ["math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.6518771331058021, "equal_cnt": 10, "replace_cnt": 3, "delete_cnt": 2, "insert_cnt": 4, "fix_ops_cnt": 9, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\n\nnamespace ConsoleApplication249\n{\n class Program\n {\n static void Main(string[] args)\n {\n string[] s = Console.ReadLine().Split();\n long a = long.Parse(s[0]);\n long b = long.Parse(s[1]);\n long[] m = { a, b };\n int k = 1;\n while (true)\n {\n if (m[0] == m[1])\n {\n break;\n }\n Array.Sort(m);\n m[1] -= m[0];\n k++;\n }\n Console.WriteLine(k);\n }\n }\n}\n\n\n\n", "lang": "MS C#", "bug_code_uid": "5725e83c04f42d7fc19d550fd9735b7c", "src_uid": "ce698a0eb3f5b82de58feb177ce43b83", "apr_id": "fb3f9d36de1c5e6418714f12312d7883", "difficulty": 1100, "tags": ["math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.6651818856718634, "equal_cnt": 7, "replace_cnt": 6, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 6, "bug_source_code": "using System;\nusing System.Linq;\n\nnamespace tren\n{\n class Program\n {\n static void Main(string[] args)\n {\n long[] ab = Console.ReadLine().Split(' ').Select(long.Parse).ToArray();\n long s = 0, count = 1;\n if (ab[1] == 1) { Console.Write(ab[0]); return; }\n while(true)\n {\n if (ab[0] == ab[1]) break;\n s = Math.Min(ab[0], ab[1]);\n ab[1] = Math.Max(ab[0], ab[1]) - s;\n ab[0] = s;\n count++; \n }\n Console.Write(count);\n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "19e04304213c450a011f99ee2aadb738", "src_uid": "ce698a0eb3f5b82de58feb177ce43b83", "apr_id": "01d668112efd9fd961a6d61337effda7", "difficulty": 1100, "tags": ["math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.5990990990990991, "equal_cnt": 4, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 3, "bug_source_code": "using System;\n\nnamespace ConsoleApplication1\n{\n internal class Program\n {\n private static void Main(string[] args)\n {\n string[] input = Console.ReadLine().Split();\n UInt64 a = Convert.ToUInt64(input[0]);\n UInt64 b = Convert.ToUInt64(input[1]);\n UInt64 s = a*b;\n UInt64 count = 1;\n while (a != 1 || b != 1)\n {\n if (b < a)\n {\n s = s - (b*b);\n a = s/b;\n }\n else if (a < b)\n {\n s = s - (a*a);\n b = s/a;\n }\n count++;\n }\n Console.WriteLine(count);\n }\n }\n}", "lang": "MS C#", "bug_code_uid": "1d89acf17d4ce5d5c39eb2f700ec6ca2", "src_uid": "ce698a0eb3f5b82de58feb177ce43b83", "apr_id": "be230798c414faf565a4c6b5f1d8c26a", "difficulty": 1100, "tags": ["math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.49074074074074076, "equal_cnt": 9, "replace_cnt": 8, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 8, "bug_source_code": "using System;\nusing System.Linq;\nnamespace CodeForces\n{\n class Contest\n {\n\n static void Main()\n {\n \n string [] s = Console.ReadLine().Split(' ');\n long a = Convert.ToInt64(s[0]);\n long b = Convert.ToInt64(s[1]);\n long ans = 0;\n while (a != b) \n {\n long m = Math.Max(a, b);\n long n = Math.Min(a, b);\n a = m - n;\n b = n;\n ans++;\n \n\n }\n ans++;\n \n Console.WriteLine(ans);\n //Console.ReadKey();\n\n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "5aba1d471b0fcd2cf23fb5d46bd9ca5c", "src_uid": "ce698a0eb3f5b82de58feb177ce43b83", "apr_id": "450ae53db41e95da02cbdabbfe49dfa9", "difficulty": 1100, "tags": ["math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.8295942720763723, "equal_cnt": 5, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 2, "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 _527A.Playing_with_Paper\n{\n class Program\n {\n static void Main(string[] args)\n {\n string line = Console.ReadLine();\n string[] tok = line.Split(' ');\n ulong a = ulong.Parse(tok[0]),b=ulong.Parse(tok[1]),suma=0;\n while(a>1&&b>1)\n {\n if (b > a)\n {\n b -= a;\n suma++;\n }\n else if (b < a)\n {\n a -= b;\n suma++;\n }\n else\n {\n suma++;\n a = 0;\n b = 0;\n }\n }\n if (b == 1)\n suma += a;\n else if (a == 1)\n suma += b;\n Console.WriteLine(\"{0}\", suma);\n }\n }\n}", "lang": "MS C#", "bug_code_uid": "764f7d31d9f8ded3d0aba7e4104fa6f0", "src_uid": "ce698a0eb3f5b82de58feb177ce43b83", "apr_id": "df1b8ca064f5200352725bf141d528aa", "difficulty": 1100, "tags": ["math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9833601717659689, "equal_cnt": 6, "replace_cnt": 4, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 5, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Collections.Specialized;\nusing System.ComponentModel;\nusing System.IO;\nusing System.Linq;\nusing System.Security;\nusing System.Security.Cryptography.X509Certificates;\nusing System.Text;\n\nnamespace codeforces\n{\n\tclass Program\n\t{\n\t\tpublic class User\n\t\t{\n\t\t\tpublic int c;\n\n\t\t\tpublic int r;\n\t\t}\n\n\t\tpublic class Comparer : IComparer\n\t\t{\n\t\t\tpublic int Compare(User x, User y)\n\t\t\t{\n\t\t\t\tif (x.c < y.c)\n\t\t\t\t\treturn -1;\n\t\t\t\treturn 1;\n\t\t\t}\n\t\t}\n\n\t\tpublic static long getGcd(long a, long b)\n\t\t{\n\t\t\tif (b == 0)\n\t\t\t\treturn a;\n\t\t\treturn getGcd(b, a % b);\n\t\t}\n\n\t\tpublic static void WriteYESNO(bool x, string yes = \"YES\", string no = \"NO\")\n\t\t{\n\t\t\tif (x)\n\t\t\t\tConsole.WriteLine(yes);\n\t\t\telse\n\t\t\t{\n\t\t\t\tConsole.WriteLine(no);\n\t\t\t}\n\t\t}\n\n\t\tpublic static string GetString()\n\t\t{\n\t\t\treturn Console.ReadLine();\n\t\t}\n\n\t\tpublic static List getList()\n\t\t{\n\t\t\tvar s = Console.ReadLine();\n\t\t\treturn s.Split(' ').Select(int.Parse).ToList();\n\t\t}\n\n\t\tpublic static int Min(int x, int y)\n\t\t{\n\t\t\treturn Math.Min(x, y);\n\t\t}\n\n\t\tpublic static int Max(int x, int y)\n\t\t{\n\t\t\treturn Math.Max(x, y);\n\t\t}\n\n\t\tpublic static int Abs(int x)\n\t\t{\n\t\t\treturn Math.Abs(x);\n\t\t}\n\n\t\tpublic static int getInt()\n\t\t{\n\t\t\tvar s = Console.ReadLine();\n\t\t\treturn int.Parse(s);\n\t\t}\n\n\t\tpublic static bool Equal(int x, int y, int x1, int y1)\n\t\t{\n\t\t\treturn x == x1 && y == y1;\n\t\t}\n\n\t\tprivate static void Main(string[] args)\n\t\t{\n/*\t\t\tvar input = new StreamReader(\"input.txt\");\n\t\t\tvar output = new StreamWriter(\"output.txt\");*/\n\t\t\tvar arr = Console.ReadLine().Split(' ').Select(long.Parse).ToList();\n\t\t\tvar a = arr[0];\n\t\t\tvar b = arr[1];\n\t\t\tvar ans = 1;\n\t\t\twhile (a != b)\n\t\t\t{\n\t\t\t\tans++;\n\t\t\t\ta = a - b;\n\t\t\t\tif (a < b)\n\t\t\t\t{\n\t\t\t\t\ta = a + b;\n\t\t\t\t\tb = a - b;\n\t\t\t\t\ta = a - b;\n\t\t\t\t}\n\t\t\t}\n\t\t\tConsole.WriteLine(ans);\n\t\t\t/*\t\t\tinput.Close();\n\t\t\toutput.Close();*/\n\t\t}\n\t}\n}\n", "lang": "MS C#", "bug_code_uid": "816ead8ecc35decbe73f01a876004a3b", "src_uid": "ce698a0eb3f5b82de58feb177ce43b83", "apr_id": "26950ab069bf7b08b9375058265777c3", "difficulty": 1100, "tags": ["math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.5328049317481286, "equal_cnt": 44, "replace_cnt": 23, "delete_cnt": 3, "insert_cnt": 17, "fix_ops_cnt": 43, "bug_source_code": "using System;\n\nclass Program\n{\n public static void Main(string[] args)\n {\n int[] input = ReadArray();\n if(input.Length == 2)\n {\n int a = input[0];\n int b = input[1];\n int count = 0;\n do\n {\n int delta = a - b;\n a = b;\n b = delta;\n count++;\n }\n while(delta > 0)\n Console.WriteLine(count);\n }\n }\n \n private static int[] ReadIntArray()\n {\n string line;\n while(Console.ReadKey().Key == ConsoleKey.Enter)\n {\n line = Console.ReadLine();\n }\n if(line != null)\n {\n string[] sArray = line.Split(' ');\n int n = stringArray.Length;\n int[] intArray = new int[n];\n for(int i = 0; i < n; i++)\n {\n string s = stringArray[i].Trim();\n intArray[i] = int.Parse(s);\n }\n return intArray;\n }\n return null;\n }\n}", "lang": "MS C#", "bug_code_uid": "fb93c0324f7e3fdfbaf8c3cc7a3dceb9", "src_uid": "ce698a0eb3f5b82de58feb177ce43b83", "apr_id": "4b37deff34b1ac7192e9c311ab579eec", "difficulty": 1100, "tags": ["math", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.6000701016473887, "equal_cnt": 25, "replace_cnt": 16, "delete_cnt": 5, "insert_cnt": 3, "fix_ops_cnt": 24, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace ConsoleApp5\n{\n class Program\n {\n static void Main(string[] args)\n {\n int n = int.Parse(Console.ReadLine());\n int[] a = Console.ReadLine().Split().Select(int.Parse).ToArray();\n int[] b = Console.ReadLine().Split().Select(int.Parse).ToArray();\n\n\n\n int[] A = new int[5];\n int[] B = new int[5];\n\n for (int i = 0; i < 5; i++)\n {\n A[i] = 0; B[i] = 0;\n }\n\n foreach (int i in a)\n {\n switch (i)\n {\n case 1: A[0]++; break;\n case 2: A[1]++; break;\n case 3: A[2]++; break;\n case 4: A[3]++; break;\n case 5: A[4]++; break;\n }\n switch (i)\n {\n case 1: B[0]++; break;\n case 2: B[1]++; break;\n case 3: B[2]++; break;\n case 4: B[3]++; break;\n case 5: B[4]++; break;\n }\n }\n\n int[] arr = new int[5];\n\n for (int i = 0; i < n; i++)\n arr[i] = Math.Abs(B[i] - A[i]);\n\n foreach(int x in arr)\n {\n if(x%2!=0)\n {\n Console.WriteLine(-1);\n return;\n }\n }\n\n int Last_Words = 0;\n foreach(int x in A)\n {\n Last_Words += x / 2;\n }\n Console.WriteLine(Last_Words);\n\n Console.ReadLine();\n\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "55035245ff99c07e71ca30584c5d1e9f", "src_uid": "47da1dd95cd015acb8c7fd6ae5ec22a3", "apr_id": "1a219b22da0da824a88eac1ae5c29652", "difficulty": 1000, "tags": ["math", "constructive algorithms"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9952904238618524, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 3, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Numerics;\nusing System.Linq;\n\npublic class Program\n{\n public static void Main(string[] args)\n {\n var x = int.Parse(Console.ReadLine());\n var timeInput = Array.ConvertAll(Console.ReadLine().Split(' '), int.Parse);\n\n var time = new DateTime(1, 1, 1, timeInput[0], timeInput[1], 0);\n\n var answer = 0;\n while (time.Minute.ToString().IndexOf('7') == -1 &&\n time.Hour.ToString().IndexOf('7') == -1)\n {\n time = time.AddMinutes(-x);\n ++answer;\n }\n\n Console.WriteLine(answer);\n }\n}", "lang": "MS C#", "bug_code_uid": "1f14a905402bea8d58b537177ea615f2", "src_uid": "5ecd569e02e0164a5da9ff549fca3ceb", "apr_id": "5974b503f698ba2618ef743c6b576bc7", "difficulty": 900, "tags": ["math", "brute force", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.6864045476077688, "equal_cnt": 67, "replace_cnt": 11, "delete_cnt": 15, "insert_cnt": 41, "fix_ops_cnt": 67, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace ConsoleApplication1.BFS\n{\n class NewYearFireworks\n {\n class Node\n {\n public int Level { get; set; }\n public int Direction { get; set; }\n public int X { get; set; }\n public int Y { get; set; }\n }\n\n static void Main(string[] args)\n {\n var N = int.Parse(Console.ReadLine());\n var t = new int[N];\n var s = Console.ReadLine().Split(' ').ToArray();\n for (var i = 0; i < N; i++)\n {\n t[i] = int.Parse(s[i]);\n }\n\n var directions = new int[][] {\n new int []{0,1},\n new int []{1,1},\n new int []{1,0},\n new int []{1,-1},\n new int []{0,-1},\n new int []{-1,-1},\n new int []{-1,0},\n new int []{-1,1}\n };\n \n\n var visited = new bool[600, 600];\n var queue = new Queue();\n queue.Enqueue(new Node()\n {\n Level = 0,\n Direction = 0,\n X = 300,\n Y = 300\n });\n visited[300, 300] = true;\n var res = 1;\n while (queue.Count > 0)\n {\n var current = queue.Dequeue();\n \n for(var i = 1; i < t[current.Level]; i++)\n {\n if (!visited[current.X + i * directions[current.Direction][0], current.Y + i * directions[current.Direction][1]])\n {\n res++;\n visited[current.X + i * directions[current.Direction][0], current.Y + i * directions[current.Direction][1]] = true;\n }\n }\n current.X += (t[current.Level]-1) * directions[current.Direction][0];\n current.Y += (t[current.Level] - 1) * directions[current.Direction][1];\n\n\n if (current.Level == N - 1)\n {\n continue;\n }\n var direction = Math.Abs((current.Direction + 1) % 8);\n queue.Enqueue(new Node()\n {\n Direction = direction,\n Level = current.Level + 1,\n X = current.X + directions[direction][0],\n Y = current.Y + directions[direction][1]\n });\n if (!visited[current.X + directions[direction][0], current.Y + directions[direction][1]])\n {\n visited[current.X + directions[direction][0], current.Y + directions[direction][1]] = true;\n res++;\n }\n direction = (current.Direction - 1) % 8;\n if(direction < 0)\n {\n direction = 8 + direction;\n }\n queue.Enqueue(new Node()\n {\n Direction = direction,\n Level = current.Level + 1,\n X = current.X + directions[direction][0],\n Y = current.Y + directions[direction][1]\n });\n if (!visited[current.X + directions[direction][0], current.Y + directions[direction][1]])\n {\n visited[current.X + directions[direction][0], current.Y + directions[direction][1]] = true;\n res++;\n }\n\n if(res == 150 * 150)\n {\n break;\n }\n }\n \n Console.WriteLine(res);\n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "52dbd0d792029ed63d6ee3e75b8915a2", "src_uid": "a96bc7f93fe9d9d4b78018b49bbc68d9", "apr_id": "343ad95a20353ee2aa1b8a4439ab5956", "difficulty": 1900, "tags": ["dp", "dfs and similar", "data structures", "implementation", "brute force"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.4353588397099275, "equal_cnt": 51, "replace_cnt": 26, "delete_cnt": 5, "insert_cnt": 19, "fix_ops_cnt": 50, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace ConsoleApplication1.BFS\n{\n class NewYearFireworks\n {\n class Node\n {\n public int Level { get; set; }\n public int Direction { get; set; }\n public int X { get; set; }\n public int Y { get; set; }\n }\n\n static void Main(string[] args)\n {\n var N = int.Parse(Console.ReadLine());\n var t = new int[N];\n var s = Console.ReadLine().Split(' ').ToArray();\n for (var i = 0; i < N; i++)\n {\n t[i] = int.Parse(s[i]);\n }\n\n var directions = new int[][] {\n new int []{0,1},\n new int []{1,1},\n new int []{1,0},\n new int []{1,-1},\n new int []{0,-1},\n new int []{-1,-1},\n new int []{-1,0},\n new int []{-1,1}\n };\n \n\n var visited = new bool[600, 600];\n var queue = new Stack();\n queue.Push(new Node()\n {\n Level = 0,\n Direction = 0,\n X = 300,\n Y = 300\n });\n visited[300, 300] = true;\n while(queue.Count > 0)\n {\n var current = queue.Pop();\n \n for(var i = 1; i < t[current.Level]; i++)\n {\n visited[current.X + i* directions[current.Direction][0], current.Y + i* directions[current.Direction][1]] = true;\n }\n current.X += (t[current.Level]-1) * directions[current.Direction][0];\n current.Y += (t[current.Level] - 1) * directions[current.Direction][1];\n\n\n if (current.Level == N - 1)\n {\n continue;\n }\n var direction = Math.Abs((current.Direction + 1) % 8);\n queue.Push(new Node()\n {\n Direction = direction,\n Level = current.Level + 1,\n X = current.X + directions[direction][0],\n Y = current.Y + directions[direction][1]\n });\n visited[current.X + directions[direction][0], current.Y + directions[direction][1]] = true;\n direction = (current.Direction - 1) % 8;\n if(direction < 0)\n {\n direction = 8 + direction;\n }\n queue.Push(new Node()\n {\n Direction = direction,\n Level = current.Level + 1,\n X = current.X + directions[direction][0],\n Y = current.Y + directions[direction][1]\n });\n visited[current.X + directions[direction][0], current.Y + directions[direction][1]] = true;\n }\n var res = 0;\n for(var i = 0; i < 600; i++)\n {\n for(var j = 0; j < 600; j++)\n {\n if(visited[i, j]) {\n res++;\n }\n }\n }\n Console.WriteLine(res);\n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "cb4f8ea2ba6d0e2411d8953bbec340d2", "src_uid": "a96bc7f93fe9d9d4b78018b49bbc68d9", "apr_id": "343ad95a20353ee2aa1b8a4439ab5956", "difficulty": 1900, "tags": ["dp", "dfs and similar", "data structures", "implementation", "brute force"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.6006214063783436, "equal_cnt": 88, "replace_cnt": 61, "delete_cnt": 10, "insert_cnt": 16, "fix_ops_cnt": 87, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Collections;\nusing System.Linq;\nusing System.Numerics;\nusing System.Text;\n\n\n\nnamespace contest\n{\n\n \n\n \n\n class contest\n {\n\n\n static void Main(string[] args)\n {\n\n\n\n\n\n //var num = Console.ReadLine().Split().Select(int.Parse).ToArray();\n //int n = num[0];\n //int m = num[1];\n\n //var input = Console.ReadLine().Split().Select(int.Parse).ToArray();\n\n\n\n\n //int n = int.Parse(Console.ReadLine());\n\n //var num = Console.ReadLine().Split().Select(int.Parse).ToArray();\n //for (int i = 0; i < n; i++)\n //{\n // input[i] = Console.ReadLine().Split().Select(int.Parse).ToArray();\n\n //}\n\n\n //int n = int.Parse(Console.ReadLine());\n //var num = Console.ReadLine().Split().Select(int.Parse).ToArray();\n //int n = num[0];\n //int m = num[1];\n\n\n\n //int n = int.Parse(Console.ReadLine());\n //var arr = new int[n][];//Console.ReadLine().Split().Select(int.Parse).ToArray();\n //for(int i =0; i< n; i++)\n //{\n // arr[i] = Console.ReadLine().Split().Select(int.Parse).ToArray();\n //}\n\n\n\n\n //int n = int.Parse(Console.ReadLine());\n //var num = Console.ReadLine().Split().Select(int.Parse).ToArray();\n\n\n\n //var num = Console.ReadLine().Split().Select(int.Parse).ToArray();\n //var tastes = Console.ReadLine().Split().Select(int.Parse).ToArray(); \n //int n = int.Parse(Console.ReadLine());\n //var arr = new int[n][];\n //for(int i =0; i< n; i++)\n //{\n // arr[i] = Console.ReadLine().Split().Select(int.Parse).ToArray();\n //}\n\n\n\n int n = int.Parse(Console.ReadLine());\n var arr = Console.ReadLine().Split().Select(int.Parse).ToArray();\n\n int count = 0;\n\n var dp = new bool[501,501];\n var list = new List>();\n for (int i = 0; i < n; i++)\n {\n int cur = arr[i];\n var tmp = new List>();\n if(i==0)\n {\n for(int j=0; j>(tmp);\n }\n\n\n\n for (int i = 0; i < 501; i++)\n {\n for (int j = 0; j < 501; j++)\n {\n if (dp[i, j]) count++;\n }\n }\n\n\n\n Console.WriteLine(count);\n \n\n\n\n\n //Console.WriteLine();\n\n\n\n\n\n\n\n \n }\n\n \n\n public static void VH(int x , int y , int cur,int deg, ref List> tmp, ref bool[,] dp)\n {\n if(deg == 45)\n {\n for (int k = 1; k <= cur; k++)\n {\n dp[y, x + k] = true;\n }\n tmp.Add(Tuple.Create(y , x + cur, 180));\n for (int k = 1; k <= cur; k++)\n {\n dp[y - k, x] = true;\n }\n tmp.Add(Tuple.Create(y - cur, x , 90));\n }\n else if(deg == 135)\n {\n for (int k = 1; k <= cur; k++)\n {\n dp[y, x + k] = true;\n }\n tmp.Add(Tuple.Create(y , x + cur, 180));\n for (int k = 1; k <= cur; k++)\n {\n dp[y + k, x] = true;\n }\n tmp.Add(Tuple.Create(y + cur, x , 270));\n }\n else if (deg == 225)\n {\n for (int k = 1; k <= cur; k++)\n {\n dp[y, x - k] = true;\n }\n tmp.Add(Tuple.Create(y , x - cur, 0));\n for (int k = 1; k <= cur; k++)\n {\n dp[y + k, x] = true;\n }\n tmp.Add(Tuple.Create(y + cur, x, 270));\n }\n else \n {\n for (int k = 1; k <= cur; k++)\n {\n dp[y, x - k] = true;\n }\n tmp.Add(Tuple.Create(y , x - cur, 0));\n for (int k = 1; k <= cur; k++)\n {\n dp[y - k, x] = true;\n }\n tmp.Add(Tuple.Create(y - cur, x , 90));\n }\n\n }\n\n public static void ee(int x, int y, int cur, int deg, ref List> tmp, ref bool[,] dp)\n {\n if (deg == 0)\n {\n for (int k = 1; k <= cur; k++)\n {\n dp[y + k, x - k] = true;\n }\n tmp.Add(Tuple.Create(y + cur, x - cur, 225));\n for (int k = 1; k <= cur; k++)\n {\n dp[y - k, x - k] = true;\n }\n tmp.Add(Tuple.Create(y - cur, x - cur, 315));\n }\n else if (deg == 90)\n {\n for (int k = 1; k <= cur; k++)\n {\n dp[y-k, x - k] = true;\n }\n tmp.Add(Tuple.Create(y-cur, x - cur, 315));\n for (int k = 1; k <= cur; k++)\n {\n dp[y - k, x+k] = true;\n }\n tmp.Add(Tuple.Create(y - cur, x+cur, 45));\n }\n else if (deg == 180)\n {\n for (int k = 1; k <= cur; k++)\n {\n dp[y-k, x + k] = true;\n }\n tmp.Add(Tuple.Create(y-cur, x + cur, 45));\n for (int k = 1; k <= cur; k++)\n {\n dp[y + k, x+k] = true;\n }\n tmp.Add(Tuple.Create(y + cur, x+cur, 135));\n }\n else\n {\n for (int k = 1; k <= cur; k++)\n {\n dp[y + k, x + k] = true;\n }\n tmp.Add(Tuple.Create(y + cur, x + cur, 135));\n for (int k = 1; k <= cur; k++)\n {\n dp[y + k, x - k] = true;\n }\n tmp.Add(Tuple.Create(y + cur, x - cur, 225));\n }\n\n }\n\n\n }\n\n\n class Segment\n {\n //public int[] arr;\n public Tuple[] arr;\n int n;\n\n public Segment(int n)\n {\n this.n = n * 2;\n //arr = Enumerable.Range(0, n*2).ToArray();\n //arr = new int[this.n];\n arr = new Tuple[this.n];\n for (int i = 0; i < this.n; i++)\n {\n arr[i] = Tuple.Create(0,0,0,0,0);\n }\n\n }\n\n public void update(int i, int x)\n {\n i = (n / 2) + i - 1;\n //arr[i] = 1;\n if (x == 2) arr[i] = Tuple.Create(1, 0, 0, 0, 0);\n else if (x == 0) arr[i] = Tuple.Create( 0,1, 0, 0, 0);\n else if (x == 1) arr[i] = Tuple.Create(0,0,1,0,0);\n else if (x == 6) arr[i] = Tuple.Create( 0, 0, 0,1, 0);\n else if (x == 7) arr[i] = Tuple.Create( 0, 0, 0, 0,1);\n\n while (i > 0)\n {\n i = (i - 1) / 2;\n //arr[i] = Math.Max(arr[i*2+1], arr[i*2+2]);\n //if (arr[i * 2 + 1] > arr[i * 2 + 2])\n //{\n // arr[i] = arr[i*2+1];\n //}\n //else\n //{\n // arr[i] = arr[i*2+2];\n //}\n //arr[i] = arr[i * 2 + 1] + arr[i * 2 + 2];\n arr[i] = Tuple.Create(arr[i*2+1].Item1+ arr[i*2+2].Item1,\n arr[i * 2 + 1].Item2 + arr[i * 2 + 2].Item2,\n arr[i * 2 + 1].Item3 + arr[i * 2 + 2].Item3,\n arr[i * 2 + 1].Item4 + arr[i * 2 + 2].Item4,\n arr[i * 2 + 1].Item5 + arr[i * 2 + 2].Item5);\n }\n\n }\n\n //call : query(a,b, 0, 0, n)\n public Tuple query(int a, int b, int k, int l, int r)\n {\n if (r <= a || b <= l) return Tuple.Create(0,0,0,0,0);\n if (a <= l && r <= b) return arr[k];\n else\n {\n\n\n\n\n var vl = query(a, b, k * 2 + 1, l, (l + r) / 2);\n var vr = query(a, b, k * 2 + 2, (l + r) / 2, r);\n\n\n\n //if (vl.Item4 > vr.Item4)\n //{\n // return vl;\n //}\n ////else if (vl.Item4 == vr.Item4)\n ////{\n //// if (countA >= countB) return vr;\n //// else return vl;\n ////}\n //else return vr;\n\n\n return Tuple.Create(vl.Item1 + vr.Item1,\n vl.Item2 + vr.Item2,\n vl.Item3 + vr.Item3,\n vl.Item4 + vr.Item4,\n vl.Item5 + vr.Item5);\n\n\n //return Math.Max(vl, vr);\n //return vl\n int countA = 0;\n int countB = 0;\n if (vl.Item1 == 0) countA++;\n if (vl.Item2 == 0) countA++;\n if (vl.Item3 == 0) countA++;\n if (vl.Item4 == 0) countA++;\n if (vl.Item5 == 0) countA++;\n\n if (vr.Item1 == 0) countB++;\n if (vr.Item2 == 0) countB++;\n if (vr.Item3 == 0) countB++;\n if (vr.Item4 == 0) countB++;\n if (vr.Item5 == 0) countB++;\n\n\n if((vl.Item1==0 && vr.Item1>0))\n {\n return vr;\n }\n else if ((vl.Item1 > 0 && vr.Item1 == 0))\n {\n return vl;\n }\n else if ((vl.Item2 == 0 && vr.Item2 > 0))\n {\n return vr;\n }\n else if ((vl.Item2 > 0 && vr.Item2 == 0))\n {\n return vl;\n }\n else if ((vl.Item3 == 0 && vr.Item3 > 0))\n {\n return vr;\n }\n else if ((vl.Item3 > 0 && vr.Item3 == 0))\n {\n return vl;\n }\n else if ((vl.Item4 == 0 && vr.Item4 > 0))\n {\n return vr;\n }\n else if ((vl.Item4 > 0 && vr.Item4 == 0))\n {\n return vl;\n }\n else if ((vl.Item5 == 0 && vr.Item5 > 0))\n {\n return vr;\n }\n else if ((vl.Item5 > 0 && vr.Item5 == 0))\n {\n return vl;\n }\n\n if (vl.Item4 > vr.Item4)\n {\n return vl;\n }\n else if (vl.Item4 == vr.Item4)\n {\n if (countA >= countB) return vr;\n else return vl;\n }\n else return vr;\n\n //if (countA <= countB) return vl;\n //else return vr;\n }\n }\n\n\n }\n\n\n class UnionFind\n {\n public int[] path;\n\n\n public UnionFind(int n)\n {\n path = new int[n];\n\n for (int i = 0; i < n; i++)\n {\n path[i] = i;\n }\n\n }\n\n private int root(int i)\n {\n while (i != path[i])\n {\n path[i] = path[path[i]];\n i = path[i];\n }\n return i;\n }\n\n\n\n public bool find(int p, int q)\n {\n return root(p) == root(q);\n }\n\n\n\n public void unite(int p, int q)\n {\n int i = root(p);\n int j = root(q);\n path[i] = j;\n }\n\n\n }\n}\n", "lang": "MS C#", "bug_code_uid": "5db8fe265e4218759b949a04e5330c06", "src_uid": "a96bc7f93fe9d9d4b78018b49bbc68d9", "apr_id": "cce23c56a13c7e3801f7080b4a1ea36b", "difficulty": 1900, "tags": ["dp", "dfs and similar", "data structures", "implementation", "brute force"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.501613787223677, "equal_cnt": 83, "replace_cnt": 62, "delete_cnt": 9, "insert_cnt": 11, "fix_ops_cnt": 82, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Collections;\nusing System.Linq;\nusing System.Numerics;\nusing System.Text;\n\n\n\nnamespace contest\n{\n\n \n\n \n\n class contest\n {\n\n\n static void Main(string[] args)\n {\n\n\n\n\n\n //var num = Console.ReadLine().Split().Select(int.Parse).ToArray();\n //int n = num[0];\n //int m = num[1];\n\n //var input = Console.ReadLine().Split().Select(int.Parse).ToArray();\n\n\n\n\n //int n = int.Parse(Console.ReadLine());\n\n //var num = Console.ReadLine().Split().Select(int.Parse).ToArray();\n //for (int i = 0; i < n; i++)\n //{\n // input[i] = Console.ReadLine().Split().Select(int.Parse).ToArray();\n\n //}\n\n\n //int n = int.Parse(Console.ReadLine());\n //var num = Console.ReadLine().Split().Select(int.Parse).ToArray();\n //int n = num[0];\n //int m = num[1];\n\n\n\n //int n = int.Parse(Console.ReadLine());\n //var arr = new int[n][];//Console.ReadLine().Split().Select(int.Parse).ToArray();\n //for(int i =0; i< n; i++)\n //{\n // arr[i] = Console.ReadLine().Split().Select(int.Parse).ToArray();\n //}\n\n\n\n\n //int n = int.Parse(Console.ReadLine());\n //var num = Console.ReadLine().Split().Select(int.Parse).ToArray();\n\n\n\n //var num = Console.ReadLine().Split().Select(int.Parse).ToArray();\n //var tastes = Console.ReadLine().Split().Select(int.Parse).ToArray(); \n //int n = int.Parse(Console.ReadLine());\n //var arr = new int[n][];\n //for(int i =0; i< n; i++)\n //{\n // arr[i] = Console.ReadLine().Split().Select(int.Parse).ToArray();\n //}\n\n\n\n int n = int.Parse(Console.ReadLine());\n var arr = Console.ReadLine().Split().Select(int.Parse).ToArray();\n\n int count = 0;\n\n var dp = new bool[501,501];\n\n dfs(0,250,250,0,ref dp, arr);\n\n\n //var list = new List>();\n //for (int i = 0; i < n; i++)\n //{\n // int cur = arr[i];\n // var tmp = new List>();\n // if(i==0)\n // {\n // for(int j=0; j>(tmp);\n //}\n\n\n\n for (int i = 0; i < 501; i++)\n {\n for (int j = 0; j < 501; j++)\n {\n if (dp[i, j]) count++;\n }\n }\n\n\n\n Console.WriteLine(count);\n \n\n\n\n\n //Console.WriteLine();\n\n\n\n\n\n\n \n }\n\n\n public static void dfs(int depth,int y, int x ,int deg, ref bool[,] dp, int[] arr)\n {\n if (depth == arr.Length) return;\n int cur = arr[depth];\n \n\n if(depth == 0)\n {\n for (int j = 0; j < cur; j++)\n {\n dp[250 - j, 250] = true;\n }\n dfs(depth+1, 250 - (cur - 1), 250, 90 , ref dp, arr);\n }\n else if(depth % 2 == 1)\n {\n if (deg == 0)\n {\n for (int k = 1; k <= cur; k++)\n {\n dp[y + k, x - k] = true;\n }\n \n dfs(depth + 1, y + cur, x - cur, 225, ref dp, arr);\n for (int k = 1; k <= cur; k++)\n {\n dp[y - k, x - k] = true;\n }\n \n dfs(depth + 1, y - cur, x - cur, 315, ref dp, arr);\n }\n else if (deg == 90)\n {\n for (int k = 1; k <= cur; k++)\n {\n dp[y - k, x - k] = true;\n }\n \n dfs(depth + 1, y - cur, x - cur, 315, ref dp, arr);\n for (int k = 1; k <= cur; k++)\n {\n dp[y - k, x + k] = true;\n }\n \n dfs(depth + 1, y - cur, x + cur, 45, ref dp, arr);\n }\n else if (deg == 180)\n {\n for (int k = 1; k <= cur; k++)\n {\n dp[y - k, x + k] = true;\n }\n \n dfs(depth + 1, y - cur, x + cur, 45, ref dp, arr);\n for (int k = 1; k <= cur; k++)\n {\n dp[y + k, x + k] = true;\n }\n \n dfs(depth + 1, y + cur, x + cur, 135, ref dp, arr);\n }\n else\n {\n for (int k = 1; k <= cur; k++)\n {\n dp[y + k, x + k] = true;\n }\n \n dfs(depth + 1, y + cur, x + cur, 135, ref dp, arr);\n for (int k = 1; k <= cur; k++)\n {\n dp[y + k, x - k] = true;\n }\n \n dfs(depth + 1, y + cur, x - cur, 225, ref dp, arr);\n }\n }\n else\n {\n if (deg == 45)\n {\n for (int k = 1; k <= cur; k++)\n {\n dp[y, x + k] = true;\n }\n \n dfs(depth + 1, y, x + cur, 180, ref dp, arr);\n for (int k = 1; k <= cur; k++)\n {\n dp[y - k, x] = true;\n }\n \n dfs(depth + 1, y - cur, x, 90, ref dp, arr);\n }\n else if (deg == 135)\n {\n for (int k = 1; k <= cur; k++)\n {\n dp[y, x + k] = true;\n }\n dfs(depth + 1, y, x + cur, 180, ref dp, arr);\n for (int k = 1; k <= cur; k++)\n {\n dp[y + k, x] = true;\n }\n \n dfs(depth + 1, y + cur, x, 270, ref dp, arr);\n }\n else if (deg == 225)\n {\n for (int k = 1; k <= cur; k++)\n {\n dp[y, x - k] = true;\n }\n \n dfs(depth + 1, y, x - cur, 0, ref dp, arr);\n for (int k = 1; k <= cur; k++)\n {\n dp[y + k, x] = true;\n }\n dfs(depth + 1, y + cur, x, 270, ref dp, arr);\n }\n else\n {\n for (int k = 1; k <= cur; k++)\n {\n dp[y, x - k] = true;\n }\n dfs(depth + 1, y, x - cur, 0, ref dp, arr);\n for (int k = 1; k <= cur; k++)\n {\n dp[y - k, x] = true;\n }\n dfs(depth + 1, y - cur, x, 90, ref dp, arr);\n }\n\n }\n\n }\n\n \n\n public static void VH(int x , int y , int cur,int deg, ref List> tmp, ref bool[,] dp)\n {\n if(deg == 45)\n {\n for (int k = 1; k <= cur; k++)\n {\n dp[y, x + k] = true;\n }\n tmp.Add(Tuple.Create(y , x + cur, 180));\n for (int k = 1; k <= cur; k++)\n {\n dp[y - k, x] = true;\n }\n tmp.Add(Tuple.Create(y - cur, x , 90));\n }\n else if(deg == 135)\n {\n for (int k = 1; k <= cur; k++)\n {\n dp[y, x + k] = true;\n }\n tmp.Add(Tuple.Create(y , x + cur, 180));\n for (int k = 1; k <= cur; k++)\n {\n dp[y + k, x] = true;\n }\n tmp.Add(Tuple.Create(y + cur, x , 270));\n }\n else if (deg == 225)\n {\n for (int k = 1; k <= cur; k++)\n {\n dp[y, x - k] = true;\n }\n tmp.Add(Tuple.Create(y , x - cur, 0));\n for (int k = 1; k <= cur; k++)\n {\n dp[y + k, x] = true;\n }\n tmp.Add(Tuple.Create(y + cur, x, 270));\n }\n else \n {\n for (int k = 1; k <= cur; k++)\n {\n dp[y, x - k] = true;\n }\n tmp.Add(Tuple.Create(y , x - cur, 0));\n for (int k = 1; k <= cur; k++)\n {\n dp[y - k, x] = true;\n }\n tmp.Add(Tuple.Create(y - cur, x , 90));\n }\n\n }\n\n public static void ee(int x, int y, int cur, int deg, ref List> tmp, ref bool[,] dp)\n {\n if (deg == 0)\n {\n for (int k = 1; k <= cur; k++)\n {\n dp[y + k, x - k] = true;\n }\n tmp.Add(Tuple.Create(y + cur, x - cur, 225));\n for (int k = 1; k <= cur; k++)\n {\n dp[y - k, x - k] = true;\n }\n tmp.Add(Tuple.Create(y - cur, x - cur, 315));\n }\n else if (deg == 90)\n {\n for (int k = 1; k <= cur; k++)\n {\n dp[y-k, x - k] = true;\n }\n tmp.Add(Tuple.Create(y-cur, x - cur, 315));\n for (int k = 1; k <= cur; k++)\n {\n dp[y - k, x+k] = true;\n }\n tmp.Add(Tuple.Create(y - cur, x+cur, 45));\n }\n else if (deg == 180)\n {\n for (int k = 1; k <= cur; k++)\n {\n dp[y-k, x + k] = true;\n }\n tmp.Add(Tuple.Create(y-cur, x + cur, 45));\n for (int k = 1; k <= cur; k++)\n {\n dp[y + k, x+k] = true;\n }\n tmp.Add(Tuple.Create(y + cur, x+cur, 135));\n }\n else\n {\n for (int k = 1; k <= cur; k++)\n {\n dp[y + k, x + k] = true;\n }\n tmp.Add(Tuple.Create(y + cur, x + cur, 135));\n for (int k = 1; k <= cur; k++)\n {\n dp[y + k, x - k] = true;\n }\n tmp.Add(Tuple.Create(y + cur, x - cur, 225));\n }\n\n }\n\n\n }\n\n\n class Segment\n {\n //public int[] arr;\n public Tuple[] arr;\n int n;\n\n public Segment(int n)\n {\n this.n = n * 2;\n //arr = Enumerable.Range(0, n*2).ToArray();\n //arr = new int[this.n];\n arr = new Tuple[this.n];\n for (int i = 0; i < this.n; i++)\n {\n arr[i] = Tuple.Create(0,0,0,0,0);\n }\n\n }\n\n public void update(int i, int x)\n {\n i = (n / 2) + i - 1;\n //arr[i] = 1;\n if (x == 2) arr[i] = Tuple.Create(1, 0, 0, 0, 0);\n else if (x == 0) arr[i] = Tuple.Create( 0,1, 0, 0, 0);\n else if (x == 1) arr[i] = Tuple.Create(0,0,1,0,0);\n else if (x == 6) arr[i] = Tuple.Create( 0, 0, 0,1, 0);\n else if (x == 7) arr[i] = Tuple.Create( 0, 0, 0, 0,1);\n\n while (i > 0)\n {\n i = (i - 1) / 2;\n //arr[i] = Math.Max(arr[i*2+1], arr[i*2+2]);\n //if (arr[i * 2 + 1] > arr[i * 2 + 2])\n //{\n // arr[i] = arr[i*2+1];\n //}\n //else\n //{\n // arr[i] = arr[i*2+2];\n //}\n //arr[i] = arr[i * 2 + 1] + arr[i * 2 + 2];\n arr[i] = Tuple.Create(arr[i*2+1].Item1+ arr[i*2+2].Item1,\n arr[i * 2 + 1].Item2 + arr[i * 2 + 2].Item2,\n arr[i * 2 + 1].Item3 + arr[i * 2 + 2].Item3,\n arr[i * 2 + 1].Item4 + arr[i * 2 + 2].Item4,\n arr[i * 2 + 1].Item5 + arr[i * 2 + 2].Item5);\n }\n\n }\n\n //call : query(a,b, 0, 0, n)\n public Tuple query(int a, int b, int k, int l, int r)\n {\n if (r <= a || b <= l) return Tuple.Create(0,0,0,0,0);\n if (a <= l && r <= b) return arr[k];\n else\n {\n\n\n\n\n var vl = query(a, b, k * 2 + 1, l, (l + r) / 2);\n var vr = query(a, b, k * 2 + 2, (l + r) / 2, r);\n\n\n\n //if (vl.Item4 > vr.Item4)\n //{\n // return vl;\n //}\n ////else if (vl.Item4 == vr.Item4)\n ////{\n //// if (countA >= countB) return vr;\n //// else return vl;\n ////}\n //else return vr;\n\n\n return Tuple.Create(vl.Item1 + vr.Item1,\n vl.Item2 + vr.Item2,\n vl.Item3 + vr.Item3,\n vl.Item4 + vr.Item4,\n vl.Item5 + vr.Item5);\n\n\n //return Math.Max(vl, vr);\n //return vl\n int countA = 0;\n int countB = 0;\n if (vl.Item1 == 0) countA++;\n if (vl.Item2 == 0) countA++;\n if (vl.Item3 == 0) countA++;\n if (vl.Item4 == 0) countA++;\n if (vl.Item5 == 0) countA++;\n\n if (vr.Item1 == 0) countB++;\n if (vr.Item2 == 0) countB++;\n if (vr.Item3 == 0) countB++;\n if (vr.Item4 == 0) countB++;\n if (vr.Item5 == 0) countB++;\n\n\n if((vl.Item1==0 && vr.Item1>0))\n {\n return vr;\n }\n else if ((vl.Item1 > 0 && vr.Item1 == 0))\n {\n return vl;\n }\n else if ((vl.Item2 == 0 && vr.Item2 > 0))\n {\n return vr;\n }\n else if ((vl.Item2 > 0 && vr.Item2 == 0))\n {\n return vl;\n }\n else if ((vl.Item3 == 0 && vr.Item3 > 0))\n {\n return vr;\n }\n else if ((vl.Item3 > 0 && vr.Item3 == 0))\n {\n return vl;\n }\n else if ((vl.Item4 == 0 && vr.Item4 > 0))\n {\n return vr;\n }\n else if ((vl.Item4 > 0 && vr.Item4 == 0))\n {\n return vl;\n }\n else if ((vl.Item5 == 0 && vr.Item5 > 0))\n {\n return vr;\n }\n else if ((vl.Item5 > 0 && vr.Item5 == 0))\n {\n return vl;\n }\n\n if (vl.Item4 > vr.Item4)\n {\n return vl;\n }\n else if (vl.Item4 == vr.Item4)\n {\n if (countA >= countB) return vr;\n else return vl;\n }\n else return vr;\n\n //if (countA <= countB) return vl;\n //else return vr;\n }\n }\n\n\n }\n\n\n class UnionFind\n {\n public int[] path;\n\n\n public UnionFind(int n)\n {\n path = new int[n];\n\n for (int i = 0; i < n; i++)\n {\n path[i] = i;\n }\n\n }\n\n private int root(int i)\n {\n while (i != path[i])\n {\n path[i] = path[path[i]];\n i = path[i];\n }\n return i;\n }\n\n\n\n public bool find(int p, int q)\n {\n return root(p) == root(q);\n }\n\n\n\n public void unite(int p, int q)\n {\n int i = root(p);\n int j = root(q);\n path[i] = j;\n }\n\n\n }\n}\n", "lang": "MS C#", "bug_code_uid": "e9892c0613aaea7305ee90f44688e3a4", "src_uid": "a96bc7f93fe9d9d4b78018b49bbc68d9", "apr_id": "cce23c56a13c7e3801f7080b4a1ea36b", "difficulty": 1900, "tags": ["dp", "dfs and similar", "data structures", "implementation", "brute force"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.6142241379310345, "equal_cnt": 7, "replace_cnt": 2, "delete_cnt": 2, "insert_cnt": 3, "fix_ops_cnt": 7, "bug_source_code": "using System;\nusing System.Collections;\nusing System.Collections.Generic;\nusing System.Linq;\n\nnamespace Problem{\n \n public class Solution{\n \n public void Main(){\n \n int n = int.Parse(Console.ReadLine());\n if(n == 1){\n Console.WriteLine(n);\n }else{\n Console.WriteLine((n*2 - 3)*(n*2 - 3) + 4);\n }\n } \n }\n}", "lang": "Mono C#", "bug_code_uid": "0e9ab9d80b55963d3b1bf443a6069380", "src_uid": "758d342c1badde6d0b4db81285be780c", "apr_id": "224acdb691fe30ef845efc0500492f56", "difficulty": 800, "tags": ["dp", "math", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.9086576648133439, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "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 ConsoleApp33\n{\n class Program\n {\n static void Main(string[] args)\n {\n int n = Convert.ToInt32(Console.ReadLine());\n int[] mas = new int[n];\n int ans = (n + n - 1) * (n + n - 1);\n mas[1] = 1;\n for (int i = 2; i < n; i++)\n {\n mas[i] = mas[i - 1] + i;\n }\n Console.WriteLine(ans - (mas[mas.Length - 1] * 4));\n }\n }\n}", "lang": "Mono C#", "bug_code_uid": "2a31a8cae286fe5d7443f4b9e26077f1", "src_uid": "758d342c1badde6d0b4db81285be780c", "apr_id": "92dc1876dc4ab5828c5cf102f79982da", "difficulty": 800, "tags": ["dp", "math", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.8543046357615894, "equal_cnt": 8, "replace_cnt": 2, "delete_cnt": 1, "insert_cnt": 4, "fix_ops_cnt": 7, "bug_source_code": "using System;\n\nnamespace C\n{\n\tclass Program\n\t{\n\t\tstatic void Main()\n\t\t{\n\t\t\tvar s = Console.ReadLine();\n\t\t\tvar ss = s.Split(' ');\n\t\t\tvar r = int.Parse(ss[0]);\n\t\t\tvar h = int.Parse(ss[1]);\n\n\t\t\tConsole.WriteLine((h / r) * 2 + (h % r >= (double) r / 2 ? 2 : 1));\n\t\t}\n\t}\n}\n", "lang": "MS C#", "bug_code_uid": "cdeabf32c3b77de3203c1ce6449c3119", "src_uid": "ae883bf16842c181ea4bd123dee12ef9", "apr_id": "b404b949321a6880a692f3eb8aac2416", "difficulty": 1900, "tags": ["geometry"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.9943636902996144, "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.Globalization;\nusing System.IO;\n\nclass Program\n{\n public static int[] Read(string str)\n {\n string[] tokens = str.Trim().Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries);\n int[] ret = new int[tokens.Length];\n for (int i = 0; i < ret.Length; i++)\n {\n ret[i] = int.Parse(tokens[i]);\n }\n\n return ret;\n }\n\n public static double[] ReadDouble(string str)\n {\n string[] tokens = str.Trim().Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries);\n double[] ret = new double[tokens.Length];\n for (int i = 0; i < ret.Length; i++)\n {\n ret[i] = double.Parse(tokens[i], CultureInfo.InvariantCulture);\n }\n\n return ret;\n }\n\n static string Reverse(string s)\n {\n char[] a = s.ToCharArray();\n Array.Reverse(a);\n return new string(a);\n }\n \n static void Main(string[] args)\n {\n long x = long.Parse(Console.ReadLine().Trim());\n if (x < 0) x = -x;\n \n if (x == 0)\n {\n Console.WriteLine(0);\n return;\n }\n\n int step = 1;\n long sum = 0;\n while (true)\n {\n sum += step;\n if (sum == x)\n {\n Console.WriteLine(step);\n break;\n }\n if (sum > x)\n {\n long t = sum - x;\n if (t % 2 == 0 && (t / 2) <= step)\n {\n Console.WriteLine(step);\n break;\n }\n }\n step++;\n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "c0e63a32f0572911b65c3d65877236e9", "src_uid": "18644c9df41b9960594fdca27f1d2fec", "apr_id": "709569cea4d9166476e82e86615de4d4", "difficulty": 1600, "tags": ["math"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "delete", "lang_cluster": "C#"} {"similarity_score": 0.2440087145969499, "equal_cnt": 14, "replace_cnt": 6, "delete_cnt": 5, "insert_cnt": 3, "fix_ops_cnt": 14, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace Carrot_Cakes\n{\n class Program\n {\n static void Main(string[] args)\n {\n string[] numbers = Console.ReadLine().Split();\n\n if(int.Parse(numbers[2]) >= int.Parse(numbers[0]))\n {\n Console.WriteLine(\"NO\");\n }\n else\n {\n int target = int.Parse(numbers[0]);\n int t1 = int.Parse(numbers[1]);\n int t2 = int.Parse(numbers[2]);\n\n while (t2 != target)\n {\n t1 += t1;\n t2 += t2;\n\n }\n t1 = t1 - int.Parse(numbers[1]);\n if(t1 <= int.Parse(numbers[3]))\n {\n Console.WriteLine(\"NO\");\n\n }\n else\n {\n Console.WriteLine(\"YES\");\n\n }\n \n }\n Console.ReadLine();\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "cc20a940b335ec46b3bc8b0424d2a356", "src_uid": "32c866d3d394e269724b4930df5e4407", "apr_id": "86c3acde1c94ac452d226de872b6dd8c", "difficulty": 1100, "tags": ["brute force", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9938186813186813, "equal_cnt": 7, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 4, "fix_ops_cnt": 6, "bug_source_code": "using System;\nusing System.Collections.Generic;\n \n \nnamespace ProblemSolving_CF_A\n{\n class Program\n {\n static void Main(string[] args)\n {\n \n string outputMessage = CarrotCakes() ? \"YES\" : \"NO\";\n Console.WriteLine(outputMessage);\n }\n \n static bool CarrotCakes()\n {\n var input = Console.ReadLine()?.Split();\n if (input == null)\n return false;\n \n var numberOfNeededCakes = float.Parse(input[0]);\n var timeToOneOvenTobake = float.Parse(input[1]);\n var numberofBakedCakes = float.Parse(input[2]);\n var timeTobuildSecondOven = float.Parse(input[3]);\n \n if (numberofBakedCakes < numberOfNeededCakes)\n {\n if (timeTobuildSecondOven < timeToOneOvenTobake)\n {\n return true;\n }\n \n if (numberofBakedCakes < numberOfNeededCakes / 2)\n {\n if (timeTobuildSecondOven == timeToOneOvenTobake)\n return true;\n \n if (timeTobuildSecondOven > timeToOneOvenTobake)\n {\n var numberOfNeededIteration = Math.Round(numberOfNeededCakes / numberofBakedCakes,5);\n var s = numberOfNeededIteration.ToString(CultureInfo.InvariantCulture).Split('.');\n\n if (s.Length >1)\n {\n if (double.Parse(s[1]) > 0)\n {\n\n\n numberOfNeededIteration += 1;\n numberOfNeededIteration = Math.Round(numberOfNeededIteration);\n }\n }\n\n for (int iteration = 1; iteration <= numberOfNeededIteration; iteration++)\n {\n timeTobuildSecondOven -= timeToOneOvenTobake;\n numberOfNeededCakes -= numberofBakedCakes;\n if (timeTobuildSecondOven < 0)\n {\n if (iteration < numberOfNeededIteration && numberOfNeededCakes > 0)\n {\n return true;\n }\n\n }\n\n if (timeTobuildSecondOven == 0)\n {\n if (iteration < numberOfNeededIteration - 1 && numberOfNeededCakes > 0)\n {\n return true;\n }\n }\n }\n } \n } \n }\n return false;\n}\n}\n}", "lang": "Mono C#", "bug_code_uid": "0ebe8be7b5f2192e998fb819f4cc2618", "src_uid": "32c866d3d394e269724b4930df5e4407", "apr_id": "f46d1a613be3ab767aa90e8cfe8183af", "difficulty": 1100, "tags": ["brute force", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.9946666666666667, "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.Text;\nusing System.Threading.Tasks;\n\nnamespace ConsoleApp1\n{\n class Program\n {\n\n static void Main(string[] args)\n {\n long a = 0, b = 0,ans;\n string s;\n s = Console.ReadLine();\n string[] mas = s.Split(' ');\n\n a = Convert.ToInt32(mas[0]);\n b = Convert.ToInt32(mas[1]);\n if (b - a >= 10) Console.WriteLine(0);\n else\n {\n ans = 1;\n for (long i = a + 1; i <= b; i++)\n ans = (ans * (i % 10)) % 10;\n Console.WriteLine(\"{0}\\n\", ans);\n }\n \n }\n \n } \n}\n", "lang": "MS C#", "bug_code_uid": "c3af11abdafe1995296d459d762790cb", "src_uid": "2ed5a7a6176ed9b0bda1de21aad13d60", "apr_id": "913ecb5ba72eeccc3f955c96549898c6", "difficulty": 1100, "tags": ["math"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.651925820256776, "equal_cnt": 17, "replace_cnt": 9, "delete_cnt": 2, "insert_cnt": 5, "fix_ops_cnt": 16, "bug_source_code": "using System;\n\nnamespace ConsoleApp1\n{\n class Program\n {\n static void Main()\n {\n double a, b, result=1;\n string s = Console.ReadLine();\n string[] arr = s.Split(' ');\n double.TryParse(arr[0], out a);\n double.TryParse(arr[1], out b);\n double res = b - a;\n for (int i=0; i long.Parse(i)).ToArray();\n long a = tmp[0];\n long b = tmp[1];\n long r = 1;\n while(b > a)\n {\n r *= b;\n r = r % 10;\n b--;\n }\n Console.WriteLine(r);\n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "2e1f391c9d43b4d9e46efd489e93cc69", "src_uid": "2ed5a7a6176ed9b0bda1de21aad13d60", "apr_id": "44baeefc8188201dbe83fc6194665aa1", "difficulty": 1100, "tags": ["math"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.4646333549643089, "equal_cnt": 12, "replace_cnt": 9, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 11, "bug_source_code": "using System;\n\nnamespace R_C_273\n{\n class Program\n {\n static void Main(string[] args)\n {\n string[] s = Console.ReadLine().Split(' ');\n int r = int.Parse(s[0]), g = int.Parse(s[1]), b = int.Parse(s[2]);\n int min = Math.Min(r, Math.Min(g, b)), sum = 0;\n r -= min;\n g -= min;\n b -= min;\n sum += min;\n int a1, a2;\n if (r == 0)\n {\n a1 = g;\n a2 = b;\n }\n else if (g == 0)\n {\n a1 = r;\n a2 = b;\n }\n else\n {\n a1 = r;\n a2 = g;\n }\n while ((a1 != 0) && (a2 != 0))\n {\n int k1 = Math.Max(a1, a2) / 2, k2 = Math.Min(a1, a2), k3 = Math.Min(k1, k2);\n a1 -= k3;\n a2 -= k3;\n sum += k3;\n }\n Console.WriteLine(sum);\n Console.ReadLine();\n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "4d2d840dd162baeab88e375c2c94b99e", "src_uid": "bae7cbcde19114451b8712d6361d2b01", "apr_id": "0c01d22a3d77b41244c2dcd75575aa32", "difficulty": 1800, "tags": ["greedy"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.07919782460910944, "equal_cnt": 30, "replace_cnt": 15, "delete_cnt": 5, "insert_cnt": 10, "fix_ops_cnt": 30, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace _273c\n{\n\tclass Program\n\t{\n\t\tstatic void Main(string[] args)\n\t\t{\n\t\t\t//Console.SetIn(File.OpenText(\"in.txt\"));\n\t\t\tvar d = Console.ReadLine().Split(' ').Select(i => int.Parse(i)).ToArray();\n\t\t\t//var r = d[0];\n\t\t\t//var g = d[1];\n\t\t\t//var b = d[2];\n\n\t\t\t//Array.Sort(d);\n\t\t\t//var max = d[2];\n\t\t\t//var mid = d[1];\n\t\t\t//var min = d[0];\n\n\t\t\tvar count = 0;\n\t\t\twhile (true)\n\t\t\t{\n\t\t\t\tArray.Sort(d);\n\t\t\t\tvar max = d.Max();\n\t\t\t\tvar min = d.Min();\n\t\t\t\tif (max - min <= 1)\n\t\t\t\t{\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tvar md = d[2] - d[0];\n\t\t\t\tvar md2 = d[1] - d[0];\n\t\t\t\tvar ml = Math.Min(md, md2);\n\t\t\t\tvar cr3 = ml / 3;\n\t\t\t\td[2] -= cr3 * 3;\n\t\t\t\td[1] -= cr3 * 3;\n\t\t\t\tcount += cr3 * 2;\n\n\t\t\t\tmd = d[2] - d[0];\n\t\t\t\tmd2 = d[1] - d[0];\n\n\t\t\t\tvar ml2 = Math.Min(d[2], d[1]);\n\t\t\t\tvar mx = Math.Max(d[2], d[1]);\n\n\t\t\t\tvar c = d[1] - d[0];\n\t\t\t\tfor (int i = 0; i < c; i++)\n\t\t\t\t{\n\t\t\t\t\tif (mx - 2 < d[0])\n\t\t\t\t\t{\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\tmx -= 2;\n\t\t\t\t\tml2 -= 1;\n\t\t\t\t\tcount++;\n\t\t\t\t}\n\n\t\t\t\td[2] = mx;\n\t\t\t\td[1] = ml2;\n\t\t\t\t\n\n\t\t\t\twhile (true)\n\t\t\t\t{\n\t\t\t\t\tmax = d.Max();\n\t\t\t\t\tmin = d.Min();\n\t\t\t\t\tif (max - min <= 1)\n\t\t\t\t\t{\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\tvar need = d[2] - d[0];\n\t\t\t\t\tvar av = d[0];\n\t\t\t\t\tvar re = Math.Min(need, av);\n\t\t\t\t\td[2] -= re * 2;\n\t\t\t\t\td[1] -= re;\n\t\t\t\t\td[0] -= re;\n\t\t\t\t\tcount += re;\n\n\t\t\t\t}\n\n\n\t\t\t\tbreak;\n\n\t\t\t}\n\n\t\t\tvar tor = d.Min();\n\t\t\tcount += tor;\n\t\t\tConsole.WriteLine(count);\n\t\t}\n\n\t\t\n\t}\n}\n", "lang": "MS C#", "bug_code_uid": "8e16a92a6667cb67f77bc7b8991da1c5", "src_uid": "bae7cbcde19114451b8712d6361d2b01", "apr_id": "0b4d7bef1d0dfff16aa5a65714501a79", "difficulty": 1800, "tags": ["greedy"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.7488198757763975, "equal_cnt": 17, "replace_cnt": 8, "delete_cnt": 2, "insert_cnt": 6, "fix_ops_cnt": 16, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace CodeForces_273_C {\n class Program {\n static void Main(string[] args) {\n string[] astr = Console.ReadLine().Split(new string[] { \" \" }, StringSplitOptions.RemoveEmptyEntries);\n int[] aint = new int[astr.Length];\n int i = 0;\n foreach(string s in astr) {\n aint[i] = int.Parse(s);\n i++;\n }\n Array.Sort(aint);\n\n int k = Func1(aint);\n\n Console.WriteLine(k);\n Console.ReadLine();\n }\n\n private static int Func1(int[] arr) {\n int kMax = (int)(((long)arr[0] + arr[1] + arr[2]) / 3);\n if(kMax > arr[1] + arr[2]) kMax = arr[1] + arr[2];\n\n int k = 0;\n\n int kMin2 = 2 * arr[1] - arr[2];\n if(kMin2 > arr[0]) kMin2 = arr[0];\n if(kMin2 > 0) {\n arr[0] -= kMin2;\n arr[1] -= kMin2;\n arr[2] -= kMin2;\n k += kMin2;\n }\n int kMin = arr[0];\n\n while(true) {\n if(arr[1] == 0 || arr[2] == 0) break;\n if((long)arr[0] + arr[1] + arr[2] < 3) break;\n\n if(arr[0] > 0) {\n int tmp = 0;\n if((arr[2] - arr[1] / 2) >= arr[0] * 2) {\n tmp = arr[0];\n } else {\n tmp = (arr[2] - arr[1] / 2) / 2;\n }\n if(tmp > 0) {\n k += tmp;\n arr[0] -= tmp;\n arr[2] -= tmp * 2;\n Array.Sort(arr);\n continue;\n }\n }\n\n arr[2] -= 2;\n if(arr[0] > 0) {\n arr[0] -= 1;\n } else {\n arr[1] -= 1;\n }\n\n if(arr[2] < arr[1]) {\n int tmp = arr[2];\n arr[2] = arr[1];\n arr[1] = tmp;\n }\n\n k++;\n }\n\n return k;\n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "f3ddee61f60d6ec609db86db8ca2b337", "src_uid": "bae7cbcde19114451b8712d6361d2b01", "apr_id": "7d3f7e325fa7a41bf728e0a327f6d2b0", "difficulty": 1800, "tags": ["greedy"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.3084940072954664, "equal_cnt": 16, "replace_cnt": 10, "delete_cnt": 3, "insert_cnt": 4, "fix_ops_cnt": 17, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\nusing System.Text.RegularExpressions;\nusing System.IO;\nusing System.Numerics;\nusing System.Globalization;\nusing System.Threading;\n\n\nnamespace probleme {\n class Program {\n static int[] v;\n static void read() {\n v = Array.ConvertAll(Console.ReadLine().Split(' '), ts => int.Parse(ts));\n }\n\n static int f() {\n Array.Sort(v);\n if (v[0] == v[1] && v[1] == v[2]) {\n return v[0];\n }\n v[1] -= 1;\n v[2] -= 2;\n return 1 + f();\n }\n\n static void solve() {\n read();\n\n int ans = f();\n Console.Write(ans);\n }\n\n static void Main(string[] args) {\n\n //Console.SetIn(new StreamReader(\"file.in\"));\n /*\n FileStream filestream = new FileStream(\"out.txt\", FileMode.Create);\n var streamwriter = new StreamWriter(filestream);\n streamwriter.AutoFlush = true;\n Console.SetOut(streamwriter);\n */\n\n solve();\n\n //Console.ReadKey();\n }\n }\n}", "lang": "MS C#", "bug_code_uid": "c96f4459307621f1c75065b80ab74ad9", "src_uid": "bae7cbcde19114451b8712d6361d2b01", "apr_id": "7e1c0279f6c1c69f172037e17213ee59", "difficulty": 1800, "tags": ["greedy"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.6849087893864013, "equal_cnt": 10, "replace_cnt": 5, "delete_cnt": 0, "insert_cnt": 4, "fix_ops_cnt": 9, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace B.Barnicle\n{\n class Program\n {\n static void Main(string[] args)\n {\n string line = Console.ReadLine();\n var splits = line.Split('e');\n var splits2 = splits[0].Split('.');\n int a = int.Parse(splits2[0]);\n string d = splits2[1];\n int b = int.Parse(splits[1]);\n\n string output = \"\";\n if ( a > 0 ) output += a;\n else if ( b == 0 && a == 0 ) output += a;\n output += d.Substring(0, b);\n output += \".\";\n output += d.Substring(b);\n\n if (output[output.Length - 1] == '.') output = output.Substring(0, output.Length - 1);\n\n Console.WriteLine(output);\n \n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "da4ecd5281176d0b6bbacbed677fa9cc", "src_uid": "a79358099f08f3ec50c013d47d910eef", "apr_id": "035b32f2a759da9e6b17030f0ecb58d3", "difficulty": 1400, "tags": ["strings", "math", "brute force", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9752154026167429, "equal_cnt": 6, "replace_cnt": 4, "delete_cnt": 1, "insert_cnt": 0, "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 Dreamoon_and_WiFi\n{\n //class Teste\n //{\n // public Array dreamoon;\n // public Array drazil;\n // int posResposta = 0;\n // int posFinal = 0;\n // int numInterrogacao = 0;\n\n // public void calcula(string x, string y)\n // {\n // dreamoon = x.ToArray();\n // drazil = y.ToArray();\n\n // for (int i = 0; i < dreamoon.Length; i++)\n // {\n // if (dreamoon.GetValue(i).ToString() == \"+\")\n // posResposta++;\n // else\n // posResposta--;\n // }\n\n // for (int i = 0; i < dreamoon.Length; i++)\n // {\n // if (drazil.GetValue(i).ToString() == \"?\")\n // numInterrogacao++;\n // else if (drazil.GetValue(i).ToString() == \"+\")\n // posFinal++;\n // else\n // posFinal--;\n // }\n\n // int distancia = posResposta - posFinal;\n // double resposta;\n // if ((distancia + numInterrogacao) % 2 != 0 || numInterrogacao < Math.Abs(distancia)) //can't reach the destination no matter how\n // resposta = 0;\n // else\n // {\n\n // }\n\n // Console.WriteLine(resposta);\n // }\n //}\n class Codigo\n {\n //Iniciando as variáveis dreamoon e drazil\n private string dreamoon;\n private string drazil;\n\n //Iniciando um vetor que vai guardar os dois valores possíveis nas instruções\n private int[] contaDreamon = new int[2];\n private int[] contaDrazil = new int[2];\n\n //Quantidade de valores desconhecidos passados ao drazil\n private int quantInt;\n\n private int distancia;\n private int posDreamoon;\n private int posDrazil;\n\n public Codigo(string drazil, string dreamoon)\n {\n contaDreamon[0] = dreamoon.Split(new char[] { '-' }).Length - 1; //Vai contar quantos '-' possui e vai passar para a variável, e assim respectivamente com as 3 próxima linhas\n contaDreamon[1] = dreamoon.Split(new char[] { '+' }).Length - 1;\n contaDrazil[0] = drazil.Split(new char[] { '-' }).Length - 1;\n contaDrazil[1] = drazil.Split(new char[] { '+' }).Length - 1;\n quantInt = dreamoon.Split(new char[] { '?' }).Length - 1; //Quantidade de códigos desconhecidos\n\n for (int i = 0; i < dreamoon.Length; i++)\n {\n if (dreamoon.Substring(i, 1) == \"+\")\n posDreamoon++;\n else if (dreamoon.Substring(i, 1) == \"-\")\n posDreamoon--; \n }\n\n for (int i = 0; i < drazil.Length; i++)\n {\n if (drazil.Substring(i, 1) == \"+\")\n posDrazil++;\n else\n posDrazil--;\n }\n\n distancia = posDrazil - posDreamoon;\n }\n\n private double compara()\n {\n if (contaDreamon[0] == contaDrazil[0] && contaDreamon[1] == contaDrazil[1]) //Se receberem a mesma quantidade de '+' e '-', a conta termina em 100%\n {\n return 1;\n }\n else if ((contaDreamon[0] == 0 && contaDrazil[0] != 0) || ((contaDreamon[1] == 0 && contaDrazil[1] != 0 && quantInt == 0))) //Se receber valores incorretos, a probabilidade é zero\n return 0;\n else\n {\n int m = (quantInt + Math.Abs(distancia)) / 2; //Calcula a quantidade de passos válidos para chegar na posição correta\n\n double combinacao = (fatorial(quantInt) / (fatorial(quantInt - m) * (fatorial(m))));\n\n return (double)combinacao / (1 << quantInt);\n }\n }\n\n public void exibe()\n {\n string result = compara().ToString();\n result = result.Replace(',', '.');\n Console.WriteLine(\"{0:F12}\", result); //Exibe o resultado com 12 algarismos\n }\n\n private double fatorial(int n)\n {\n if (n == 1 || n == 0)\n return 1;\n else\n return (n * fatorial(n - 1));\n }\n }\n class Program\n {\n static void Main(string[] args)\n {\n //Teste x = new Teste();\n //x.calcula(Console.ReadLine(), Console.ReadLine());\n Codigo cod = new Codigo(Console.ReadLine(), Console.ReadLine()); //Chama a função com os dois valores digitados\n cod.exibe(); //Exibe o resultado em decimal\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "2865efec17e0dfafa470993916eacf39", "src_uid": "f7f68a15cfd33f641132fac265bc5299", "apr_id": "43ddaf907cc889f210ee4f00ae0d5876", "difficulty": 1300, "tags": ["dp", "probabilities", "combinatorics", "bitmasks", "math", "brute force"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9800235017626322, "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 CF183A\n{\n class Program\n {\n static void Main(string[] args)\n {\n int n = 74000;\n int res = 0;\n for (var a = 1; a < n; a++)\n {\n var bmax = Math.Sqrt(Math.Truncate((double)(n * n - a * a)));\n for (var b = a; b <= bmax; b++)\n {\n var result = (double)(a * a + b * b);\n var c = Math.Truncate(result);\n var cSqr = Math.Sqrt(c);\n var CTrunc = Math.Truncate(cSqr);\n if (cSqr == CTrunc && c <= n * n)\n res++;\n }\n }\n Console.WriteLine(res);\n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "6e09ec0beaefd5840f55284e4168f6a0", "src_uid": "36a211f7814e77339eb81dc132e115e1", "apr_id": "16650a5cc6fe013fd5f7de4026063ce4", "difficulty": 1200, "tags": ["math", "brute force"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.26204564666103125, "equal_cnt": 9, "replace_cnt": 5, "delete_cnt": 3, "insert_cnt": 1, "fix_ops_cnt": 9, "bug_source_code": "using System;\nusing System.Linq;\nclass Program_158A\n{\n static void Main()\n {\n int[] a = new int[0];\n int b = Convert.ToInt32(Console.ReadLine()), sum = 0;\n for (int i = 1; i < b; i++)\n for (int j = i + 1; j < b; j++)\n {\n\n if ((IsPrime(i) || IsPrime(j)) & ((j - i) % 2 == 1) & (j % i != (i == 1 ? 1 : 0)))\n {\n Array.Resize(ref a, a.Length + 1);\n a[a.Length - 1] = i * i + j * j;\n }\n }\n a = a.Select(x => x).Where(x => x <= b).ToArray();\n for (int i = 0; i < a.Length; sum += b / a[i++]) ;\n Console.WriteLine(sum);\n }\n static bool IsPrime(int x)\n {\n for (int ii = 2; ii <= x / ii; ii++)\n if ((x % ii) == 0) return false;\n return true;\n }\n}", "lang": "MS C#", "bug_code_uid": "84926734a46eef9eced206d08cbc84b3", "src_uid": "36a211f7814e77339eb81dc132e115e1", "apr_id": "9703da981a53c95226f1fb83ba437c20", "difficulty": 1200, "tags": ["math", "brute force"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9887640449438202, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "using System;\n\nclass P { \n static void Main() {\n var n = int.Parse(Console.ReadLine());\n var res = 0;\n for (var c = n; c >= 1; c--) for (var b = c ; b >= 1 ; b--) {\n var sa = c*c-b*b;\n var a = (int)Math.Sqrt(sa);\n if ((a*a == sa && a >= 1 && a <= b) || (a*a+2*a+1 &&a+1>=1 &&a+1 <=b)==sa) res++;\n }\n Console.Write(res);\n }\n}", "lang": "MS C#", "bug_code_uid": "b761ef3765909828db83d883f96818a2", "src_uid": "36a211f7814e77339eb81dc132e115e1", "apr_id": "075bcbfda55d91768bd93a0e18023b2b", "difficulty": 1200, "tags": ["math", "brute force"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C#"} {"similarity_score": 0.7410124724871606, "equal_cnt": 15, "replace_cnt": 8, "delete_cnt": 5, "insert_cnt": 2, "fix_ops_cnt": 15, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\n\nnamespace _304A\n{\n class Program\n {\n static void Main(string[] args)\n {\n int n = int.Parse(Console.ReadLine());\n int results = 0;\n for (int c = n; c >= 1; c--)\n {\n for (int b = 1; b < c; b++)\n {\n for (int a = 1; a <= b; a++)\n {\n if (c * c == b * b + a * a)\n {\n results++;\n }\n }\n }\n }\n Console.Write(results);\n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "3757fbfbddd6eb9996a801d67dea8176", "src_uid": "36a211f7814e77339eb81dc132e115e1", "apr_id": "b2657dc623345adeb850e2e498cac666", "difficulty": 1200, "tags": ["math", "brute force"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.493116395494368, "equal_cnt": 8, "replace_cnt": 5, "delete_cnt": 3, "insert_cnt": 0, "fix_ops_cnt": 8, "bug_source_code": "using System;\nclass Program\n{\n static void Main()\n {\n var n = int.Parse(Console.ReadLine());\n var c = 0;\n for (int i = 1; i <= n - 2; i++)\n {\n for (int j = i + 1; j <= n - 1; j++)\n {\n for (int z = j + 1; z <= n; z++)\n {\n c += i * i + j * j == z * z ? 1 : 0;\n }\n }\n }\n Console.WriteLine(c);\n }\n}", "lang": "MS C#", "bug_code_uid": "ebfb79615bacecc8a9fa9ed00ee4eda2", "src_uid": "36a211f7814e77339eb81dc132e115e1", "apr_id": "a285db14c0467a5eaad54c75b9f1cdf8", "difficulty": 1200, "tags": ["math", "brute force"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.02011963023382273, "equal_cnt": 10, "replace_cnt": 7, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 10, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Globalization;\nusing System.IO;\nusing System.Linq;\nusing System.Text;\npublic class Codeforces\n{\n protected static TextReader reader;\n protected static TextWriter writer;\n static int gcd(int a, int b)\n {\n if (a == 0)\n {\n return b;\n }\n return gcd(b % a, a);\n }\n static int gcd(int[] numbers)\n {\n return numbers.Aggregate(gcd);\n }\n static void Main()\n {\n reader = new StreamReader(Console.OpenStandardInput(1024 * 10), System.Text.Encoding.ASCII, false, 1024 * 10);\n writer = new StreamWriter(Console.OpenStandardOutput(1024 * 10), System.Text.Encoding.ASCII, 1024 * 10);\n var n = ReadInt();\n var a = ReadIntArray();\n var Gcd = a.Aggregate(gcd);\n Write((a.Max() / Gcd - n) % 2 == 0 ? \"Bob\" : \"Alice\");\n reader.Close();\n writer.Close();\n }\n #region Read / Write\n\n private static Queue currentLineTokens = new Queue();\n\n private static string[] ReadAndSplitLine()\n {\n return reader.ReadLine().Split(new[] { ' ', '\\t' }, StringSplitOptions.RemoveEmptyEntries);\n }\n\n public static string ReadToken()\n {\n while (currentLineTokens.Count == 0)\n currentLineTokens = new Queue(ReadAndSplitLine());\n return currentLineTokens.Dequeue();\n }\n\n public static int ReadInt()\n {\n return int.Parse(ReadToken());\n }\n\n public static long ReadLong()\n {\n return long.Parse(ReadToken());\n }\n\n public static double ReadDouble()\n {\n return double.Parse(ReadToken(), CultureInfo.InvariantCulture);\n }\n\n public static int[] ReadIntArray()\n {\n return ReadAndSplitLine().Select(int.Parse).ToArray();\n }\n\n public static long[] ReadLongArray()\n {\n return ReadAndSplitLine().Select(long.Parse).ToArray();\n }\n\n public static double[] ReadDoubleArray()\n {\n return ReadAndSplitLine().Select(s => double.Parse(s, CultureInfo.InvariantCulture)).ToArray();\n }\n public static int[][] ReadIntMatrix(int numberOfRows)\n {\n int[][] matrix = new int[numberOfRows][];\n for (int i = 0; i < numberOfRows; i++)\n matrix[i] = ReadIntArray();\n return matrix;\n }\n public static int[][] ReadAndTransposeIntMatrix(int numberOfRows)\n {\n int[][] matrix = ReadIntMatrix(numberOfRows);\n int[][] ret = new int[matrix[0].Length][];\n for (int i = 0; i < ret.Length; i++)\n {\n ret[i] = new int[numberOfRows];\n for (int j = 0; j < numberOfRows; j++)\n ret[i][j] = matrix[j][i];\n }\n return ret;\n }\n\n public static string[] ReadLines(int quantity)\n {\n string[] lines = new string[quantity];\n for (int i = 0; i < quantity; i++)\n lines[i] = reader.ReadLine().Trim();\n return lines;\n }\n public static void WriteArray(IEnumerable array)\n {\n writer.WriteLine(string.Join(\" \", array));\n }\n\n public static void Write(params T[] array)\n {\n WriteArray(array);\n }\n\n public static void WriteLines(IEnumerable array)\n {\n foreach (var a in array)\n writer.WriteLine(a);\n }\n #endregion\n}", "lang": "MS C#", "bug_code_uid": "dfb80f8cb99539fcc2d36348c9154546", "src_uid": "36a211f7814e77339eb81dc132e115e1", "apr_id": "a285db14c0467a5eaad54c75b9f1cdf8", "difficulty": 1200, "tags": ["math", "brute force"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.7219973009446694, "equal_cnt": 8, "replace_cnt": 3, "delete_cnt": 2, "insert_cnt": 2, "fix_ops_cnt": 7, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\n\nnamespace Теорема_Пифагора_II\n{\n class Program\n {\n static void Main(string[] args)\n {\n Int64 n;\n n = Convert.ToInt64(Console.ReadLine());\n Int64 sqn = n * n;\n Int64 a, b, c, ret = 0;\n for (a = 1; a <= n; a++)\n for (b = a; b <= n; b++)\n {\n for (c = b; c <= n; c++)\n if (a * a + b * b == c * c)\n {\n ret++;\n break;\n }\n }\n Console.Write(ret);\n\n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "e2785704189daa1791e41acdd373240d", "src_uid": "36a211f7814e77339eb81dc132e115e1", "apr_id": "5451a8f645825af93bba15c804bf7145", "difficulty": 1200, "tags": ["math", "brute force"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.6232006773920407, "equal_cnt": 6, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 4, "fix_ops_cnt": 5, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Collections;\n\nnamespace a2oj\n{\n class Program\n {\n\n\n static void Main(string[] args)\n {\n string s = Console.ReadLine();\n string[] part = s.Split('.');\n string[] dec = part[1].Split('e');\n\n\n\n int t = int.Parse(dec[1]);\n\n for (int i = 0; i < t;i++ )\n {\n part[0] += dec[0][i];\n }\n if(t 0)\n {\n Console.Write(n - 1 + 1 );\n Console.Write(\" \");\n }\n\n for (int i = n - 2; i >= 0; i--)\n {\n if (array[n - 1 - i -1] == 0)\n {\n //Console.Write(i + 1);\n //Console.Write(\" \");\n }\n else\n {\n Console.Write(i + 1);\n Console.Write(\" \");\n }\n \n }\n Console.WriteLine(\"\");\n\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "78e0b6892502a9a106d52faeb10ac6c2", "src_uid": "a8da7cbd9ddaec8e0468c6cce884e7a2", "apr_id": "6abb40aa9f177e0df3349d72eb979c63", "difficulty": 1800, "tags": ["divide and conquer", "math", "bitmasks"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.9908504574771262, "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.IO;\nusing Kattis.IO;\nusing System.Resources;\n\npublic class _513B {\n\n static List calc (List cand, long m) {\n int first = cand [0];\n List res = new List ();\n if (cand.Count == 1) {\n res.Add (first);\n return res;\n }\n\n long half = 1L << (cand.Count - 2);\n cand.RemoveAt (0);\n if (m <= half) {\n res = calc (cand, m);\n res.Insert (0, first);\n } else {\n res = calc (cand, m - half);\n res.Add (first);\n }\n return res;\n }\n\n public static void Main (string[] args) {\n var cin = new Tokenizer (File.OpenRead (\"in\"));\n// var cin = new Tokenizer(Console.OpenStandardInput());\n var cout = new BufferedStdoutWriter ();\n\n int n = int.Parse (cin.Next ());\n long m = long.Parse (cin.Next ());\n List cand = new List ();\n for (int i = 1; i <= n; i++)\n cand.Add (i);\n List res = calc (cand, m);\n cout.Write (\"{0}\", res [0]);\n for (int i = 1; i < res.Count; i++)\n cout.Write (\" {0}\", res [i]);\n cout.WriteLine ();\n \n cout.Close ();\n }\n}\n\nnamespace Kattis.IO {\n public class NoMoreTokensException : Exception {\n }\n\n public class Tokenizer {\n string[] tokens = new string[0];\n private int pos;\n StreamReader reader;\n\n public Tokenizer (Stream inStream) {\n var bs = new BufferedStream (inStream);\n reader = new StreamReader (bs);\n }\n\n public Tokenizer () : this (Console.OpenStandardInput ()) {\n // Nothing more to do\n }\n\n private string PeekNext () {\n if (pos < 0)\n // pos < 0 indicates that there are no more tokens\n return null;\n if (pos < tokens.Length) {\n if (tokens [pos].Length == 0) {\n ++pos;\n return PeekNext ();\n }\n return tokens [pos];\n }\n string line = reader.ReadLine ();\n if (line == null) {\n // There is no more data to read\n pos = -1;\n return null;\n }\n // Split the line that was read on white space characters\n tokens = line.Split (null);\n pos = 0;\n return PeekNext ();\n }\n\n public bool HasNext () {\n return (PeekNext () != null);\n }\n\n public string Next () {\n string next = PeekNext ();\n if (next == null)\n throw new NoMoreTokensException ();\n ++pos;\n return next;\n }\n }\n\n public class Scanner : Tokenizer {\n\n public int NextInt () {\n return int.Parse (Next ());\n }\n\n public long NextLong () {\n return long.Parse (Next ());\n }\n\n public float NextFloat () {\n return float.Parse (Next ());\n }\n\n public double NextDouble () {\n return double.Parse (Next ());\n }\n }\n\n public class BufferedStdoutWriter : StreamWriter {\n public BufferedStdoutWriter () : base (new BufferedStream (Console.OpenStandardOutput ())) {\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "b2cf810260adf80264c9aed9086c1ea5", "src_uid": "a8da7cbd9ddaec8e0468c6cce884e7a2", "apr_id": "b737d13b1a354f7b97a42920f2884c35", "difficulty": 1800, "tags": ["divide and conquer", "math", "bitmasks"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.8658965344048217, "equal_cnt": 11, "replace_cnt": 7, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 10, "bug_source_code": "using System;\nusing System.Collections;\nusing System.Collections.Generic;\n \nclass TEST{\n\tstatic void Main(){\n\t\tSol mySol =new Sol();\n\t\tmySol.Solve();\n\t}\n}\n\nclass Sol{\n\tpublic void Solve(){\n\t\tint cnt=0;\n\t\tfor(int i=0;iint.Parse(e));}\n\tstatic long[] rla(){return Array.ConvertAll(Console.ReadLine().Split(' '),e=>long.Parse(e));}\n\tstatic double[] rda(){return Array.ConvertAll(Console.ReadLine().Split(' '),e=>double.Parse(e));}\n}\n", "lang": "Mono C#", "bug_code_uid": "081d4114f4f29077815914c7ac7fbaff", "src_uid": "9679acef82356004e47b1118f8fc836a", "apr_id": "163397035ec36d940cfc880eef1cf568", "difficulty": 1100, "tags": ["brute force", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9167974882260597, "equal_cnt": 6, "replace_cnt": 4, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 5, "bug_source_code": "using System;\nusing System.Text;\nusing System.IO;\nusing System.Globalization;\nusing System.Collections.Generic;\nusing System.Linq;\n\nstatic class Extensions {\n\tpublic static T MyLast(this IList list) { return list[list.Count - 1]; }\n}\n\nclass App {\n\tstatic string Solve() {\n\t\tvar k = int.Parse(Console.ReadLine());\n\t\tvar s = Console.ReadLine().ToArray();\n\t\tvar n = s.Length;\n\t\tfor (var i = 0 ; i < n / 2 ; i++) if (s[n - 1 - i] != '?') {\n\t\t\tif (s[n - 1 - i] == s[i]) continue;\n\t\t\tif (s[i] != '?') return null;\n\t\t\ts[i] = s[n - 1 - i];\n\t\t}\n\t\tvar requiredChars = Enumerable.Range(0, k).Select(i => (char) ('a' + i)).ToArray();\n\t\t\n\t\tvar firstHalf = Enumerable.Range(0, (n + 1) / 2);\n\t\tvar spots = firstHalf.Count(i => s[i] == '?');\n\t\tvar currentChars = requiredChars.Count(s.Contains);\n\t\tif (currentChars + spots < k) return null;\n\t\tforeach (var q in Enumerable.Range(0, k - currentChars - spots)) {\n\t\t\tvar i = firstHalf.First(ix => s[ix] == '?');\n\t\t\ts[i] = 'a';\n\t\t}\n\t\tforeach (var c in requiredChars) if (!s.Contains(c)) {\n\t\t\tvar i = firstHalf.First(ix => s[ix] == '?');\n\t\t\ts[i] = c;\n\t\t}\n\t\t\n\t\tforeach (var i in firstHalf) s[n - 1 - i] = s[i];\n\t\treturn new string(s);\n\t}\n\n\tstatic void Main() {\n\t\tConsole.WriteLine(Solve() ?? \"IMPOSSIBLE\");\n\t}\n}", "lang": "MS C#", "bug_code_uid": "f99e2463be440217c756dbea8eea7dd9", "src_uid": "9d1dd9d722e5fe46823224334b3b208a", "apr_id": "e7fe3d7a24d96ec72ce8c817e6d94406", "difficulty": 1600, "tags": ["expression parsing"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.827818506043194, "equal_cnt": 4, "replace_cnt": 2, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 3, "bug_source_code": "using System;\nusing System.Linq;\n\nnamespace ConsoleApp1\n{\n class Program\n {\n static void Main(string[] args)\n {\n char[] x = Console.ReadLine().ToArray();\n int size = x.Length;\n\n if (size <= 100 && size > 0)\n {\n for (int i = 0; i < x.Length - 1;)\n {\n char c = x[i];\n char s = x[i + 1];\n\n if (c != 'n' && c != 'a' && c != 'e' && c != 'o' && c != 'u' && c != 'i')\n {\n if (s != 'a' && s != 'e' && s != 'o' && s != 'u' && s != 'i')\n {\n Console.WriteLine(\"NO\");\n return;\n }\n else\n {\n i += 2;\n }\n }\n else if (c == 'n')\n {\n char y = x[i + 2];\n if (s != 'n' && s != 'a' && s != 'e' && s != 'o' && s != 'u' && s != 'i')\n {\n if (y != 'n' && y != 'a' && y != 'e' && y != 'o' && y != 'u' && y != 'i')\n {\n Console.WriteLine(\"NO\");\n return;\n }\n else\n {\n i += 3;\n }\n }\n else if (s == 'n' || s == 'a' || s == 'e' || s == 'o' || s == 'u' || s == 'i')\n {\n i += 2;\n }\n else\n {\n\n i += 3;\n }\n }\n else\n {\n if (s != 'n' && s != 'a' && s != 'e' && s != 'o' && s != 'u' && s != 'i')\n {\n i++;\n }\n else\n {\n i += 2;\n }\n }\n }\n if(x.Length == 1)\n {\n char c = x[0];\n if (c != 'n' && c != 'a' && c != 'e' && c != 'o' && c != 'u' && c != 'i')\n {\n Console.WriteLine(\"NO\");\n return;\n }\n }else if(x[x.Length - 1] != 'n' && x[x.Length - 1] != 'a' && x[x.Length - 1] != 'e' && x[x.Length - 1] != 'o' && x[x.Length - 1] != 'u' && x[x.Length - 1] != 'i')\n {\n Console.WriteLine(\"NO\");\n return;\n }\n Console.WriteLine(\"YES\");\n return;\n }\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "d96386e02a9ba875afd1442664e0554a", "src_uid": "a83144ba7d4906b7692456f27b0ef7d4", "apr_id": "a8d4c8206d52cee1bb8572f9a70e325d", "difficulty": 900, "tags": ["strings", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.712082262210797, "equal_cnt": 20, "replace_cnt": 10, "delete_cnt": 6, "insert_cnt": 3, "fix_ops_cnt": 19, "bug_source_code": "using System;\nusing System.Linq;\n\nnamespace ConsoleApp1\n{\n class Program\n {\n static void Main(string[] args)\n {\n char[] x = Console.ReadLine().ToArray();\n int size = x.Length;\n\n if (size <= 100 && size > 0)\n {\n for (int i = 0; i < x.Length-1;)\n {\n char c = x[i];\n char s = x[i + 1];\n\n if (c != 'n' && c != 'a' && c != 'e' && c != 'o' && c != 'u' && c != 'i')\n {\n if (s != 'a' && s != 'e' && s != 'o' && s != 'u' && s != 'i')\n {\n Console.WriteLine(\"NO\");\n return;\n }\n else\n {\n i += 2;\n }\n }\n else if (c == 'n')\n {\n char y = x[i + 2];\n if (s != 'n' && s != 'a' && s != 'e' && s != 'o' && s != 'u' && s != 'i')\n {\n if (y != 'n' && y != 'a' && y != 'e' && y != 'o' && y != 'u' && y != 'i')\n {\n Console.WriteLine(\"NO\");\n return;\n }\n else\n {\n i += 3;\n }\n }\n else\n {\n i += 2;\n }\n }\n }\n Console.WriteLine(\"YES\");\n return;\n }\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "206e6c03d76689cfc5ce267744b9a0ce", "src_uid": "a83144ba7d4906b7692456f27b0ef7d4", "apr_id": "a8d4c8206d52cee1bb8572f9a70e325d", "difficulty": 900, "tags": ["strings", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.6475548060708263, "equal_cnt": 7, "replace_cnt": 5, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 6, "bug_source_code": "using System;\n\nnamespace CSharp\n{\n public class _527A\n {\n public static void Main(string[] args)\n {\n string[] tokens = Console.ReadLine().Split();\n\n long a = long.Parse(tokens[0]);\n long b = long.Parse(tokens[1]);\n\n long count = 1;\n\n while (a != b)\n {\n long c = Math.Abs(a - b);\n long d = Math.Min(a, b);\n\n a = c;\n b = d;\n\n count++;\n }\n\n Console.WriteLine(count);\n }\n }\n}", "lang": "Mono C#", "bug_code_uid": "e2d3d0bd12fe9d0409da4b48760bee68", "src_uid": "ce698a0eb3f5b82de58feb177ce43b83", "apr_id": "743ad89b1be7bbc29fac243403d40fc1", "difficulty": 1100, "tags": ["math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.5775347912524851, "equal_cnt": 8, "replace_cnt": 5, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 7, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Runtime.InteropServices;\nusing System.Text;\n\n\nnamespace returntoi\n{\n class Program\n {\n\n static void Main(string[] args)\n {\n string[] s = Console.ReadLine().Split(' ');\n long a = Convert.ToInt64(s[0]);\n long b = Convert.ToInt64(s[1]);\n long c = 0;\n long k = 0;\n \n\n\n while (a != b)\n {\n if (b == 1) {k += a; break;}\n c = a - b;\n if (c < b)\n {\n a = b;\n b = c;\n }\n else\n {\n a = c;\n }\n \n k++;\n if (a == b) k++; \n }\n \n\n Console.WriteLine(k);\n }\n }\n}", "lang": "Mono C#", "bug_code_uid": "bda8f582a2c4639b8d24f8382e474025", "src_uid": "ce698a0eb3f5b82de58feb177ce43b83", "apr_id": "6f84edffb0dc62ef87a28516167d5169", "difficulty": 1100, "tags": ["math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.563231850117096, "equal_cnt": 14, "replace_cnt": 8, "delete_cnt": 4, "insert_cnt": 2, "fix_ops_cnt": 14, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace _527A\n{\n class Program\n {\n static void Main(string[] args)\n {\n long[] line = Console.ReadLine().Split().Select(_ => Int64.Parse(_)).ToArray();\n long a = line[0], b = line[1];\n if (a % b == 0)\n {\n Console.WriteLine(a / b); return;\n }\n int cnt = 0;\n while(Math.Min(a,b)>0)\n {\n if(a>b)\n {\n a = a - b;cnt++;\n }\n else\n {\n b = b - a;cnt++;\n }\n }\n Console.WriteLine(cnt);\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "cf08f5983f454cac16289dc5a7edc45a", "src_uid": "ce698a0eb3f5b82de58feb177ce43b83", "apr_id": "0f3d9d597c1d01059c7070e060ac06e4", "difficulty": 1100, "tags": ["math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9888575976490755, "equal_cnt": 5, "replace_cnt": 3, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 4, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.IO;\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 Pi = Pair;\n\nclass Solver\n{\n public void Solve(Scanner sc)\n {\n long N, M, L, R;\n sc.Make(out N, out M, out L, out R);\n R -= L;\n if (N * M % 2 == 1)\n {\n Fail(ModInt.Pow(R + 1, N * M));\n }\n long odd = (R + 1) / 2, even = R / 2 + 1;\n ModInt a = (ModInt)odd / (R * 2);\n WriteLine(ModInt.Pow(R + 1, N * M - 1) * (a * odd + (1 - a) * even));\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;//階乗\n private static ModInt[] inv;//逆数\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 { 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 { 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) { 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[] Shuffle(this IList A) { T[] rt = A.ToArray(); Random rnd = new Random(); for (int i = rt.Length - 1; i >= 1; i--) swap(ref rt[i], ref rt[rnd.Next(i + 1)]); return rt; }\n [MethodImpl(MethodImplOptions.AggressiveInlining)]\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 [MethodImpl(MethodImplOptions.AggressiveInlining)]\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 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 (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}\npublic class Pair : IComparable>\n{\n public T1 v1;\n public T2 v2;\n public Pair() { }\n public Pair(T1 v1, T2 v2)\n { this.v1 = v1; this.v2 = v2; }\n\n [MethodImpl(MethodImplOptions.AggressiveInlining)]\n public int CompareTo(Pair p)\n {\n var c = Comparer.Default.Compare(v1, p.v1);\n if (c == 0)\n c = Comparer.Default.Compare(v2, p.v2);\n return c;\n }\n public override string ToString() => $\"{v1.ToString()} {v2.ToString()}\";\n public void Deconstruct(out T1 a, out T2 b) { a = v1; b = v2; }\n}\n\npublic class Pair : Pair, IComparable>\n{\n public T3 v3;\n public Pair() : base() { }\n public Pair(T1 v1, T2 v2, T3 v3) : base(v1, v2)\n { this.v3 = v3; }\n\n [MethodImpl(MethodImplOptions.AggressiveInlining)]\n public int CompareTo(Pair p)\n {\n var c = base.CompareTo(p);\n if (c == 0)\n c = Comparer.Default.Compare(v3, p.v3);\n return c;\n }\n public override string ToString() => $\"{base.ToString()} {v3.ToString()}\";\n public void Deconstruct(out T1 a, out T2 b, out T3 c) { Deconstruct(out a, out b); c = v3; }\n}\n#endregion", "lang": "Mono C#", "bug_code_uid": "0bb5a7bce4cfd6867a150d3147081b91", "src_uid": "ded299fa1cd010822c60f2389a3ba1a3", "apr_id": "d7eabb4a5a32f50b5bc9969aef6a7530", "difficulty": 2100, "tags": ["matrices", "math", "combinatorics", "constructive algorithms"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9986345459865406, "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.IO;\nusing System.Linq;\nusing static System.Math;\nusing System.Text;\nusing System.Threading;\nusing System.Globalization;\nusing System.Runtime.CompilerServices;\nusing Library;\n\nnamespace Program\n{\n public static class CODEFORCES1\n {\n static public int numberOfRandomCases = 0;\n static public void MakeTestCase(List _input, List _output, ref Func _outputChecker)\n {\n }\n static public void Solve()\n {\n var n = NN;\n var m = NN;\n var L = NN;\n var R = NN;\n LIB_Mod._mod = 998244353;\n if (R - L == 0)\n {\n Console.WriteLine(1);\n return;\n }\n var tmp = LIB_Mod.Pow(LIB_Mod.Pow(R - L + 1, n), m);\n Console.WriteLine(((n * m) % 2 == 0) ? tmp / 2 : tmp);\n }\n class Printer : StreamWriter\n {\n public override IFormatProvider FormatProvider { get { return CultureInfo.InvariantCulture; } }\n public Printer(Stream stream) : base(stream, new UTF8Encoding(false, true)) { base.AutoFlush = false; }\n public Printer(Stream stream, Encoding encoding) : base(stream, encoding) { base.AutoFlush = false; }\n }\n static LIB_FastIO fastio = new LIB_FastIODebug();\n static public void Main(string[] args) { if (args.Length == 0) { fastio = new LIB_FastIO(); Console.SetOut(new Printer(Console.OpenStandardOutput())); } var t = new Thread(Solve, 134217728); t.Start(); t.Join(); Console.Out.Flush(); }\n static long NN => fastio.Long();\n static double ND => fastio.Double();\n static string NS => fastio.Scan();\n static long[] NNList(long N) => Repeat(0, N).Select(_ => NN).ToArray();\n static double[] NDList(long N) => Repeat(0, N).Select(_ => ND).ToArray();\n static string[] NSList(long N) => Repeat(0, N).Select(_ => NS).ToArray();\n static IEnumerable OrderByRand(this IEnumerable x) => x.OrderBy(_ => xorshift);\n static long Count(this IEnumerable x, Func pred) => Enumerable.Count(x, pred);\n static IEnumerable Repeat(T v, long n) => Enumerable.Repeat(v, (int)n);\n static IEnumerable Range(long s, long c) => Enumerable.Range((int)s, (int)c);\n static IEnumerable OrderBy(this IEnumerable x) => x.OrderBy(e => e, StringComparer.OrdinalIgnoreCase);\n static IEnumerable OrderBy(this IEnumerable x, Func selector) => x.OrderBy(selector, StringComparer.OrdinalIgnoreCase);\n static IEnumerable OrderByDescending(this IEnumerable x) => x.OrderByDescending(e => e, StringComparer.OrdinalIgnoreCase);\n static IEnumerable OrderByDescending(this IEnumerable x, Func selector) => x.OrderByDescending(selector, StringComparer.OrdinalIgnoreCase);\n static uint xorshift { get { _xsi.MoveNext(); return _xsi.Current; } }\n static IEnumerator _xsi = _xsc();\n static IEnumerator _xsc() { uint x = 123456789, y = 362436069, z = 521288629, w = (uint)(DateTime.Now.Ticks & 0xffffffff); while (true) { var t = x ^ (x << 11); x = y; y = z; z = w; w = (w ^ (w >> 19)) ^ (t ^ (t >> 8)); yield return w; } }\n }\n}\nnamespace Library {\n struct LIB_Mod : IEquatable, IEquatable\n {\n static public long _mod = 1000000007; long v;\n [MethodImpl(MethodImplOptions.AggressiveInlining)]\n public LIB_Mod(long x)\n {\n if (x < _mod && x >= 0) v = x;\n else if ((v = x % _mod) < 0) v += _mod;\n }\n [MethodImpl(MethodImplOptions.AggressiveInlining)]\n static public implicit operator LIB_Mod(long x) => new LIB_Mod(x);\n [MethodImpl(MethodImplOptions.AggressiveInlining)]\n static public implicit operator long(LIB_Mod x) => x.v;\n [MethodImpl(MethodImplOptions.AggressiveInlining)]\n public void Add(LIB_Mod x) { if ((v += x.v) >= _mod) v -= _mod; }\n [MethodImpl(MethodImplOptions.AggressiveInlining)]\n public void Sub(LIB_Mod x) { if ((v -= x.v) < 0) v += _mod; }\n [MethodImpl(MethodImplOptions.AggressiveInlining)]\n public void Mul(LIB_Mod x) => v = (v * x.v) % _mod;\n [MethodImpl(MethodImplOptions.AggressiveInlining)]\n public void Div(LIB_Mod x) => v = (v * Inverse(x.v)) % _mod;\n [MethodImpl(MethodImplOptions.AggressiveInlining)]\n static public LIB_Mod operator +(LIB_Mod x, LIB_Mod y) { var t = x.v + y.v; return t >= _mod ? new LIB_Mod { v = t - _mod } : new LIB_Mod { v = t }; }\n [MethodImpl(MethodImplOptions.AggressiveInlining)]\n static public LIB_Mod operator -(LIB_Mod x, LIB_Mod y) { var t = x.v - y.v; return t < 0 ? new LIB_Mod { v = t + _mod } : new LIB_Mod { v = t }; }\n [MethodImpl(MethodImplOptions.AggressiveInlining)]\n static public LIB_Mod operator *(LIB_Mod x, LIB_Mod y) => x.v * y.v;\n [MethodImpl(MethodImplOptions.AggressiveInlining)]\n static public LIB_Mod operator /(LIB_Mod x, LIB_Mod y) => x.v * Inverse(y.v);\n [MethodImpl(MethodImplOptions.AggressiveInlining)]\n static public bool operator ==(LIB_Mod x, LIB_Mod y) => x.v == y.v;\n [MethodImpl(MethodImplOptions.AggressiveInlining)]\n static public bool operator !=(LIB_Mod x, LIB_Mod y) => x.v != y.v;\n [MethodImpl(MethodImplOptions.AggressiveInlining)]\n static public long Inverse(long x)\n {\n long b = _mod, r = 1, u = 0, t = 0;\n while (b > 0)\n {\n var q = x / b;\n t = u;\n u = r - q * u;\n r = t;\n t = b;\n b = x - q * b;\n x = t;\n }\n return r < 0 ? r + _mod : r;\n }\n [MethodImpl(MethodImplOptions.AggressiveInlining)]\n public bool Equals(LIB_Mod x) => v == x.v;\n [MethodImpl(MethodImplOptions.AggressiveInlining)]\n public bool Equals(long x) => v == x;\n [MethodImpl(MethodImplOptions.AggressiveInlining)]\n public override bool Equals(object x) => x == null ? false : Equals((LIB_Mod)x);\n [MethodImpl(MethodImplOptions.AggressiveInlining)]\n public override int GetHashCode() => v.GetHashCode();\n [MethodImpl(MethodImplOptions.AggressiveInlining)]\n public override string ToString() => v.ToString();\n static List _fact = new List() { 1 };\n static long _factm = _mod;\n [MethodImpl(MethodImplOptions.AggressiveInlining)]\n static void B(long n)\n {\n if (_factm != _mod) _fact = new List() { 1 };\n if (n >= _fact.Count)\n for (int i = _fact.Count; i <= n; ++i)\n _fact.Add(_fact[i - 1] * i);\n _factm = _mod;\n }\n [MethodImpl(MethodImplOptions.AggressiveInlining)]\n static public LIB_Mod Comb(long n, long k)\n {\n B(n);\n if (n == 0 && k == 0) return 1;\n if (n < k || n < 0) return 0;\n return _fact[(int)n] / _fact[(int)(n - k)] / _fact[(int)k];\n }\n [MethodImpl(MethodImplOptions.AggressiveInlining)]\n static public LIB_Mod CombOK(long n, long k)\n {\n LIB_Mod ret = 1;\n for (var i = 0; i < k; i++) ret *= n - i;\n for (var i = 1; i <= k; i++) ret /= i;\n return ret;\n }\n [MethodImpl(MethodImplOptions.AggressiveInlining)]\n static public LIB_Mod Perm(long n, long k)\n {\n B(n);\n if (n == 0 && k == 0) return 1;\n if (n < k || n < 0) return 0;\n return _fact[(int)n] / _fact[(int)(n - k)];\n }\n [MethodImpl(MethodImplOptions.AggressiveInlining)]\n static public LIB_Mod Pow(LIB_Mod x, long y)\n {\n LIB_Mod a = 1;\n while (y != 0)\n {\n if ((y & 1) == 1) a.Mul(x);\n x.Mul(x);\n y >>= 1;\n }\n return a;\n }\n }\n class LIB_FastIO\n {\n public LIB_FastIO() { str = Console.OpenStandardInput(); }\n readonly Stream str;\n readonly byte[] buf = new byte[1024];\n int len, ptr;\n public bool isEof = false;\n public bool IsEndOfStream { get { return isEof; } }\n byte read()\n {\n if (isEof) throw new EndOfStreamException();\n if (ptr >= len)\n {\n ptr = 0;\n if ((len = str.Read(buf, 0, 1024)) <= 0)\n {\n isEof = true;\n return 0;\n }\n }\n return buf[ptr++];\n }\n char Char()\n {\n byte b = 0;\n do b = read();\n while (b < 33 || 126 < b);\n return (char)b;\n }\n virtual public string Scan()\n {\n var sb = new StringBuilder();\n for (var b = Char(); b >= 33 && b <= 126; b = (char)read())\n sb.Append(b);\n return sb.ToString();\n }\n virtual public long Long()\n {\n long ret = 0; byte b = 0; var ng = false;\n do b = read();\n while (b != '-' && (b < '0' || '9' < b));\n if (b == '-') { ng = true; b = read(); }\n for (; true; b = read())\n {\n if (b < '0' || '9' < b)\n return ng ? -ret : ret;\n else ret = ret * 10 + b - '0';\n }\n }\n virtual public double Double() { return double.Parse(Scan(), CultureInfo.InvariantCulture); }\n }\n class LIB_FastIODebug : LIB_FastIO\n {\n Queue param = new Queue();\n string NextString() { if (param.Count == 0) foreach (var item in Console.ReadLine().Split(' ')) param.Enqueue(item); return param.Dequeue(); }\n public LIB_FastIODebug() { }\n public override string Scan() => NextString();\n public override long Long() => long.Parse(NextString());\n public override double Double() => double.Parse(NextString());\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "5b2ff3a40753e7b7447413d654bb7acc", "src_uid": "ded299fa1cd010822c60f2389a3ba1a3", "apr_id": "03699ca4602e4f1b71c1cf3be576ed85", "difficulty": 2100, "tags": ["matrices", "math", "combinatorics", "constructive algorithms"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.979211914365498, "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.Text;\nusing System.Threading.Tasks;\n\nnamespace ConsoleApplication1\n{\n class Program\n {\n static void Main(string[] args)\n {\n var data = Console.ReadLine().Split().Select(int.Parse).ToArray();\n var n = data[0];\n var k = data[1];\n var line = Console.ReadLine();\n var strings = new HashSet();\n \n var sb = new StringBuilder();\n var q = new Queue();\n q.Enqueue(line);\n while (strings.Count < k && q.Count > 0)\n {\n var current = q.Dequeue(); \n strings.Add(current);\n for (int i = 0; i < current.Length; i++)\n {\n sb.Clear();\n for (int j = 0; j < current.Length; j++)\n {\n if(j == i)\n continue;\n sb.Append(current[j]);\n }\n\n var otherString = sb.ToString();\n if (strings.Add(otherString)) \n q.Enqueue(otherString);\n if(strings.Count == k)\n break;\n }\n }\n\n if (strings.Count != k)\n {\n Console.WriteLine(-1);\n return;\n }\n\n var res = k*n - strings.Sum(x => x.Length);\n Console.WriteLine(res);\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "6fbdbcc9673251b583c884f0eb86ed21", "src_uid": "ae5d21919ecac431ea7507cb1b6dc72b", "apr_id": "8bd12ef48d60a8aecdfe3ad75bb45948", "difficulty": 2000, "tags": ["graphs", "dp", "implementation", "shortest paths"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.4430979978925184, "equal_cnt": 18, "replace_cnt": 9, "delete_cnt": 7, "insert_cnt": 2, "fix_ops_cnt": 18, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Text;\n\nnamespace International_Olympiad\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 = int.Parse(reader.ReadLine());\n\n var h = new HashSet();\n\n\n for (int i = 0; i < n; i++)\n {\n string s = reader.ReadLine().Substring(4);\n long t = long.Parse(s);\n\n long start, pow;\n if (t == 9)\n {\n start = 198;\n pow = 10;\n }\n else if (t < 9)\n {\n start = 199;\n pow = 10;\n }\n else if (t >= 89 && t < 100)\n {\n start = 19;\n pow = 100;\n }\n else if (t < 100)\n {\n start = 20;\n pow = 100;\n }\n else if (t >= 989 && t < 1000)\n {\n start = 1;\n pow = 1000;\n }\n else if (t < 1000)\n {\n start = 2;\n pow = 1000;\n }\n else if (t >= 1989 && t < 10000)\n {\n start = 0;\n pow = 10000;\n }\n else if (t < 10000)\n {\n start = 1;\n pow = 10000;\n }\n else\n {\n start = 0;\n pow = Pow(10, s.Length + 1);\n }\n\n while (true)\n {\n long y = start*pow + t;\n if (h.Contains(y))\n start++;\n else\n {\n h.Add(y);\n writer.WriteLine(y);\n break;\n }\n }\n }\n\n\n writer.Flush();\n }\n\n private static long Pow(long a, int k)\n {\n long r = 1;\n while (k > 0)\n {\n if ((k & 1) == 1)\n {\n r = (r*a);\n }\n a = (a*a);\n k >>= 1;\n }\n return r;\n }\n }\n}", "lang": "MS C#", "bug_code_uid": "6349c52bbaaa7ef6d5e92ecec7a09c3d", "src_uid": "31be4d38a8b5ea8738a65bfee24a5a21", "apr_id": "feb971fb262cd4ec5946c3105c603d5e", "difficulty": 2000, "tags": ["greedy", "math", "constructive algorithms", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9993060374739764, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "using System;\n\nnamespace CSharp\n{\n public class _909A\n {\n public static void Main()\n {\n string[] tokens = Console.ReadLine().Split();\n\n string login = null;\n\n for (int l0 = 1; l0 <= tokens[0].Length; l0++)\n {\n for (int l1 = 1; l1 < tokens[1].Length; l1++)\n {\n string potentialLogin = tokens[0].Substring(0, l0) + tokens[1].Substring(0, l1);\n\n if (login == null || string.Compare(potentialLogin, login) < 0)\n {\n login = potentialLogin;\n }\n }\n }\n\n Console.WriteLine(login);\n }\n }\n}", "lang": "Mono C#", "bug_code_uid": "8e32a7e762c380234e447b6c8c1db3d1", "src_uid": "aed892f2bda10b6aee10dcb834a63709", "apr_id": "5ebae43b58565c6324087dce6e00fd03", "difficulty": 1000, "tags": ["greedy", "brute force", "sortings"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.9990407016582157, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "using System;\nusing System.Collections;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\nusing System.Text;\n\nclass Program\n{\n const bool TEST_MODE = true;\n\n static void Main()\n {\n if (TEST_MODE)\n {\n string[] readText = File.ReadAllLines(\"..\\\\..\\\\TextFile1.txt\");\n\n var testCases = new Dictionary, string>();\n var lastKeyword = \"\";\n var current = new List();\n foreach (string s in readText)\n {\n if(s == \"Input\")\n {\n current = new List();\n lastKeyword = s;\n continue;\n }\n if (s == \"Copy\")\n continue;\n if (s == \"Output\")\n {\n lastKeyword = s;\n continue;\n }\n\n if (lastKeyword == \"Input\")\n current.Add(s);\n if (lastKeyword == \"Output\")\n testCases.Add(current,s);\n \n }\n\n foreach(var testCase in testCases)\n {\n var result = ProblemWrapper.Solve(testCase.Key.ToArray(), testCase.Value);\n if (result == testCase.Value)\n Console.ForegroundColor = ConsoleColor.Green;\n else\n Console.ForegroundColor = ConsoleColor.Red;\n\n\n Console.Write(\"input: \");\n foreach (var input in testCase.Key)\n Console.Write(input + \" // \");\n Console.Write(\"\\noutput: \");\n Console.WriteLine(testCase.Value);\n\n Console.Write(\"Actual: \");\n Console.WriteLine(result);\n\n Console.ResetColor();\n }\n }\n else\n ProblemWrapper.Solve();\n\n Console.ReadLine();\n }\n}\n\nclass ProblemWrapper\n{\n public static void Solve()\n {\n string[] input = new string[2];\n input[0] = Console.ReadLine();\n input[1] = Console.ReadLine();\n\n var numGrades = ReadInt(input[0]);\n var grades = ReadIntArr(input[1]);\n\n Console.WriteLine(Algo(numGrades, grades));\n }\n \n public static string Solve(string[] input, string output)\n {\n var numGrades = ReadInt(input[0]);\n var grades = ReadIntArr(input[1]);\n\n return (Algo(numGrades, grades));\n }\n\n public static string Algo(int numGrades, int[] grades)\n {\n int answer = 0;\n\n //**\n {\n var gradesList = grades.ToList();\n gradesList.Sort();\n\n while (gradesList.Average() < 4.5)\n {\n gradesList.RemoveAt(0);\n gradesList.Add(5);\n answer++;\n }\n\n }\n //**\n\n return Convert.ToString(answer);\n }\n\n static String ReadString(string input) { return input; }\n static String[] ReadStringArr(string input) { return input.Split(' '); }\n static int ReadInt(string input) { return int.Parse(input); }\n static long ReadLong(string input) { return long.Parse(input); }\n static double ReadDouble(string input) { return double.Parse(input); }\n static int[] ReadIntArr(string input) { return Array.ConvertAll(input.Split(' '), e => int.Parse(e)); }\n static long[] ReadLongArr(string input) { return Array.ConvertAll(input.Split(' '), e => long.Parse(e)); }\n static double[] ReadDoubleArr(string input) { return Array.ConvertAll(input.Split(' '), e => double.Parse(e)); }\n}", "lang": "Mono C#", "bug_code_uid": "faa584182e75a19b59232392dddd83af", "src_uid": "715608282b27a0a25b66f08574a6d5bd", "apr_id": "d01c818d20ce649fb44404682ede94c7", "difficulty": 900, "tags": ["greedy", "sortings"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.027110289587184228, "equal_cnt": 14, "replace_cnt": 13, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 14, "bug_source_code": "\nMicrosoft Visual Studio Solution File, Format Version 12.00\n# Visual Studio 15\nVisualStudioVersion = 15.0.27130.2027\nMinimumVisualStudioVersion = 10.0.40219.1\nProject(\"{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}\") = \"CF491_B\", \"CF491_B\\CF491_B.csproj\", \"{E1F8EB5B-7A2E-45BB-ACBE-930B8B7988A1}\"\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{E1F8EB5B-7A2E-45BB-ACBE-930B8B7988A1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{E1F8EB5B-7A2E-45BB-ACBE-930B8B7988A1}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{E1F8EB5B-7A2E-45BB-ACBE-930B8B7988A1}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{E1F8EB5B-7A2E-45BB-ACBE-930B8B7988A1}.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 = {54CF0155-66D9-4782-AF71-AEF5B259F28F}\n\tEndGlobalSection\nEndGlobal\n", "lang": "Mono C#", "bug_code_uid": "cb3881fa880c1abc53ae05fc8e26181a", "src_uid": "715608282b27a0a25b66f08574a6d5bd", "apr_id": "3f4e2dda6483108e4594bc16bc5edee4", "difficulty": 900, "tags": ["greedy", "sortings"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9351977146293791, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 3, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Diagnostics;\nusing System.Globalization;\nusing System.IO;\nusing System.Linq;\nusing System.Numerics;\nusing System.Text;\nusing System.Threading;\n\nnamespace ReadWriteTemplate\n{\n\tpublic static class Solver\n\t{\n\t\tprivate static void SolveCase()\n\t\t{\n\t\t\tint n = ReadInt();\n\t\t\tvar a = ReadIntArray();\n\t\t\tArray.Sort(a);\n\t\t\tint sum = a.Sum();\n\t\t\tint i = 0;\n\t\t\twhile (2 * sum < 9 * n)\n\t\t\t{\n\t\t\t\tsum = sum - a[i] + 5;\n\t\t\t\ti++;\n\t\t\t}\n\t\t\tWriter.WriteLine(i);\n\t\t}\n\n\t\tpublic static void Solve()\n\t\t{\n\t\t\tSolveCase();\n\t\t}\n\n\t\tpublic static void Main()\n\t\t{\n\t\t\tThread.CurrentThread.CurrentCulture = CultureInfo.InvariantCulture;\n\n\t\t\t// Solve();\n\t\t\tThread thread = new Thread(Solve, 64 * 1024 * 1024);\n\t\t\tthread.CurrentCulture = CultureInfo.InvariantCulture;\n\t\t\tthread.Start();\n\t\t\tthread.Join();\n\n\t\t\tReader.Close();\n\t\t\tWriter.Close();\n\t\t}\n\n\t\tpublic static IOrderedEnumerable OrderByWithShuffle(this IEnumerable source, Func keySelector)\n\t\t{\n\t\t\treturn source.Shuffle().OrderBy(keySelector);\n\t\t}\n\n\t\tpublic static T[] Shuffle(this IEnumerable source)\n\t\t{\n\t\t\tT[] result = source.ToArray();\n\t\t\tRandom rnd = new Random();\n\t\t\tfor (int i = result.Length - 1; i >= 1; i--)\n\t\t\t{\n\t\t\t\tint k = rnd.Next(i + 1);\n\t\t\t\tT tmp = result[k];\n\t\t\t\tresult[k] = result[i];\n\t\t\t\tresult[i] = tmp;\n\t\t\t}\n\t\t\treturn result;\n\t\t}\n\n\t\t#region Read/Write\n\n\t\tprivate static TextReader Reader;\n\n\t\tprivate static TextWriter Writer;\n\n\t\tprivate static Queue CurrentLineTokens = new Queue();\n\n\t\tprivate static string[] ReadAndSplitLine()\n\t\t{\n\t\t\treturn Reader.ReadLine().Split(new[] { ' ', '\\t' }, StringSplitOptions.RemoveEmptyEntries);\n\t\t}\n\n\t\tpublic static string ReadToken()\n\t\t{\n\t\t\twhile (CurrentLineTokens.Count == 0)\n\t\t\t\tCurrentLineTokens = new Queue(ReadAndSplitLine());\n\t\t\treturn CurrentLineTokens.Dequeue();\n\t\t}\n\n\t\tpublic static string ReadLine()\n\t\t{\n\t\t\treturn Reader.ReadLine();\n\t\t}\n\n\t\tpublic static int ReadInt()\n\t\t{\n\t\t\treturn int.Parse(ReadToken());\n\t\t}\n\n\t\tpublic static long ReadLong()\n\t\t{\n\t\t\treturn long.Parse(ReadToken());\n\t\t}\n\n\t\tpublic static double ReadDouble()\n\t\t{\n\t\t\treturn double.Parse(ReadToken(), CultureInfo.InvariantCulture);\n\t\t}\n\n\t\tpublic static int[] ReadIntArray()\n\t\t{\n\t\t\treturn ReadAndSplitLine().Select(int.Parse).ToArray();\n\t\t}\n\n\t\tpublic static long[] ReadLongArray()\n\t\t{\n\t\t\treturn ReadAndSplitLine().Select(long.Parse).ToArray();\n\t\t}\n\n\t\tpublic static double[] ReadDoubleArray()\n\t\t{\n\t\t\treturn ReadAndSplitLine().Select(s => double.Parse(s, CultureInfo.InvariantCulture)).ToArray();\n\t\t}\n\n\t\tpublic static int[][] ReadIntMatrix(int numberOfRows)\n\t\t{\n\t\t\tint[][] matrix = new int[numberOfRows][];\n\t\t\tfor (int i = 0; i < numberOfRows; i++)\n\t\t\t\tmatrix[i] = ReadIntArray();\n\t\t\treturn matrix;\n\t\t}\n\n\t\tpublic static string[] ReadLines(int quantity)\n\t\t{\n\t\t\tstring[] lines = new string[quantity];\n\t\t\tfor (int i = 0; i < quantity; i++)\n\t\t\t\tlines[i] = Reader.ReadLine().Trim();\n\t\t\treturn lines;\n\t\t}\n\n\t\tpublic static void WriteArray(IEnumerable array)\n\t\t{\n\t\t\tWriter.WriteLine(string.Join(\" \", array));\n\t\t}\n\n\t\t#endregion\n\t}\n}", "lang": "Mono C#", "bug_code_uid": "75f32a29e72af0e40cc2566278003bf6", "src_uid": "715608282b27a0a25b66f08574a6d5bd", "apr_id": "f475ccab70cf953a0106556510b6b683", "difficulty": 900, "tags": ["greedy", "sortings"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.5887284583139264, "equal_cnt": 14, "replace_cnt": 6, "delete_cnt": 2, "insert_cnt": 5, "fix_ops_cnt": 13, "bug_source_code": "using System;\nusing System.Linq;\nusing System.Reflection.Metadata.Ecma335;\nusing System.Runtime.InteropServices;\n\nnamespace cs\n{\n class Program\n {\n static void Main(string[] args)\n {\n int n = int.Parse(Console.ReadLine());\n int[] scores = Console.ReadLine().Split(' ').Select(int.Parse).ToArray();\n double EPSILON = 0.000001;\n int count = 0;\n int sum = scores.Sum();\n int i = 0;\n while ((double)sum / n - 4.5 < EPSILON && i < n)\n {\n if (scores[i] != 5)\n {\n sum += (5 - scores[i]);\n count++;\n }\n i++;\n }\n\n Console.WriteLine(count);\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "ccc3b2d4d72502fd142385a4b57da68e", "src_uid": "715608282b27a0a25b66f08574a6d5bd", "apr_id": "a0476aa4afdae493f5c11bbc2ab0a394", "difficulty": 900, "tags": ["greedy", "sortings"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9326765188834154, "equal_cnt": 1, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": " static void Main()\n {\n long a, b, c;\n string s = \"\";\n s = Console.ReadLine();\n string[] nums = s.Split(' ');\n a = long.Parse(nums[0]);\n b = long.Parse(nums[1]);\n c = long.Parse(nums[2]);\n\n if (b == a)\n Console.Write(\"YES\");\n else if (c == 0)\n Console.Write(\"NO\");\n else if ((b - a) % c == 0 && (b - a) / c > 0)\n Console.Write(\"YES\");\n else\n Console.Write(\"NO\");\n\n }", "lang": "MS C#", "bug_code_uid": "0424d11f42cac1573179c32f73fb6134", "src_uid": "9edf42c20ddf22a251b84553d7305a7d", "apr_id": "649d136a69aac3ce684cd4048cfbdc97", "difficulty": 1100, "tags": ["math"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.8643941278925106, "equal_cnt": 12, "replace_cnt": 6, "delete_cnt": 0, "insert_cnt": 5, "fix_ops_cnt": 11, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\n\nnamespace CodeForces\n{\n class Caesars_Legions\n {\n public static void Main()\n {\n string[] line = Console.ReadLine().Split(' ');\n int n1 = int.Parse(line[0]);\n int n2 = int.Parse(line[1]);\n int k1 = int.Parse(line[2]);\n int k2 = int.Parse(line[3]);\n\n var dp = new int[101, 101, 12, 12];\n var answer = recurse(n1, n2, k1, k2, 0, 0, dp, 0, 0, 0);\n Console.WriteLine(answer);\n }\n\n public static int recurse(int s, int h, int k1, int k2, int sp, int hp, int[,,,] dp, int tsp, int thp, int total)\n {\n // If there is only one thing left to place there is exactly one way to do it.\n if (total == s + h)\n {\n return 1;\n }\n\n // Have we calculated this branch before?\n if (dp[sp, hp, tsp, thp] != 0)\n {\n return dp[sp, hp, tsp, thp];\n }\n\n // Is it legal to place a soldier?\n int a = 0;\n if (tsp < s && sp + 1 <= k1)\n {\n a = recurse(s, h, k1, k2, sp + 1, 0, dp, tsp + 1, thp, total + 1);\n }\n\n // Is it legal to place a horse?\n int b = 0;\n if (thp < h && hp + 1 <= k2)\n {\n b = recurse(s, h, k1, k2, 0, hp + 1, dp, tsp, thp + 1, total + 1);\n }\n\n // Add the results of both sides of the tree and mod (per problem statement)\n int answer = (a + b) % 100000000;\n\n // Save the answer so we don't have to recalculate it.\n dp[sp, hp, tsp, thp] = answer;\n\n return answer;\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "64b1c0c25d4aa6cc8a358d01e45fe319", "src_uid": "63aabef26fe008e4c6fc9336eb038289", "apr_id": "04597667d864be6e1dc3226b39b2dbb0", "difficulty": 1700, "tags": ["dp"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.8847972132371237, "equal_cnt": 10, "replace_cnt": 5, "delete_cnt": 0, "insert_cnt": 4, "fix_ops_cnt": 9, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\n\nnamespace CodeForces\n{\n class Caesars_Legions\n {\n public static void Main()\n {\n string[] line = Console.ReadLine().Split(' ');\n int n1 = int.Parse(line[0]);\n int n2 = int.Parse(line[1]);\n int k1 = int.Parse(line[2]);\n int k2 = int.Parse(line[3]);\n\n var dp = new int[101, 101, 11, 11];\n var answer = recurse(n1, n2, k1, k2, 0, 0, dp, 0, 0, 0);\n Console.WriteLine(answer);\n }\n\n public static int recurse(int s, int h, int k1, int k2, int sp, int hp, int[,,,] dp, int tsp, int thp, int total)\n {\n // If there is only one thing left to place there is exactly one way to do it.\n if (total == s + h)\n {\n return 1;\n }\n\n // Have we calculated this branch before?\n if (dp[tsp, thp, sp, hp] != 0)\n {\n return dp[tsp, thp, sp, hp];\n }\n\n // Is it legal to place a soldier?\n int a = 0;\n if (tsp < s && sp + 1 <= k1)\n {\n a = recurse(s, h, k1, k2, sp + 1, 0, dp, tsp + 1, thp, total + 1);\n }\n\n // Is it legal to place a horse?\n int b = 0;\n if (thp < h && hp + 1 <= k2)\n {\n b = recurse(s, h, k1, k2, 0, hp + 1, dp, tsp, thp + 1, total + 1);\n }\n\n // Add the results of both sides of the tree and mod (per problem statement)\n int answer = (a + b) % 100000000;\n\n // Save the answer so we don't have to recalculate it.\n dp[tsp, thp, sp, hp] = answer;\n\n return answer;\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "4ac4ecbdd459cf1ec3c30128cd9bd644", "src_uid": "63aabef26fe008e4c6fc9336eb038289", "apr_id": "04597667d864be6e1dc3226b39b2dbb0", "difficulty": 1700, "tags": ["dp"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.7057761732851986, "equal_cnt": 8, "replace_cnt": 7, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 8, "bug_source_code": "using System;\nusing System.Linq;\n\nnamespace olimpP\n{\n\tclass MainClass\n\t{\n\t\tpublic static void Main (string[] args)\n\t\t{\n\t\t\tstring s = Console.ReadLine ();\n\n\t\t\tConsole.WriteLine(Func4 (s));\n\n\t\t}\n\t\tpublic static string Func4(string s)\n\t\t{\n\n\t\t\tstring[] arr = s.Split (' ');\n\t\t\tdouble a = Convert.ToInt32 (arr [0]);\n\t\t\tdouble b = Convert.ToInt32 (arr [1]);\n\t\t\tdouble c = Convert.ToInt32 (arr [2]);\n\t\t\tdouble d = Convert.ToInt32 (arr [3]);\n\t\t\tdouble e = Convert.ToInt32 (arr [4]);\n\t\t\tdouble f = Convert.ToInt32 (arr [5]);\n\t\t\tif (a != 0 && c != 0 && e != 0 && b!=0 && d!=0 && f!=0) {\n\t\t\t\tif ((b * d * f) / (a * c * e) > 1)\n\t\t\t\t\treturn \"Ron\";\n\t\t\t\telse\n\t\t\t\t\treturn \"Hermione\";\n\t\t\t} \n\t\t\tif (a == 0 && b == 0 && c == 0 && d == 0 & e == 0 && f == 0)\n\t\t\t\treturn \"Hermione\";\n\t\t\tif (c==0 && d!=0)\n\t\t\t\treturn \"Ron\";\n\t\t\tif (b==0 && a!=0)\n\t\t\t\treturn \"Hermione\";\n\t\t\tif (e==0 && f!=0)\n\t\t\t\treturn \"Ron\";\n\n\n\n\n\n\t\t}\n\n\t}\n}\n\t\n", "lang": "Mono C#", "bug_code_uid": "7f1b4b30ddce780aaf93d133c6bf837d", "src_uid": "44d608de3e1447f89070e707ba550150", "apr_id": "e9a8bf695a2163b0a662c9ad93e6c822", "difficulty": 1800, "tags": ["math", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9953364423717521, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "using System;\n\nnamespace CF_1085_A\n{\n class Program\n {\n static void Main(string[] args)\n {\n \n string s = Console.ReadLine();\n if(s.Length <= 2)\n {\n Console.WriteLine(s);\n return;\n }\n\n string ans = \"\";\n\n if(s.Length %2 == 1)\n {\n ans = s[0].ToString();\n s.Remove(0, 1);\n }\n\n while (s.Length > 0)\n {\n ans = s[s.Length - 1].ToString() + ans ;\n s = s.Remove(s.Length - 1);\n ans = s[0].ToString() + ans;\n s = s.Remove(0, 1);\n }\n\n Console.WriteLine(ans);\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "95042d1f1798d7453eb219ca5a4d7cd8", "src_uid": "992ae43e66f1808f19c86b1def1f6b41", "apr_id": "94bbf89ac8c692090fb6b306472e0bb8", "difficulty": 800, "tags": ["strings", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.4949683190458442, "equal_cnt": 19, "replace_cnt": 12, "delete_cnt": 6, "insert_cnt": 1, "fix_ops_cnt": 19, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\nusing System.Numerics;\n\nnamespace ярморка\n{\n class Program\n {\n static UInt64 RepeatNum(int n, int count)\n {\n string res = \"\";\n for (int i = 0; i < count; i++)\n {\n res += n.ToString();\n }\n return Convert.ToUInt64(res);\n }\n static bool IsZCY(UInt64 n)\n {\n string num = n.ToString();\n\n if (num.Length % 2 != 0) return false;\n\n for (int i = 0; i < num.Length / 2; i++)\n {\n if (num[i] != num[num.Length - 1 - i])\n {\n return false;\n }\n }\n\n return true;\n }\n static void Main(string[] args)\n {\n\n string[] input = Console.ReadLine().Split();\n int k = Convert.ToInt32(input[0]);\n UInt64 p = Convert.ToUInt64(input[1]);\n\n UInt64 sum = 0;\n int zcy = 9;\n int count = 1;\n\n while (k / zcy != 0)\n {\n if (k / zcy > 0)\n {\n sum += RepeatNum(495, count);\n k -= zcy;\n count++;\n }\n zcy = Convert.ToInt32(Convert.ToString(zcy) + \"0\");\n }\n\n UInt64 i = Convert.ToUInt64(Math.Pow(10, 2 * count - 1));\n count = 0;\n while (count < k)\n {\n if (IsZCY(i))\n {\n sum += i;\n count++;\n }\n i++;\n }\n\n Console.WriteLine(sum % p);\n\n\n\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "e9b75f56432f6a1cc1c7a347900e2b8f", "src_uid": "00e90909a77ce9e22bb7cbf1285b0609", "apr_id": "2cd748be7c70bf8013ba9e4d424c8119", "difficulty": 1300, "tags": ["brute force"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9188640973630832, "equal_cnt": 12, "replace_cnt": 4, "delete_cnt": 1, "insert_cnt": 6, "fix_ops_cnt": 11, "bug_source_code": "using System;\nusing System.Linq;\nusing System.Collections.Generic;\n\nusing static System.Console;\n \npublic class Test\n{ \n static int Sum(int n)\n {\n return (2 + n - 1) * n / 2;\n }\n\n static int Res(int i, int n)\n {\n return Sum(i) - n + i;\n }\n\n static int Mid(int left, int right)\n {\n return (int)Math.Floor((double)(left + right / 2));\n }\n\n public static void Main()\n\t{\n var line1 = ReadLine().Split();\n int n = int.Parse(line1[0]);\n int k = int.Parse(line1[1]);\n \n int left = 1;\n int right = n;\n int mid = Mid(left, right);\n while(Res(mid, n) != k)\n {\n if(Res(mid, n) > k)\n {\n right = mid;\n }\n else\n {\n left = mid;\n } \n\n mid = Mid(left, right); \n }\n\n WriteLine(Sum(mid) - k);\n\t}\n}", "lang": "Mono C#", "bug_code_uid": "4b25eb3eea2da1633bca1773895a12a4", "src_uid": "17b5ec1c6263ef63c668c2b903db1d77", "apr_id": "620eacfb33d7c0701065952a089fd845", "difficulty": 1000, "tags": ["math", "brute force", "binary search"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.6477462437395659, "equal_cnt": 11, "replace_cnt": 6, "delete_cnt": 2, "insert_cnt": 3, "fix_ops_cnt": 11, "bug_source_code": "using System;\nusing System.Collections;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\n\nnamespace Contest\n{\n class Program\n {\n static void Main(string[] args)\n {\n var nk = Array.ConvertAll(Console.ReadLine().Split(), Convert.ToInt64);\n long n = nk[0], k = nk[1];\n int kq = 0;\n long ts = n * n + n - 2 * k;\n while (true)\n {\n if(ts%(2*n+3-kq)==0&&ts/(2*n*3-kq)==kq)\n {\n Console.WriteLine(kq);\n break;\n }\n kq++;\n }\n\n }\n }\n}\n ", "lang": "Mono C#", "bug_code_uid": "7b9598d7f01f95ba28d7c07b616e17d2", "src_uid": "17b5ec1c6263ef63c668c2b903db1d77", "apr_id": "2684181fd893ef3408c91e968a86fdbb", "difficulty": 1000, "tags": ["math", "brute force", "binary search"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.6507413509060955, "equal_cnt": 13, "replace_cnt": 7, "delete_cnt": 3, "insert_cnt": 3, "fix_ops_cnt": 13, "bug_source_code": "using System;\nusing System.Collections;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\n\nnamespace Contest\n{\n class Program\n {\n static void Main(string[] args)\n {\n var nk = Array.ConvertAll(Console.ReadLine().Split(), Convert.ToInt64);\n long n = nk[0], k = nk[1];\n long ts = n * n + n - 2 * k;\n long kq = ts / (2 * n + 3);\n while (true)\n {\n if(ts%(2*n+3-kq)==0&&ts/(2*n+3-kq)==kq)\n {\n Console.WriteLine(kq);\n break;\n }\n kq++;\n }\n\n }\n }\n}\n ", "lang": "Mono C#", "bug_code_uid": "c8fc040a94ec6651c493b01749bc7277", "src_uid": "17b5ec1c6263ef63c668c2b903db1d77", "apr_id": "2684181fd893ef3408c91e968a86fdbb", "difficulty": 1000, "tags": ["math", "brute force", "binary search"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9002383384405857, "equal_cnt": 23, "replace_cnt": 12, "delete_cnt": 6, "insert_cnt": 4, "fix_ops_cnt": 22, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\nusing System.Reflection;\n\nnamespace ConsoleApp1\n{\n class Program\n {\n static void Main(string[] args)\n {\n int[] array = new int[2];\n\n string str = Console.ReadLine();\n string s = \"\";\n\n for(int i = 0; i < str.Length; i++)\n {\n if(str[i]==' ')\n {\n array[0] = Convert.ToInt32(s);\n s = \"\";\n }\n else\n {\n s += str[i];\n }\n }\n array[1] = Convert.ToInt32(s);\n\n int l,m,mid;\n l = array[0];\n m = 1;\n\n while (true)\n {\n mid = (l + m) / 2;\n if ((1 + mid) * mid / 2 - (array[0] - mid) > array[1])\n {\n l = mid -1;\n }\n if ((1 + mid) * mid / 2 - (array[0] - mid) < array[1])\n {\n m = mid +1;\n }\n\n if ((1 + mid) * mid / 2 - (array[0] - mid) == array[1])\n {\n break;\n }\n \n\n }\n\n Console.WriteLine(array[0] - mid);\n \n\n \n\n // Console.Read();\n\n }\n }\n \n}\n", "lang": "Mono C#", "bug_code_uid": "fa9065961ad2f92fd03e95b06e0903eb", "src_uid": "17b5ec1c6263ef63c668c2b903db1d77", "apr_id": "8d8fdc1a22b0e4a8b9e0346145260233", "difficulty": 1000, "tags": ["math", "brute force", "binary search"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.6182108626198083, "equal_cnt": 11, "replace_cnt": 7, "delete_cnt": 3, "insert_cnt": 1, "fix_ops_cnt": 11, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace Task_02\n{\n class Program\n {\n static void Main(string[] args)\n {\n var ints = Console.ReadLine().Split(null).Select(int.Parse).ToArray();\n int n = ints[0];\n int k = ints[1];\n\n var i = 0;\n while (true)\n {\n if ((n - i) * (n - i + 1) / 2 - i == k)\n break;\n i++;\n }\n\n Console.WriteLine(i);\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "de509725a2b791b67f088cc8de0484d3", "src_uid": "17b5ec1c6263ef63c668c2b903db1d77", "apr_id": "423e8b81ae8c8332e38c2d4803c29023", "difficulty": 1000, "tags": ["math", "brute force", "binary search"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9724888035828535, "equal_cnt": 5, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 4, "fix_ops_cnt": 4, "bug_source_code": "using System;\nusing System.Collections.Generic;\n\n\nclass Scanner\n{\n string[] s;\n int i;\n\n char[] cs = new char[] { ' ' };\n\n public Scanner()\n {\n s = new string[0];\n i = 0;\n }\n\n public string next()\n {\n if (i < s.Length) return s[i++];\n s = Console.ReadLine().Split(cs, StringSplitOptions.RemoveEmptyEntries);\n i = 0;\n return s[i++];\n }\n\n public int nextInt()\n {\n return int.Parse(next());\n }\n\n public long nextLong()\n {\n return long.Parse(next());\n }\n\n}\n\nclass Myon\n{\n Scanner cin;\n Myon() { }\n\n public static void Main()\n {\n new Myon().calc();\n }\n\n\n bool[,, ,] dp;\n int n;\n string s;\n int len;\n int ret;\n\n void calc()\n {\n cin = new Scanner();\n int i, j, k;\n s = Console.ReadLine();\n n = cin.nextInt();\n len = s.Length;\n dp = new bool[101, 300, n + 1, 2];\n ret = 0;\n dfs(0, 150, 0, 0);\n Console.WriteLine(ret);\n }\n\n\n void dfs(int now, int pos, int change, int a)\n {\n if (change > n) return;\n if (now == len)\n {\n if (change != n) return;\n ret = Math.Max(ret, Math.Abs(pos - 150)); return;\n }\n if (dp[now, pos, change, a]) return;\n int memo = 1;\n if (s[now] == 'F') memo = 0;\n int v = 1;\n if (a == 1) v = -1;\n\n dfs(now + 1, pos + v, change + memo, a);\n dfs(now + 1, pos, change + (1 - memo), 1 - a);\n }\n}", "lang": "Mono C#", "bug_code_uid": "9c8727cd0c67d73a81f913c1e4b95617", "src_uid": "4a54971eb22e62b1d9e6b72f05ae361d", "apr_id": "8b7d00755cb175587ee58b7596556c8d", "difficulty": 1800, "tags": ["dp"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.7390263367916999, "equal_cnt": 20, "replace_cnt": 3, "delete_cnt": 4, "insert_cnt": 13, "fix_ops_cnt": 20, "bug_source_code": "\nnamespace ConsoleApplication89\n{\n class Prog\n {\n static void Main(string[] args)\n {\n\n int n;\n string s;\n \n n =int.Parse(Console.ReadLine());\n s = Console.ReadLine();\n\n string vowel = \"aeiouy\";\n\n for (int i = 0; i < s.Length-1; ++i)\n {\n if(vowel.Contains(s[i]) && vowel.Contains(s[i+1]) )\n {\n s = s.Remove(i+1, 1);\n }\n }\n Console.WriteLine(s);\n }\n }\n}", "lang": "MS C#", "bug_code_uid": "1ebb6aa5a4f603d3bf560cf629f64345", "src_uid": "63a4a5795d94f698b0912bb8d4cdf690", "apr_id": "a64167d5ad126a079e2a914c3c5f02c9", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.9852310624106717, "equal_cnt": 5, "replace_cnt": 1, "delete_cnt": 2, "insert_cnt": 2, "fix_ops_cnt": 5, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\nusing System.Text;\n\n\nnamespace Compete.CFE38 {\n public class TaskA : IProblem {\n public static void Main(string[] args) {\n new TaskA().Solve(Console.In, Console.Out);\n }\n\n public void Solve(TextReader input, TextWriter output) {\n // INPUT\n var n = int.Parse(input.ReadLine());\n var s = input.ReadLine();\n\n // SOLUTION\n var sb = new StringBuilder();\n bool prev = false;\n foreach (var c in s) {\n if (IsVowel(c)) {\n if (!prev) {\n prev = true;\n sb.Append(c);\n }\n }\n else {\n prev = false;\n sb.Append(c);\n }\n }\n\n // OUTPUT\n output.WriteLine(sb.ToString());\n }\n\n\n private static bool IsVowel(char c) => \"aeiouy\".Contains(c);\n }\n}\n", "lang": "MS C#", "bug_code_uid": "1c1631944694be43696ea0b74cb167fe", "src_uid": "63a4a5795d94f698b0912bb8d4cdf690", "apr_id": "fe455b0f5c211e630882cf32f1c76e8e", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C#"} {"similarity_score": 0.9884259259259259, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Text;\n\nclass C\n{\n private static string NextToken()\n {\n StringBuilder result = new StringBuilder();\n while (true)\n {\n int c = Console.Read();\n if (c == -1)\n return result.ToString();\n if (char.IsWhiteSpace((char)c))\n {\n if (result.Length > 0)\n {\n return result.ToString();\n }\n }\n else\n {\n result.Append((char)c);\n }\n }\n }\n\n private static int NextInt()\n {\n return int.Parse(NextToken());\n }\n\n private static long NextLong()\n {\n return long.Parse(NextToken());\n }\n\n private static double NextDouble()\n {\n return double.Parse(NextToken());\n }\n\n static void Solve()\n {\n int n = NextInt();\n int[] x = new int[n];\n for (int i = 0; i < n; i++)\n {\n x[i] = NextInt();\n }\n Array.Sort(x);\n int answer = n;\n for (int piles = 1; piles < n; piles++)\n {\n bool possible = true;\n int mod = n%piles;\n int minh = n/piles;\n int maxh = n/piles + (mod > 0 ? 1 : 0);\n for (int h = 1; h <= maxh; h++)\n {\n if (h*piles <= n)\n {\n var upper = n - 1 - (h - 1)*piles;\n var lower = upper - piles + 1;\n for (int i = lower; i <= upper; i++)\n {\n if (x[i] < minh - h)\n {\n possible = false;\n break;\n }\n }\n }\n else\n {\n if (minh == 0)\n break;\n var upper = mod + piles - 1;\n var lower = upper - mod + 1;\n for (int i = lower; i <= upper; i++)\n {\n if (x[i] < 1)\n {\n possible = false;\n break;\n }\n }\n }\n if (!possible)\n break;\n }\n if (possible)\n {\n answer = piles;\n break;\n }\n }\n Console.WriteLine(answer);\n }\n\n static void Main(string[] args)\n {\n //using (var reader = new StreamReader(new FileStream(\"c.in\", FileMode.OpenOrCreate, FileAccess.Read)))\n //{\n // Console.SetIn(reader);\n // using (var writer = new StreamWriter(new FileStream(\"c.out\", FileMode.Create, FileAccess.Write)))\n // {\n // Console.SetOut(writer);\n Solve();\n // }\n //}\n }\n}\n\n", "lang": "MS C#", "bug_code_uid": "75441cb50ee6fb4b0f4b99152246d8a6", "src_uid": "7c710ae68f27f140e7e03564492f7214", "apr_id": "3fa534cb7f9d19916c47c714c66202c6", "difficulty": 1400, "tags": ["dp", "greedy", "binary search"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.7346502936465563, "equal_cnt": 11, "replace_cnt": 4, "delete_cnt": 3, "insert_cnt": 3, "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 ProblemC\n{\n class Program\n {\n static void Main(string[] args)\n {\n //Console.SetIn(System.IO.File.OpenText(\"input.txt\"));\n int n = int.Parse(Console.ReadLine());\n List st = Console.ReadLine().Split().Select(t => int.Parse(t)).ToList();\n st.Sort();\n int count = 0;\n while (st.Count > 0)\n {\n count++;\n int prev = st[st.Count - 1];\n st.RemoveAt(st.Count - 1);\n for (int i = st.Count - 1; i >= 0; i--)\n {\n if (st[i] < prev)\n {\n prev = st[i];\n st.RemoveAt(i);\n }\n }\n }\n Console.WriteLine(count);\n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "cdf57ca39fc27d40c1395318ecca6559", "src_uid": "7c710ae68f27f140e7e03564492f7214", "apr_id": "c78ccca61869046e3e678d148fd4efbe", "difficulty": 1400, "tags": ["dp", "greedy", "binary search"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9790754257907542, "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;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace ConsoleApp1\n{\n class Program\n {\n static void Main(string[] args)\n {\n string password = Console.ReadLine();\n int length = 0;\n\n string tmp = Console.ReadLine();\n int.TryParse(tmp, out length);\n\n string[] parts = new string[length];\n\n for (int i = 0; i < length; i++)\n {\n parts[i] = Console.ReadLine();\n }\n\n bool isExists = false;\n\n for (int i = 0; i < length; i++)\n {\n for (int j = 0; j < length; j++)\n {\n if (j == i) continue;\n\n if ((parts[i] + parts[j]).Contains(password))\n {\n isExists = true;\n break;\n }\n }\n }\n\n Console.WriteLine(isExists ? \"YES\" : \"NO\");\n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "feee9ed3948a40a9e6571424e3806df1", "src_uid": "cad8283914da16bc41680857bd20fe9f", "apr_id": "c8e0d61ba81b189c26dd770d984435f8", "difficulty": 900, "tags": ["strings", "brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "C#"} {"similarity_score": 0.8788536691272254, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "using System;\nusing System.Collections;\nusing System.Collections.Generic;\nusing System.Collections.Specialized;\nusing System.Text;\nusing System.Text.RegularExpressions;\nusing System.IO;\n\npublic class MonstersValley2\n{\n \n public static void Main()\n {\n string str = Console.ReadLine();\n string[] values = str.Split(' ');\n long x = long.Parse(values[0]);\n long y = long.Parse(values[1]);\n long m = long.Parse(values[2]);\n\n long ans = 0,a,b;\n if (Math.Max(x, y) >= m)\n { Console.WriteLine(0); }\n\n else if ((x + y) <= Math.Min(x, y))\n { Console.WriteLine(-1); }\n else\n {\n while ((Math.Max(x, y) < m))\n {\n a = x;\n b = y;\n b = x >= y ? x + y : y;\n a = x >= y ? x : x + y;\n ans++;\n x = a;\n y = b;\n }\n Console.WriteLine(ans);\n }\n\n Console.ReadLine();\n\n }\n}", "lang": "Mono C#", "bug_code_uid": "02c8dd34202de878cdd862dcb3503a90", "src_uid": "82026a3c3d9a6bda2e2ac6e14979d821", "apr_id": "3a91d21dc1dcea10d44db8d2d96ced33", "difficulty": 1600, "tags": ["math", "greedy"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.8352713178294574, "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.Text;\n\nnamespace CodeForces\n{\n class R188_Div2_C\n {\n static void Main(string[] args)\n {\n string[] s = Console.ReadLine().Split();\n long x = long.Parse(s[0]);\n long y = long.Parse(s[1]);\n long m = long.Parse(s[2]);\n\n long x2 = x;\n long y2 = y;\n long cnt = 0, sum;\n while (x2 < m && y2 < m && (x2+y2 >0 || (x2+y2 > Math.Min(x2,y2))))\n {\n sum = x2 + y2;\n if (x2 < y2) \n x2 = sum;\n else\n y2 = sum;\n cnt++;\n }\n if (x2 < m && y2 < m)\n Console.WriteLine(-1);\n else\n Console.WriteLine(cnt);\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "1c4c2c555973614cda3e7b52a8aee197", "src_uid": "82026a3c3d9a6bda2e2ac6e14979d821", "apr_id": "586d814756c7b1009543689cb87aa46c", "difficulty": 1600, "tags": ["math", "greedy"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.9873737373737373, "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.Text;\nusing System.Threading.Tasks;\n\nnamespace burglar_and_matches\n{\n class Program\n {\n static void Main(string[] args)\n {\n string nm = Console.ReadLine();\n int n = int.Parse(nm.Substring(0, nm.IndexOf(' ')));\n int m =int.Parse(nm.Substring(nm.IndexOf(' ')+1));\n int[] arr = new int[m];\n int[] arr1 = new int[m];\n for(int i =0;ia = arr1.ToList();\n a.Sort();\n a.Reverse();\n int[] x = a.ToArray();\n int sum =0;\n int remaining = n;\n int var = 0;\n for(int j =0;j();\n\n while (m-->0)\n {\n input = Console.ReadLine().Split(new[] { ' ' }, StringSplitOptions.RemoveEmptyEntries);\n\n bs.Add(new b{ count = int.Parse(input[0]), val = int.Parse(input[1])});\n }\n\n var res = 0;\n\n bs = bs.OrderByDescending(b => b.val).ToList();\n\n var curB = 0;\n\n for (int i = 0; i < n; i++)\n {\n while (curB < bs.Count)\n {\n if (bs[curB].count >= 1)\n {\n res += bs[curB].val;\n bs[curB].count--;\n break;\n }\n\n curB++;\n }\n\n if (curB > bs.Count) break;\n }\n\n Console.WriteLine(res);\n }\n\n class b\n {\n public int count { get; set; }\n public int val { get; set; }\n }\n}", "lang": "MS C#", "bug_code_uid": "f8d3387b1348529aa2177819efd14bc1", "src_uid": "c052d85e402691b05e494b5283d62679", "apr_id": "acf9698145830057a55cebb132ab4bd1", "difficulty": 900, "tags": ["greedy", "sortings", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9997258771929824, "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.Text;\n\nclass Program\n{\n static int ResultCount = 0;\n static char[,] map;\n static int n;\n static int m;\n static void Main(string[] args)\n {\n string firstLine = Console.ReadLine();\n n = Convert.ToInt32(firstLine.Split(' ')[0]);\n m = Convert.ToInt32(firstLine.Split(' ')[1]);\n\n map = new char[n, m];\n for (int index = 0; index < n; index++)\n {\n string line = Console.ReadLine();\n for (int j = 0; j < m; j++)\n {\n map[index, j] = line[j];\n }\n }\n\n while (GetOne()) ;\n while (GetTwo()) ;\n Console.WriteLine(ResultCount);\n }\n\n static bool GetTwo()\n {\n int lastResultCount = ResultCount;\n for (int i = 0; i < n; i++)\n {\n for (int j = 0; j < m; j++)\n {\n char ch = map[i, j];\n if (ch == '.') { continue; }\n\n int count = 0;\n int i2 = i;\n int j2 = j;\n if (i != n - 1 && map[i + 1, j] != '.' && map[i + 1, j] != map[i, j])\n {\n count++;\n i2 = i + 1;\n j2 = j;\n }\n if (i != 0 && map[i - 1, j] != '.' && map[i - 1, j] != map[i, j])\n {\n count++;\n i2 = i - 1;\n j2 = j;\n }\n if (j != n - 1 && map[i, j + 1] != '.' && map[i, j + 1] != map[i, j])\n {\n count++;\n i2 = i;\n j2 = j + 1;\n }\n if (j != 0 && map[i, j - 1] != '.' && map[i, j - 1] != map[i, j])\n {\n count++;\n i2 = i;\n j2 = j - 1;\n }\n\n if (count == 2)\n {\n ResultCount++;\n map[i, j] = '.';\n map[i, j + 1] = '.';\n while (GetOne()) ;\n }\n }\n }\n return lastResultCount != ResultCount;\n }\n\n static bool GetOne()\n {\n int lastResultCount = ResultCount;\n for (int i = 0; i < n; i++)\n {\n for (int j = 0; j < m; j++)\n {\n char ch = map[i, j];\n if (ch == '.') { continue; }\n\n int count = 0;\n int i2 = i;\n int j2 = j;\n if (i != n - 1 && map[i + 1, j] != '.' && map[i + 1, j] != map[i, j])\n {\n count++;\n i2 = i + 1;\n j2 = j;\n }\n if (i != 0 && map[i - 1, j] != '.' && map[i - 1, j] != map[i, j])\n {\n count++;\n i2 = i - 1;\n j2 = j;\n }\n if (j != m - 1 && map[i, j + 1] != '.' && map[i, j + 1] != map[i, j])\n {\n count++;\n i2 = i;\n j2 = j + 1;\n }\n if (j != 0 && map[i, j - 1] != '.' && map[i, j - 1] != map[i, j])\n {\n count++;\n i2 = i;\n j2 = j - 1;\n }\n\n if (count == 1)\n {\n ResultCount++;\n map[i, j] = '.';\n map[i2, j2] = '.';\n }\n }\n }\n return lastResultCount != ResultCount;\n }\n}\n\n", "lang": "Mono C#", "bug_code_uid": "2c8b5feb4e8f811e4885882b704bcad1", "src_uid": "969b24ed98d916184821b2b2f8fd3aac", "apr_id": "350a35d7378e5b051d679b9b9b2f7b79", "difficulty": 1100, "tags": ["greedy", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9961559582646897, "equal_cnt": 9, "replace_cnt": 2, "delete_cnt": 2, "insert_cnt": 4, "fix_ops_cnt": 8, "bug_source_code": "\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\n\nclass GFG\n{\n\n\n public static void Main()\n {\n var input = Console.ReadLine().Split(' ');\n var n = int.Parse(input[0]);\n var m = int.Parse(input[1]);\n char[,] arr = new char[n, m];\n for (int i = 0; i < n; i++)\n {\n var chars = Console.ReadLine().ToCharArray();\n for (int j = 0; j < m; j++)\n {\n arr[i, j] = chars[j];\n }\n }\n bool[,] check = new bool[n, m];\n int count = 0;\n for (int i = 0; i < n; i++)\n {\n\n for (int j = 0; j < m; j++)\n {\n if (arr[i, j] == 'W')\n {\n if (i-1 >= 0 && check[i - 1, j] == false && arr[i - 1, j] == 'P')\n {\n check[i - 1, j] = true;\n count++;\n continue;\n }\n if (j -1>= 0 && check[i, j - 1] == false && arr[i, j - 1] == 'P')\n {\n check[i, j - 1] = true;\n count++;\n continue;\n }\n if (i+1 <= n && check[i + 1, j] == false && arr[i + 1, j] == 'P')\n {\n check[i + 1, j] = true;\n count++;\n continue;\n }\n if (j+1 <= m && check[i, j + 1] == false && arr[i, j + 1] == 'P')\n {\n check[i, j + 1] = true;\n count++;\n continue;\n }\n\n }\n }\n }\n\n Console.Write(count);\n }\n}\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n", "lang": "Mono C#", "bug_code_uid": "e8f77d0cb9f2f76672a49f82d456406a", "src_uid": "969b24ed98d916184821b2b2f8fd3aac", "apr_id": "b6d058bbcf5d5e36959735b220d98c71", "difficulty": 1100, "tags": ["greedy", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.9291907514450867, "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;\n\nnamespace ConsoleApplication1\n{\n class Program\n {\n static void Main(string[] args)\n {\n int n = int.Parse(Console.ReadLine());\n string[] y = Console.ReadLine().Split(' ');\n int[] a = new int[7];\n for (int i = 0; i < a.Length; i++)\n {\n a[i] = int.Parse(y[i]);\n }\n int nn = 0;\n while (n > 0)\n {\n n -= a[nn];\n nn++;\n if (nn == 8)\n nn = 0;\n }\n Console.Write(nn);\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "527e57450884be843821bdd73ab9aaa2", "src_uid": "007a779d966e2e9219789d6d9da7002c", "apr_id": "d27662b10ab292324794a307a774062e", "difficulty": 1000, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C#"} {"similarity_score": 0.999530736743313, "equal_cnt": 3, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "using System;\nusing System.Text;\nusing System.Collections;\nusing System.Collections.Generic;\nusing System.IO;\n\n\nclass Program\n{\n class Point: IComparable\n {\n public int x, y;\n public Point(int x, int y)\n {\n this.x = x;\n this.y = y;\n }\n public int CompareTo(Point other)\n {\n if (other.x != x)\n return x - other.x;\n else\n return y - other.y;\n }\n public override bool Equals(object obj)\n {\n Point other = (Point)obj;\n return other.x == x && other.y == y;\n }\n }\n class Seg\n {\n public Point a, b;\n public Seg(Point a, Point b)\n {\n this.a = a;\n this.b = b;\n }\n public void revert()\n {\n Point temp = a;\n a = b;\n b = temp;\n }\n }\n void solve()\n {\n Seg[] seg = new Seg[4];\n for (int i = 0; i < 4; i++)\n {\n seg[i] = new Seg(new Point(nextInt(), nextInt()), new Point(nextInt(), nextInt()));\n }\n List vertical = new List();\n List horizontal = new List();\n foreach (Seg s in seg)\n {\n if (s.a.x == s.b.x)\n {\n vertical.Add(s);\n }\n else if (s.a.y == s.b.y)\n {\n horizontal.Add(s);\n }\n else\n {\n Console.WriteLine(\"NO\");\n return;\n }\n }\n if (vertical.Count < 2 || horizontal.Count < 2)\n {\n Console.WriteLine(\"NO\");\n return;\n }\n foreach (Seg s in vertical)\n {\n if (s.a.y > s.b.y)\n s.revert();\n }\n foreach (Seg s in horizontal)\n {\n if (s.a.x < s.b.y)\n s.revert();\n }\n int height1 = vertical[0].b.y - vertical[0].a.y;\n int height2 = vertical[1].b.y - vertical[1].a.y;\n int width1 = horizontal[0].b.x - horizontal[0].a.x;\n int width2 = horizontal[1].b.x - horizontal[1].a.x;\n if (height1 != height2 || width1 != width2 || height1==0 || width1==0)\n {\n Console.WriteLine(\"NO\");\n return;\n }\n if (vertical[0].a.x > vertical[1].a.x)\n {\n Seg temp = vertical[0];\n vertical[0] = vertical[1];\n vertical[1] = temp;\n }\n if (horizontal[0].a.y > horizontal[1].a.y)\n {\n Seg temp = horizontal[0];\n horizontal[0] = horizontal[1];\n horizontal[1] = temp;\n }\n if (!vertical[0].a.Equals(horizontal[0].a))\n {\n Console.WriteLine(\"NO\");\n return;\n }\n if (!vertical[0].b.Equals(horizontal[1].a))\n {\n Console.WriteLine(\"NO\");\n return;\n }\n if (!vertical[1].a.Equals(horizontal[0].b))\n {\n Console.WriteLine(\"NO\");\n return;\n }\n if (!vertical[1].b.Equals(horizontal[1].b))\n {\n Console.WriteLine(\"NO\");\n return;\n }\n Console.WriteLine(\"YES\");\n \n \n\n }\n\n\n\n //\n\n\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();\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", "lang": "Mono C#", "bug_code_uid": "66072ff26fa374edb5941396bbdd2748", "src_uid": "ad105c08f63e9761fe90f69630628027", "apr_id": "654f1588c37226f80167cca4ea81da7e", "difficulty": 1700, "tags": ["geometry", "math", "implementation", "brute force", "constructive algorithms"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9776071657069738, "equal_cnt": 8, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 5, "fix_ops_cnt": 7, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Text;\n\nnamespace codeforces\n{\n class C\n {\n static CodeforcesUtils CF = new CodeforcesUtils(\n@\"\n0 0 0 1\n0 1 0 2\n0 2 0 3\n0 3 0 0\n\");\n\n static void Main(string[] args)\n {\n bool b = true;\n Dictionary c = new Dictionary();\n List xs = new List();\n List ys = new List();\n for (int i = 0;i<4;i++)\n {\n string[] ss = CF.ReadLine().Split(' ');\n int x1 = int.Parse(ss[0]);\n int y1 = int.Parse(ss[1]);\n int x2 = int.Parse(ss[2]);\n int y2 = int.Parse(ss[3]);\n\n if (!_l(x1, y1, x2, y2))\n {\n b = false;\n break;\n }\n\n string p1 = x1 +\",\"+ y1;\n if (!c.ContainsKey(p1))\n c.Add(p1, 0);\n c[p1]++;\n\n string p2 = x2 + \",\" + y2;\n if (!c.ContainsKey(p2))\n c.Add(p2, 0);\n c[p2]++;\n\n if( !xs.Contains(x1) )\n xs.Add(x1);\n if (!xs.Contains(x2))\n xs.Add(x2);\n if (!ys.Contains(y1))\n ys.Add(y1);\n if (!ys.Contains(y2))\n ys.Add(y2);\n }\n\n if (b)\n {\n if (xs.Count != 2 || ys.Count != 2)\n b = false;\n else if (c.Count != 4)\n b = false;\n else\n {\n foreach (int v in c.Values)\n {\n if (v != 2)\n {\n b=false;\n break;\n }\n }\n }\n }\n\n if (b)\n CF.WriteLine(\"YES\");\n else\n CF.WriteLine(\"NO\");\n\n\n }\n\n static bool _l(int x1,int y1,int x2,int y2)\n {\n if( x1!=x2&&y1!=y2)\n return false;\n if (x1 == x2 && y1 == y2)\n return false;\n return true;\n }\n\n #region test\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#else\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 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 Console.Write(o);\n#endif\n }\n\n public CodeforcesUtils(string test_input)\n {\n _test_input = test_input;\n }\n\n string _test_input;\n\n List _lines;\n }\n\n #endregion\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "559a0afa038df8cbc48a864fb36ebec3", "src_uid": "ad105c08f63e9761fe90f69630628027", "apr_id": "d59d23309e2d8d97c823fcca17cae677", "difficulty": 1700, "tags": ["geometry", "math", "implementation", "brute force", "constructive algorithms"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.9977903265406335, "equal_cnt": 3, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "using System;\nusing System.Collections;\nusing System.Collections.Generic;\nusing System.Collections.Specialized;\nusing System.Numerics;\nusing System.Text;\nusing System.Text.RegularExpressions;\nusing System.Linq;\nusing System.IO;\npublic class CodeForces\n{\n#if TEST\n // To set this go to Project -> Properties -> Build -> General -> Conditional compilation symbols: -> enter 'TEST' into text box.\n const bool testing = true;\n#else\nconst bool testing = false;\n#endif\n\n static void program(TextReader input)\n {\n // var n = int.Parse(input.ReadLine());\n var data = input.ReadLine().Split(' ').Select(int.Parse).ToList();\n var l = data[0];\n var r = data[1];\n var a = data[2];\n var i = 200;\n for (; i > 0; i-=2)\n {\n var left = i / 2;\n var right = left;\n left -= l;\n right -= r;\n var need = 0;\n need = Math.Max(0, left) + Math.Max(0, right);\n if(need <= a)\n {\n break;\n }\n }\n\n Console.WriteLine(i);\n }\n\n public static void Main(string[] args)\n {\n if (!testing)\n { // set testing to false when submiting to codeforces\n program(Console.In); // write your program in 'program' function (its your new main !)\n return;\n }\n\n Console.WriteLine(\"Test Case(1) => expected :\");\n Console.WriteLine(\"6\\n\");\n Console.WriteLine(\"Test Case(1) => found :\");\n program(new StringReader(\"1 4 2\\n\"));\n Console.WriteLine();\n\n Console.WriteLine(\"Test Case(2) => expected :\");\n Console.WriteLine(\"14\\n\");\n Console.WriteLine(\"Test Case(2) => found :\");\n program(new StringReader(\"5 5 5\\n\"));\n Console.WriteLine();\n\n Console.WriteLine(\"Test Case(3) => expected :\");\n Console.WriteLine(\"0\\n\");\n Console.WriteLine(\"Test Case(3) => found :\");\n program(new StringReader(\"0 2 0\\n\"));\n Console.WriteLine();\n\n }\n}\n", "lang": "MS C#", "bug_code_uid": "a8a83fd68d2c6f170cf9cc610572daf0", "src_uid": "e8148140e61baffd0878376ac5f3857c", "apr_id": "2f23a932b37e3b6e1eab61ee044cc6fd", "difficulty": 800, "tags": ["math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.8340034462952326, "equal_cnt": 8, "replace_cnt": 3, "delete_cnt": 2, "insert_cnt": 2, "fix_ops_cnt": 7, "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 int Main(string[] args)\n {\n int K, L, i;\n //Read line, and split it by whitespace into an array of strings\n string[] tokens = Console.ReadLine().Split();\n\n //Parse element 0\n K = int.Parse(tokens[0]);\n\n //Parse element 1\n L = int.Parse(tokens[1]);\n\n for (i = 1; Math.Pow((double)K , (double)i) <= (double)L; i++)\n {\n double a = Math.Pow((double)K , (double)i);\n double b = (double)L;\n if (a == b)\n {\n Console.WriteLine(\"YES\\n{0}\\n\", i - 1);\n return 0;\n }\n }\n Console.WriteLine(\"NO\\n\");\n return 0;\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "3f45dc8a3a96e38fd7506ea8ba2aecbf", "src_uid": "8ce89b754aa4080e7c3b2c3b10f4be46", "apr_id": "97c545bd21646ba5ca79a3a4d05953f1", "difficulty": 1000, "tags": ["math"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.5991189427312775, "equal_cnt": 7, "replace_cnt": 3, "delete_cnt": 2, "insert_cnt": 2, "fix_ops_cnt": 7, "bug_source_code": "using System;\nusing System.Collections.Generic;\n\nclass Program\n {\n static void Main()\n {\n\n string[] arr = Console.ReadLine().Split();\n\n List bets_list = arr.Select(int.Parse).ToList();\n int intial_bet_sum = 0;\n for(int i=0; i < bets_list.Count; i++)\n {\n intial_bet_sum += bets_list[i];\n }\n //decimal bet = intial_bet_sum / bets_list.Count;\n //double b = intial_bet_sum / bets_list.Count;\n\n if ((intial_bet_sum % bets_list.Count) == 0)\n {\n Console.WriteLine(intial_bet_sum / bets_list.Count);\n }\n else\n {\n Console.WriteLine(-1);\n }\n \n }\n \n }", "lang": "Mono C#", "bug_code_uid": "d55bca5a864eb64d115c16705df8f197", "src_uid": "af1ec6a6fc1f2360506fc8a34e3dcd20", "apr_id": "c50d23896bd052431cb073d56f073e6f", "difficulty": 1100, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9669979373710857, "equal_cnt": 8, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 4, "fix_ops_cnt": 7, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Globalization;\nusing System.IO;\nusing System.Linq;\nusing System.Text;\nusing System.Threading;\n\n// (づ°ω°)づミe★゜・。。・゜゜・。。・゜☆゜・。。・゜゜・。。・゜\npublic class Solver\n{\n long Fun(long a, long b, long x)\n {\n if (b > x)\n return 0;\n return (x - b) / a + 1;\n }\n\n long Fun(long a, long b, long l, long r)\n {\n return Fun(a, b, r) - Fun(a, b, l - 1);\n }\n\n long Gcd(long a, long b, out long x, out long y) \n {\n if (a == 0)\n {\n x = 0;\n y = 1;\n return b;\n }\n\t long x1, y1;\n\t long d = Gcd(b % a, a, out x1, out y1);\n\t x = y1 - (b / a) * x1;\n\t y = x1;\n\t return d;\n }\n \n bool Dio(long a, long b, long c, out long x0, out long y0, out long g) \n {\n\t g = Gcd(Math.Abs(a), Math.Abs(b), out x0, out y0);\n\t if (c % g != 0)\n\t\t return false;\n\t x0 *= c / g;\n\t y0 *= c / g;\n\t if (a < 0)\n x0 *= -1;\n\t if (b < 0) \n y0 *= -1;\n\t return true;\n }\n\n public void Solve()\n {\n long a1 = ReadInt();\n long b1 = ReadInt();\n long a2 = ReadInt();\n long b2 = ReadInt();\n long l = ReadInt();\n long r = ReadInt();\n\n if (a1 == a2)\n {\n if (Math.Abs(b1 - b2) % a1 != 0)\n Write(0);\n else\n Write(Fun(a1, Math.Max(b1, b2), l, r));\n return;\n }\n\n long x0, y0, g;\n if (!Dio(a1, -a2, b2 - b1, out x0, out y0, out g))\n {\n Write(0);\n return;\n }\n \n long d = a2 / g;\n if (x0 < 0)\n x0 += ((-x0 - 1) / d + 1) * d;\n x0 %= d;\n Write(Fun(d * a1, a1 * x0 + b1, l, r));\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 new Solver().Solve();\n //var thread = new Thread(new Solver().Solve, 1024 * 1024 * 128);\n //thread.Start();\n //thread.Join();\n }\n catch (Exception ex)\n {\n#if DEBUG\n Console.WriteLine(ex);\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": "66c170040b4351ce24047bd3259f1380", "src_uid": "b08ee0cd6f5cb574086fa02f07d457a4", "apr_id": "d452a5a5ee2d5c88c5209eda721b37c5", "difficulty": 2500, "tags": ["math", "number theory"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.854493793928518, "equal_cnt": 11, "replace_cnt": 2, "delete_cnt": 2, "insert_cnt": 6, "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 Martian_Clock\n{\n class Program\n {\n static int GetDecimal(string s, int b, Dictionary chars)\n {\n double res = 0;\n int cc = s.Length - 1;\n for (int i =0 ; i chars = new Dictionary();\n string s = \"ABCDEFGHIJKLMNOPQRSTUVWXYZ\";\n int u = 10;\n for (int i = 0; i < s.Length; i++)\n {\n chars.Add(s[i], u); u++;\n }\n\n s = \"0123456789\";\n u = 0;\n for (int i = 0; i < s.Length; i++)\n {\n chars.Add(s[i], u); u++;\n }\n\n\n //while (true)\n //{\n // Console.WriteLine(GetDecimal(Console.ReadLine(), 16, chars));\n //}\n\n s = Console.ReadLine();\n string []arr = s.Split(':');\n string hours = \"\";\n string minutes = \"\";\n int hmax = 0;\n int mmax = 0;\n bool x = true;\n for (int i = 0; i < arr[0].Length; i++)\n {\n if (arr[0][i] != '0' || !x)\n {\n hours += arr[0][i]; x = false;\n int tem = chars[arr[0][i]];\n if (tem>hmax)\n {\n hmax = tem;\n }\n }\n \n \n\n }\n x = true;\n for (int i = 0; i < arr[1].Length; i++)\n {\n if (arr[1][i] != '0'||!x)\n {\n minutes += arr[1][i]; x = false;\n int tem = chars[arr[1][i]];\n if (tem > mmax)\n {\n mmax = tem;\n }\n }\n \n \n }\n if (hours.Length==1&& minutes.Length==1)\n {\n Console.WriteLine(-1); return;\n }\n\n int basesC = 0;\n List bases = new List();\n \n hmax++;\n mmax++;\n int initbase = Math.Max(hmax, mmax);\n while (GetDecimal(hours, initbase, chars) < 24 && GetDecimal(minutes, initbase, chars) < 60)\n {\n bases.Add(initbase); initbase++;\n basesC++;\n }\n\n if (basesC == 0)\n {\n Console.WriteLine(0); return;\n }\n\n int max = bases.Max();\n foreach (int item in bases)\n {\n if (item !=max)\n {\n Console.Write(item + \" \");\n }\n }\n Console.WriteLine(max);\n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "cc14927a8b26ebeca9647144a9d8830e", "src_uid": "c02dfe5b8d9da2818a99c3afbe7a5293", "apr_id": "e3ab7f89702d07325ef4f07573516b84", "difficulty": 1600, "tags": ["implementation"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.8745279060008393, "equal_cnt": 13, "replace_cnt": 7, "delete_cnt": 4, "insert_cnt": 2, "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 Martian_Clock\n{\n class Program\n {\n static int GetDecimal(string s, int b, Dictionary chars)\n {\n double res = 0;\n int cc = s.Length - 1;\n for (int i =0 ; i 0)\n {\n vv = vv / b; res += 1; \n }\n\n return (int)res;\n }\n static void Main(string[] args)\n {\n Dictionary chars = new Dictionary();\n string s = \"ABCDEFGHIJKLMNOPQRSTUVWXYZ\";\n int u = 10;\n for (int i = 0; i < s.Length; i++)\n {\n chars.Add(s[i], u); u++;\n }\n\n s = \"0123456789\";\n u = 0;\n for (int i = 0; i < s.Length; i++)\n {\n chars.Add(s[i], u); u++;\n }\n\n\n //while (true)\n //{\n // Console.WriteLine(GetDecimal(Console.ReadLine(), 16, chars));\n //}\n\n s = Console.ReadLine();\n string []arr = s.Split(':');\n string hours = \"\";\n string minutes = \"\";\n int hmax = 0;\n int mmax = 0;\n bool x = true;\n for (int i = 0; i < arr[0].Length; i++)\n {\n if (arr[0][i] != '0' || !x)\n {\n hours += arr[0][i]; x = false;\n int tem = chars[arr[0][i]];\n if (tem>hmax)\n {\n hmax = tem;\n }\n }\n \n \n\n }\n x = true;\n for (int i = 0; i < arr[1].Length; i++)\n {\n if (arr[1][i] != '0'||!x)\n {\n minutes += arr[1][i]; x = false;\n int tem = chars[arr[1][i]];\n if (tem > mmax)\n {\n mmax = tem;\n }\n }\n \n \n }\n\n hmax++;\n mmax++;\n int initbase = Math.Max(hmax, mmax);\n \n \n \n\n int basesC = 0;\n List bases = new List();\n \n \n \n while (GetDecimal(hours, initbase, chars) < 24 && GetDecimal(minutes, initbase, chars) < 60)\n {\n\n \n\n bases.Add(initbase); initbase++;\n basesC++;\n }\n if (GetDigits(initbase, 59) > arr[1].Length)\n {\n Console.WriteLine(0); return;\n }\n if (hours.Length <= 1 && minutes.Length <= 1)\n {\n\n Console.WriteLine(-1); return;\n }\n if (basesC == 0)\n {\n Console.WriteLine(0); return;\n }\n\n int max = bases.Max();\n foreach (int item in bases)\n {\n if (item !=max)\n {\n Console.Write(item + \" \");\n }\n }\n Console.WriteLine(max);\n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "083b964af6b1d6c0a62dd4489e0f60ed", "src_uid": "c02dfe5b8d9da2818a99c3afbe7a5293", "apr_id": "e3ab7f89702d07325ef4f07573516b84", "difficulty": 1600, "tags": ["implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.31992687385740404, "equal_cnt": 14, "replace_cnt": 8, "delete_cnt": 0, "insert_cnt": 6, "fix_ops_cnt": 14, "bug_source_code": "using System;\nusing System.Collections;\nusing System.Collections.Generic;\nusing System.Text;\nusing System.Linq;\n\npublic class C\n{\n public static void Main()\n {\n var nms = Console.ReadLine().Split(' ').Select(str=>long.Parse(str)).ToArray();\n long n = nms[0], m = nms[1], s = nms[2];\n Console.WriteLine(Math.Min(m, s)*Math.Min(n, s));\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "c2768818731f39bb32291f4c7977e449", "src_uid": "e853733fb2ed87c56623ff9a5ac09c36", "apr_id": "c569bd6aeb723841659729dd6eaa0028", "difficulty": 1700, "tags": ["math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9978453435480009, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Text;\n\nnamespace CodeForcesApp\n{\n class C\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\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.C);\n //tester.Test();\n\n Task task = new Task();\n task.Solve();\n }\n\n public class Task\n {\n \n public void Solve()\n {\n int n, m, s;\n RInts3(out n, out m, out s);\n\n int nmax = 1 + (n - 1) / s;\n int mmax = 1 + (m - 1) / s;\n\n int n1 = 0;\n int m1 = 0;\n\n for (int i = 0; i < n; i++)\n if (1 + i / s + (n - i - 1) / s == nmax)\n n1++;\n\n for (int i = 0; i < m; i++)\n if (1 + i / s + (m - i - 1) / s == mmax)\n m1++;\n\n Console.WriteLine(n1 * m1);\n }\n \n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "0770a29c463ff0e7c24e44a224e08a6e", "src_uid": "e853733fb2ed87c56623ff9a5ac09c36", "apr_id": "e0d4c2a3b7bde1af3da49175b58a5198", "difficulty": 1700, "tags": ["math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9920377469772929, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 0, "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 run\n{\n class Program\n {\n private static int Swap(ref int a, ref int b)\n {\n if (a < b)\n {\n int tmp = a;\n a = b;\n b = tmp;\n }\n\n return 0;\n }\n\n private static int gcd(int a, int b)\n {\n Swap(ref a, ref b);\n\n while (a % b != 0)\n {\n a %= b;\n Swap(ref a, ref b);\n }\n\n return b;\n\n }\n\n private static void Main(string[] args)\n {\n \n var nstr = Console.ReadLine().Split(' ').Select(Int32.Parse).ToList();\n int a = nstr[0], b = nstr[1], c = nstr[2], d = nstr[3];\n\n\n if (c < d)\n {\n Swap(ref c, ref d);\n int tmp = a;\n a = b;\n b = tmp;\n }\n \n int lcm = a * c / gcd(a, c);\n\n b = b * (lcm / a);\n //a = lca;\n d = d * (lcm / c);\n //c = lca;\n\n int p = Math.Max(b, d);\n int q = Math.Abs(b - d);\n\n if (q == 0) while (true) q = 0;\n\n //Swap(ref p, ref q);\n\n for (int i = 2; i <= q; ++i)\n {\n if (p % i == 0 && q % i == 0)\n {\n p /= i;\n q /= i;\n i--;\n }\n }\n\n Console.WriteLine(\"{0}/{1}\", q, p);\n \n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "455ed3d68d9a5e5c71a37dedeb3adcbe", "src_uid": "b0f435fc2f7334aee0d07524bc37cb1e", "apr_id": "0ece494f3abd09cd53c92442290a7ad6", "difficulty": 1400, "tags": ["greedy", "math", "number theory"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9967614249730119, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 0, "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 ConsoleApplication1\n{\n class Program\n {\n static int[] ReadInt(int size)\n {\n string[] input = Console.ReadLine().Split(' ');\n int[] res = new int[size]; \n for (int i=0; i b ? a : b);\n } \n\n static void Main(string[] args)\n {\n String input = ReadString();\n bool[] a = new bool[100];\n int res = 0;\n foreach (Char ch in input)\n {\n if (!a[ch])\n {\n res++;\n a[ch] = true;\n }\n }\n if (res%2==0)\n {\n Console.WriteLine(\"CHAT WITH HER!\");\n }\n else\n {\n Console.WriteLine(\"IGNORE HIM!\");\n }\n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "22f06acf1ecc77c3ed2ad788fa40fd89", "src_uid": "a8c14667b94b40da087501fd4bdd7818", "apr_id": "9e79e0b5fd06a70b01219edf2978032b", "difficulty": 800, "tags": ["strings", "brute force", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.896625033218177, "equal_cnt": 13, "replace_cnt": 5, "delete_cnt": 3, "insert_cnt": 4, "fix_ops_cnt": 12, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\n\nnamespace ProgrammingContest.Codeforces.Round62\n{\n class C\n {\n static int n;\n static int[] fuel;\n static List[] xs;\n static int f,c;\n\n static void chk(int cost)\n {\n if (fuel[n - 1] < 0) return;\n if (f == fuel[n - 1] && c < cost) { c = cost; }\n if (f == -1 || f > fuel[n - 1]) { f = fuel[n - 1]; c = cost; }\n }\n\n static void dfs(int i, int j, int cost)\n {\n if (i >= n - 1) { chk(cost); return; }\n if (j >= xs[i].Count) { if(fuel[i] == 0) dfs(i + 1, 0, cost); return; }\n int dst = xs[i][j][1];\n for (int k = 0; k <= 5; k++)\n if (k <= fuel[i] && xs[i][j][2] <= k && k <= xs[i][j][3])\n {\n fuel[i] -= k;\n fuel[dst] += k;\n\n int nc = k == 0 ? cost : (cost + k * k + xs[i][j][4]);\n dfs(i, j + 1, nc);\n\n fuel[dst] -= k;\n fuel[i] += k;\n }\n }\n\n public static void Main()\n {\n n = int.Parse(Console.ReadLine());\n xs = new List[n];\n fuel = new int[n];\n for (int i = 0; i < n; i++)\n xs[i] = new List();\n for (int i = 0; i < n * (n - 1) / 2; i++)\n {\n var ys = Array.ConvertAll(Console.ReadLine().Split(' '), sss => int.Parse(sss));\n ys[0]--; ys[1]--;\n xs[ys[0]].Add(ys);\n }\n f = -1; c = -1;\n for (int i = 0; i <= 5; i++)\n {\n fuel[0] = i;\n dfs(0, 0, 0);\n }\n Console.WriteLine(\"{0} {1}\", f, c);\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "cad1d9e3b7c36eb4de21aa619b9beccd", "src_uid": "38886ad7b0d83e66b77348be34828426", "apr_id": "0e461442a0e68e62f7d7a9b5a46c3cce", "difficulty": 2200, "tags": ["brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.8764752163650669, "equal_cnt": 10, "replace_cnt": 3, "delete_cnt": 5, "insert_cnt": 1, "fix_ops_cnt": 9, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\n\nnamespace ProgrammingContest.Codeforces.Round62\n{\n class C\n {\n static int n;\n static int[] fuel;\n static List[] xs;\n static int f,c;\n\n static void chk(int cost)\n {\n if (fuel[n - 1] < 0) return;\n if (f == fuel[n - 1] && c < cost) { c = cost; }\n if (f == -1 || f > fuel[n - 1]) { f = fuel[n - 1]; c = cost; }\n }\n\n static void dfs(int i, int j, int cost)\n {\n if (i >= n - 1) { chk(cost); return; }\n if (j >= xs[i].Count)\n {\n if (i == 0 || fuel[i] == 0)\n dfs(i + 1, 0, cost);\n return;\n }\n\n int dst = xs[i][j][1];\n for (int k = 0; k <= 5; k++)\n if (i == 0 || k <= fuel[i])\n if (xs[i][j][2] <= k && k <= xs[i][j][3])\n {\n fuel[i] -= k;\n fuel[dst] += k;\n\n int nc = k == 0 ? cost : (cost + k * k + xs[i][j][4]);\n dfs(i, j + 1, nc);\n\n fuel[dst] -= k;\n fuel[i] += k;\n }\n }\n\n public static void Main()\n {\n n = int.Parse(Console.ReadLine());\n xs = new List[n];\n fuel = new int[n];\n for (int i = 0; i < n; i++)\n xs[i] = new List();\n for (int i = 0; i < n * (n - 1) / 2; i++)\n {\n var ys = Array.ConvertAll(Console.ReadLine().Split(' '), sss => int.Parse(sss));\n ys[0]--; ys[1]--;\n xs[ys[0]].Add(ys);\n }\n f = -1; c = -1;\n dfs(0, 0, 0);\n Console.WriteLine(\"{0} {1}\", f, c);\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "6222740a748e8d0bf25bc68a492ceab4", "src_uid": "38886ad7b0d83e66b77348be34828426", "apr_id": "0e461442a0e68e62f7d7a9b5a46c3cce", "difficulty": 2200, "tags": ["brute force"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "delete", "lang_cluster": "C#"} {"similarity_score": 0.8297575926441906, "equal_cnt": 28, "replace_cnt": 22, "delete_cnt": 0, "insert_cnt": 5, "fix_ops_cnt": 27, "bug_source_code": "using System;\n\nnamespace ConsoleApplication4\n{\n class Program\n {\n struct Matrix\n {\n public long A1, A2, A3, A4;\n\n public static Matrix Mul(Matrix m1, Matrix m2)\n {\n Matrix result = new Matrix();\n result.A1 = m1.A1 * m2.A1 + m1.A2 * m2.A3;\n result.A2 = m1.A1 * m2.A2 + m1.A2 * m2.A4;\n result.A3 = m1.A3 * m2.A1 + m1.A4 * m2.A3;\n result.A4 = m1.A3 * m2.A2 + m1.A4 * m2.A4;\n return result;\n }\n\n public void Mod(long mod)\n {\n A1 %= mod; A2 %= mod; A3 %= mod; A4 %= mod;\n }\n\n public static Matrix PowerMod(int power, Matrix m, long mod)\n {\n Matrix modLast = m, result = new Matrix();\n\n while (power != 0)\n {\n if ((power & 1) == 1)\n {\n if (result.A1 == 0)\n result = modLast;\n else\n result = Matrix.Mul(result, modLast);\n\n result.Mod(mod);\n }\n\n modLast = Matrix.Mul(modLast, modLast);\n modLast.Mod(mod);\n power >>= 1;\n }\n\n return result;\n }\n }\n\n static void Main(string[] args)\n {\n string[] fStrings = new string[41];\n fStrings[0] = \"a\"; fStrings[1] = \"b\";\n\n for (int i = 2; i < fStrings.Length; i++)\n fStrings[i] = fStrings[i - 1] + fStrings[i - 2];\n\n string[] inputStr = Console.ReadLine().Split(' ');\n int m = Convert.ToInt32(inputStr[0]);\n int n = Convert.ToInt32(inputStr[1]);\n\n for (int i = 0; i < n; i++)\n {\n string s = Console.ReadLine();\n long count = CalCount(s, fStrings, m - 1);\n Console.WriteLine(count % 1000000007);\n }\n }\n\n static long CalCount(string s, string[] fStrings, int f)\n {\n if (f < 16)\n return ContainCount(s, fStrings[f]);\n\n Matrix m = new Matrix { A1 = 1, A2 = 1, A3 = 1, A4 = 0 };\n int[] result = new int[fStrings.Length];\n\n for (int i = 0; i < fStrings.Length; i++)\n {\n if (fStrings[i].Length > s.Length)\n result[i] = ContainCount(s, fStrings[i]);\n\n if (fStrings[i].Length > s.Length * 10)\n break;\n }\n\n int index = Array.IndexOf(result, 1);\n if (index < 0)\n return 0;\n\n if (result[index + 1] == 1)\n index++;\n\n Matrix power = Matrix.PowerMod(f - index + 1, m, 1000000007);\n\n if (result[index + 1] == 2)\n {\n if (result[index + 2] == 3)\n return power.A2;\n else\n return power.A1 - 1;\n }\n else\n return power.A1 - (f - index) % 2;\n }\n\n static int ContainCount(string p, string s)\n {\n int k = -1;\n int count = 0;\n\n while (true)\n {\n k = s.IndexOf(p, k + 1);\n if (k == -1) break;\n count++;\n }\n\n return count;\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "68e3a03efcbf45e675296d33af6020a5", "src_uid": "8983915e904ba763d893d56e94d9f7f0", "apr_id": "3e8791cfd90c992271531e0a0d16e504", "difficulty": 2600, "tags": ["matrices", "strings"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9863531955141197, "equal_cnt": 9, "replace_cnt": 8, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 8, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.IO;\n\nnamespace ConsoleApplication4\n{\n class Program\n {\n struct Matrix\n {\n public long A1, A2, A3, A4;\n\n public static Matrix Mul(Matrix m1, Matrix m2)\n {\n Matrix result = new Matrix();\n result.A1 = m1.A1 * m2.A1 + m1.A2 * m2.A3;\n result.A2 = m1.A1 * m2.A2 + m1.A2 * m2.A4;\n result.A3 = m1.A3 * m2.A1 + m1.A4 * m2.A3;\n result.A4 = m1.A3 * m2.A2 + m1.A4 * m2.A4;\n return result;\n }\n\n public void Mod(long mod)\n {\n A1 %= mod; A2 %= mod; A3 %= mod; A4 %= mod;\n }\n\n public static Matrix PowerMod(int power, Matrix m, long mod)\n {\n Matrix modLast = m, result = new Matrix();\n\n while (power != 0)\n {\n if ((power & 1) == 1)\n {\n if (result.A1 == 0)\n result = modLast;\n else\n result = Matrix.Mul(result, modLast);\n\n result.Mod(mod);\n }\n\n modLast = Matrix.Mul(modLast, modLast);\n modLast.Mod(mod);\n power >>= 1;\n }\n\n return result;\n }\n }\n\n static void Main(string[] args)\n {\n string[] fStrings = new string[31];\n fStrings[0] = \"a\"; fStrings[1] = \"b\";\n\n for (int i = 2; i < fStrings.Length; i++)\n fStrings[i] = fStrings[i - 1] + fStrings[i - 2];\n\n string[] inputStr = Console.ReadLine().Split(' ');\n int m = Convert.ToInt32(inputStr[0]);\n int n = Convert.ToInt32(inputStr[1]);\n StreamWriter sw = new StreamWriter(Console.OpenStandardOutput());\n\n for (int i = 0; i < n; i++)\n {\n string s = Console.ReadLine();\n long count = CalCount(s, fStrings, m - 1);\n sw.WriteLine(count % 1000000007);\n }\n\n sw.Flush();\n }\n\n static long CalCount(string s, string[] fStrings, int f)\n {\n if (f < 10)\n return ContainCount(s, fStrings[f]);\n\n Matrix m = new Matrix { A1 = 1, A2 = 1, A3 = 1, A4 = 0 };\n List result = new List();\n int index = 0;\n\n for (int i = 0; i < fStrings.Length; i++)\n {\n int count = ContainCount(s, fStrings[i]);\n if (count > 1)\n {\n if(index == 0)\n index = i;\n\n result.Add(count);\n }\n\n if (fStrings[i].Length > s.Length * 10)\n break;\n }\n\n if(result.Count == 0)\n return 0;\n\n index -= 2;\n Matrix power = Matrix.PowerMod(f - index + 1, m, 1000000007);\n\n if (result[0] == 2)\n {\n if (result[1] == 3)\n return power.A2;\n else\n return power.A1 - 1;\n }\n else\n return power.A1 - (f - index) % 2;\n }\n\n static int ContainCount(string p, string s)\n {\n if (p.Length > s.Length) return 0;\n int k = -1, count = 0;\n\n while (true)\n {\n k = s.IndexOf(p, k + 1);\n if (k == -1) break;\n count++;\n }\n\n return count;\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "803df7e2b22cf40567ec704fa4d5f7b0", "src_uid": "8983915e904ba763d893d56e94d9f7f0", "apr_id": "3e8791cfd90c992271531e0a0d16e504", "difficulty": 2600, "tags": ["matrices", "strings"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9951137970939952, "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.Text;\n\nnamespace ProgrammingContest.Codeforces.Round70\n{\n class E\n {\n static int t,n;\n static int[,] dist, dist2;\n static string[] b1, b2;\n\n static void bfs(int x, int y, bool chk)\n {\n int[] dx = new int[4] { 1, 0, -1, 0 },\n dy = new int[4] { 0, -1, 0, 1 };\n bool[,] visited = new bool[n, n];\n Queue q = new Queue();\n q.Enqueue(x * n + y);\n visited[x, y] = true;\n for (int a = 0; a < n; a++)\n for (int b = 0; b < n; b++)\n dist[a, b] = 100000;\n dist[x, y] = 0;\n while (q.Any())\n {\n int v = q.Dequeue();\n x = v / n; y = v % n;\n for (int i = 0; i < 4; i++)\n if (InRange(x + dx[i]) && InRange(y + dy[i]))\n {\n int d = dist[x, y] + 1;\n if (visited[x + dx[i], y + dy[i]] || d > t)\n {\n continue;\n }\n visited[x + dx[i], y + dy[i]] = true;\n if (!chk)\n {\n dist[x + dx[i], y + dy[i]] = d;\n q.Enqueue((x + dx[i]) * n + (y + dy[i]));\n }\n else\n {\n char b = b2[y + dy[i]][x + dx[i]];\n if (!char.IsDigit(b1[y + dy[i]][x + dx[i]]))\n {\n dist[x + dx[i], y + dy[i]] = d;\n }\n else if (d < dist2[x + dx[i], y + dy[i]])\n {\n q.Enqueue((x + dx[i]) * n + (y + dy[i]));\n dist[x + dx[i], y + dy[i]] = d;\n }\n else if ('0' <= b && b <= '9' && d == dist2[x + dx[i], y + dy[i]])\n dist[x + dx[i], y + dy[i]] = d;\n }\n }\n }\n }\n\n static bool InRange(int v) { return 0 <= v && v < n; }\n\n public static void Main()\n {\n var xs = Array.ConvertAll(Console.ReadLine().Split(' '), sss => int.Parse(sss));\n n = xs[0];\n t = xs[1];\n dist = new int[n, n];\n b1 = new string[n];\n b2 = new string[n];\n for (int y = 0; y < n; y++)\n b1[y] = Console.ReadLine();\n Console.ReadLine();\n for (int y = 0; y < n; y++)\n b2[y] = Console.ReadLine();\n Dinic dinic = new Dinic(2000);\n int scnt = 2;\n for (int y = 0; y < n; y++)\n for (int x = 0; x < n; x++)\n if (b1[y][x] == 'Z')\n {\n bfs(x,y,false);\n dist2 = (int[,])dist.Clone();\n }\n for (int y = 0; y < n; y++)\n for (int x = 0; x < n; x++)\n {\n if ('1' <= b1[y][x] && b1[y][x] <= '9')\n {\n //Console.WriteLine(\"check {0} {1}\", x, y);\n bfs(x, y, true);\n int scientists = b1[y][x] - '0';\n for (int j = 0; j < scientists; j++)\n dinic.AddEdge(0, scnt + j, 1);\n int idx = 1000;\n for (int a = 0; a < n; a++)\n for (int b = 0; b < n; b++)\n if ('1' <= b2[a][b] && b2[a][b] <= '9')\n {\n int cnt = b2[a][b] - '0';\n for (int i = 0; i < cnt; i++, idx++)\n if (dist[b, a] < 100000)\n {\n //Console.WriteLine(\"{0} {1} -> {2} {3}\", x, y, b, a);\n for (int j = 0; j < scientists; j++)\n dinic.AddEdge(scnt + j, idx, 1);\n }\n }\n scnt += scientists;\n }\n }\n for (int y = 0, k = 1000; y < n; y++)\n for (int x = 0; x < n; x++)\n if ('1' <= b2[y][x] && b2[y][x] <= '9')\n {\n int cnt = b2[y][x] - '0';\n for (int i = 0; i < cnt; i++, k++)\n dinic.AddEdge(k, 1, 1);\n }\n Console.WriteLine(dinic.BipartiteMatching(0,1));\n }\n\n #region MaximumFlow\n class Dinic\n {\n const int INF = 1 << 29;\n\n class Edge\n {\n public int to, cap, rev;\n public Edge(int to_, int cap_, int rev_) { to = to_; cap = cap_; rev = rev_; }\n }\n\n List[] G;\n int[] level, iter;\n\n void bfs(int s)\n {\n for (int i = 0; i < level.Length; i++) level[i] = -1;\n Queue q = new Queue();\n level[s] = 0;\n q.Enqueue(s);\n while (q.Count > 0)\n {\n int v = q.Dequeue();\n for (int i = 0; i < G[v].Count; i++)\n {\n Edge e = G[v][i];\n if (e.cap > 0 && level[e.to] < 0)\n {\n level[e.to] = level[v] + 1;\n q.Enqueue(e.to);\n }\n }\n }\n }\n\n int dfs(int v, int t, int f)\n {\n if (v == t) return f;\n for (int i = iter[v]; i < G[v].Count; i++, iter[v]++)\n {\n Edge e = G[v][i];\n if (e.cap > 0 && level[v] < level[e.to])\n {\n int d = dfs(e.to, t, Math.Min(f, e.cap));\n if (d > 0)\n {\n e.cap -= d;\n G[e.to][e.rev].cap += d;\n return d;\n }\n }\n }\n return 0;\n }\n\n public void AddEdge(int from, int to, int cap)\n {\n G[from].Add(new Edge(to, cap, G[to].Count));\n G[to].Add(new Edge(from, 0, G[from].Count - 1));\n }\n\n public int MaxFlow(int s, int t)\n {\n int flow = 0;\n for (; ; )\n {\n bfs(s);\n if (level[t] < 0) return flow;\n for (int i = 0; i < iter.Length; i++) iter[i] = 0;\n for (int f = 0; (f = dfs(s, t, INF)) > 0; )\n flow += f;\n }\n }\n\n public int BipartiteMatching(int s, int t)\n {\n return MaxFlow(s, t);\n }\n\n public Dinic(int size)\n {\n level = new int[size];\n iter = new int[size];\n G = new List[size];\n for (int i = 0; i < size; i++)\n G[i] = new List();\n }\n }\n #endregion\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "af4f31e9380d4ce8fb2821942e509840", "src_uid": "544de9c3729a35eb08c143b1cb9ee085", "apr_id": "678cb1b724ba878cf4142a9db8ed336d", "difficulty": 2300, "tags": ["graphs", "flows", "shortest paths"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.9611553118940964, "equal_cnt": 6, "replace_cnt": 2, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 5, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\n\nnamespace ProgrammingContest.Codeforces.Round70\n{\n class E\n {\n static int t,n;\n static int[,] dist, dist2;\n static string[] b1, b2;\n\n const int INF = 100000;\n\n static void bfs(int x, int y, bool chk)\n {\n int[] dx = new int[4] { 1, 0, -1, 0 },\n dy = new int[4] { 0, -1, 0, 1 };\n bool[,] visited = new bool[n, n];\n Queue q = new Queue();\n q.Enqueue(x * n + y);\n visited[x, y] = true;\n for (int a = 0; a < n; a++)\n for (int b = 0; b < n; b++)\n dist[a, b] = INF;\n dist[x, y] = 0;\n while (q.Any())\n {\n int v = q.Dequeue();\n x = v / n; y = v % n;\n for (int i = 0; i < 4; i++)\n if (InRange(x + dx[i]) && InRange(y + dy[i]))\n {\n int d = dist[x, y] + 1;\n if (visited[x + dx[i], y + dy[i]] || d > t)\n {\n continue;\n }\n visited[x + dx[i], y + dy[i]] = true;\n if (!chk)\n {\n dist[x + dx[i], y + dy[i]] = d;\n if (char.IsDigit(b1[y + dy[i]][x + dx[i]]))\n q.Enqueue((x + dx[i]) * n + (y + dy[i]));\n }\n else\n {\n char b = b2[y + dy[i]][x + dx[i]];\n if (d < dist2[x + dx[i], y + dy[i]])\n {\n q.Enqueue((x + dx[i]) * n + (y + dy[i]));\n dist[x + dx[i], y + dy[i]] = d;\n }\n else if ('0' <= b && b <= '9' && d == dist2[x + dx[i], y + dy[i]])\n dist[x + dx[i], y + dy[i]] = d;\n }\n }\n }\n }\n\n static bool InRange(int v) { return 0 <= v && v < n; }\n\n public static void Main()\n {\n var xs = Array.ConvertAll(Console.ReadLine().Split(' '), sss => int.Parse(sss));\n n = xs[0];\n t = xs[1];\n dist = new int[n, n];\n b1 = new string[n];\n b2 = new string[n];\n for (int y = 0; y < n; y++)\n b1[y] = Console.ReadLine();\n Console.ReadLine();\n for (int y = 0; y < n; y++)\n b2[y] = Console.ReadLine();\n Dinic dinic = new Dinic(2000);\n int scnt = 2;\n for (int y = 0; y < n; y++)\n for (int x = 0; x < n; x++)\n if (b1[y][x] == 'Z')\n {\n bfs(x,y,false);\n dist2 = (int[,])dist.Clone();\n }\n for (int y = 0; y < n; y++)\n for (int x = 0; x < n; x++)\n {\n if (!('1' <= b1[y][x] && b1[y][x] <= '9'))\n continue;\n bfs(x, y, true);\n int scientists = b1[y][x] - '0';\n for (int j = 0; j < scientists; j++)\n dinic.AddEdge(0, scnt + j, 1);\n int idx = 1000;\n for (int a = 0; a < n; a++)\n for (int b = 0; b < n; b++)\n {\n if (!('1' <= b2[a][b] && b2[a][b] <= '9'))\n continue;\n int cnt = b2[a][b] - '0';\n for (int i = 0; i < cnt; i++, idx++)\n if (dist[b, a] < INF)\n {\n //Console.WriteLine(\"{0} {1} -> {2} {3}\", x, y, b, a);\n for (int j = 0; j < scientists; j++)\n dinic.AddEdge(scnt + j, idx, 1);\n }\n }\n scnt += scientists;\n }\n for (int y = 0, k = 1000; y < n; y++)\n for (int x = 0; x < n; x++)\n if ('1' <= b2[y][x] && b2[y][x] <= '9')\n {\n int cnt = b2[y][x] - '0';\n for (int i = 0; i < cnt; i++, k++)\n dinic.AddEdge(k, 1, 1);\n }\n Console.WriteLine(dinic.BipartiteMatching(0,1));\n }\n\n #region MaximumFlow\n class Dinic\n {\n const int INF = 1 << 29;\n\n class Edge\n {\n public int to, cap, rev;\n public Edge(int to_, int cap_, int rev_) { to = to_; cap = cap_; rev = rev_; }\n }\n\n List[] G;\n int[] level, iter;\n\n void bfs(int s)\n {\n for (int i = 0; i < level.Length; i++) level[i] = -1;\n Queue q = new Queue();\n level[s] = 0;\n q.Enqueue(s);\n while (q.Count > 0)\n {\n int v = q.Dequeue();\n for (int i = 0; i < G[v].Count; i++)\n {\n Edge e = G[v][i];\n if (e.cap > 0 && level[e.to] < 0)\n {\n level[e.to] = level[v] + 1;\n q.Enqueue(e.to);\n }\n }\n }\n }\n\n int dfs(int v, int t, int f)\n {\n if (v == t) return f;\n for (int i = iter[v]; i < G[v].Count; i++, iter[v]++)\n {\n Edge e = G[v][i];\n if (e.cap > 0 && level[v] < level[e.to])\n {\n int d = dfs(e.to, t, Math.Min(f, e.cap));\n if (d > 0)\n {\n e.cap -= d;\n G[e.to][e.rev].cap += d;\n return d;\n }\n }\n }\n return 0;\n }\n\n public void AddEdge(int from, int to, int cap)\n {\n G[from].Add(new Edge(to, cap, G[to].Count));\n G[to].Add(new Edge(from, 0, G[from].Count - 1));\n }\n\n public int MaxFlow(int s, int t)\n {\n int flow = 0;\n for (; ; )\n {\n bfs(s);\n if (level[t] < 0) return flow;\n for (int i = 0; i < iter.Length; i++) iter[i] = 0;\n for (int f = 0; (f = dfs(s, t, INF)) > 0; )\n flow += f;\n }\n }\n\n public int BipartiteMatching(int s, int t)\n {\n return MaxFlow(s, t);\n }\n\n public Dinic(int size)\n {\n level = new int[size];\n iter = new int[size];\n G = new List[size];\n for (int i = 0; i < size; i++)\n G[i] = new List();\n }\n }\n #endregion\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "b559c12e48ef4097400614e12b5687e8", "src_uid": "544de9c3729a35eb08c143b1cb9ee085", "apr_id": "678cb1b724ba878cf4142a9db8ed336d", "difficulty": 2300, "tags": ["graphs", "flows", "shortest paths"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.08886742332769862, "equal_cnt": 120, "replace_cnt": 87, "delete_cnt": 13, "insert_cnt": 21, "fix_ops_cnt": 121, "bug_source_code": "#include \n#include\n#include\ntypedef long long int ll;\n\nconstexpr ll Mod = (119 << 23) + 1;\nconstexpr int E = 23;\nconstexpr ll O = 31;\nconstexpr ll InvO = 128805723;\n\nll Z[E + 1], InvZ[E + 1];\n\nvoid Init() {\n\tZ[E] = O;\n\tInvZ[E] = InvO;\n\tfor (int i = E - 1; i >= 0; i--) {\n\t\tZ[i] = (Z[i + 1] * Z[i + 1]) % Mod;\n\t\tInvZ[i] = (InvZ[i + 1] * InvZ[i + 1]) % Mod;\n\t}\n}\n\nll Pow(ll x, ll y) {\n\tll result = 1;\n\twhile (y > 0)\n\t{\n\t\tif (y % 2 == 1) {\n\t\t\tresult *= x;\n\t\t\tresult %= Mod;\n\t\t}\n\t\tx *= x;\n\t\tx %= Mod;\n\t\ty /= 2;\n\t}\n\n\treturn result;\n}\n\nll Inv(ll x) {\n\treturn Pow(x, Mod - 2);\n}\n\n// d桁のvを逆順にする\nint bits_rev(int v, int d)\n{\n\tint result = 0;\n\tfor (int i = 0; i < d; i++) {\n\t\tif ((v & (1 << i))) result |= 1 << (d - i - 1);\n\t}\n\treturn result;\n}\n\nvoid Transform(std::vector& a, int len, int lg, bool inverse) {\n\tfor (int i = 0; i < len; i++) {\n\t\tint rev = bits_rev(i, lg);\n\t\tif (i >= rev) continue;\n\t\tll t = a[i];\n\t\ta[i] = a[rev];\n\t\ta[rev] = t;\n\t}\n\n\tfor (int i = 1; i <= lg; i++) {\n\t\tint b = 1 << (i - 1);\n\t\tll z = 1;\n\t\tfor (int j = 0; j < b; j++) {\n\t\t\tfor (int k = j; k < len; k += (b << 1)) {\n\t\t\t\tll t = (z * a[k + b]) % Mod;\n\t\t\t\tll u = a[k];\n\t\t\t\ta[k] = (u + t) % Mod;\n\t\t\t\ta[k + b] = (u - t) % Mod;\n\t\t\t\tif (a[k + b] < 0) a[k + b] += Mod;\n\t\t\t}\n\t\t\tz *= inverse ? InvZ[i] : Z[i];\n\t\t\tz %= Mod;\n\t\t}\n\t}\n}\n\nvoid Convolution(std::vector& a, std::vector b, bool eq) {\n\tint sz = a.size() + b.size() - 1;\n\tint len = 1;\n\tint lg = 0;\n\twhile (len < sz)\n\t{\n\t\tlg++;\n\t\tlen *= 2;\n\t}\n\n\ta.resize(len);\n\tTransform(a, len, lg, false);\n\n\tif (eq) {\n\t\tfor (int i = 0; i < len; i++) {\n\t\t\ta[i] *= a[i];\n\t\t\ta[i] %= Mod;\n\t\t}\n\t}\n\telse {\n\t\tb.resize(len);\n\t\tTransform(b, len, lg, false);\n\t\tfor (int i = 0; i < len; i++) {\n\t\t\ta[i] *= b[i];\n\t\t\ta[i] %= Mod;\n\t\t}\n\t}\n\n\n\tTransform(a, len, lg, true);\n\n\tll inv = Inv(len);\n\n\tfor (int i = 0; i < sz; i++) {\n\t\ta[i] *= inv;\n\t\ta[i] %= Mod;\n\t}\n\ta.resize(sz);\n}\n\nint main(void) {\n\tInit();\n\n\tint n, k;\n\tscanf(\"%d %d\", &n, &k);\n\tstd::vector f;\n\tf.resize(1);\n\tf[0] = 1;\n\n\tstd::vector t;\n\tt.resize(10);\n\tfor (int i = 0; i < k; i++) {\n\t\tint d;\n\t\tscanf(\"%d\", &d);\n\t\tt[d] = 1;\n\t}\n\n\tint h = n / 2;\n\twhile (h > 0)\n\t{\n\t\tif (h % 2 == 1) {\n\n\t\t\tConvolution(f, t, false);\n\t\t}\n\t\tConvolution(t, t, true);\n\t\th /= 2;\n\t}\n\n\tll ans = 0;\n\tfor (int i = 0; i < f.size(); i++) {\n\t\tans += (f[i] * f[i]) % Mod;\n\t\tans %= Mod;\n\t}\n\n\tprintf(\"%lld\", ans);\n\treturn 0;\n}\n", "lang": "Mono C#", "bug_code_uid": "c7d99a0baf8937bccb207f0f070a4cca", "src_uid": "279f1f7d250a4be6406c6c7bfc818bbf", "apr_id": "ee00465df33ae6273ff92e4bcbc89d0b", "difficulty": 2400, "tags": ["divide and conquer", "dp", "fft"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.955312015212931, "equal_cnt": 33, "replace_cnt": 15, "delete_cnt": 7, "insert_cnt": 10, "fix_ops_cnt": 32, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Diagnostics;\nusing CompLib.Mathematics;\nusing CompLib.Util;\n\npublic class Program\n{\n private const int MaxLg = 20;\n\n\n private int N, K;\n\n public void Solve()\n {\n var sc = new Scanner();\n N = sc.NextInt();\n K = sc.NextInt();\n\n ModInt[] a = new ModInt[1];\n a[0] = 1;\n\n ModInt[] b = new ModInt[10];\n int min = int.MaxValue;\n int max = int.MinValue;\n for (int i = 0; i < K; i++)\n {\n int d = sc.NextInt();\n min = Math.Min(min, d);\n max = Math.Max(max, d);\n b[d] = 1;\n }\n\n int h = N / 2;\n int tmp = h;\n while (tmp > 0)\n {\n if ((tmp & 1) > 0)\n {\n FFT.Convolusion(ref a, b);\n }\n\n FFT.Convolusion(ref b);\n\n tmp >>= 1;\n }\n\n ModInt ans = 0;\n for (int i = min * h; i <= max * h; i++)\n {\n ans += a[i] * a[i];\n }\n\n Console.WriteLine(ans);\n }\n\n\n public static void Main(string[] args) => new Program().Solve();\n}\n\nstatic class FFT\n{\n private const int E = 23;\n private const int MaxLg = 21;\n private static readonly ModInt O = 31;\n\n private static readonly ModInt[] Z, InvZ;\n\n private static readonly List<(int f, int t)>[] Rev;\n private static readonly ModInt[] InvLen;\n\n static FFT()\n {\n Z = new ModInt[E + 1];\n InvZ = new ModInt[E + 1];\n Z[E] = O;\n InvZ[E] = ModInt.Inverse(O);\n\n for (int i = E - 1; i >= 0; i--)\n {\n Z[i] = Z[i + 1] * Z[i + 1];\n InvZ[i] = InvZ[i + 1] * InvZ[i + 1];\n }\n\n Rev = new List<(int f, int t)>[MaxLg + 1];\n for (int i = 0; i <= MaxLg; i++)\n {\n int len = 1 << i;\n Rev[i] = new List<(int f, int t)>();\n for (int j = 0; j < len; j++)\n {\n int r = BitsReverse(j, i);\n if (j < r) Rev[i].Add((j, r));\n }\n }\n\n InvLen = new ModInt[MaxLg + 1];\n for (int i = 0; i <= MaxLg; i++)\n {\n InvLen[i] = ModInt.Inverse(1 << i);\n }\n }\n\n public static void Transform(ModInt[] a, int lg, int len, bool inverse)\n {\n foreach (var pair in Rev[lg])\n {\n var t = a[pair.f];\n a[pair.f] = a[pair.t];\n a[pair.t] = t;\n }\n\n for (int i = 1; i <= lg; i++)\n {\n int b = 1 << (i - 1);\n ModInt z = 1;\n for (int j = 0; j < b; j++)\n {\n for (int k = j; k < len; k += (b << 1))\n {\n var t = z * a[k + b];\n var u = a[k];\n a[k] = u + t;\n a[k + b] = u - t;\n }\n\n z *= inverse ? InvZ[i] : Z[i];\n }\n }\n }\n\n public static void Convolusion(ref ModInt[] a, ModInt[] b)\n {\n int sz = a.Length + b.Length - 1;\n int len = 1;\n int lg = 0;\n while (len < sz)\n {\n len <<= 1;\n lg++;\n }\n\n Array.Resize(ref a, len);\n Transform(a, lg, len, false);\n Array.Resize(ref b, len);\n Transform(b, lg, len, false);\n for (int i = 0; i < len; i++)\n {\n a[i] *= b[i];\n }\n\n Transform(a, lg, len, true);\n for (int i = 0; i < len; i++)\n {\n a[i] *= InvLen[lg];\n }\n\n Array.Resize(ref a, sz);\n }\n\n public static void Convolusion(ref ModInt[] a)\n {\n int sz = a.Length + a.Length - 1;\n int len = 1;\n int lg = 0;\n while (len < sz)\n {\n len <<= 1;\n lg++;\n }\n\n Array.Resize(ref a, len);\n Transform(a, lg, len, false);\n for (int i = 0; i < len; i++)\n {\n a[i] *= a[i];\n }\n\n Transform(a, lg, len, true);\n var inv = ModInt.Inverse(len);\n for (int i = 0; i < len; i++)\n {\n a[i] *= inv;\n }\n\n Array.Resize(ref a, sz);\n }\n\n private static int BitsReverse(int v, int lg)\n {\n if (v == 0) return v;\n int r = 0;\n if (lg % 2 == 1) r |= v & (1 << (lg / 2));\n for (int i = 0; i < lg / 2; i++)\n {\n r |= ((v >> i) & 1) << (lg - i - 1);\n r |= ((v >> (lg - i - 1)) & 1) << i;\n }\n\n return r;\n }\n}\n\n\n// https://bitbucket.org/camypaper/complib\nnamespace CompLib.Mathematics\n{\n #region ModInt\n\n /// \n /// [0,) までの値を取るような数\n /// \n public struct ModInt\n {\n /// \n /// 剰余を取る値.\n /// \n public const long Mod = 998244353;\n\n /// \n /// 実際の数値.\n /// \n public long num;\n\n /// \n /// 値が であるようなインスタンスを構築します.\n /// \n /// インスタンスが持つ値\n /// パフォーマンスの問題上,コンストラクタ内では剰余を取りません.そのため, ∈ [0,) を満たすような を渡してください.このコンストラクタは O(1) で実行されます.\n public ModInt(long n)\n {\n num = n;\n }\n\n /// \n /// このインスタンスの数値を文字列に変換します.\n /// \n /// [0,) の範囲内の整数を 10 進表記したもの.\n public override string ToString()\n {\n return num.ToString();\n }\n\n public static ModInt operator +(ModInt l, ModInt r)\n {\n l.num += r.num;\n if (l.num >= Mod) l.num -= Mod;\n return l;\n }\n\n public static ModInt operator -(ModInt l, ModInt r)\n {\n l.num -= r.num;\n if (l.num < 0) l.num += Mod;\n return l;\n }\n\n public static ModInt operator *(ModInt l, ModInt r)\n {\n return new ModInt(l.num * r.num % Mod);\n }\n\n public static implicit operator ModInt(long n)\n {\n n %= Mod;\n if (n < 0) n += Mod;\n return new ModInt(n);\n }\n\n /// \n /// 与えられた 2 つの数値からべき剰余を計算します.\n /// \n /// べき乗の底\n /// べき指数\n /// 繰り返し二乗法により O(N log N) で実行されます.\n public static ModInt Pow(ModInt v, long k)\n {\n return Pow(v.num, k);\n }\n\n /// \n /// 与えられた 2 つの数値からべき剰余を計算します.\n /// \n /// べき乗の底\n /// べき指数\n /// 繰り返し二乗法により O(N log N) で実行されます.\n public static ModInt Pow(long v, long k)\n {\n long ret = 1;\n for (k %= Mod - 1; k > 0; k >>= 1, v = v * v % Mod)\n if ((k & 1) == 1)\n ret = ret * v % Mod;\n return new ModInt(ret);\n }\n\n /// \n /// 与えられた数の逆元を計算します.\n /// \n /// 逆元を取る対象となる数\n /// 逆元となるような値\n /// 法が素数であることを仮定して,フェルマーの小定理に従って逆元を O(log N) で計算します.\n public static ModInt Inverse(ModInt v)\n {\n return Pow(v, Mod - 2);\n }\n }\n\n #endregion\n\n #region Binomial Coefficient\n\n public class BinomialCoefficient\n {\n public ModInt[] fact, ifact;\n\n public BinomialCoefficient(int n)\n {\n fact = new ModInt[n + 1];\n ifact = new ModInt[n + 1];\n fact[0] = 1;\n for (int i = 1; i <= n; i++)\n fact[i] = fact[i - 1] * i;\n ifact[n] = ModInt.Inverse(fact[n]);\n for (int i = n - 1; i >= 0; i--)\n ifact[i] = ifact[i + 1] * (i + 1);\n ifact[0] = ifact[1];\n }\n\n public ModInt this[int n, int r]\n {\n get\n {\n if (n < 0 || n >= fact.Length || r < 0 || r > n) return 0;\n return fact[n] * ifact[n - r] * ifact[r];\n }\n }\n\n public ModInt RepeatedCombination(int n, int k)\n {\n if (k == 0) return 1;\n return this[n + k - 1, k];\n }\n }\n\n #endregion\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 = Console.ReadLine();\n while (s.Length == 0)\n {\n s = Console.ReadLine();\n }\n\n _line = s.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 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": "Mono C#", "bug_code_uid": "cd2a66efba6794121fd31ef81f267735", "src_uid": "279f1f7d250a4be6406c6c7bfc818bbf", "apr_id": "ee00465df33ae6273ff92e4bcbc89d0b", "difficulty": 2400, "tags": ["divide and conquer", "dp", "fft"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9526263844719816, "equal_cnt": 16, "replace_cnt": 12, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 15, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Diagnostics;\nusing System.Globalization;\nusing System.IO;\nusing System.Linq;\nusing System.Numerics;\nusing System.Text;\nusing System.Text.RegularExpressions;\nusing System.Threading;\n\nnamespace ReadWriteTemplate\n{\n public static class Solver\n {\n private static void SolveCase()\n {\n const long MOD = 998244353;\n\n var ntt = new NTT(MOD);\n\n int n = ReadInt();\n int k = ReadInt();\n int[] d = ReadIntArray();\n\n long[] result = { 1 };\n long[] a = new long[10];\n for (int i = 0; i < k; i++)\n {\n a[d[i]] = 1;\n }\n\n int n2 = n / 2;\n\n while (n2 > 0)\n {\n if ((n2 & 1) != 0)\n {\n result = ntt.Multiply(result, a);\n }\n\n a = ntt.Multiply(a, a);\n n2 >>= 1;\n }\n\n long ans = 0;\n for (int i = 0; i < result.Length; i++)\n {\n ans = (ans + result[i] * result[i]) % MOD;\n }\n\n Writer.WriteLine(ans);\n }\n\n public class NTT\n {\n private readonly long MOD;\n\n private int maxBase;\n\n private long[] roots;\n\n private long[] invRoots;\n\n public NTT(long mod)\n {\n MOD = mod;\n\n long tmp = mod - 1;\n maxBase = 0;\n while (tmp % 2 == 0)\n {\n maxBase++;\n tmp /= 2;\n }\n\n long baseRoot = 2;\n while (true)\n {\n if (Pow(baseRoot, 1 << maxBase) == 1)\n {\n if (Pow(baseRoot, 1 << (maxBase - 1)) != 1)\n {\n break;\n }\n }\n baseRoot++;\n }\n\n roots = new long[maxBase];\n roots[0] = baseRoot;\n for (int i = 1; i < maxBase; i++)\n {\n roots[i] = (roots[i - 1] * roots[i - 1]) % MOD;\n }\n invRoots = new long[maxBase];\n for (int i = 0; i < maxBase; i++)\n {\n invRoots[i] = Pow(roots[i], mod - 2);\n }\n }\n\n public long[] Multiply(long[] a, long[] b)\n {\n int n = 1;\n int p = 0;\n while (n < Math.Max(a.Length, b.Length))\n {\n n <<= 1;\n p++;\n }\n n <<= 1;\n p++;\n\n if (p > maxBase)\n {\n throw new InvalidOperationException($\"Mod {MOD} cannot be used ({p} > {maxBase}).\");\n }\n\n var fa = new long[n];\n Array.Copy(a, fa, a.Length);\n var fb = new long[n];\n Array.Copy(b, fb, b.Length);\n\n FFT(fa, p, false);\n FFT(fb, p, false);\n\n for (int i = 0; i < n; i++)\n {\n fa[i] = fa[i] * fb[i] % MOD;\n }\n\n FFT(fa, p, true);\n long invN = Pow(n, MOD - 2);\n for (int i = 0; i < n; i++)\n {\n fa[i] = fa[i] * invN % MOD;\n }\n return fa;\n }\n\n private void FFT(long[] a, int p, bool invert)\n {\n int n = a.Length;\n if (n == 1)\n {\n return;\n }\n\n var a0 = new long[n / 2];\n var a1 = new long[n / 2];\n for (int i = 0; i < n / 2; i++)\n {\n a0[i] = a[2 * i];\n a1[i] = a[2 * i + 1];\n }\n FFT(a0, p - 1, invert);\n FFT(a1, p - 1, invert);\n\n long w = 1;\n long wn = invert ? invRoots[maxBase - p] : roots[maxBase - p];\n\n for (int i = 0; i < n / 2; i++)\n {\n long d = w * a1[i] % MOD;\n a[i] = a0[i] + d;\n if (a[i] >= MOD)\n {\n a[i] -= MOD;\n }\n a[i + n / 2] = a0[i] - d;\n if (a[i + n / 2] < 0)\n {\n a[i + n / 2] += MOD;\n }\n w = w * wn % MOD;\n }\n }\n\n private long Pow(long a, long n)\n {\n long result = 1;\n\n while (n > 0)\n {\n if ((n & 1) > 0)\n {\n result = (result * a) % MOD;\n }\n\n a = (a * a) % MOD;\n n >>= 1;\n }\n\n return result;\n }\n }\n\n public static void Solve()\n {\n // var sw = Stopwatch.StartNew();\n\n SolveCase();\n\n /*int T = ReadInt();\n for (int i = 0; i < T; i++)\n {\n // Writer.WriteLine(\"Case {0}:\", i + 1);\n // Writer.Write(\"Case #{0}: \", i + 1);\n SolveCase();\n }*/\n\n // sw.Stop();\n // Console.WriteLine(sw.ElapsedMilliseconds);\n }\n\n public static void Main()\n {\n Thread.CurrentThread.CurrentCulture = CultureInfo.InvariantCulture;\n\n#if DEBUG\n // Reader = Console.In; Writer = Console.Out;\n Reader = File.OpenText(\"input.txt\"); Writer = File.CreateText(\"output.txt\");\n#else\n Reader = Console.In; Writer = Console.Out;\n#endif\n\n // Solve();\n Thread thread = new Thread(Solve, 64 * 1024 * 1024);\n thread.CurrentCulture = CultureInfo.InvariantCulture;\n thread.Start();\n thread.Join();\n\n Reader.Close();\n Writer.Close();\n }\n\n public static IOrderedEnumerable OrderByWithShuffle(this IEnumerable source, Func keySelector)\n {\n return source.Shuffle().OrderBy(keySelector);\n }\n\n public static T[] Shuffle(this IEnumerable source)\n {\n T[] result = source.ToArray();\n Random rnd = new Random();\n for (int i = result.Length - 1; i >= 1; i--)\n {\n int k = rnd.Next(i + 1);\n T tmp = result[k];\n result[k] = result[i];\n result[i] = tmp;\n }\n return result;\n }\n\n #region Read/Write\n\n private static TextReader Reader;\n\n private static TextWriter Writer;\n\n private static Queue CurrentLineTokens = new Queue();\n\n private static string[] ReadAndSplitLine()\n {\n return Reader.ReadLine().Split(new[] { ' ', '\\t' }, StringSplitOptions.RemoveEmptyEntries);\n }\n\n public static string ReadToken()\n {\n while (CurrentLineTokens.Count == 0)\n CurrentLineTokens = new Queue(ReadAndSplitLine());\n return CurrentLineTokens.Dequeue();\n }\n\n public static string ReadLine()\n {\n return Reader.ReadLine();\n }\n\n public static int ReadInt()\n {\n return int.Parse(ReadToken());\n }\n\n public static long ReadLong()\n {\n return long.Parse(ReadToken());\n }\n\n public static double ReadDouble()\n {\n return double.Parse(ReadToken(), CultureInfo.InvariantCulture);\n }\n\n public static int[] ReadIntArray()\n {\n return ReadAndSplitLine().Select(int.Parse).ToArray();\n }\n\n public static long[] ReadLongArray()\n {\n return ReadAndSplitLine().Select(long.Parse).ToArray();\n }\n\n public static double[] ReadDoubleArray()\n {\n return ReadAndSplitLine().Select(s => double.Parse(s, CultureInfo.InvariantCulture)).ToArray();\n }\n\n public static int[][] ReadIntMatrix(int numberOfRows)\n {\n int[][] matrix = new int[numberOfRows][];\n for (int i = 0; i < numberOfRows; i++)\n matrix[i] = ReadIntArray();\n return matrix;\n }\n\n public static string[] ReadLines(int quantity)\n {\n string[] lines = new string[quantity];\n for (int i = 0; i < quantity; i++)\n lines[i] = Reader.ReadLine().Trim();\n return lines;\n }\n\n public static void WriteArray(IEnumerable array)\n {\n Writer.WriteLine(string.Join(\" \", array));\n }\n\n #endregion\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "add37908f8355bd09bbbd0d32b826af4", "src_uid": "279f1f7d250a4be6406c6c7bfc818bbf", "apr_id": "bdb86ae15809b86e425700ab47a0da2b", "difficulty": 2400, "tags": ["divide and conquer", "dp", "fft"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9625710537822475, "equal_cnt": 17, "replace_cnt": 11, "delete_cnt": 1, "insert_cnt": 4, "fix_ops_cnt": 16, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Diagnostics;\nusing System.Globalization;\nusing System.IO;\nusing System.Linq;\nusing System.Text;\nusing System.Text.RegularExpressions;\nusing System.Threading;\n\nnamespace ReadWriteTemplate\n{\n public static class Solver\n {\n private static void SolveCase()\n {\n const int MOD = 998244353;\n\n var ntt = new NTTFast(MOD);\n\n int n = ReadInt();\n int k = ReadInt();\n int[] d = ReadIntArray();\n\n int[] result = { 1 };\n int[] a = new int[10];\n for (int i = 0; i < k; i++)\n {\n a[d[i]] = 1;\n }\n\n int n2 = n / 2;\n\n while (n2 > 0)\n {\n if ((n2 & 1) != 0)\n {\n result = ntt.Multiply(result, a);\n }\n\n a = ntt.Multiply(a, a);\n n2 >>= 1;\n }\n\n long ans = 0;\n for (int i = 0; i < result.Length; i++)\n {\n ans = (ans + (long) result[i] * result[i]) % MOD;\n }\n\n Writer.WriteLine(ans);\n }\n\n public class NTTFast\n {\n private int curBase = 1;\n private int[] roots = { 0, 1 };\n private int[] rev = { 0, 1 };\n private int maxBase = -1;\n private int root = -1;\n\n private readonly int MOD;\n\n public NTTFast(int mod)\n {\n MOD = mod;\n }\n\n private void Init()\n {\n int tmp = MOD - 1;\n maxBase = 0;\n while (tmp % 2 == 0)\n {\n tmp /= 2;\n maxBase++;\n }\n root = 2;\n while (true)\n {\n if (Power(root, 1 << maxBase) == 1)\n {\n if (Power(root, 1 << (maxBase - 1)) != 1)\n {\n break;\n }\n }\n root++;\n }\n }\n\n void ensure_base(int nBase)\n {\n if (maxBase == -1)\n {\n Init();\n }\n if (nBase <= curBase)\n {\n return;\n }\n if (nBase > maxBase)\n {\n throw new InvalidOperationException();\n }\n Array.Resize(ref rev, 1 << nBase);\n for (int i = 0; i < (1 << nBase); i++)\n {\n rev[i] = (rev[i >> 1] >> 1) + ((i & 1) << (nBase - 1));\n }\n Array.Resize(ref roots, 1 << nBase);\n while (curBase < nBase)\n {\n int z = Power(root, 1 << (maxBase - 1 - curBase));\n for (int i = 1 << (curBase - 1); i < (1 << curBase); i++)\n {\n roots[i << 1] = roots[i];\n roots[(i << 1) + 1] = (int)((long)roots[i] * z % MOD);\n }\n curBase++;\n }\n }\n\n public void FFT(int[] a)\n {\n int n = a.Length;\n if ((n & (n - 1)) != 0)\n {\n throw new InvalidOperationException();\n }\n int zeros = get__builtin_ctz(n);\n ensure_base(zeros);\n int shift = curBase - zeros;\n for (int i = 0; i < n; i++)\n {\n if (i < (rev[i] >> shift))\n {\n int tmp = a[i];\n a[i] = a[rev[i] >> shift];\n a[rev[i] >> shift] = tmp;\n }\n }\n for (int k = 1; k < n; k <<= 1)\n {\n for (int i = 0; i < n; i += 2 * k)\n {\n for (int j = 0; j < k; j++)\n {\n int x = a[i + j];\n int y = (int)((long)a[i + j + k] * roots[j + k] % MOD);\n a[i + j] = x + y - MOD;\n if (a[i + j] < 0)\n {\n a[i + j] += MOD;\n }\n a[i + j + k] = x - y + MOD;\n if (a[i + j + k] >= MOD)\n {\n a[i + j + k] -= MOD;\n }\n }\n }\n }\n }\n\n // todo: rename? remove?\n private int get__builtin_ctz(int n)\n {\n int c = 0;\n while (n > 0 && (n & 1) == 0)\n {\n c++;\n n >>= 1;\n }\n return c;\n }\n\n public int[] Multiply(int[] a, int[] b, int eq = 0)\n {\n int need = a.Length + b.Length - 1;\n int nbase = 0;\n while ((1 << nbase) < need)\n {\n nbase++;\n }\n ensure_base(nbase);\n int sz = 1 << nbase;\n Array.Resize(ref a, sz);\n Array.Resize(ref b, sz);\n FFT(a);\n if (eq != 0)\n {\n b = a;\n }\n else\n {\n FFT(b);\n }\n int invSz = Inv(sz);\n for (int i = 0; i < sz; i++)\n {\n a[i] = (int)((long)(int)((long)a[i] * b[i] % MOD) * invSz % MOD);\n }\n Array.Reverse(a, 1, a.Length - 1);\n FFT(a);\n\n int newSize = need;\n while (newSize > 0 && a[newSize - 1] == 0)\n {\n newSize--;\n }\n Array.Resize(ref a, newSize);\n\n return a;\n }\n\n public int[] Square(int[] a)\n {\n return Multiply(a, a, 1);\n }\n\n private int Power(int a, long b)\n {\n int res = 1;\n while (b > 0)\n {\n if ((b & 1) > 0)\n {\n res = (int)((long)res * a % MOD);\n }\n a = (int)((long)a * a % MOD);\n b >>= 1;\n }\n return res;\n }\n\n private int Inv(int a)\n {\n a %= MOD;\n if (a < 0)\n {\n a += MOD;\n }\n int b = MOD;\n int u = 0;\n int v = 1;\n while (a != 0)\n {\n int t = b / a;\n b -= t * a;\n\n int tmp = a;\n a = b;\n b = tmp;\n\n u -= t * v;\n\n tmp = u;\n u = v;\n v = tmp;\n }\n if (u < 0)\n {\n u += MOD;\n }\n return u;\n }\n }\n\n public static void Solve()\n {\n#if DEBUG\n var sw = Stopwatch.StartNew();\n#endif\n\n SolveCase();\n\n /*int T = ReadInt();\n for (int i = 0; i < T; i++)\n {\n Writer.Write(\"Case #{0}: \", i + 1);\n SolveCase();\n }*/\n\n#if DEBUG\n sw.Stop();\n Console.WriteLine(sw.ElapsedMilliseconds);\n#endif\n }\n\n public static void Main()\n {\n Thread.CurrentThread.CurrentCulture = CultureInfo.InvariantCulture;\n\n#if DEBUG\n //Reader = Console.In; Writer = Console.Out;\n Reader = File.OpenText(\"input.txt\"); Writer = File.CreateText(\"output.txt\");\n#else\n Reader = Console.In; Writer = Console.Out;\n#endif\n\n // Solve();\n Thread thread = new Thread(Solve, 64 * 1024 * 1024);\n thread.CurrentCulture = CultureInfo.InvariantCulture;\n thread.Start();\n thread.Join();\n\n Reader.Close();\n Writer.Close();\n }\n\n public static IOrderedEnumerable OrderByWithShuffle(this IEnumerable source, Func keySelector)\n {\n return source.Shuffle().OrderBy(keySelector);\n }\n\n public static T[] Shuffle(this IEnumerable source)\n {\n T[] result = source.ToArray();\n Random rnd = new Random();\n for (int i = result.Length - 1; i >= 1; i--)\n {\n int k = rnd.Next(i + 1);\n T tmp = result[k];\n result[k] = result[i];\n result[i] = tmp;\n }\n return result;\n }\n\n #region Read/Write\n\n private static TextReader Reader;\n\n private static TextWriter Writer;\n\n private static Queue CurrentLineTokens = new Queue();\n\n private static string[] ReadAndSplitLine()\n {\n return Reader.ReadLine().Split(new[] { ' ', '\\t' }, StringSplitOptions.RemoveEmptyEntries);\n }\n\n public static string ReadToken()\n {\n while (CurrentLineTokens.Count == 0)\n CurrentLineTokens = new Queue(ReadAndSplitLine());\n return CurrentLineTokens.Dequeue();\n }\n\n public static string ReadLine()\n {\n return Reader.ReadLine();\n }\n\n public static int ReadInt()\n {\n return int.Parse(ReadToken());\n }\n\n public static long ReadLong()\n {\n return long.Parse(ReadToken());\n }\n\n public static double ReadDouble()\n {\n return double.Parse(ReadToken(), CultureInfo.InvariantCulture);\n }\n\n public static int[] ReadIntArray()\n {\n return ReadAndSplitLine().Select(int.Parse).ToArray();\n }\n\n public static long[] ReadLongArray()\n {\n return ReadAndSplitLine().Select(long.Parse).ToArray();\n }\n\n public static double[] ReadDoubleArray()\n {\n return ReadAndSplitLine().Select(s => double.Parse(s, CultureInfo.InvariantCulture)).ToArray();\n }\n\n public static int[][] ReadIntMatrix(int numberOfRows)\n {\n int[][] matrix = new int[numberOfRows][];\n for (int i = 0; i < numberOfRows; i++)\n matrix[i] = ReadIntArray();\n return matrix;\n }\n\n public static string[] ReadLines(int quantity)\n {\n string[] lines = new string[quantity];\n for (int i = 0; i < quantity; i++)\n lines[i] = Reader.ReadLine().Trim();\n return lines;\n }\n\n public static void WriteArray(IEnumerable array)\n {\n Writer.WriteLine(string.Join(\" \", array));\n }\n\n #endregion\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "b7cae98ee06ce74b795230ab82bf0de0", "src_uid": "279f1f7d250a4be6406c6c7bfc818bbf", "apr_id": "bdb86ae15809b86e425700ab47a0da2b", "difficulty": 2400, "tags": ["divide and conquer", "dp", "fft"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9977324263038548, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\n\nnamespace ProgrammingContest.Codeforces.Round88 {\n class B {\n static void Mai() {\n var xs = Array.ConvertAll(Console.ReadLine().Split(' '), sss => long.Parse(sss));\n long a = xs[0], b = xs[1], mod = xs[2];\n for (long i = 1; i < mod && i <= a; i++) {\n long v = 1000000000L * i % mod;\n if ((mod - v) % mod > b) {\n Console.WriteLine(\"1 {0}\", i.ToString().PadLeft(9, '0'));\n return;\n }\n }\n Console.WriteLine(2);\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "e16d48d4e97c65e369ae4e4882667c06", "src_uid": "8b6f633802293202531264446d33fee5", "apr_id": "afc02a09abad8d7b645a1a51add5ea75", "difficulty": 1800, "tags": ["brute force", "number theory"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9916222391469917, "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.Text;\n\nnamespace ProgrammingContest.Codeforces.Round88 {\n class B {\n static void Main() {\n var xs = Array.ConvertAll(Console.ReadLine().Split(' '), sss => long.Parse(sss));\n long a = xs[0], b = xs[1], mod = xs[2];\n for (long i = 0; i <= a; i++) {\n long v = 1000000000L * i % mod;\n if ((mod - v) % mod > b) {\n Console.WriteLine(\"1 {0}\", i.ToString().PadLeft(9, '0'));\n return;\n }\n }\n Console.WriteLine(2);\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "e7a933bb9cfe3c249613a47233769e2c", "src_uid": "8b6f633802293202531264446d33fee5", "apr_id": "afc02a09abad8d7b645a1a51add5ea75", "difficulty": 1800, "tags": ["brute force", "number theory"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.9978428351309707, "equal_cnt": 4, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 3, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Text;\nusing System.IO;\nusing System.Linq;\nusing System.Collections;\n\nnamespace Task\n{\n class MyIo\n {\n char[] separators = new char[] { ' ', '\\t' };\n\n#if TEST\n TextReader inputStream = new StreamReader(\"..\\\\..\\\\input.txt\");\n#else\n TextReader inputStream = System.Console.In;\n#endif\n TextWriter outputStream = Console.Out;\n\n string[] tokens;\n int pointer;\n\n public string NextLine()\n {\n try\n {\n return inputStream.ReadLine();\n }\n catch (IOException)\n {\n return null;\n }\n }\n\n public string NextString()\n {\n try\n {\n while (tokens == null || pointer >= tokens.Length)\n {\n tokens = NextLine().Split(separators, StringSplitOptions.RemoveEmptyEntries);\n pointer = 0;\n }\n return tokens[pointer++];\n }\n catch (IOException)\n {\n return null;\n }\n }\n\n public int NextInt()\n {\n return int.Parse(NextString());\n }\n\n public long NextLong()\n {\n return long.Parse(NextString());\n }\n\n public void Print(string format, params object[] args)\n {\n outputStream.Write(format, args);\n }\n\n public void PrintLine(string format, params object[] args)\n {\n outputStream.WriteLine(format, args);\n }\n\n public void Print(T o)\n {\n outputStream.Write(o);\n }\n\n public void PrintLine(T o)\n {\n outputStream.WriteLine(o);\n }\n\n public void Close()\n {\n inputStream.Close();\n outputStream.Close();\n }\n }\n\n\n\n\n class Program\n {\n MyIo io = new MyIo();\n\n void Solve()\n {\n // Place your code here\n\n int a = io.NextInt();\n int b = io.NextInt();\n int mod = io.NextInt();\n\n if (b >= mod)\n {\n io.Print(2);\n return;\n }\n\n BitArray bits = new BitArray(mod);\n int result = -1;\n for (int A = 1; A <= a; A++)\n {\n long mlp = A * 1000000000L;\n long temp = mlp % mod;\n if (temp != 0)\n {\n if (mlp - temp > b)\n {\n result = A;\n break;\n }\n }\n if (bits[(int)mlp])\n break;\n bits[(int)mlp] = true;\n }\n\n if (result == -1)\n io.Print(2);\n else\n {\n string s = result.ToString();\n while (s.Length < 9)\n s = \"0\" + s;\n io.Print(1 + \" \" + s);\n }\n }\n\n static void Main(string[] args)\n {\n var p = new Program();\n\n p.Solve();\n p.io.Close();\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "c11d226c44d0cbc4ffb187c4d1a31233", "src_uid": "8b6f633802293202531264446d33fee5", "apr_id": "5fba2ee9191eb5f5cf19470b2f7eef9e", "difficulty": 1800, "tags": ["brute force", "number theory"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9993315508021391, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "using System;\nusing System.Collections;\nusing System.Collections.Generic;\n\n\nnamespace contest\n{\n class Program\n {\n static int[] arr = new int[150005];\n \n public static void Main()\n {\n int n , k;\n var inp = Console.ReadLine().Split(' ');\n n = int.Parse(inp[0]);\n k = int.Parse(inp[1]);\n inp = Console.ReadLine().Split(' ');\n for( int i = 0; i < n; i++ )\n {\n arr[i] = int.Parse(inp[i]);\n }\n int ans = int.MaxValue;\n for( int i = 0; i <= 100000; i++)\n {\n List list = new List();\n\n \n int cnt = 0;\n for( int j = 0; j < n; j++ )\n {\n cnt = 0;\n int x = arr[j];\n while( x > i)\n {\n cnt++;\n x /= 2;\n }\n if( x == i )\n {\n list.Add(cnt);\n }\n }\n list.Sort();\n if( list.Count >= k )\n {\n int sm = 0;\n for (int j = 0; j < k; j++)\n sm += list[j];\n ans = Math.Min(ans, sm);\n }\n }\n Console.WriteLine(ans);\n Console.ReadLine();\n }\n\n \n }\n}", "lang": "Mono C#", "bug_code_uid": "e582b7a5791cf9bea359056942a69f96", "src_uid": "ed1a2ae733121af6486568e528fe2d84", "apr_id": "c11afab6ead451bced0d6052c4aafc16", "difficulty": 1500, "tags": ["brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9976076555023924, "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.Text;\nusing System.Threading.Tasks;\n\nnamespace ConsoleApplication7\n{\n class Program\n {\n static void Main(string[] args)\n {\n string[] data = Console.ReadLine().Split(' ');\n int n = int.Parse(data[0]);\n int c = int.Parse(data[1]);\n data = Console.ReadLine().Split(' ');\n int[] prices = new int[n];\n for (int i = 0; i < n; i++)\n {\n prices[i] = int.Parse(data[i]);\n }\n int best = 0;\n for (int i = 0; i < n; i++)\n {\n if (prices[i] - prices[i + 1] - c > best)\n best = prices[i] - prices[i + 1] - c;\n }\n Console.WriteLine(best);\n\n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "7329d2b2928c12275f061e69852848d6", "src_uid": "411539a86f2e94eb6386bb65c9eb9557", "apr_id": "90d51da41dcb997124c3d8d46c8bfdcb", "difficulty": 1000, "tags": ["greedy", "brute force", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.7905569007263923, "equal_cnt": 10, "replace_cnt": 4, "delete_cnt": 4, "insert_cnt": 2, "fix_ops_cnt": 10, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nnamespace ASM\n{\n class Program\n {\n static void Main(string[] args)\n {\n int[] line1 = Console.ReadLine().Split(' ').Select(x => Int32.Parse(x)).ToArray();\n int n = line1[0];\n int c = line1[1];\n int[] prices = Console.ReadLine().Split(' ').Select(x => Int32.Parse(x)).ToArray();\n int lowestDifference = 0;\n\n for(int i=0;i< n-1; i++)\n {\n if (prices[i] - prices[i + 1] > lowestDifference && prices[i] - prices[i+1]>0)\n {\n lowestDifference = prices[i] - prices[i + 1];\n }\n }\n Console.WriteLine(lowestDifference - c);\n }\n }\n}", "lang": "MS C#", "bug_code_uid": "da6804fc6347bb3bb70fb70850952b50", "src_uid": "411539a86f2e94eb6386bb65c9eb9557", "apr_id": "6470df3c2a018330ea5dbda878b2f24c", "difficulty": 1000, "tags": ["greedy", "brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9903286292312247, "equal_cnt": 9, "replace_cnt": 4, "delete_cnt": 2, "insert_cnt": 2, "fix_ops_cnt": 8, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\n\nnamespace Codeforces\n{\n public class Input\n {\n private static string _line;\n\n public static bool Next()\n {\n _line = Console.ReadLine();\n return !string.IsNullOrEmpty(_line);\n }\n\n public static bool Next(out long a)\n {\n var ok = Next();\n a = ok ? long.Parse(_line) : 0;\n return ok;\n }\n\n public static bool Next(out long a, out long b)\n {\n var ok = Next();\n if (ok)\n {\n var array = _line.Split(' ').Select(long.Parse).ToArray();\n a = array[0];\n b = array[1];\n }\n else\n {\n a = b = 0;\n }\n\n return ok;\n }\n\n public static bool Next(out long a, out long b, out long c)\n {\n var ok = Next();\n if (ok)\n {\n var array = _line.Split(' ').Select(long.Parse).ToArray();\n a = array[0];\n b = array[1];\n c = array[2];\n }\n else\n {\n a = b = c = 0;\n }\n return ok;\n }\n\n public static bool Next(out long a, out long b, out long c, out long d)\n {\n var ok = Next();\n if (ok)\n {\n var array = _line.Split(' ').Select(long.Parse).ToArray();\n a = array[0];\n b = array[1];\n c = array[2];\n d = array[3];\n }\n else\n {\n a = b = c = d = 0;\n }\n return ok;\n }\n\n public static bool Next(out long a, out long b, out long c, out long d, out long e)\n {\n var ok = Next();\n if (ok)\n {\n var array = _line.Split(' ').Select(long.Parse).ToArray();\n a = array[0];\n b = array[1];\n c = array[2];\n d = array[3];\n e = array[4];\n }\n else\n {\n a = b = c = d = e = 0;\n }\n return ok;\n }\n\n public static List Numbers()\n {\n return !Next() ? new List() : _line.Split(' ').Select(long.Parse).ToList();\n }\n\n public static bool Next(out string value)\n {\n value = string.Empty;\n if (!Next()) return false;\n value = _line;\n return true;\n }\n }\n\n public class DisjointSet\n {\n private readonly int[] _parent;\n private readonly int[] _rank;\n public int Count { get; private set; }\n\n public DisjointSet(int count, int initialize = 0)\n {\n Count = count;\n _parent = new int[Count];\n _rank = new int[Count];\n for (var i = 0; i < initialize; i++) _parent[i] = i;\n }\n\n private DisjointSet(int count, int[] parent, int[] rank)\n {\n Count = count;\n _parent = parent;\n _rank = rank;\n }\n\n public void Add(int v)\n {\n _parent[v] = v;\n _rank[v] = 0;\n }\n\n public int Find_Recursive(int v)\n {\n if (_parent[v] == v) return v;\n return _parent[v] = Find(_parent[v]);\n }\n\n public int Find(int v)\n {\n if (_parent[v] == v) return v;\n var last = v;\n while (_parent[last] != last) last = _parent[last];\n while (_parent[v] != v)\n {\n var t = _parent[v];\n _parent[v] = last;\n v = t;\n }\n return last;\n }\n\n public int this[int v]\n {\n get { return Find(v); }\n set { Union(v, value); }\n }\n\n public void Union(int a, int b)\n {\n a = Find(a);\n b = Find(b);\n if (a == b) return;\n if (_rank[a] < _rank[b])\n {\n var t = _rank[a];\n _rank[a] = _rank[b];\n _rank[b] = t;\n }\n _parent[b] = a;\n if (_rank[a] == _rank[b]) _rank[a]++;\n }\n\n public int GetSetCount()\n {\n var result = 0;\n for (var i = 0; i < Count; i++)\n {\n if (_parent[i] == i) result++;\n }\n return result;\n }\n\n public DisjointSet Clone()\n {\n var rank = new int[Count];\n _rank.CopyTo(rank, 0);\n var parent = new int[Count];\n _parent.CopyTo(parent, 0);\n return new DisjointSet(Count, parent, rank);\n }\n\n public override string ToString()\n {\n return string.Join(\",\", _parent.Take(50));\n }\n }\n\n public class Matrix\n {\n public static Matrix Create(int i, int j)\n {\n var m = new Matrix(i, j);\n return m;\n }\n\n public static Matrix Create(int i)\n {\n var m = new Matrix(i, i);\n return m;\n }\n\n public long Modulo { get; set; }\n\n private readonly int _width;\n private readonly int _height;\n private readonly long[,] _data;\n public int Width{get { return _width; }}\n public int Height{get { return _height; }}\n\n private Matrix(int i, int j)\n {\n Modulo = 1000000000000000000L;\n _width = j;\n _height = i;\n _data = new long[_height, _width];\n }\n\n public static Matrix operator *(Matrix m1, Matrix m2)\n {\n if (m1.Width != m2.Height) throw new InvalidDataException(\"m1.Width != m2.Height\");\n var m = Create(m2.Width, m1.Height);\n m.Modulo = m1.Modulo;\n for (var i=0;i Numbers()\n {\n return !Next() ? new List() : _line.Split(' ').Select(long.Parse).ToList();\n }\n\n public static bool Next(out string value)\n {\n value = string.Empty;\n if (!Next()) return false;\n value = _line;\n return true;\n }\n }\n\n public class DisjointSet\n {\n private readonly int[] _parent;\n private readonly int[] _rank;\n public int Count { get; private set; }\n\n public DisjointSet(int count, int initialize = 0)\n {\n Count = count;\n _parent = new int[Count];\n _rank = new int[Count];\n for (var i = 0; i < initialize; i++) _parent[i] = i;\n }\n\n private DisjointSet(int count, int[] parent, int[] rank)\n {\n Count = count;\n _parent = parent;\n _rank = rank;\n }\n\n public void Add(int v)\n {\n _parent[v] = v;\n _rank[v] = 0;\n }\n\n public int Find_Recursive(int v)\n {\n if (_parent[v] == v) return v;\n return _parent[v] = Find(_parent[v]);\n }\n\n public int Find(int v)\n {\n if (_parent[v] == v) return v;\n var last = v;\n while (_parent[last] != last) last = _parent[last];\n while (_parent[v] != v)\n {\n var t = _parent[v];\n _parent[v] = last;\n v = t;\n }\n return last;\n }\n\n public int this[int v]\n {\n get { return Find(v); }\n set { Union(v, value); }\n }\n\n public void Union(int a, int b)\n {\n a = Find(a);\n b = Find(b);\n if (a == b) return;\n if (_rank[a] < _rank[b])\n {\n var t = _rank[a];\n _rank[a] = _rank[b];\n _rank[b] = t;\n }\n _parent[b] = a;\n if (_rank[a] == _rank[b]) _rank[a]++;\n }\n\n public int GetSetCount()\n {\n var result = 0;\n for (var i = 0; i < Count; i++)\n {\n if (_parent[i] == i) result++;\n }\n return result;\n }\n\n public DisjointSet Clone()\n {\n var rank = new int[Count];\n _rank.CopyTo(rank, 0);\n var parent = new int[Count];\n _parent.CopyTo(parent, 0);\n return new DisjointSet(Count, parent, rank);\n }\n\n public override string ToString()\n {\n return string.Join(\",\", _parent.Take(50));\n }\n }\n\n public class Matrix\n {\n public static Matrix Create(int i, int j)\n {\n var m = new Matrix(i, j);\n return m;\n }\n\n public static Matrix Create(int i)\n {\n var m = new Matrix(i, i);\n return m;\n }\n\n public long Modulo { get; set; }\n\n private readonly int _width;\n private readonly int _height;\n private readonly long[,] _data;\n public int Width{get { return _width; }}\n public int Height{get { return _height; }}\n\n private Matrix(int i, int j)\n {\n Modulo = 1000000000000000000L;\n _width = j;\n _height = i;\n _data = new long[_height, _width];\n }\n\n public static Matrix operator *(Matrix m1, Matrix m2)\n {\n if (m1.Width != m2.Height) throw new InvalidDataException(\"m1.Width != m2.Height\");\n var m = Create(m2.Width, m1.Height);\n m.Modulo = m1.Modulo;\n for (var i=0;i x).Where(x => x == 'X').Count();\n }\n Console.WriteLine(result);\n Console.ReadLine();\n }\n }\n}", "lang": "MS C#", "bug_code_uid": "191504effd51bfe142361455c5abe369", "src_uid": "5257f6b50f5a610a17c35a47b3a0da11", "apr_id": "ba598fcf43f7ea7aebe7363abcde9e47", "difficulty": 900, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.9991055456171736, "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.Text;\nusing System.Threading.Tasks;\nusing System.Text.RegularExpressions;\nusing System.IO;\nusing System.Numerics;\nusing System.Globalization;\nusing System.Threading;\n\n\nnamespace probleme {\n class Program {\n static void Main(string[] args) {\n\n Console.SetIn(new StreamReader(\"file.in\"));\n /*\n FileStream filestream = new FileStream(\"out.txt\", FileMode.Create);\n var streamwriter = new StreamWriter(filestream);\n streamwriter.AutoFlush = true;\n Console.SetOut(streamwriter);\n */\n\n char[] s = Console.ReadLine().ToCharArray();\n int ans = 0;\n for (int i = 0; i < s.Length; i++) {\n int cur = 0;\n ans++;\n int k = i;\n while (k < s.Length && cur < 5 && s[k] == s[i]) {\n cur++;\n k++;\n }\n i = k - 1;\n }\n Console.Write(ans);\n\n //Console.ReadKey();\n }\n }\n}", "lang": "MS C#", "bug_code_uid": "130cf778fd0b59b3ae612de50aaf8bb0", "src_uid": "5257f6b50f5a610a17c35a47b3a0da11", "apr_id": "cb15a93bd85de8cc4b2bec1e53410224", "difficulty": 900, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.9995804353789798, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\n\nnamespace ConsoleApplication1\n{\n internal class C\n {\n private static void Main(string[] args)\n {\n int n = 7000000;\n bool[] prime = new bool[n + 1];\n prime = Array.ConvertAll(prime, b => b = true);\n prime[0] = prime[1] = false;\n for (int i = 2; i * i <= n; ++i)\n {\n if (prime[i])\n for (int j = 2; j <= n / i; j++)\n if (prime[i * j])\n prime[i * j] = false;\n }\n\n string[] s = Console.ReadLine().Split(' ');\n\n float p = float.Parse(s[0]);\n float q = float.Parse(s[1]);\n float pq = p / q;\n int t = 1;\n int ppcnt = 0;\n int prcnt = 0;\n int ppi = 0;\n int res = 0;\n while (t < n)\n {\n if (t == pp[ppi])\n {\n ppcnt++;\n ppi++;\n }\n if (prime[t])\n prcnt++;\n if (prcnt <= pq * ppcnt)\n {\n res = t;\n }\n t++;\n }\n Console.WriteLine(\"{0}\", res);\n }\n\n static int[] pp = {1,2,3,4,5,6,7,8,9,11,22,33,44,55,66,77,88,99,101,111,121,131,141,151,161,171,181,191,202,212,222,232,242,252,262,272,282,292,303,313,323,333,343,353,363,373,383,393,404,414,424,434,444,454,464,474,484,494,505,515,525,535,545,555,565,575,585,595,606,616,626,636,646,656,666,676,686,696,707,717,727,737,747,757,767,777,787,797,808,818,828,838,848,858,868,878,888,898,909,919,929,939,949,959,969,979,989,999,1001,1111,1221,1331,1441,1551,1661,1771,1881,1991,2002,2112,2222,2332,2442,2552,2662,2772,2882,2992,3003,3113,3223,3333,3443,3553,3663,3773,3883,3993,4004,4114,4224,4334,4444,4554,4664,4774,4884,4994,5005,5115,5225,5335,5445,5555,5665,5775,5885,5995,6006,6116,6226,6336,6446,6556,6666,6776,6886,6996,7007,7117,7227,7337,7447,7557,7667,7777,7887,7997,8008,8118,8228,8338,8448,8558,8668,8778,8888,8998,9009,9119,9229,9339,9449,9559,9669,9779,9889,9999,10001,10101,10201,10301,10401,10501,10601,10701,10801,10901,11011,11111,11211,11311,11411,11511,11611,11711,11811,11911,12021,12121,12221,12321,12421,12521,12621,12721,12821,12921,13031,13131,13231,13331,13431,13531,13631,13731,13831,13931,14041,14141,14241,14341,14441,14541,14641,14741,14841,14941,15051,15151,15251,15351,15451,15551,15651,15751,15851,15951,16061,16161,16261,16361,16461,16561,16661,16761,16861,16961,17071,17171,17271,17371,17471,17571,17671,17771,17871,17971,18081,18181,18281,18381,18481,18581,18681,18781,18881,18981,19091,19191,19291,19391,19491,19591,19691,19791,19891,19991,20002,20102,20202,20302,20402,20502,20602,20702,20802,20902,21012,21112,21212,21312,21412,21512,21612,21712,21812,21912,22022,22122,22222,22322,22422,22522,22622,22722,22822,22922,23032,23132,23232,23332,23432,23532,23632,23732,23832,23932,24042,24142,24242,24342,24442,24542,24642,24742,24842,24942,25052,25152,25252,25352,25452,25552,25652,25752,25852,25952,26062,26162,26262,26362,26462,26562,26662,26762,26862,26962,27072,27172,27272,27372,27472,27572,27672,27772,27872,27972,28082,28182,28282,28382,28482,28582,28682,28782,28882,28982,29092,29192,29292,29392,29492,29592,29692,29792,29892,29992,30003,30103,30203,30303,30403,30503,30603,30703,30803,30903,31013,31113,31213,31313,31413,31513,31613,31713,31813,31913,32023,32123,32223,32323,32423,32523,32623,32723,32823,32923,33033,33133,33233,33333,33433,33533,33633,33733,33833,33933,34043,34143,34243,34343,34443,34543,34643,34743,34843,34943,35053,35153,35253,35353,35453,35553,35653,35753,35853,35953,36063,36163,36263,36363,36463,36563,36663,36763,36863,36963,37073,37173,37273,37373,37473,37573,37673,37773,37873,37973,38083,38183,38283,38383,38483,38583,38683,38783,38883,38983,39093,39193,39293,39393,39493,39593,39693,39793,39893,39993,40004,40104,40204,40304,40404,40504,40604,40704,40804,40904,41014,41114,41214,41314,41414,41514,41614,41714,41814,41914,42024,42124,42224,42324,42424,42524,42624,42724,42824,42924,43034,43134,43234,43334,43434,43534,43634,43734,43834,43934,44044,44144,44244,44344,44444,44544,44644,44744,44844,44944,45054,45154,45254,45354,45454,45554,45654,45754,45854,45954,46064,46164,46264,46364,46464,46564,46664,46764,46864,46964,47074,47174,47274,47374,47474,47574,47674,47774,47874,47974,48084,48184,48284,48384,48484,48584,48684,48784,48884,48984,49094,49194,49294,49394,49494,49594,49694,49794,49894,49994,50005,50105,50205,50305,50405,50505,50605,50705,50805,50905,51015,51115,51215,51315,51415,51515,51615,51715,51815,51915,52025,52125,52225,52325,52425,52525,52625,52725,52825,52925,53035,53135,53235,53335,53435,53535,53635,53735,53835,53935,54045,54145,54245,54345,54445,54545,54645,54745,54845,54945,55055,55155,55255,55355,55455,55555,55655,55755,55855,55955,56065,56165,56265,56365,56465,56565,56665,56765,56865,56965,57075,57175,57275,57375,57475,57575,57675,57775,57875,57975,58085,58185,58285,58385,58485,58585,58685,58785,58885,58985,59095,59195,59295,59395,59495,59595,59695,59795,59895,59995,60006,60106,60206,60306,60406,60506,60606,60706,60806,60906,61016,61116,61216,61316,61416,61516,61616,61716,61816,61916,62026,62126,62226,62326,62426,62526,62626,62726,62826,62926,63036,63136,63236,63336,63436,63536,63636,63736,63836,63936,64046,64146,64246,64346,64446,64546,64646,64746,64846,64946,65056,65156,65256,65356,65456,65556,65656,65756,65856,65956,66066,66166,66266,66366,66466,66566,66666,66766,66866,66966,67076,67176,67276,67376,67476,67576,67676,67776,67876,67976,68086,68186,68286,68386,68486,68586,68686,68786,68886,68986,69096,69196,69296,69396,69496,69596,69696,69796,69896,69996,70007,70107,70207,70307,70407,70507,70607,70707,70807,70907,71017,71117,71217,71317,71417,71517,71617,71717,71817,71917,72027,72127,72227,72327,72427,72527,72627,72727,72827,72927,73037,73137,73237,73337,73437,73537,73637,73737,73837,73937,74047,74147,74247,74347,74447,74547,74647,74747,74847,74947,75057,75157,75257,75357,75457,75557,75657,75757,75857,75957,76067,76167,76267,76367,76467,76567,76667,76767,76867,76967,77077,77177,77277,77377,77477,77577,77677,77777,77877,77977,78087,78187,78287,78387,78487,78587,78687,78787,78887,78987,79097,79197,79297,79397,79497,79597,79697,79797,79897,79997,80008,80108,80208,80308,80408,80508,80608,80708,80808,80908,81018,81118,81218,81318,81418,81518,81618,81718,81818,81918,82028,82128,82228,82328,82428,82528,82628,82728,82828,82928,83038,83138,83238,83338,83438,83538,83638,83738,83838,83938,84048,84148,84248,84348,84448,84548,84648,84748,84848,84948,85058,85158,85258,85358,85458,85558,85658,85758,85858,85958,86068,86168,86268,86368,86468,86568,86668,86768,86868,86968,87078,87178,87278,87378,87478,87578,87678,87778,87878,87978,88088,88188,88288,88388,88488,88588,88688,88788,88888,88988,89098,89198,89298,89398,89498,89598,89698,89798,89898,89998,90009,90109,90209,90309,90409,90509,90609,90709,90809,90909,91019,91119,91219,91319,91419,91519,91619,91719,91819,91919,92029,92129,92229,92329,92429,92529,92629,92729,92829,92929,93039,93139,93239,93339,93439,93539,93639,93739,93839,93939,94049,94149,94249,94349,94449,94549,94649,94749,94849,94949,95059,95159,95259,95359,95459,95559,95659,95759,95859,95959,96069,96169,96269,96369,96469,96569,96669,96769,96869,96969,97079,97179,97279,97379,97479,97579,97679,97779,97879,97979,98089,98189,98289,98389,98489,98589,98689,98789,98889,98989,99099,99199,99299,99399,99499,99599,99699,99799,99899,99999,100001,101101,102201,103301,104401,105501,106601,107701,108801,109901,110011,111111,112211,113311,114411,115511,116611,117711,118811,119911,120021,121121,122221,123321,124421,125521,126621,127721,128821,129921,130031,131131,132231,133331,134431,135531,136631,137731,138831,139931,140041,141141,142241,143341,144441,145541,146641,147741,148841,149941,150051,151151,152251,153351,154451,155551,156651,157751,158851,159951,160061,161161,162261,163361,164461,165561,166661,167761,168861,169961,170071,171171,172271,173371,174471,175571,176671,177771,178871,179971,180081,181181,182281,183381,184481,185581,186681,187781,188881,189981,190091,191191,192291,193391,194491,195591,196691,197791,198891,199991,200002,201102,202202,203302,204402,205502,206602,207702,208802,209902,210012,211112,212212,213312,214412,215512,216612,217712,218812,219912,220022,221122,222222,223322,224422,225522,226622,227722,228822,229922,230032,231132,232232,233332,234432,235532,236632,237732,238832,239932,240042,241142,242242,243342,244442,245542,246642,247742,248842,249942,250052,251152,252252,253352,254452,255552,256652,257752,258852,259952,260062,261162,262262,263362,264462,265562,266662,267762,268862,269962,270072,271172,272272,273372,274472,275572,276672,277772,278872,279972,280082,281182,282282,283382,284482,285582,286682,287782,288882,289982,290092,291192,292292,293392,294492,295592,296692,297792,298892,299992,300003,301103,302203,303303,304403,305503,306603,307703,308803,309903,310013,311113,312213,313313,314413,315513,316613,317713,318813,319913,320023,321123,322223,323323,324423,325523,326623,327723,328823,329923,330033,331133,332233,333333,334433,335533,336633,337733,338833,339933,340043,341143,342243,343343,344443,345543,346643,347743,348843,349943,350053,351153,352253,353353,354453,355553,356653,357753,358853,359953,360063,361163,362263,363363,364463,365563,366663,367763,368863,369963,370073,371173,372273,373373,374473,375573,376673,377773,378873,379973,380083,381183,382283,383383,384483,385583,386683,387783,388883,389983,390093,391193,392293,393393,394493,395593,396693,397793,398893,399993,400004,401104,402204,403304,404404,405504,406604,407704,408804,409904,410014,411114,412214,413314,414414,415514,416614,417714,418814,419914,420024,421124,422224,423324,424424,425524,426624,427724,428824,429924,430034,431134,432234,433334,434434,435534,436634,437734,438834,439934,440044,441144,442244,443344,444444,445544,446644,447744,448844,449944,450054,451154,452254,453354,454454,455554,456654,457754,458854,459954,460064,461164,462264,463364,464464,465564,466664,467764,468864,469964,470074,471174,472274,473374,474474,475574,476674,477774,478874,479974,480084,481184,482284,483384,484484,485584,486684,487784,488884,489984,490094,491194,492294,493394,494494,495594,496694,497794,498894,499994,500005,501105,502205,503305,504405,505505,506605,507705,508805,509905,510015,511115,512215,513315,514415,515515,516615,517715,518815,519915,520025,521125,522225,523325,524425,525525,526625,527725,528825,529925,530035,531135,532235,533335,534435,535535,536635,537735,538835,539935,540045,541145,542245,543345,544445,545545,546645,547745,548845,549945,550055,551155,552255,553355,554455,555555,556655,557755,558855,559955,560065,561165,562265,563365,564465,565565,566665,567765,568865,569965,570075,571175,572275,573375,574475,575575,576675,577775,578875,579975,580085,581185,582285,583385,584485,585585,586685,587785,588885,589985,590095,591195,592295,593395,594495,595595,596695,597795,598895,599995,600006,601106,602206,603306,604406,605506,606606,607706,608806,609906,610016,611116,612216,613316,614416,615516,616616,617716,618816,619916,620026,621126,622226,623326,624426,625526,626626,627726,628826,629926,630036,631136,632236,633336,634436,635536,636636,637736,638836,639936,640046,641146,642246,643346,644446,645546,646646,647746,648846,649946,650056,651156,652256,653356,654456,655556,656656,657756,658856,659956,660066,661166,662266,663366,664466,665566,666666,667766,668866,669966,670076,671176,672276,673376,674476,675576,676676,677776,678876,679976,680086,681186,682286,683386,684486,685586,686686,687786,688886,689986,690096,691196,692296,693396,694496,695596,696696,697796,698896,699996,700007,701107,702207,703307,704407,705507,706607,707707,708807,709907,710017,711117,712217,713317,714417,715517,716617,717717,718817,719917,720027,721127,722227,723327,724427,725527,726627,727727,728827,729927,730037,731137,732237,733337,734437,735537,736637,737737,738837,739937,740047,741147,742247,743347,744447,745547,746647,747747,748847,749947,750057,751157,752257,753357,754457,755557,756657,757757,758857,759957,760067,761167,762267,763367,764467,765567,766667,767767,768867,769967,770077,771177,772277,773377,774477,775577,776677,777777,778877,779977,780087,781187,782287,783387,784487,785587,786687,787787,788887,789987,790097,791197,792297,793397,794497,795597,796697,797797,798897,799997,800008,801108,802208,803308,804408,805508,806608,807708,808808,809908,810018,811118,812218,813318,814418,815518,816618,817718,818818,819918,820028,821128,822228,823328,824428,825528,826628,827728,828828,829928,830038,831138,832238,833338,834438,835538,836638,837738,838838,839938,840048,841148,842248,843348,844448,845548,846648,847748,848848,849948,850058,851158,852258,853358,854458,855558,856658,857758,858858,859958,860068,861168,862268,863368,864468,865568,866668,867768,868868,869968,870078,871178,872278,873378,874478,875578,876678,877778,878878,879978,880088,881188,882288,883388,884488,885588,886688,887788,888888,889988,890098,891198,892298,893398,894498,895598,896698,897798,898898,899998,900009,901109,902209,903309,904409,905509,906609,907709,908809,909909,910019,911119,912219,913319,914419,915519,916619,917719,918819,919919,920029,921129,922229,923329,924429,925529,926629,927729,928829,929929,930039,931139,932239,933339,934439,935539,936639,937739,938839,939939,940049,941149,942249,943349,944449,945549,946649,947749,948849,949949,950059,951159,952259,953359,954459,955559,956659,957759,958859,959959,960069,961169,962269,963369,964469,965569,966669,967769,968869,969969,970079,971179,972279,973379,974479,975579,976679,977779,978879,979979,980089,981189,982289,983389,984489,985589,986689,987789,988889,989989,990099,991199,992299,993399,994499,995599,996699,997799,998899,999999,1000001,1001001,1002001,1003001,1004001,1005001,1006001,1007001,1008001,1009001,1010101,1011101,1012101,1013101,1014101,1015101,1016101,1017101,1018101,1019101,1020201,1021201,1022201,1023201,1024201,1025201,1026201,1027201,1028201,1029201,1030301,1031301,1032301,1033301,1034301,1035301,1036301,1037301,1038301,1039301,1040401,1041401,1042401,1043401,1044401,1045401,1046401,1047401,1048401,1049401,1050501,1051501,1052501,1053501,1054501,1055501,1056501,1057501,1058501,1059501,1060601,1061601,1062601,1063601,1064601,1065601,1066601,1067601,1068601,1069601,1070701,1071701,1072701,1073701,1074701,1075701,1076701,1077701,1078701,1079701,1080801,1081801,1082801,1083801,1084801,1085801,1086801,1087801,1088801,1089801,1090901,1091901,1092901,1093901,1094901,1095901,1096901,1097901,1098901,1099901,1100011,1101011,1102011,1103011,1104011,1105011,1106011,1107011,1108011,1109011,1110111,1111111,1112111,1113111,1114111,1115111,1116111,1117111,1118111,1119111,1120211,1121211,1122211,1123211,1124211,1125211,1126211,1127211,1128211,1129211,1130311,1131311,1132311,1133311,1134311,1135311,1136311,1137311,1138311,1139311,1140411,1141411,1142411,1143411,1144411,1145411,1146411,1147411,1148411,1149411,1150511,1151511,1152511,1153511,1154511,1155511,1156511,1157511,1158511,1159511,1160611,1161611,1162611,1163611,1164611,1165611,1166611,1167611,1168611,1169611,1170711,1171711,1172711,1173711,1174711,1175711,1176711,1177711,1178711,1179711,1180811,1181811,1182811,1183811,1184811,1185811,1186811,1187811,1188811,1189811,1190911,1191911,1192911,1193911,1194911,1195911,1196911,1197911,1198911,1199911,1200021,1201021,1202021,1203021,1204021,1205021,1206021,1207021,1208021,1209021,1210121,1211121,1212121,1213121,1214121,1215121,1216121,1217121,1218121,1219121,1220221,1221221,1222221,1223221,1224221,1225221,1226221,1227221,1228221,1229221,1230321,1231321,1232321,1233321,1234321,1235321,1236321,1237321,1238321,1239321,1240421,1241421,1242421,1243421,1244421,1245421,1246421,1247421,1248421,1249421,1250521,1251521,1252521,1253521,1254521,1255521,1256521,1257521,1258521,1259521,1260621,1261621,1262621,1263621,1264621,1265621,1266621,1267621,1268621,1269621,1270721,1271721,1272721,1273721,1274721,1275721,1276721,1277721,1278721,1279721,1280821,1281821,1282821,1283821,1284821,1285821,1286821,1287821,1288821,1289821,1290921,1291921,1292921,1293921,1294921,1295921,1296921,1297921,1298921,1299921,1300031,1301031,1302031,1303031,1304031,1305031,1306031,1307031,1308031,1309031,1310131,1311131,1312131,1313131,1314131,1315131,1316131,1317131,1318131,1319131,1320231,1321231,1322231,1323231,1324231,1325231,1326231,1327231,1328231,1329231,1330331,1331331,1332331,1333331,1334331,1335331,1336331,1337331,1338331,1339331,1340431,1341431,1342431,1343431,1344431,1345431,1346431,1347431,1348431,1349431,1350531,1351531,1352531,1353531,1354531,1355531,1356531,1357531,1358531,1359531,1360631,1361631,1362631,1363631,1364631,1365631,1366631,1367631,1368631,1369631,1370731,1371731,1372731,1373731,1374731,1375731,1376731,1377731,1378731,1379731,1380831,1381831,1382831,1383831,1384831,1385831,1386831,1387831,1388831,1389831,1390931,1391931,1392931,1393931,1394931,1395931,1396931,1397931,1398931,1399931,1400041,1401041,1402041,1403041,1404041,1405041,1406041,1407041,1408041,1409041,1410141,1411141,1412141,1413141,1414141,1415141,1416141,1417141,1418141,1419141,1420241,1421241,1422241,1423241,1424241,1425241,1426241,1427241,1428241,1429241,1430341,1431341,1432341,1433341,1434341,1435341,1436341,1437341,1438341,1439341,1440441,1441441,1442441,1443441,1444441,1445441,1446441,1447441,1448441,1449441,1450541,1451541,1452541,1453541,1454541,1455541,1456541,1457541,1458541,1459541,1460641,1461641,1462641,1463641,1464641,1465641,1466641,1467641,1468641,1469641,1470741,1471741,1472741,1473741,1474741,1475741,1476741,1477741,1478741,1479741,1480841,1481841,1482841,1483841,1484841,1485841,1486841,1487841,1488841,1489841,1490941,1491941,1492941,1493941,1494941,1495941,1496941,1497941,1498941,1499941,1500051,1501051,1502051,1503051,1504051,1505051,1506051,1507051,1508051,1509051,1510151,1511151,1512151,1513151,1514151,1515151,1516151,1517151,1518151,1519151,1520251,1521251,1522251,1523251,1524251,1525251,1526251,1527251,1528251,1529251,1530351,1531351,1532351,1533351,1534351,1535351,1536351,1537351,1538351,1539351,1540451,1541451,1542451,1543451,1544451,1545451,1546451,1547451,1548451,1549451,1550551,1551551,1552551,1553551,1554551,1555551,1556551,1557551,1558551,1559551,1560651,1561651,1562651,1563651,1564651,1565651,1566651,1567651,1568651,1569651,1570751,1571751,1572751,1573751,1574751,1575751,1576751,1577751,1578751,1579751,1580851,1581851,1582851,1583851,1584851,1585851,1586851,1587851,1588851,1589851,1590951,1591951,1592951,1593951,1594951,1595951,1596951,1597951,1598951,1599951,1600061,1601061,1602061,1603061,1604061,1605061,1606061,1607061,1608061,1609061,1610161,1611161,1612161,1613161,1614161,1615161,1616161,1617161,1618161,1619161,1620261,1621261,1622261,1623261,1624261,1625261,1626261,1627261,1628261,1629261,1630361,1631361,1632361,1633361,1634361,1635361,1636361,1637361,1638361,1639361,1640461,1641461,1642461,1643461,1644461,1645461,1646461,1647461,1648461,1649461,1650561,1651561,1652561,1653561,1654561,1655561,1656561,1657561,1658561,1659561,1660661,1661661,1662661,1663661,1664661,1665661,1666661,1667661,1668661,1669661,1670761,1671761,1672761,1673761,1674761,1675761,1676761,1677761,1678761,1679761,1680861,1681861,1682861,1683861,1684861,1685861,1686861,1687861,1688861,1689861,1690961,1691961,1692961,1693961,1694961,1695961,1696961,1697961,1698961,1699961,1700071,1701071,1702071,1703071,1704071,1705071,1706071,1707071,1708071,1709071,1710171,1711171,1712171,1713171,1714171,1715171,1716171,1717171,1718171,1719171,1720271,1721271,1722271,1723271,1724271,1725271,1726271,1727271,1728271,1729271,1730371,1731371,1732371,1733371,1734371,1735371,1736371,1737371,1738371,1739371,1740471,1741471,1742471,1743471,1744471,1745471,1746471,1747471,1748471,1749471,1750571,1751571,1752571,1753571,1754571,1755571,1756571,1757571,1758571,1759571,1760671,1761671,1762671,1763671,1764671,1765671,1766671,1767671,1768671,1769671,1770771,1771771,1772771,1773771,1774771,1775771,1776771,1777771,1778771,1779771,1780871,1781871,1782871,1783871,1784871,1785871,1786871,1787871,1788871,1789871,1790971,1791971,1792971,1793971,1794971,1795971,1796971,1797971,1798971,1799971,1800081,1801081,1802081,1803081,1804081,1805081,1806081,1807081,1808081,1809081,1810181,1811181,1812181,1813181,1814181,1815181,1816181,1817181,1818181,1819181,1820281,1821281,1822281,1823281,1824281,1825281,1826281,1827281,1828281,1829281,1830381,1831381,1832381,1833381,1834381,1835381,1836381,1837381,1838381,1839381,1840481,1841481,1842481,1843481,1844481,1845481,1846481,1847481,1848481,1849481,1850581,1851581,1852581,1853581,1854581,1855581,1856581,1857581,1858581,1859581,1860681,1861681,1862681,1863681,1864681,1865681,1866681,1867681,1868681,1869681,1870781,1871781,1872781,1873781,1874781,1875781,1876781,1877781,1878781,1879781,1880881,1881881,1882881,1883881,1884881,1885881,1886881,1887881,1888881,1889881,1890981,1891981,1892981,1893981,1894981,1895981,1896981,1897981,1898981,1899981,1900091,1901091,1902091,1903091,1904091,1905091,1906091,1907091,1908091,1909091,1910191,1911191,1912191,1913191,1914191,1915191,1916191,1917191,1918191,1919191,1920291,1921291,1922291,1923291,1924291,1925291,1926291,1927291,1928291,1929291,1930391,1931391,1932391,1933391,1934391,1935391,1936391,1937391,1938391,1939391,1940491,1941491,1942491,1943491,1944491,1945491,1946491,1947491,1948491,1949491,1950591,1951591,1952591,1953591,1954591,1955591,1956591,1957591,1958591,1959591,1960691,1961691,1962691,1963691,1964691,1965691,1966691,1967691,1968691,1969691,1970791,1971791,1972791,1973791,1974791,1975791,1976791,1977791,1978791,1979791,1980891,1981891,1982891,1983891,1984891,1985891,1986891,1987891,1988891,1989891,1990991,1991991,1992991,1993991,1994991,1995991,1996991,1997991,1998991,1999991,2000002,2001002,2002002,2003002,2004002,2005002,2006002,2007002,2008002,2009002,2010102,2011102,2012102,2013102,2014102,2015102,2016102,2017102,2018102,2019102,2020202,2021202,2022202,2023202,2024202,2025202,2026202,2027202,2028202,2029202,2030302,2031302,2032302,2033302,2034302,2035302,2036302,2037302,2038302,2039302,2040402,2041402,2042402,2043402,2044402,2045402,2046402,2047402,2048402,2049402,2050502,2051502,2052502,2053502,2054502,2055502,2056502,2057502,2058502,2059502,2060602,2061602,2062602,2063602,2064602,2065602,2066602,2067602,2068602,2069602,2070702,2071702,2072702,2073702,2074702,2075702,2076702,2077702,2078702,2079702,2080802,2081802,2082802,2083802,2084802,2085802,2086802,2087802,2088802,2089802,2090902,2091902,2092902,2093902,2094902,2095902,2096902,2097902,2098902,2099902,2100012,2101012,2102012,2103012,2104012,2105012,2106012,2107012,2108012,2109012,2110112,2111112,2112112,2113112,2114112,2115112,2116112,2117112,2118112,2119112,2120212,2121212,2122212,2123212,2124212,2125212,2126212,2127212,2128212,2129212,2130312,2131312,2132312,2133312,2134312,2135312,2136312,2137312,2138312,2139312,2140412,2141412,2142412,2143412,2144412,2145412,2146412,2147412,2148412,2149412,2150512,2151512,2152512,2153512,2154512,2155512,2156512,2157512,2158512,2159512,2160612,2161612,2162612,2163612,2164612,2165612,2166612,2167612,2168612,2169612,2170712,2171712,2172712,2173712,2174712,2175712,2176712,2177712,2178712,2179712,2180812,2181812,2182812,2183812,2184812,2185812,2186812,2187812,2188812,2189812,2190912,2191912,2192912,2193912,2194912,2195912,2196912,2197912,2198912,2199912,2200022,2201022,2202022,2203022,2204022,2205022,2206022,2207022,2208022,2209022,2210122,2211122,2212122,2213122,2214122,2215122,2216122,2217122,2218122,2219122,2220222,2221222,2222222,2223222,2224222,2225222,2226222,2227222,2228222,2229222,2230322,2231322,2232322,2233322,2234322,2235322,2236322,2237322,2238322,2239322,2240422,2241422,2242422,2243422,2244422,2245422,2246422,2247422,2248422,2249422,2250522,2251522,2252522,2253522,2254522,2255522,2256522,2257522,2258522,2259522,2260622,2261622,2262622,2263622,2264622,2265622,2266622,2267622,2268622,2269622,2270722,2271722,2272722,2273722,2274722,2275722,2276722,2277722,2278722,2279722,2280822,2281822,2282822,2283822,2284822,2285822,2286822,2287822,2288822,2289822,2290922,2291922,2292922,2293922,2294922,2295922,2296922,2297922,2298922,2299922,2300032,2301032,2302032,2303032,2304032,2305032,2306032,2307032,2308032,2309032,2310132,2311132,2312132,2313132,2314132,2315132,2316132,2317132,2318132,2319132,2320232,2321232,2322232,2323232,2324232,2325232,2326232,2327232,2328232,2329232,2330332,2331332,2332332,2333332,2334332,2335332,2336332,2337332,2338332,2339332,2340432,2341432,2342432,2343432,2344432,2345432,2346432,2347432,2348432,2349432,2350532,2351532,2352532,2353532,2354532,2355532,2356532,2357532,2358532,2359532,2360632,2361632,2362632,2363632,2364632,2365632,2366632,2367632,2368632,2369632,2370732,2371732,2372732,2373732,2374732,2375732,2376732,2377732,2378732,2379732,2380832,2381832,2382832,2383832,2384832,2385832,2386832,2387832,2388832,2389832,2390932,2391932,2392932,2393932,2394932,2395932,2396932,2397932,2398932,2399932,2400042,2401042,2402042,2403042,2404042,2405042,2406042,2407042,2408042,2409042,2410142,2411142,2412142,2413142,2414142,2415142,2416142,2417142,2418142,2419142,2420242,2421242,2422242,2423242,2424242,2425242,2426242,2427242,2428242,2429242,2430342,2431342,2432342,2433342,2434342,2435342,2436342,2437342,2438342,2439342,2440442,2441442,2442442,2443442,2444442,2445442,2446442,2447442,2448442,2449442,2450542,2451542,2452542,2453542,2454542,2455542,2456542,2457542,2458542,2459542,2460642,2461642,2462642,2463642,2464642,2465642,2466642,2467642,2468642,2469642,2470742,2471742,2472742,2473742,2474742,2475742,2476742,2477742,2478742,2479742,2480842,2481842,2482842,2483842,2484842,2485842,2486842,2487842,2488842,2489842,2490942,2491942,2492942,2493942,2494942,2495942,2496942,2497942,2498942,2499942,2500052,2501052,2502052,2503052,2504052,2505052,2506052,2507052,2508052,2509052,2510152,2511152,2512152,2513152,2514152,2515152,2516152,2517152,2518152,2519152,2520252,2521252,2522252,2523252,2524252,2525252,2526252,2527252,2528252,2529252,2530352,2531352,2532352,2533352,2534352,2535352,2536352,2537352,2538352,2539352,2540452,2541452,2542452,2543452,2544452,2545452,2546452,2547452,2548452,2549452,2550552,2551552,2552552,2553552,2554552,2555552,2556552,2557552,2558552,2559552,2560652,2561652,2562652,2563652,2564652,2565652,2566652,2567652,2568652,2569652,2570752,2571752,2572752,2573752,2574752,2575752,2576752,2577752,2578752,2579752,2580852,2581852,2582852,2583852,2584852,2585852,2586852,2587852,2588852,2589852,2590952,2591952,2592952,2593952,2594952,2595952,2596952,2597952,2598952,2599952,2600062,2601062,2602062,2603062,2604062,2605062,2606062,2607062,2608062,2609062,2610162,2611162,2612162,2613162,2614162,2615162,2616162,2617162,2618162,2619162,2620262,2621262,2622262,2623262,2624262,2625262,2626262,2627262,2628262,2629262,2630362,2631362,2632362,2633362,2634362,2635362,2636362,2637362,2638362,2639362,2640462,2641462,2642462,2643462,2644462,2645462,2646462,2647462,2648462,2649462,2650562,2651562,2652562,2653562,2654562,2655562,2656562,2657562,2658562,2659562,2660662,2661662,2662662,2663662,2664662,2665662,2666662,2667662,2668662,2669662,2670762,2671762,2672762,2673762,2674762,2675762,2676762,2677762,2678762,2679762,2680862,2681862,2682862,2683862,2684862,2685862,2686862,2687862,2688862,2689862,2690962,2691962,2692962,2693962,2694962,2695962,2696962,2697962,2698962,2699962,2700072,2701072,2702072,2703072,2704072,2705072,2706072,2707072,2708072,2709072,2710172,2711172,2712172,2713172,2714172,2715172,2716172,2717172,2718172,2719172,2720272,2721272,2722272,2723272,2724272,2725272,2726272,2727272,2728272,2729272,2730372,2731372,2732372,2733372,2734372,2735372,2736372,2737372,2738372,2739372,2740472,2741472,2742472,2743472,2744472,2745472,2746472,2747472,2748472,2749472,2750572,2751572,2752572,2753572,2754572,2755572,2756572,2757572,2758572,2759572,2760672,2761672,2762672,2763672,2764672,2765672,2766672,2767672,2768672,2769672,2770772,2771772,2772772,2773772,2774772,2775772,2776772,2777772,2778772,2779772,2780872,2781872,2782872,2783872,2784872,2785872,2786872,2787872,2788872,2789872,2790972,2791972,2792972,2793972,2794972,2795972,2796972,2797972,2798972,2799972,2800082,2801082,2802082,2803082,2804082,2805082,2806082,2807082,2808082,2809082,2810182,2811182,2812182,2813182,2814182,2815182,2816182,2817182,2818182,2819182,2820282,2821282,2822282,2823282,2824282,2825282,2826282,2827282,2828282,2829282,2830382,2831382,2832382,2833382,2834382,2835382,2836382,2837382,2838382,2839382,2840482,2841482,2842482,2843482,2844482,2845482,2846482,2847482,2848482,2849482,2850582,2851582,2852582,2853582,2854582,2855582,2856582,2857582,2858582,2859582,2860682,2861682,2862682,2863682,2864682,2865682,2866682,2867682,2868682,2869682,2870782,2871782,2872782,2873782,2874782,2875782,2876782,2877782,2878782,2879782,2880882,2881882,2882882,2883882,2884882,2885882,2886882,2887882,2888882,2889882,2890982,2891982,2892982,2893982,2894982,2895982,2896982,2897982,2898982,2899982,2900092,2901092,2902092,2903092,2904092,2905092,2906092,2907092,2908092,2909092,2910192,2911192,2912192,2913192,2914192,2915192,2916192,2917192,2918192,2919192,2920292,2921292,2922292,2923292,2924292,2925292,2926292,2927292,2928292,2929292,2930392,2931392,2932392,2933392,2934392,2935392,2936392,2937392,2938392,2939392,2940492,2941492,2942492,2943492,2944492,2945492,2946492,2947492,2948492,2949492,2950592,2951592,2952592,2953592,2954592,2955592,2956592,2957592,2958592,2959592,2960692,2961692,2962692,2963692,2964692,2965692,2966692,2967692,2968692,2969692,2970792,2971792,2972792,2973792,2974792,2975792,2976792,2977792,2978792,2979792,2980892,2981892,2982892,2983892,2984892,2985892,2986892,2987892,2988892,2989892,2990992,2991992,2992992,2993992,2994992,2995992,2996992,2997992,2998992,2999992,3000003,3001003,3002003,3003003,3004003,3005003,3006003,3007003,3008003,3009003,3010103,3011103,3012103,3013103,3014103,3015103,3016103,3017103,3018103,3019103,3020203,3021203,3022203,3023203,3024203,3025203,3026203,3027203,3028203,3029203,3030303,3031303,3032303,3033303,3034303,3035303,3036303,3037303,3038303,3039303,3040403,3041403,3042403,3043403,3044403,3045403,3046403,3047403,3048403,3049403,3050503,3051503,3052503,3053503,3054503,3055503,3056503,3057503,3058503,3059503,3060603,3061603,3062603,3063603,3064603,3065603,3066603,3067603,3068603,3069603,3070703,3071703,3072703,3073703,3074703,3075703,3076703,3077703,3078703,3079703,3080803,3081803,3082803,3083803,3084803,3085803,3086803,3087803,3088803,3089803,3090903,3091903,3092903,3093903,3094903,3095903,3096903,3097903,3098903,3099903,3100013,3101013,3102013,3103013,3104013,3105013,3106013,3107013,3108013,3109013,3110113,3111113,3112113,3113113,3114113,3115113,3116113,3117113,3118113,3119113,3120213,3121213,3122213,3123213,3124213,3125213,3126213,3127213,3128213,3129213,3130313,3131313,3132313,3133313,3134313,3135313,3136313,3137313,3138313,3139313,3140413,3141413,3142413,3143413,3144413,3145413,3146413,3147413,3148413,3149413,3150513,3151513,3152513,3153513,3154513,3155513,3156513,3157513,3158513,3159513,3160613,3161613,3162613,3163613,3164613,3165613,3166613,3167613,3168613,3169613,3170713,3171713,3172713,3173713,3174713,3175713,3176713,3177713,3178713,3179713,3180813,3181813,3182813,3183813,3184813,3185813,3186813,3187813,3188813,3189813,3190913,3191913,3192913,3193913,3194913,3195913,3196913,3197913,3198913,3199913,3200023,3201023,3202023,3203023,3204023,3205023,3206023,3207023,3208023,3209023,3210123,3211123,3212123,3213123,3214123,3215123,3216123,3217123,3218123,3219123,3220223,3221223,3222223,3223223,3224223,3225223,3226223,3227223,3228223,3229223,3230323,3231323,3232323,3233323,3234323,3235323,3236323,3237323,3238323,3239323,3240423,3241423,3242423,3243423,3244423,3245423,3246423,3247423,3248423,3249423,3250523,3251523,3252523,3253523,3254523,3255523,3256523,3257523,3258523,3259523,3260623,3261623,3262623,3263623,3264623,3265623,3266623,3267623,3268623,3269623,3270723,3271723,3272723,3273723,3274723,3275723,3276723,3277723,3278723,3279723,3280823,3281823,3282823,3283823,3284823,3285823,3286823,3287823,3288823,3289823,3290923,3291923,3292923,3293923,3294923,3295923,3296923,3297923,3298923,3299923,3300033,3301033,3302033,3303033,3304033,3305033,3306033,3307033,3308033,3309033,3310133,3311133,3312133,3313133,3314133,3315133,3316133,3317133,3318133,3319133,3320233,3321233,3322233,3323233,3324233,3325233,3326233,3327233,3328233,3329233,3330333,3331333,3332333,3333333,3334333,3335333,3336333,3337333,3338333,3339333,3340433,3341433,3342433,3343433,3344433,3345433,3346433,3347433,3348433,3349433,3350533,3351533,3352533,3353533,3354533,3355533,3356533,3357533,3358533,3359533,3360633,3361633,3362633,3363633,3364633,3365633,3366633,3367633,3368633,3369633,3370733,3371733,3372733,3373733,3374733,3375733,3376733,3377733,3378733,3379733,3380833,3381833,3382833,3383833,3384833,3385833,3386833,3387833,3388833,3389833,3390933,3391933,3392933,3393933,3394933,3395933,3396933,3397933,3398933,3399933,3400043,3401043,3402043,3403043,3404043,3405043,3406043,3407043,3408043,3409043,3410143,3411143,3412143,3413143,3414143,3415143,3416143,3417143,3418143,3419143,3420243,3421243,3422243,3423243,3424243,3425243,3426243,3427243,3428243,3429243,3430343,3431343,3432343,3433343,3434343,3435343,3436343,3437343,3438343,3439343,3440443,3441443,3442443,3443443,3444443,3445443,3446443,3447443,3448443,3449443,3450543,3451543,3452543,3453543,3454543,3455543,3456543,3457543,3458543,3459543,3460643,3461643,3462643,3463643,3464643,3465643,3466643,3467643,3468643,3469643,3470743,3471743,3472743,3473743,3474743,3475743,3476743,3477743,3478743,3479743,3480843,3481843,3482843,3483843,3484843,3485843,3486843,3487843,3488843,3489843,3490943,3491943,3492943,3493943,3494943,3495943,3496943,3497943,3498943,3499943,3500053,3501053,3502053,3503053,3504053,3505053,3506053,3507053,3508053,3509053,3510153,3511153,3512153,3513153,3514153,3515153,3516153,3517153,3518153,3519153,3520253,3521253,3522253,3523253,3524253,3525253,3526253,3527253,3528253,3529253,3530353,3531353,3532353,3533353,3534353,3535353,3536353,3537353,3538353,3539353,3540453,3541453,3542453,3543453,3544453,3545453,3546453,3547453,3548453,3549453,3550553,3551553,3552553,3553553,3554553,3555553,3556553,3557553,3558553,3559553,3560653,3561653,3562653,3563653,3564653,3565653,3566653,3567653,3568653,3569653,3570753,3571753,3572753,3573753,3574753,3575753,3576753,3577753,3578753,3579753,3580853,3581853,3582853,3583853,3584853,3585853,3586853,3587853,3588853,3589853,3590953,3591953,3592953,3593953,3594953,3595953,3596953,3597953,3598953,3599953,3600063,3601063,3602063,3603063,3604063,3605063,3606063,3607063,3608063,3609063,3610163,3611163,3612163,3613163,3614163,3615163,3616163,3617163,3618163,3619163,3620263,3621263,3622263,3623263,3624263,3625263,3626263,3627263,3628263,3629263,3630363,3631363,3632363,3633363,3634363,3635363,3636363,3637363,3638363,3639363,3640463,3641463,3642463,3643463,3644463,3645463,3646463,3647463,3648463,3649463,3650563,3651563,3652563,3653563,3654563,3655563,3656563,3657563,3658563,3659563,3660663,3661663,3662663,3663663,3664663,3665663,3666663,3667663,3668663,3669663,3670763,3671763,3672763,3673763,3674763,3675763,3676763,3677763,3678763,3679763,3680863,3681863,3682863,3683863,3684863,3685863,3686863,3687863,3688863,3689863,3690963,3691963,3692963,3693963,3694963,3695963,3696963,3697963,3698963,3699963,3700073,3701073,3702073,3703073,3704073,3705073,3706073,3707073,3708073,3709073,3710173,3711173,3712173,3713173,3714173,3715173,3716173,3717173,3718173,3719173,3720273,3721273,3722273,3723273,3724273,3725273,3726273,3727273,3728273,3729273,3730373,3731373,3732373,3733373,3734373,3735373,3736373,3737373,3738373,3739373,3740473,3741473,3742473,3743473,3744473,3745473,3746473,3747473,3748473,3749473,3750573,3751573,3752573,3753573,3754573,3755573,3756573,3757573,3758573,3759573,3760673,3761673,3762673,3763673,3764673,3765673,3766673,3767673,3768673,3769673,3770773,3771773,3772773,3773773,3774773,3775773,3776773,3777773,3778773,3779773,3780873,3781873,3782873,3783873,3784873,3785873,3786873,3787873,3788873,3789873,3790973,3791973,3792973,3793973,3794973,3795973,3796973,3797973,3798973,3799973,3800083,3801083,3802083,3803083,3804083,3805083,3806083,3807083,3808083,3809083,3810183,3811183,3812183,3813183,3814183,3815183,3816183,3817183,3818183,3819183,3820283,3821283,3822283,3823283,3824283,3825283,3826283,3827283,3828283,3829283,3830383,3831383,3832383,3833383,3834383,3835383,3836383,3837383,3838383,3839383,3840483,3841483,3842483,3843483,3844483,3845483,3846483,3847483,3848483,3849483,3850583,3851583,3852583,3853583,3854583,3855583,3856583,3857583,3858583,3859583,3860683,3861683,3862683,3863683,3864683,3865683,3866683,3867683,3868683,3869683,3870783,3871783,3872783,3873783,3874783,3875783,3876783,3877783,3878783,3879783,3880883,3881883,3882883,3883883,3884883,3885883,3886883,3887883,3888883,3889883,3890983,3891983,3892983,3893983,3894983,3895983,3896983,3897983,3898983,3899983,3900093,3901093,3902093,3903093,3904093,3905093,3906093,3907093,3908093,3909093,3910193,3911193,3912193,3913193,3914193,3915193,3916193,3917193,3918193,3919193,3920293,3921293,3922293,3923293,3924293,3925293,3926293,3927293,3928293,3929293,3930393,3931393,3932393,3933393,3934393,3935393,3936393,3937393,3938393,3939393,3940493,3941493,3942493,3943493,3944493,3945493,3946493,3947493,3948493,3949493,3950593,3951593,3952593,3953593,3954593,3955593,3956593,3957593,3958593,3959593,3960693,3961693,3962693,3963693,3964693,3965693,3966693,3967693,3968693,3969693,3970793,3971793,3972793,3973793,3974793,3975793,3976793,3977793,3978793,3979793,3980893,3981893,3982893,3983893,3984893,3985893,3986893,3987893,3988893,3989893,3990993,3991993,3992993,3993993,3994993,3995993,3996993,3997993,3998993,3999993,4000004,4001004,4002004,4003004,4004004,4005004,4006004,4007004,4008004,4009004,4010104,4011104,4012104,4013104,4014104,4015104,4016104,4017104,4018104,4019104,4020204,4021204,4022204,4023204,4024204,4025204,4026204,4027204,4028204,4029204,4030304,4031304,4032304,4033304,4034304,4035304,4036304,4037304,4038304,4039304,4040404,4041404,4042404,4043404,4044404,4045404,4046404,4047404,4048404,4049404,4050504,4051504,4052504,4053504,4054504,4055504,4056504,4057504,4058504,4059504,4060604,4061604,4062604,4063604,4064604,4065604,4066604,4067604,4068604,4069604,4070704,4071704,4072704,4073704,4074704,4075704,4076704,4077704,4078704,4079704,4080804,4081804,4082804,4083804,4084804,4085804,4086804,4087804,4088804,4089804,4090904,4091904,4092904,4093904,4094904,4095904,4096904,4097904,4098904,4099904,4100014,4101014,4102014,4103014,4104014,4105014,4106014,4107014,4108014,4109014,4110114,4111114,4112114,4113114,4114114,4115114,4116114,4117114,4118114,4119114,4120214,4121214,4122214,4123214,4124214,4125214,4126214,4127214,4128214,4129214,4130314,4131314,4132314,4133314,4134314,4135314,4136314,4137314,4138314,4139314,4140414,4141414,4142414,4143414,4144414,4145414,4146414,4147414,4148414,4149414,4150514,4151514,4152514,4153514,4154514,4155514,4156514,4157514,4158514,4159514,4160614,4161614,4162614,4163614,4164614,4165614,4166614,4167614,4168614,4169614,4170714,4171714,4172714,4173714,4174714,4175714,4176714,4177714,4178714,4179714,4180814,4181814,4182814,4183814,4184814,4185814,4186814,4187814,4188814,4189814,4190914,4191914,4192914,4193914,4194914,4195914,4196914,4197914,4198914,4199914,4200024,4201024,4202024,4203024,4204024,4205024,4206024,4207024,4208024,4209024,4210124,4211124,4212124,4213124,4214124,4215124,4216124,4217124,4218124,4219124,4220224,4221224,4222224,4223224,4224224,4225224,4226224,4227224,4228224,4229224,4230324,4231324,4232324,4233324,4234324,4235324,4236324,4237324,4238324,4239324,4240424,4241424,4242424,4243424,4244424,4245424,4246424,4247424,4248424,4249424,4250524,4251524,4252524,4253524,4254524,4255524,4256524,4257524,4258524,4259524,4260624,4261624,4262624,4263624,4264624,4265624,4266624,4267624,4268624,4269624,4270724,4271724,4272724,4273724,4274724,4275724,4276724,4277724,4278724,4279724,4280824,4281824,4282824,4283824,4284824,4285824,4286824,4287824,4288824,4289824,4290924,4291924,4292924,4293924,4294924,4295924,4296924,4297924,4298924,4299924,4300034,4301034,4302034,4303034,4304034,4305034,4306034,4307034,4308034,4309034,4310134,4311134,4312134,4313134,4314134,4315134,4316134,4317134,4318134,4319134,4320234,4321234,4322234,4323234,4324234,4325234,4326234,4327234,4328234,4329234,4330334,4331334,4332334,4333334,4334334,4335334,4336334,4337334,4338334,4339334,4340434,4341434,4342434,4343434,4344434,4345434,4346434,4347434,4348434,4349434,4350534,4351534,4352534,4353534,4354534,4355534,4356534,4357534,4358534,4359534,4360634,4361634,4362634,4363634,4364634,4365634,4366634,4367634,4368634,4369634,4370734,4371734,4372734,4373734,4374734,4375734,4376734,4377734,4378734,4379734,4380834,4381834,4382834,4383834,4384834,4385834,4386834,4387834,4388834,4389834,4390934,4391934,4392934,4393934,4394934,4395934,4396934,4397934,4398934,4399934,4400044,4401044,4402044,4403044,4404044,4405044,4406044,4407044,4408044,4409044,4410144,4411144,4412144,4413144,4414144,4415144,4416144,4417144,4418144,4419144,4420244,4421244,4422244,4423244,4424244,4425244,4426244,4427244,4428244,4429244,4430344,4431344,4432344,4433344,4434344,4435344,4436344,4437344,4438344,4439344,4440444,4441444,4442444,4443444,4444444,4445444,4446444,4447444,4448444,4449444,4450544,4451544,4452544,4453544,4454544,4455544,4456544,4457544,4458544,4459544,4460644,4461644,4462644,4463644,4464644,4465644,4466644,4467644,4468644,4469644,4470744,4471744,4472744,4473744,4474744,4475744,4476744,4477744,4478744,4479744,4480844,4481844,4482844,4483844,4484844,4485844,4486844,4487844,4488844,4489844,4490944,4491944,4492944,4493944,4494944,4495944,4496944,4497944,4498944,4499944,4500054,4501054,4502054,4503054,4504054,4505054,4506054,4507054,4508054,4509054,4510154,4511154,4512154,4513154,4514154,4515154,4516154,4517154,4518154,4519154,4520254,4521254,4522254,4523254,4524254,4525254,4526254,4527254,4528254,4529254,4530354,4531354,4532354,4533354,4534354,4535354,4536354,4537354,4538354,4539354,4540454,4541454,4542454,4543454,4544454,4545454,4546454,4547454,4548454,4549454,4550554,4551554,4552554,4553554,4554554,4555554,4556554,4557554,4558554,4559554,4560654,4561654,4562654,4563654,4564654,4565654,4566654,4567654,4568654,4569654,4570754,4571754,4572754,4573754,4574754,4575754,4576754,4577754,4578754,4579754,4580854,4581854,4582854,4583854,4584854,4585854,4586854,4587854,4588854,4589854,4590954,4591954,4592954,4593954,4594954,4595954,4596954,4597954,4598954,4599954,4600064,4601064,4602064,4603064,4604064,4605064,4606064,4607064,4608064,4609064,4610164,4611164,4612164,4613164,4614164,4615164,4616164,4617164,4618164,4619164,4620264,4621264,4622264,4623264,4624264,4625264,4626264,4627264,4628264,4629264,4630364,4631364,4632364,4633364,4634364,4635364,4636364,4637364,4638364,4639364,4640464,4641464,4642464,4643464,4644464,4645464,4646464,4647464,4648464,4649464,4650564,4651564,4652564,4653564,4654564,4655564,4656564,4657564,4658564,4659564,4660664,4661664,4662664,4663664,4664664,4665664,4666664,4667664,4668664,4669664,4670764,4671764,4672764,4673764,4674764,4675764,4676764,4677764,4678764,4679764,4680864,4681864,4682864,4683864,4684864,4685864,4686864,4687864,4688864,4689864,4690964,4691964,4692964,4693964,4694964,4695964,4696964,4697964,4698964,4699964,4700074,4701074,4702074,4703074,4704074,4705074,4706074,4707074,4708074,4709074,4710174,4711174,4712174,4713174,4714174,4715174,4716174,4717174,4718174,4719174,4720274,4721274,4722274,4723274,4724274,4725274,4726274,4727274,4728274,4729274,4730374,4731374,4732374,4733374,4734374,4735374,4736374,4737374,4738374,4739374,4740474,4741474,4742474,4743474,4744474,4745474,4746474,4747474,4748474,4749474,4750574,4751574,4752574,4753574,4754574,4755574,4756574,4757574,4758574,4759574,4760674,4761674,4762674,4763674,4764674,4765674,4766674,4767674,4768674,4769674,4770774,4771774,4772774,4773774,4774774,4775774,4776774,4777774,4778774,4779774,4780874,4781874,4782874,4783874,4784874,4785874,4786874,4787874,4788874,4789874,4790974,4791974,4792974,4793974,4794974,4795974,4796974,4797974,4798974,4799974,4800084,4801084,4802084,4803084,4804084,4805084,4806084,4807084,4808084,4809084,4810184,4811184,4812184,4813184,4814184,4815184,4816184,4817184,4818184,4819184,4820284,4821284,4822284,4823284,4824284,4825284,4826284,4827284,4828284,4829284,4830384,4831384,4832384,4833384,4834384,4835384,4836384,4837384,4838384,4839384,4840484,4841484,4842484,4843484,4844484,4845484,4846484,4847484,4848484,4849484,4850584,4851584,4852584,4853584,4854584,4855584,4856584,4857584,4858584,4859584,4860684,4861684,4862684,4863684,4864684,4865684,4866684,4867684,4868684,4869684,4870784,4871784,4872784,4873784,4874784,4875784,4876784,4877784,4878784,4879784,4880884,4881884,4882884,4883884,4884884,4885884,4886884,4887884,4888884,4889884,4890984,4891984,4892984,4893984,4894984,4895984,4896984,4897984,4898984,4899984,4900094,4901094,4902094,4903094,4904094,4905094,4906094,4907094,4908094,4909094,4910194,4911194,4912194,4913194,4914194,4915194,4916194,4917194,4918194,4919194,4920294,4921294,4922294,4923294,4924294,4925294,4926294,4927294,4928294,4929294,4930394,4931394,4932394,4933394,4934394,4935394,4936394,4937394,4938394,4939394,4940494,4941494,4942494,4943494,4944494,4945494,4946494,4947494,4948494,4949494,4950594,4951594,4952594,4953594,4954594,4955594,4956594,4957594,4958594,4959594,4960694,4961694,4962694,4963694,4964694,4965694,4966694,4967694,4968694,4969694,4970794,4971794,4972794,4973794,4974794,4975794,4976794,4977794,4978794,4979794,4980894,4981894,4982894,4983894,4984894,4985894,4986894,4987894,4988894,4989894,4990994,4991994,4992994,4993994,4994994,4995994,4996994,4997994,4998994,4999994,5000005,5001005,5002005,5003005,5004005,5005005,5006005,5007005,5008005,5009005,5010105,5011105,5012105,5013105,5014105,5015105,5016105,5017105,5018105,5019105,5020205,5021205,5022205,5023205,5024205,5025205,5026205,5027205,5028205,5029205,5030305,5031305,5032305,5033305,5034305,5035305,5036305,5037305,5038305,5039305,5040405,5041405,5042405,5043405,5044405,5045405,5046405,5047405,5048405,5049405,5050505,5051505,5052505,5053505,5054505,5055505,5056505,5057505,5058505,5059505,5060605,5061605,5062605,5063605,5064605,5065605,5066605,5067605,5068605,5069605,5070705,5071705,5072705,5073705,5074705,5075705,5076705,5077705,5078705,5079705,5080805,5081805,5082805,5083805,5084805,5085805,5086805,5087805,5088805,5089805,5090905,5091905,5092905,5093905,5094905,5095905,5096905,5097905,5098905,5099905,5100015,5101015,5102015,5103015,5104015,5105015,5106015,5107015,5108015,5109015,5110115,5111115,5112115,5113115,5114115,5115115,5116115,5117115,5118115,5119115,5120215,5121215,5122215,5123215,5124215,5125215,5126215,5127215,5128215,5129215,5130315,5131315,5132315,5133315,5134315,5135315,5136315,5137315,5138315,5139315,5140415,5141415,5142415,5143415,5144415,5145415,5146415,5147415,5148415,5149415,5150515,5151515,5152515,5153515,5154515,5155515,5156515,5157515,5158515,5159515,5160615,5161615,5162615,5163615,5164615,5165615,5166615,5167615,5168615,5169615,5170715,5171715,5172715,5173715,5174715,5175715,5176715,5177715,5178715,5179715,5180815,5181815,5182815,5183815,5184815,5185815,5186815,5187815,5188815,5189815,5190915,5191915,5192915,5193915,5194915,5195915,5196915,5197915,5198915,5199915,5200025,5201025,5202025,5203025,5204025,5205025,5206025,5207025,5208025,5209025,5210125,5211125,5212125,5213125,5214125,5215125,5216125,5217125,5218125,5219125,5220225,5221225,5222225,5223225,5224225,5225225,5226225,5227225,5228225,5229225,5230325,5231325,5232325,5233325,5234325,5235325,5236325,5237325,5238325,5239325,5240425,5241425,5242425,5243425,5244425,5245425,5246425,5247425,5248425,5249425,5250525,5251525,5252525,5253525,5254525,5255525,5256525,5257525,5258525,5259525,5260625,5261625,5262625,5263625,5264625,5265625,5266625,5267625,5268625,5269625,5270725,5271725,5272725,5273725,5274725,5275725,5276725,5277725,5278725,5279725,5280825,5281825,5282825,5283825,5284825,5285825,5286825,5287825,5288825,5289825,5290925,5291925,5292925,5293925,5294925,5295925,5296925,5297925,5298925,5299925,5300035,5301035,5302035,5303035,5304035,5305035,5306035,5307035,5308035,5309035,5310135,5311135,5312135,5313135,5314135,5315135,5316135,5317135,5318135,5319135,5320235,5321235,5322235,5323235,5324235,5325235,5326235,5327235,5328235,5329235,5330335,5331335,5332335,5333335,5334335,5335335,5336335,5337335,5338335,5339335,5340435,5341435,5342435,5343435,5344435,5345435,5346435,5347435,5348435,5349435,5350535,5351535,5352535,5353535,5354535,5355535,5356535,5357535,5358535,5359535,5360635,5361635,5362635,5363635,5364635,5365635,5366635,5367635,5368635,5369635,5370735,5371735,5372735,5373735,5374735,5375735,5376735,5377735,5378735,5379735,5380835,5381835,5382835,5383835,5384835,5385835,5386835,5387835,5388835,5389835,5390935,5391935,5392935,5393935,5394935,5395935,5396935,5397935,5398935,5399935,5400045,5401045,5402045,5403045,5404045,5405045,5406045,5407045,5408045,5409045,5410145,5411145,5412145,5413145,5414145,5415145,5416145,5417145,5418145,5419145,5420245,5421245,5422245,5423245,5424245,5425245,5426245,5427245,5428245,5429245,5430345,5431345,5432345,5433345,5434345,5435345,5436345,5437345,5438345,5439345,5440445,5441445,5442445,5443445,5444445,5445445,5446445,5447445,5448445,5449445,5450545,5451545,5452545,5453545,5454545,5455545,5456545,5457545,5458545,5459545,5460645,5461645,5462645,5463645,5464645,5465645,5466645,5467645,5468645,5469645,5470745,5471745,5472745,5473745,5474745,5475745,5476745,5477745,5478745,5479745,5480845,5481845,5482845,5483845,5484845,5485845,5486845,5487845,5488845,5489845,5490945,5491945,5492945,5493945,5494945,5495945,5496945,5497945,5498945,5499945,5500055,5501055,5502055,5503055,5504055,5505055,5506055,5507055,5508055,5509055,5510155,5511155,5512155,5513155,5514155,5515155,5516155,5517155,5518155,5519155,5520255,5521255,5522255,5523255,5524255,5525255,5526255,5527255,5528255,5529255,5530355,5531355,5532355,5533355,5534355,5535355,5536355,5537355,5538355,5539355,5540455,5541455,5542455,5543455,5544455,5545455,5546455,5547455,5548455,5549455,5550555,5551555,5552555,5553555,5554555,5555555,5556555,5557555,5558555,5559555,5560655,5561655,5562655,5563655,5564655,5565655,5566655,5567655,5568655,5569655,5570755,5571755,5572755,5573755,5574755,5575755,5576755,5577755,5578755,5579755,5580855,5581855,5582855,5583855,5584855,5585855,5586855,5587855,5588855,5589855,5590955,5591955,5592955,5593955,5594955,5595955,5596955,5597955,5598955,5599955,5600065,5601065,5602065,5603065,5604065,5605065,5606065,5607065,5608065,5609065,5610165,5611165,5612165,5613165,5614165,5615165,5616165,5617165,5618165,5619165,5620265,5621265,5622265,5623265,5624265,5625265,5626265,5627265,5628265,5629265,5630365,5631365,5632365,5633365,5634365,5635365,5636365,5637365,5638365,5639365,5640465,5641465,5642465,5643465,5644465,5645465,5646465,5647465,5648465,5649465,5650565,5651565,5652565,5653565,5654565,5655565,5656565,5657565,5658565,5659565,5660665,5661665,5662665,5663665,5664665,5665665,5666665,5667665,5668665,5669665,5670765,5671765,5672765,5673765,5674765,5675765,5676765,5677765,5678765,5679765,5680865,5681865,5682865,5683865,5684865,5685865,5686865,5687865,5688865,5689865,5690965,5691965,5692965,5693965,5694965,5695965,5696965,5697965,5698965,5699965,5700075,5701075,5702075,5703075,5704075,5705075,5706075,5707075,5708075,5709075,5710175,5711175,5712175,5713175,5714175,5715175,5716175,5717175,5718175,5719175,5720275,5721275,5722275,5723275,5724275,5725275,5726275,5727275,5728275,5729275,5730375,5731375,5732375,5733375,5734375,5735375,5736375,5737375,5738375,5739375,5740475,5741475,5742475,5743475,5744475,5745475,5746475,5747475,5748475,5749475,5750575,5751575,5752575,5753575,5754575,5755575,5756575,5757575,5758575,5759575,5760675,5761675,5762675,5763675,5764675,5765675,5766675,5767675,5768675,5769675,5770775,5771775,5772775,5773775,5774775,5775775,5776775,5777775,5778775,5779775,5780875,5781875,5782875,5783875,5784875,5785875,5786875,5787875,5788875,5789875,5790975,5791975,5792975,5793975,5794975,5795975,5796975,5797975,5798975,5799975,5800085,5801085,5802085,5803085,5804085,5805085,5806085,5807085,5808085,5809085,5810185,5811185,5812185,5813185,5814185,5815185,5816185,5817185,5818185,5819185,5820285,5821285,5822285,5823285,5824285,5825285,5826285,5827285,5828285,5829285,5830385,5831385,5832385,5833385,5834385,5835385,5836385,5837385,5838385,5839385,5840485,5841485,5842485,5843485,5844485,5845485,5846485,5847485,5848485,5849485,5850585,5851585,5852585,5853585,5854585,5855585,5856585,5857585,5858585,5859585,5860685,5861685,5862685,5863685,5864685,5865685,5866685,5867685,5868685,5869685,5870785,5871785,5872785,5873785,5874785,5875785,5876785,5877785,5878785,5879785,5880885,5881885,5882885,5883885,5884885,5885885,5886885,5887885,5888885,5889885,5890985,5891985,5892985,5893985,5894985,5895985,5896985,5897985,5898985,5899985,5900095,5901095,5902095,5903095,5904095,5905095,5906095,5907095,5908095,5909095,5910195,5911195,5912195,5913195,5914195,5915195,5916195,5917195,5918195,5919195,5920295,5921295,5922295,5923295,5924295,5925295,5926295,5927295,5928295,5929295,5930395,5931395,5932395,5933395,5934395,5935395,5936395,5937395,5938395,5939395,5940495,5941495,5942495,5943495,5944495,5945495,5946495,5947495,5948495,5949495,5950595,5951595,5952595,5953595,5954595,5955595,5956595,5957595,5958595,5959595,5960695,5961695,5962695,5963695,5964695,5965695,5966695,5967695,5968695,5969695,5970795,5971795,5972795,5973795,5974795,5975795,5976795,5977795,5978795,5979795,5980895,5981895,5982895,5983895,5984895,5985895,5986895,5987895,5988895,5989895,5990995,5991995,5992995,5993995,5994995,5995995,5996995,5997995,5998995,5999995,6000006,6001006,6002006,6003006,6004006,6005006,6006006,6007006,6008006,6009006,6010106,6011106,6012106,6013106,6014106,6015106,6016106,6017106,6018106,6019106,6020206,6021206,6022206,6023206,6024206,6025206,6026206,6027206,6028206,6029206,6030306,6031306,6032306,6033306,6034306,6035306,6036306,6037306,6038306,6039306,6040406,6041406,6042406,6043406,6044406,6045406,6046406,6047406,6048406,6049406,6050506,6051506,6052506,6053506,6054506,6055506,6056506,6057506,6058506,6059506,6060606,6061606,6062606,6063606,6064606,6065606,6066606,6067606,6068606,6069606,6070706,6071706,6072706,6073706,6074706,6075706,6076706,6077706,6078706,6079706,6080806,6081806,6082806,6083806,6084806,6085806,6086806,6087806,6088806,6089806,6090906,6091906,6092906,6093906,6094906,6095906,6096906,6097906,6098906,6099906,6100016,6101016,6102016,6103016,6104016,6105016,6106016,6107016,6108016,6109016,6110116,6111116,6112116,6113116,6114116,6115116,6116116,6117116,6118116,6119116,6120216,6121216,6122216,6123216,6124216,6125216,6126216,6127216,6128216,6129216,6130316,6131316,6132316,6133316,6134316,6135316,6136316,6137316,6138316,6139316,6140416,6141416,6142416,6143416,6144416,6145416,6146416,6147416,6148416,6149416,6150516,6151516,6152516,6153516,6154516,6155516,6156516,6157516,6158516,6159516,6160616,6161616,6162616,6163616,6164616,6165616,6166616,6167616,6168616,6169616,6170716,6171716,6172716,6173716,6174716,6175716,6176716,6177716,6178716,6179716,6180816,6181816,6182816,6183816,6184816,6185816,6186816,6187816,6188816,6189816,6190916,6191916,6192916,6193916,6194916,6195916,6196916,6197916,6198916,6199916,6200026,6201026,6202026,6203026,6204026,6205026,6206026,6207026,6208026,6209026,6210126,6211126,6212126,6213126,6214126,6215126,6216126,6217126,6218126,6219126,6220226,6221226,6222226,6223226,6224226,6225226,6226226,6227226,6228226,6229226,6230326,6231326,6232326,6233326,6234326,6235326,6236326,6237326,6238326,6239326,6240426,6241426,6242426,6243426,6244426,6245426,6246426,6247426,6248426,6249426,6250526,6251526,6252526,6253526,6254526,6255526,6256526,6257526,6258526,6259526,6260626,6261626,6262626,6263626,6264626,6265626,6266626,6267626,6268626,6269626,6270726,6271726,6272726,6273726,6274726,6275726,6276726,6277726,6278726,6279726,6280826,6281826,6282826,6283826,6284826,6285826,6286826,6287826,6288826,6289826,6290926,6291926,6292926,6293926,6294926,6295926,6296926,6297926,6298926,6299926,6300036,6301036,6302036,6303036,6304036,6305036,6306036,6307036,6308036,6309036,6310136,6311136,6312136,6313136,6314136,6315136,6316136,6317136,6318136,6319136,6320236,6321236,6322236,6323236,6324236,6325236,6326236,6327236,6328236,6329236,6330336,6331336,6332336,6333336,6334336,6335336,6336336,6337336,6338336,6339336,6340436,6341436,6342436,6343436,6344436,6345436,6346436,6347436,6348436,6349436,6350536,6351536,6352536,6353536,6354536,6355536,6356536,6357536,6358536,6359536,6360636,6361636,6362636,6363636,6364636,6365636,6366636,6367636,6368636,6369636,6370736,6371736,6372736,6373736,6374736,6375736,6376736,6377736,6378736,6379736,6380836,6381836,6382836,6383836,6384836,6385836,6386836,6387836,6388836,6389836,6390936,6391936,6392936,6393936,6394936,6395936,6396936,6397936,6398936,6399936,6400046,6401046,6402046,6403046,6404046,6405046,6406046,6407046,6408046,6409046,6410146,6411146,6412146,6413146,6414146,6415146,6416146,6417146,6418146,6419146,6420246,6421246,6422246,6423246,6424246,6425246,6426246,6427246,6428246,6429246,6430346,6431346,6432346,6433346,6434346,6435346,6436346,6437346,6438346,6439346,6440446,6441446,6442446,6443446,6444446,6445446,6446446,6447446,6448446,6449446,6450546,6451546,6452546,6453546,6454546,6455546,6456546,6457546,6458546,6459546,6460646,6461646,6462646,6463646,6464646,6465646,6466646,6467646,6468646,6469646,6470746,6471746,6472746,6473746,6474746,6475746,6476746,6477746,6478746,6479746,6480846,6481846,6482846,6483846,6484846,6485846,6486846,6487846,6488846,6489846,6490946,6491946,6492946,6493946,6494946,6495946,6496946,6497946,6498946,6499946,6500056,6501056,6502056,6503056,6504056,6505056,6506056,6507056,6508056,6509056,6510156,6511156,6512156,6513156,6514156,6515156,6516156,6517156,6518156,6519156,6520256,6521256,6522256,6523256,6524256,6525256,6526256,6527256,6528256,6529256,6530356,6531356,6532356,6533356,6534356,6535356,6536356,6537356,6538356,6539356,6540456,6541456,6542456,6543456,6544456,6545456,6546456,6547456,6548456,6549456,6550556,6551556,6552556,6553556,6554556,6555556,6556556,6557556,6558556,6559556,6560656,6561656,6562656,6563656,6564656,6565656,6566656,6567656,6568656,6569656,6570756,6571756,6572756,6573756,6574756,6575756,6576756,6577756,6578756,6579756,6580856,6581856,6582856,6583856,6584856,6585856,6586856,6587856,6588856,6589856,6590956,6591956,6592956,6593956,6594956,6595956,6596956,6597956,6598956,6599956,6600066,6601066,6602066,6603066,6604066,6605066,6606066,6607066,6608066,6609066,6610166,6611166,6612166,6613166,6614166,6615166,6616166,6617166,6618166,6619166,6620266,6621266,6622266,6623266,6624266,6625266,6626266,6627266,6628266,6629266,6630366,6631366,6632366,6633366,6634366,6635366,6636366,6637366,6638366,6639366,6640466,6641466,6642466,6643466,6644466,6645466,6646466,6647466,6648466,6649466,6650566,6651566,6652566,6653566,6654566,6655566,6656566,6657566,6658566,6659566,6660666,6661666,6662666,6663666,6664666,6665666,6666666,6667666,6668666,6669666,6670766,6671766,6672766,6673766,6674766,6675766,6676766,6677766,6678766,6679766,6680866,6681866,6682866,6683866,6684866,6685866,6686866,6687866,6688866,6689866,6690966,6691966,6692966,6693966,6694966,6695966,6696966,6697966,6698966,6699966,6700076,6701076,6702076,6703076,6704076,6705076,6706076,6707076,6708076,6709076,6710176,6711176,6712176,6713176,6714176,6715176,6716176,6717176,6718176,6719176,6720276,6721276,6722276,6723276,6724276,6725276,6726276,6727276,6728276,6729276,6730376,6731376,6732376,6733376,6734376,6735376,6736376,6737376,6738376,6739376,6740476,6741476,6742476,6743476,6744476,6745476,6746476,6747476,6748476,6749476,6750576,6751576,6752576,6753576,6754576,6755576,6756576,6757576,6758576,6759576,6760676,6761676,6762676,6763676,6764676,6765676,6766676,6767676,6768676,6769676,6770776,6771776,6772776,6773776,6774776,6775776,6776776,6777776,6778776,6779776,6780876,6781876,6782876,6783876,6784876,6785876,6786876,6787876,6788876,6789876,6790976,6791976,6792976,6793976,6794976,6795976,6796976,6797976,6798976,6799976,6800086,6801086,6802086,6803086,6804086,6805086,6806086,6807086,6808086,6809086,6810186,6811186,6812186,6813186,6814186,6815186,6816186,6817186,6818186,6819186,6820286,6821286,6822286,6823286,6824286,6825286,6826286,6827286,6828286,6829286,6830386,6831386,6832386,6833386,6834386,6835386,6836386,6837386,6838386,6839386,6840486,6841486,6842486,6843486,6844486,6845486,6846486,6847486,6848486,6849486,6850586,6851586,6852586,6853586,6854586,6855586,6856586,6857586,6858586,6859586,6860686,6861686,6862686,6863686,6864686,6865686,6866686,6867686,6868686,6869686,6870786,6871786,6872786,6873786,6874786,6875786,6876786,6877786,6878786,6879786,6880886,6881886,6882886,6883886,6884886,6885886,6886886,6887886,6888886,6889886,6890986,6891986,6892986,6893986,6894986,6895986,6896986,6897986,6898986,6899986,6900096,6901096,6902096,6903096,6904096,6905096,6906096,6907096,6908096,6909096,6910196,6911196,6912196,6913196,6914196,6915196,6916196,6917196,6918196,6919196,6920296,6921296,6922296,6923296,6924296,6925296,6926296,6927296,6928296,6929296,6930396,6931396,6932396,6933396,6934396,6935396,6936396,6937396,6938396,6939396,6940496,6941496,6942496,6943496,6944496,6945496,6946496,6947496,6948496,6949496,6950596,6951596,6952596,6953596,6954596,6955596,6956596,6957596,6958596,6959596,6960696,6961696,6962696,6963696,6964696,6965696,6966696,6967696,6968696,6969696,6970796,6971796,6972796,6973796,6974796,6975796,6976796,6977796,6978796,6979796,6980896,6981896,6982896,6983896,6984896,6985896,6986896,6987896,6988896,6989896,6990996,6991996,6992996,6993996,6994996,6995996,6996996,6997996,6998996,6999996};\n}\n}", "lang": "MS C#", "bug_code_uid": "bdbb17bf60eabb89c1db0d51bc270d20", "src_uid": "e6e760164882b9e194a17663625be27d", "apr_id": "f502b9f983644b3c4d4a52fc498c8120", "difficulty": 1600, "tags": ["math", "brute force", "number theory", "binary search"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.018796992481203006, "equal_cnt": 32, "replace_cnt": 23, "delete_cnt": 1, "insert_cnt": 8, "fix_ops_cnt": 32, "bug_source_code": "\n\n \n \n Debug\n AnyCPU\n {CFF74FAA-1C76-4632-987A-AB7304DC07F5}\n Exe\n Properties\n C.Primes_or_Palindromes\n C.Primes_or_Palindromes\n v4.5\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 \n", "lang": "MS C#", "bug_code_uid": "954d4d296c31898307a3fb1558c5bb6e", "src_uid": "e6e760164882b9e194a17663625be27d", "apr_id": "5104aec33f275a1dbaca199c6834d925", "difficulty": 1600, "tags": ["math", "brute force", "number theory", "binary search"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9689291101055807, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "using System;\nusing System.Text;\nusing System.Collections;\nusing System.Collections.Generic;\n\nnamespace ConsoleApp\n{\n public class Program\n {\n public static void Main()\n {\n //int n = Convert.ToInt32(Console.ReadLine());\n //int[] array = Array.ConvertAll(Console.ReadLine().Split(), Convert.ToInt32);\n //StringBuilder stringBuilder = new StringBuilder();\n int n = Convert.ToInt32(Console.ReadLine());\n int degree = Convert.ToInt32(Console.ReadLine());\n BitArray bitArray = new BitArray(360);\n bitArray[degree] = true;\n bitArray[360 - degree] = true;\n BitArray left = (BitArray)bitArray.Clone();\n BitArray right = (BitArray)bitArray.Clone();\n BitArray temp1;\n BitArray temp2;\n for (; n > 1; n--)\n {\n degree = Convert.ToInt32(Console.ReadLine());\n temp1 = (BitArray)left.Clone();\n temp2 = (BitArray)left.Clone();\n left = (BitArray)(temp1.LeftShift(degree).Or(temp2.LeftShift(360 - degree))).Clone();\n temp1 = (BitArray)right.Clone();\n temp2 = (BitArray)right.Clone();\n right = (BitArray)(temp1.RightShift(degree).Or(temp2.RightShift(360 - degree))).Clone();\n\n bitArray = (BitArray)left.Or(right).Clone();\n }\n\n if (bitArray[0])\n {\n Console.Write(\"YES\");\n }\n else\n {\n Console.Write(\"NO\");\n }\n }\n }\n}\n", "lang": ".NET Core C#", "bug_code_uid": "f3566a53f3f119a13573e4cb67feb151", "src_uid": "01b50fcba4185ceb1eb8e4ba04a0cc10", "apr_id": "df64885f73a0f70236c491c77ce311ff", "difficulty": 1200, "tags": ["dp", "brute force", "bitmasks"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.9681940700808626, "equal_cnt": 6, "replace_cnt": 2, "delete_cnt": 3, "insert_cnt": 0, "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 ConsoleApplication14\n{\n class Program\n {\n static void Main(string[] args)\n {\n var n = Convert.ToInt32(Console.ReadLine());\n int[] vs = new int[n];\n for (int i = 0; i < n; i++)\n {\n vs[i] = Convert.ToInt32(Console.ReadLine());\n\n bool result = DegreeChecker(vs, 0, 0);\n if (result)\n Console.WriteLine(\"YES\");\n else\n Console.WriteLine(\"NO\");\n }\n }\n static bool DegreeChecker(int[] vs, int sum, int i)\n {\n if (i == vs.Length)\n {\n return sum % 360 == 0;\n }\n return DegreeChecker(vs, sum - vs[i], i + 1) || DegreeChecker(vs, sum + vs[i], i + 1);\n }\n }\n}", "lang": "Mono C#", "bug_code_uid": "c85c766ec1aecd44d3aed1222e318ee9", "src_uid": "01b50fcba4185ceb1eb8e4ba04a0cc10", "apr_id": "ffb95e8ae8e3bf2e1fea5152c00c6844", "difficulty": 1200, "tags": ["dp", "brute force", "bitmasks"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "C#"} {"similarity_score": 0.9848908113303896, "equal_cnt": 18, "replace_cnt": 8, "delete_cnt": 5, "insert_cnt": 4, "fix_ops_cnt": 17, "bug_source_code": "#define FileIO\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.IO;\n\nnamespace CF\n{\n delegate double F(double x);\n delegate decimal Fdec(decimal x);\n\n\n class Program\n {\n\n static void Main(string[] args)\n {\n\n#if FileIO\n StreamReader sr = new StreamReader(\"input.txt\");\n StreamWriter sw = new StreamWriter(\"output.txt\");\n Console.SetIn(sr);\n Console.SetOut(sw);\n#endif\n\n D();\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 int[] b = new int[n];\n for (int i = 0; i < n; i++)\n {\n string[] tokens = ReadArray(' ');\n a[i] = int.Parse(tokens[0]);\n b[i] = int.Parse(tokens[1]);\n }\n int ans = 0;\n for (int i = 0; i < n; i++)\n {\n bool isHere = false;\n for (int j = 0; j < n; j++)\n {\n if (i == j) continue;\n if (b[j] == a[i])\n isHere = true;\n }\n if (!isHere)\n ans++;\n }\n Console.WriteLine(ans);\n }\n\n static void B()\n {\n int n, m;\n string[] tokens = ReadArray(' ');\n n = int.Parse(tokens[0]);\n m = int.Parse(tokens[1]);\n int[] a = new int[n];\n tokens = ReadArray(' ');\n for (int i = 0; i < n; i++)\n a[i] = int.Parse(tokens[i]);\n\n int[] sum = new int[m + 1];\n int[] last = new int[n];\n StringBuilder ans = new StringBuilder();\n for (int i = 1; i <= m; i++)\n {\n sum[i] = sum[i - 1];\n tokens = ReadArray(' ');\n int t = int.Parse(tokens[0]);\n if (t == 1)\n {\n int v = int.Parse(tokens[1]);\n int x = int.Parse(tokens[2]);\n a[v - 1] = x;\n last[v - 1] = i;\n }\n if (t == 2)\n {\n int y = int.Parse(tokens[1]);\n sum[i] += y;\n }\n if (t == 3)\n {\n int q = int.Parse(tokens[1]);\n int val = a[q - 1] + (sum[i] - sum[last[q - 1]]);\n ans.AppendLine(val.ToString());\n }\n }\n Console.Write(ans);\n }\n\n static void C()\n {\n long n, k;\n string[] tokens = ReadArray(' ');\n n = long.Parse(tokens[0]);\n k = long.Parse(tokens[1]);\n long[] a = new long[n + 1];\n tokens = ReadArray(' ');\n for (int i = 1; i <= n; i++)\n {\n a[i] = long.Parse(tokens[i - 1]);\n }\n StringBuilder ans = new StringBuilder();\n long cnt = 0;\n long cur = 0;\n long _d = 0;\n for (int i = 1; i <= n; i++)\n {\n _d = 0;\n _d -= (i - 1 - cnt) * ((n-cnt) - (i-cnt)) * a[i];\n _d += cur;\n if (_d < k)\n {\n ans.AppendLine(i.ToString());\n cnt++;\n }\n else\n {\n cur += (i - cnt - 1) * a[i];\n }\n }\n Console.Write(ans);\n }\n\n static int FirstIndex(string a, string c, int i,int z, int j)\n {\n for (int k = 0; k < a.Length; k++, z++)\n {\n if (a[(i + z) % a.Length].Equals(c[j])) return (z + 1);\n }\n return -1;\n }\n\n static void D()\n {\n int b, d;\n string[] tokens = ReadArray(' ');\n b = int.Parse(tokens[0]);\n d = int.Parse(tokens[1]);\n string a = ReadLine();\n string c = ReadLine();\n\n int[] _cnt = new int[a.Length];\n for (int i = 0; i < a.Length; i++)\n {\n int z = 0;\n for (int j = 0; j < c.Length; j++)\n {\n int m = FirstIndex(a, c, i, z, j);\n if (m == -1)\n {\n Console.WriteLine(0);\n return;\n }\n z = m;\n }\n _cnt[i] = z;\n }\n\n int[] r = new int[a.Length];\n int[] __cnt = new int[a.Length];\n for (int i = 0; i < a.Length; i++)\n {\n int j = 0;\n for (int k = 0; k < d; j += _cnt[(i + j) % a.Length], k++)\n {\n if (r[(i + j) % a.Length] > 0)\n {\n int dif = j - r[(i + j) % a.Length];\n j += (d - k) * dif;\n break;\n }\n r[(i + j) % a.Length] = j;\n r = new int[a.Length];\n }\n __cnt[i] = j;\n }\n r = new int[a.Length];\n int[] _r = new int[a.Length];\n int p = 0;\n for (int j = 0; j < a.Length * b; )\n {\n if (r[j % a.Length] > 0)\n {\n int dif = j - r[j % a.Length];\n int _dif = p - _r[j % a.Length];\n p += ((a.Length * b - j) / dif) * (_dif);\n j += ((a.Length * b - j) / dif) * dif;\n while (j + __cnt[j % a.Length] < a.Length * b)\n {\n p++;\n j += __cnt[j % a.Length];\n }\n break;\n }\n r[j % a.Length] = j;\n _r[j % a.Length] = p;\n j += __cnt[j % a.Length];\n if (j < a.Length * b) p++;\n }\n Console.WriteLine(p);\n\n }\n\n static void E()\n {\n\n }\n\n static void TestGen()\n {\n\n }\n\n static string[] ReadArray(char sep)\n {\n return Console.ReadLine().Split(sep);\n }\n\n static int ReadInt()\n {\n return int.Parse(Console.ReadLine());\n }\n\n static string ReadLine()\n {\n return Console.ReadLine();\n }\n }\n\n public static class MyMath\n {\n public static long BinPow(long a, long n, long mod)\n {\n long res = 1;\n while (n > 0)\n {\n if ((n & 1) == 1)\n {\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) b = a % (a = b);\n return a;\n }\n\n public static int GCD(int a, int b)\n {\n while (b != 0) 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 class Edge\n {\n public int a;\n public int b;\n public int w;\n\n public Edge(int a, int b, int w)\n {\n this.a = a;\n this.b = b;\n this.w = w;\n }\n }\n\n class Graph\n {\n public List[] g;\n public int[] color; //0-white, 1-gray, 2-black\n public int[] o; //open\n public int[] c; //close\n public int[] p;\n public int[] d;\n public List e;\n public Stack ans = new Stack();\n public Graph(int n)\n {\n g = new List[n + 1];\n for (int i = 0; i <= n; i++)\n g[i] = new List();\n color = new int[n + 1];\n o = new int[n + 1];\n c = new int[n + 1];\n p = new int[n + 1];\n d = new int[n + 1];\n }\n\n const int white = 0;\n const int gray = 1;\n const int black = 2;\n\n public bool DFS(int u, ref int time)\n {\n color[u] = gray;\n time++;\n o[u] = time;\n for (int i = 0; i < g[u].Count; i++)\n {\n int v = g[u][i];\n if (color[v] == gray)\n {\n return true;\n }\n if (color[v] == white)\n {\n p[v] = u;\n if (DFS(v, ref time)) return true;\n }\n }\n color[u] = black;\n ans.Push(u);\n c[u] = time;\n time++;\n return false;\n }\n }\n\n static class GraphUtils\n {\n const int white = 0;\n const int gray = 1;\n const int black = 2;\n\n public static void BFS(int s, Graph g)\n {\n Queue q = new Queue();\n q.Enqueue(s);\n while (q.Count != 0)\n {\n int u = q.Dequeue();\n for (int i = 0; i < g.g[u].Count; i++)\n {\n int v = g.g[u][i];\n if (g.color[v] == white)\n {\n g.color[v] = gray;\n g.d[v] = g.d[u] + 1;\n g.p[v] = u;\n q.Enqueue(v);\n }\n }\n g.color[u] = black;\n }\n }\n\n public static bool DFS(int u, ref int time, Graph g, Stack st)\n {\n g.color[u] = gray;\n time++;\n g.o[u] = time;\n for (int i = 0; i < g.g[u].Count; i++)\n {\n int v = g.g[u][i];\n if (g.color[v] == gray)\n {\n return true;\n }\n if (g.color[v] == white)\n {\n g.p[v] = u;\n if (DFS(v, ref time, g, st)) return true;\n }\n }\n g.color[u] = black;\n st.Push(u);\n g.c[u] = time;\n time++;\n return false;\n }\n\n public static void FordBellman(int u, Graph g)\n {\n int n = g.g.Length;\n for (int i = 0; i <= n; i++)\n {\n g.d[i] = int.MaxValue;\n g.p[i] = 0;\n }\n\n g.d[u] = 0;\n\n for (int i = 0; i < n - 1; i++)\n {\n for (int j = 0; j < g.e.Count; j++)\n {\n if (g.d[g.e[j].a] != int.MaxValue)\n {\n if (g.d[g.e[j].a] + g.e[j].w < g.d[g.e[j].b])\n {\n g.d[g.e[j].b] = g.d[g.e[j].a] + g.e[j].w;\n g.p[g.e[j].b] = g.e[j].a;\n }\n }\n }\n }\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 {\n mid = left + ((right - left) >> 1);\n if (val <= a[mid])\n {\n right = mid;\n }\n else\n {\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 {\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\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 {\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 {\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 {\n if (i > q)\n {\n for (; k <= r; k++, j++)\n A[k] = R[j];\n return;\n }\n if (j > r)\n {\n for (; k <= r; k++, i++)\n A[k] = L[i];\n return;\n }\n if (comp(L[i], R[j]) <= 0)\n {\n A[k] = L[i];\n i++;\n }\n else\n {\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) 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 {\n if (i > q)\n {\n for (; k <= r; k++, j++)\n A[k] = R[j];\n return;\n }\n if (j > r)\n {\n for (; k <= r; k++, i++)\n A[k] = L[i];\n return;\n }\n if (L[i].CompareTo(R[j]) >= 0)\n {\n A[k] = L[i];\n i++;\n }\n else\n {\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) 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 static void Shake(T[] a)\n {\n Random rnd = new Random(Environment.TickCount);\n T temp;\n int b, c;\n for (int i = 0; i < a.Length; i++)\n {\n b = rnd.Next(0, a.Length);\n c = rnd.Next(0, a.Length);\n temp = a[b];\n a[b] = a[c];\n a[c] = temp;\n }\n }\n }\n}", "lang": "MS C#", "bug_code_uid": "77c9666e1cf96e8ac1861764f4d50337", "src_uid": "5ea0351ac9f949dedae1928bfb7ebffa", "apr_id": "1c65fca2b3d1d0e0d4ab80bb39d01afc", "difficulty": 2000, "tags": ["dfs and similar", "strings"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9852521551076803, "equal_cnt": 14, "replace_cnt": 8, "delete_cnt": 4, "insert_cnt": 1, "fix_ops_cnt": 13, "bug_source_code": "#define Online\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.IO;\n\nnamespace CF\n{\n delegate double F(double x);\n delegate decimal Fdec(decimal x);\n\n\n class Program\n {\n\n static void Main(string[] args)\n {\n\n#if FileIO\n StreamReader sr = new StreamReader(\"input.txt\");\n StreamWriter sw = new StreamWriter(\"output.txt\");\n Console.SetIn(sr);\n Console.SetOut(sw);\n#endif\n\n D();\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 int[] b = new int[n];\n for (int i = 0; i < n; i++)\n {\n string[] tokens = ReadArray(' ');\n a[i] = int.Parse(tokens[0]);\n b[i] = int.Parse(tokens[1]);\n }\n int ans = 0;\n for (int i = 0; i < n; i++)\n {\n bool isHere = false;\n for (int j = 0; j < n; j++)\n {\n if (i == j) continue;\n if (b[j] == a[i])\n isHere = true;\n }\n if (!isHere)\n ans++;\n }\n Console.WriteLine(ans);\n }\n\n static void B()\n {\n int n, m;\n string[] tokens = ReadArray(' ');\n n = int.Parse(tokens[0]);\n m = int.Parse(tokens[1]);\n int[] a = new int[n];\n tokens = ReadArray(' ');\n for (int i = 0; i < n; i++)\n a[i] = int.Parse(tokens[i]);\n\n int[] sum = new int[m + 1];\n int[] last = new int[n];\n StringBuilder ans = new StringBuilder();\n for (int i = 1; i <= m; i++)\n {\n sum[i] = sum[i - 1];\n tokens = ReadArray(' ');\n int t = int.Parse(tokens[0]);\n if (t == 1)\n {\n int v = int.Parse(tokens[1]);\n int x = int.Parse(tokens[2]);\n a[v - 1] = x;\n last[v - 1] = i;\n }\n if (t == 2)\n {\n int y = int.Parse(tokens[1]);\n sum[i] += y;\n }\n if (t == 3)\n {\n int q = int.Parse(tokens[1]);\n int val = a[q - 1] + (sum[i] - sum[last[q - 1]]);\n ans.AppendLine(val.ToString());\n }\n }\n Console.Write(ans);\n }\n\n static void C()\n {\n long n, k;\n string[] tokens = ReadArray(' ');\n n = long.Parse(tokens[0]);\n k = long.Parse(tokens[1]);\n long[] a = new long[n + 1];\n tokens = ReadArray(' ');\n for (int i = 1; i <= n; i++)\n {\n a[i] = long.Parse(tokens[i - 1]);\n }\n StringBuilder ans = new StringBuilder();\n long cnt = 0;\n long cur = 0;\n long _d = 0;\n for (int i = 1; i <= n; i++)\n {\n _d = 0;\n _d -= (i - 1 - cnt) * ((n-cnt) - (i-cnt)) * a[i];\n _d += cur;\n if (_d < k)\n {\n ans.AppendLine(i.ToString());\n cnt++;\n }\n else\n {\n cur += (i - cnt - 1) * a[i];\n }\n }\n Console.Write(ans);\n }\n\n static int FirstIndex(string a, string c, int i,int z, int j)\n {\n for (int k = 0; k < a.Length; k++, z++)\n {\n if (a[(i + z) % a.Length].Equals(c[j])) return (z + 1);\n }\n return -1;\n }\n\n static void D()\n {\n int b, d;\n string[] tokens = ReadArray(' ');\n b = int.Parse(tokens[0]);\n d = int.Parse(tokens[1]);\n string a = ReadLine();\n string c = ReadLine();\n\n int[] _cnt = new int[a.Length];\n for (int i = 0; i < a.Length; i++)\n {\n int z = 0;\n for (int j = 0; j < c.Length; j++)\n {\n int m = FirstIndex(a, c, i, z, j);\n if (m == -1)\n {\n Console.WriteLine(0);\n return;\n }\n z = m;\n }\n _cnt[i] = z;\n }\n\n int[] r = new int[a.Length];\n int[] __cnt = new int[a.Length];\n for (int i = 0; i < a.Length; i++)\n {\n int j = 0;\n for (int k = 0; k < d; j += _cnt[(i + j) % a.Length], k++)\n {\n if (r[(i + j) % a.Length] > 0)\n {\n int dif = j - r[(i + j) % a.Length];\n j += (d - k) * dif;\n break;\n }\n r[(i + j) % a.Length] = j;\n r = new int[a.Length];\n }\n __cnt[i] = j;\n }\n r = new int[a.Length];\n int[] _r = new int[a.Length];\n int p = 0;\n for (int j = 0; j < a.Length * b; )\n {\n if (r[j % a.Length] > 0)\n {\n int dif = j - r[j % a.Length];\n int _dif = p - _r[j % a.Length];\n p += ((a.Length * b - j) / dif) * (_dif);\n j += ((a.Length * b - j) / dif) * dif;\n while (j + __cnt[j % a.Length] <= a.Length * b)\n {\n p++;\n j += __cnt[j % a.Length];\n }\n break;\n }\n r[j % a.Length] = j;\n _r[j % a.Length] = p;\n j += __cnt[j % a.Length];\n if (j <= a.Length * b) p++;\n }\n Console.WriteLine(p);\n\n }\n\n static void E()\n {\n\n }\n\n static void TestGen()\n {\n\n }\n\n static string[] ReadArray(char sep)\n {\n return Console.ReadLine().Split(sep);\n }\n\n static int ReadInt()\n {\n return int.Parse(Console.ReadLine());\n }\n\n static string ReadLine()\n {\n return Console.ReadLine();\n }\n }\n\n public static class MyMath\n {\n public static long BinPow(long a, long n, long mod)\n {\n long res = 1;\n while (n > 0)\n {\n if ((n & 1) == 1)\n {\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) b = a % (a = b);\n return a;\n }\n\n public static int GCD(int a, int b)\n {\n while (b != 0) 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 class Edge\n {\n public int a;\n public int b;\n public int w;\n\n public Edge(int a, int b, int w)\n {\n this.a = a;\n this.b = b;\n this.w = w;\n }\n }\n\n class Graph\n {\n public List[] g;\n public int[] color; //0-white, 1-gray, 2-black\n public int[] o; //open\n public int[] c; //close\n public int[] p;\n public int[] d;\n public List e;\n public Stack ans = new Stack();\n public Graph(int n)\n {\n g = new List[n + 1];\n for (int i = 0; i <= n; i++)\n g[i] = new List();\n color = new int[n + 1];\n o = new int[n + 1];\n c = new int[n + 1];\n p = new int[n + 1];\n d = new int[n + 1];\n }\n\n const int white = 0;\n const int gray = 1;\n const int black = 2;\n\n public bool DFS(int u, ref int time)\n {\n color[u] = gray;\n time++;\n o[u] = time;\n for (int i = 0; i < g[u].Count; i++)\n {\n int v = g[u][i];\n if (color[v] == gray)\n {\n return true;\n }\n if (color[v] == white)\n {\n p[v] = u;\n if (DFS(v, ref time)) return true;\n }\n }\n color[u] = black;\n ans.Push(u);\n c[u] = time;\n time++;\n return false;\n }\n }\n\n static class GraphUtils\n {\n const int white = 0;\n const int gray = 1;\n const int black = 2;\n\n public static void BFS(int s, Graph g)\n {\n Queue q = new Queue();\n q.Enqueue(s);\n while (q.Count != 0)\n {\n int u = q.Dequeue();\n for (int i = 0; i < g.g[u].Count; i++)\n {\n int v = g.g[u][i];\n if (g.color[v] == white)\n {\n g.color[v] = gray;\n g.d[v] = g.d[u] + 1;\n g.p[v] = u;\n q.Enqueue(v);\n }\n }\n g.color[u] = black;\n }\n }\n\n public static bool DFS(int u, ref int time, Graph g, Stack st)\n {\n g.color[u] = gray;\n time++;\n g.o[u] = time;\n for (int i = 0; i < g.g[u].Count; i++)\n {\n int v = g.g[u][i];\n if (g.color[v] == gray)\n {\n return true;\n }\n if (g.color[v] == white)\n {\n g.p[v] = u;\n if (DFS(v, ref time, g, st)) return true;\n }\n }\n g.color[u] = black;\n st.Push(u);\n g.c[u] = time;\n time++;\n return false;\n }\n\n public static void FordBellman(int u, Graph g)\n {\n int n = g.g.Length;\n for (int i = 0; i <= n; i++)\n {\n g.d[i] = int.MaxValue;\n g.p[i] = 0;\n }\n\n g.d[u] = 0;\n\n for (int i = 0; i < n - 1; i++)\n {\n for (int j = 0; j < g.e.Count; j++)\n {\n if (g.d[g.e[j].a] != int.MaxValue)\n {\n if (g.d[g.e[j].a] + g.e[j].w < g.d[g.e[j].b])\n {\n g.d[g.e[j].b] = g.d[g.e[j].a] + g.e[j].w;\n g.p[g.e[j].b] = g.e[j].a;\n }\n }\n }\n }\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 {\n mid = left + ((right - left) >> 1);\n if (val <= a[mid])\n {\n right = mid;\n }\n else\n {\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 {\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\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 {\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 {\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 {\n if (i > q)\n {\n for (; k <= r; k++, j++)\n A[k] = R[j];\n return;\n }\n if (j > r)\n {\n for (; k <= r; k++, i++)\n A[k] = L[i];\n return;\n }\n if (comp(L[i], R[j]) <= 0)\n {\n A[k] = L[i];\n i++;\n }\n else\n {\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) 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 {\n if (i > q)\n {\n for (; k <= r; k++, j++)\n A[k] = R[j];\n return;\n }\n if (j > r)\n {\n for (; k <= r; k++, i++)\n A[k] = L[i];\n return;\n }\n if (L[i].CompareTo(R[j]) >= 0)\n {\n A[k] = L[i];\n i++;\n }\n else\n {\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) 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 static void Shake(T[] a)\n {\n Random rnd = new Random(Environment.TickCount);\n T temp;\n int b, c;\n for (int i = 0; i < a.Length; i++)\n {\n b = rnd.Next(0, a.Length);\n c = rnd.Next(0, a.Length);\n temp = a[b];\n a[b] = a[c];\n a[c] = temp;\n }\n }\n }\n}", "lang": "MS C#", "bug_code_uid": "7edc18b016bedd050d7fb8cc095f8b2c", "src_uid": "5ea0351ac9f949dedae1928bfb7ebffa", "apr_id": "1c65fca2b3d1d0e0d4ab80bb39d01afc", "difficulty": 2000, "tags": ["dfs and similar", "strings"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.6320455984800507, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 3, "bug_source_code": "using System;\nusing System.Collections;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Text.RegularExpressions;\nusing System.Threading.Tasks;\n\nnamespace CodeForces\n{\n public class CodeForces\n {\n static void Main(string[] args)\n {\n var arr = GetArray();\n var n = arr[0];\n var a = arr[1];\n var b = arr[2];\n Console.WriteLine(Solve(n,a,b));\n }\n\n public static void Tests()\n {\n //\\\n }\n\n public static long Solve(int n, int a, int b)\n {\n\n var i = 1;\n var k = n - i;\n var max = 0;\n while ( i <= k)\n {\n var m = Math.Min(a / i, b / k);\n var t = Math.Min(a / k, b / i);\n max = Math.Max(max, m);\n max = Math.Max(max, t);\n i++;\n k = n - i;\n\n }\n return max;\n\n }\n\n }\n}", "lang": "Mono C#", "bug_code_uid": "287d9abd114a75c4c805b90ef4c0ec09", "src_uid": "a254b1e3451c507cf7ce3e2496b3d69e", "apr_id": "7bf6e59df565ab4b4266e737ca5cd385", "difficulty": 1200, "tags": ["brute force", "implementation", "binary search"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.9993021632937893, "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 _224A.Parallelepiped\n{\n class Program\n {\n static void Main(string[] args)\n {\n double[] arz = Console.ReadLine().Split().Select(double.Parse).ToArray();\n Console.WriteLine(coun(arz));\n \n }\n static int coun(double[]ars)\n {\n \n double x= ars[0] * ars[2] / ars[1];\n double y= ars[0] * ars[1] / ars[2];\n double z= ars[1] * ars[2] / ars[0];\n int a=0, b=0, c=0;\n int[] roots = new int[10001];\n for (int i = 0; i < roots.Length; i++)\n {\n roots[i] = (i) * (i);\n }\n int j = 1;\n while(x>=roots[j]|| y >= roots[j]|| z >= roots[j])\n {\n if (x <= roots[j] && x > roots[j - 1])\n {\n x = roots[j];\n a = j;\n } \n if (y <= roots[j] && y > roots[j - 1])\n {\n y = roots[j];\n b = j;\n }\n if (z <= roots[j] && z > roots[j - 1])\n {\n z = roots[j];\n c = j;\n }\n j++;\n }\n return (4*(a + b + c));\n }\n }\n}", "lang": "MS C#", "bug_code_uid": "4934705a9cbf83e668f715cf7268a3c9", "src_uid": "c0a3290be3b87f3a232ec19d4639fefc", "apr_id": "4016e329c65a46931b269cb46dd8d1fe", "difficulty": 1100, "tags": ["geometry", "math", "brute force"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C#"} {"similarity_score": 0.7625786163522013, "equal_cnt": 6, "replace_cnt": 5, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 5, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\n\nnamespace CodeForces\n{\n\tinternal class Template\n\t{\n\t\tprivate static readonly Scanner cin = new Scanner();\n\n\t\tprivate static void Main()\n\t\t{\n\t\t\t//Console.SetIn(new StreamReader(@\"C:\\CodeForces\\input.txt\"));\n\t\t\tnew Template().Solve();\n\t\t}\n\n\t\tprivate void Solve()\n\t\t{\n\t\t\tvar p = cin.NextInt();\n\t\t\tvar primes = new List();\n\t\t\tprimes.Add(2);\n\t\t\tprimes.Add(3);\n\t\t\tfor (var i = 5; i < 4010; i += 2)\n\t\t\t{\n\t\t\t\tif (!primes.Any(x => i % x == 0))\n\t\t\t\t{\n\t\t\t\t\tprimes.Add(i);\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor (var i = 0; i < primes.Count; i++)\n\t\t\t{\n\t\t\t\tif (primes[i] == p)\n\t\t\t\t{\n\t\t\t\t\tConsole.WriteLine(i);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tinternal class Scanner\n\t{\n\t\tprivate string[] s = new string[0];\n\t\tprivate int i;\n\t\tprivate readonly char[] cs = new[] { ' ' };\n\n\t\tpublic string Next()\n\t\t{\n\t\t\tif (i < s.Length) return s[i++];\n\t\t\tvar line = Console.ReadLine() ?? string.Empty;\n\t\t\ts = line.Split(cs, StringSplitOptions.RemoveEmptyEntries);\n\t\t\ti = 1;\n\t\t\treturn s.First();\n\t\t}\n\n\t\tpublic double NextDouble()\n\t\t{\n\t\t\treturn double.Parse(Next());\n\t\t}\n\n\t\tpublic int NextInt()\n\t\t{\n\t\t\treturn int.Parse(Next());\n\t\t}\n\n\t\tpublic long NextLong()\n\t\t{\n\t\t\treturn long.Parse(Next());\n\t\t}\n\t}\n}", "lang": "Mono C#", "bug_code_uid": "0c63ac7ee6fa58087c6f7f5c9b705a18", "src_uid": "3bed682b6813f1ddb54410218c233cff", "apr_id": "78be01f7929b8b0965c8900c2ae65718", "difficulty": 1400, "tags": ["number theory", "math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9735994848679974, "equal_cnt": 7, "replace_cnt": 2, "delete_cnt": 1, "insert_cnt": 3, "fix_ops_cnt": 6, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Numerics;\n\nnamespace CodeForces174DIV2A\n{\n class CowsAndPrimitiveRoots\n {\n static void Main(string[] args)\n {\n int p = int.Parse(Console.ReadLine());\n int counter = 0; bool isgood = true; BigInteger cur = 1;\n for (int x = 2; x < p; x++)\n {\n for (int i = 1; i <= p - 2; i++)\n {\n cur = cur * x;\n if (cur % p == 1) { isgood = false; break; }\n }\n if (isgood && ((cur*x) % p == 1)) counter++;\n isgood = true; cur = 1;\n }\n Console.WriteLine(counter);\n Console.Read();\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "1f59331401569e9431f31397cdc33951", "src_uid": "3bed682b6813f1ddb54410218c233cff", "apr_id": "a0226d1f579e25c4e19edd8f8332a559", "difficulty": 1400, "tags": ["number theory", "math", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.9761227970437749, "equal_cnt": 5, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 4, "bug_source_code": "using System;\nusing System.Collections;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\n\nclass TEST{\n\tstatic void Main(){\n\t\tSol mySol =new Sol();\n\t\tmySol.Solve();\n\t}\n}\n\nclass Sol{\n\tlong gcd(long a, long b){ return a == 0 ? b : gcd(b % a, a);}\n\tpublic void Solve(){\ntry{\nchecked{\n\t\t\n\t\tlong mo = N * K;\n\t\tList X = new List(){\n\t\t\tA, (mo - A) % mo\n\t\t};\n\t\tlong ma = -1, mi = (long) 1e18;\n\t\tforeach(var s in X){\n\t\t\tfor(int i=0;iint.Parse(e));}\n\tstatic long[] rla(char sep=' '){return Array.ConvertAll(Console.ReadLine().Split(sep),e=>long.Parse(e));}\n\tstatic double[] rda(char sep=' '){return Array.ConvertAll(Console.ReadLine().Split(sep),e=>double.Parse(e));}\n}\n", "lang": "Mono C#", "bug_code_uid": "c323cdc4d6097f6d5aff921b55db4709", "src_uid": "5bb4adff1b332f43144047955eefba0c", "apr_id": "eb79b4481fcbcda6c653127f1fb3b90b", "difficulty": 1700, "tags": ["math", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.016272189349112426, "equal_cnt": 23, "replace_cnt": 21, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 23, "bug_source_code": "\n\n \n Debug\n x86\n 8.0.30703\n 2.0\n {2297ECA0-C062-46E8-B61B-A63120803B57}\n Exe\n Properties\n Tram\n Tram\n v4.0\n Client\n 512\n \n \n x86\n true\n full\n false\n bin\\Debug\\\n DEBUG;TRACE\n prompt\n 4\n \n \n x86\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", "lang": "Mono C#", "bug_code_uid": "aa77bcbd0228cf04b1f4566de0c82e6d", "src_uid": "f13eba0a0fb86e20495d218fc4ad532d", "apr_id": "50ac2a9fd6ed3ac2c566f840a122a5ad", "difficulty": 800, "tags": ["strings", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9884057971014493, "equal_cnt": 3, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\nusing System.Text.RegularExpressions;\nusing System.IO;\nusing System.Numerics;\nusing System.Globalization;\nusing System.Threading;\n\n\nnamespace probleme {\n class Program {\n static void Main(string[] args) {\n\n //Console.SetIn(new StreamReader(\"file.in\"));\n /*\n FileStream filestream = new FileStream(\"out.txt\", FileMode.Create);\n var streamwriter = new StreamWriter(filestream);\n streamwriter.AutoFlush = true;\n Console.SetOut(streamwriter);\n */\n\n string[] s = Console.ReadLine().Split(':');\n int h = int.Parse(s[0]), m = int.Parse(s[1]);\n int a = int.Parse(Console.ReadLine());\n int m1 = a % 60;\n a /= 60;\n int h1 = a % 24;\n int m2 = (m1 + m) % 60;\n int h2 = ((m1 + m) / 60 + h1 + h) % 24;\n char[] a1 = new char[2];\n char[] a2 = new char[2];\n a1[1] = (char)(h2 % 10 + '0');\n h2 /= 10;\n a1[0] = (char)(h2 % 10 + '0');\n a2[1] = (char)(m2 % 10 + '0');\n m2 /= 10;\n a2[0] = (char)(m2 % 10 + '0');\n Console.Write(\"{0}:{1}\", a1, a2);\n\n //Console.ReadKey();\n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "46f45c20de62f49fed78f0a91331577c", "src_uid": "20c2d9da12d6b88f300977d74287a15d", "apr_id": "218b649edd6a53c1cac600840ab1ab11", "difficulty": 900, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.022035676810073453, "equal_cnt": 16, "replace_cnt": 13, "delete_cnt": 1, "insert_cnt": 3, "fix_ops_cnt": 17, "bug_source_code": "\nMicrosoft Visual Studio Solution File, Format Version 12.00\n# Visual Studio 2013\nVisualStudioVersion = 12.0.21005.1\nMinimumVisualStudioVersion = 10.0.40219.1\nProject(\"{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}\") = \"ConsoleApplication1\", \"ConsoleApplication1\\ConsoleApplication1.csproj\", \"{70ADB980-9528-4E57-BA4F-42243ED6D468}\"\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{70ADB980-9528-4E57-BA4F-42243ED6D468}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{70ADB980-9528-4E57-BA4F-42243ED6D468}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{70ADB980-9528-4E57-BA4F-42243ED6D468}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{70ADB980-9528-4E57-BA4F-42243ED6D468}.Release|Any CPU.Build.0 = Release|Any CPU\n\tEndGlobalSection\n\tGlobalSection(SolutionProperties) = preSolution\n\t\tHideSolutionNode = FALSE\n\tEndGlobalSection\nEndGlobal\n", "lang": "MS C#", "bug_code_uid": "fea91588699597eed9845dad1a433b39", "src_uid": "20c2d9da12d6b88f300977d74287a15d", "apr_id": "23907c27b9ca7dc5a2f0cf4f420be228", "difficulty": 900, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.44057118857622846, "equal_cnt": 11, "replace_cnt": 5, "delete_cnt": 2, "insert_cnt": 4, "fix_ops_cnt": 11, "bug_source_code": "using System;\nusing System.Collections;\nusing System.Collections.Generic;\nusing System.Diagnostics;\nusing System.IO;\nusing System.Linq;\nusing System.Numerics;\nusing System.Text;\nusing System.Text.RegularExpressions;\nusing System.Threading.Tasks;\nusing static System.Math;\nusing MethodImplAttribute = System.Runtime.CompilerServices.MethodImplAttribute;\nusing MethodImplOptions = System.Runtime.CompilerServices.MethodImplOptions;\n\npublic static class P\n{\n public static void Main()\n {\n var nm = Console.ReadLine().Split().Select(int.Parse).ToArray();\n var n = nm[0];\n ModInt.MOD = nm[1];\n ModInt res = 0;\n for (int frameSize = 1; frameSize <= n; frameSize++)\n res += (n - frameSize + 1) * Factorial(frameSize) * Factorial(n - frameSize + 1);\n Console.WriteLine(res);\n }\n\n static List factorialMemo = new List() { 1 };\n static ModInt Factorial(int x)\n {\n for (int i = factorialMemo.Count; i <= x; i++) factorialMemo.Add(factorialMemo.Last() * i);\n return factorialMemo[x];\n }\n}\n\n\nstruct ModInt\n{\n public static int MOD;\n long Data;\n [MethodImpl(MethodImplOptions.AggressiveInlining)]\n public ModInt(long data) { if ((Data = data % MOD) < 0) Data += MOD; }\n [MethodImpl(MethodImplOptions.AggressiveInlining)]\n public static implicit operator long(ModInt modInt) => modInt.Data;\n [MethodImpl(MethodImplOptions.AggressiveInlining)]\n public static implicit operator ModInt(long val) => new ModInt(val);\n [MethodImpl(MethodImplOptions.AggressiveInlining)]\n public static ModInt operator +(ModInt a, int b) => new ModInt() { Data = (a.Data + b) % MOD };\n [MethodImpl(MethodImplOptions.AggressiveInlining)]\n public static ModInt operator +(ModInt a, long b) => new ModInt(a.Data + b);\n [MethodImpl(MethodImplOptions.AggressiveInlining)]\n public static ModInt operator +(ModInt a, ModInt b) { long res = a.Data + b.Data; return new ModInt() { Data = res >= MOD ? res - MOD : res }; }\n [MethodImpl(MethodImplOptions.AggressiveInlining)]\n public static ModInt operator -(ModInt a, int b) => new ModInt() { Data = (a.Data - b) % MOD };\n [MethodImpl(MethodImplOptions.AggressiveInlining)]\n public static ModInt operator -(ModInt a, long b) => new ModInt(a.Data - b);\n [MethodImpl(MethodImplOptions.AggressiveInlining)]\n public static ModInt operator -(ModInt a, ModInt b) { long res = a.Data - b.Data; return new ModInt() { Data = res < 0 ? res + MOD : res }; }\n [MethodImpl(MethodImplOptions.AggressiveInlining)]\n public static ModInt operator *(ModInt a, int b) => new ModInt(a.Data * b);\n [MethodImpl(MethodImplOptions.AggressiveInlining)]\n public static ModInt operator *(ModInt a, long b) => a * new ModInt(b);\n [MethodImpl(MethodImplOptions.AggressiveInlining)]\n public static ModInt operator *(ModInt a, ModInt b) => new ModInt() { Data = a.Data * b.Data % MOD };\n [MethodImpl(MethodImplOptions.AggressiveInlining)]\n public static ModInt operator /(ModInt a, ModInt b) => new ModInt() { Data = a.Data * GetInverse(b) % MOD };\n [MethodImpl(MethodImplOptions.AggressiveInlining)]\n public override string ToString() => Data.ToString();\n [MethodImpl(MethodImplOptions.AggressiveInlining)]\n static long GetInverse(long a)\n {\n long div, p = MOD, x1 = 1, y1 = 0, x2 = 0, y2 = 1;\n while (true)\n {\n if (p == 1) return x2 + MOD; div = a / p; x1 -= x2 * div; y1 -= y2 * div; a %= p;\n if (a == 1) return x1 + MOD; div = p / a; x2 -= x1 * div; y2 -= y1 * div; p %= a;\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "033fe30304545cc573950be2d233d90c", "src_uid": "020d5dae7157d937c3f58554c9b155f9", "apr_id": "95e3e1da02d4a4b263bef0f213f3da9b", "difficulty": 1600, "tags": ["math", "combinatorics"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9982127490567286, "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.IO;\nusing System.Linq;\nusing static System.Math;\nusing System.Text;\nusing System.Threading;\nusing System.Globalization;\nusing System.Runtime.CompilerServices;\nusing Library;\n\nnamespace Program\n{\n public static class CODEFORCES1\n {\n static public int numberOfRandomCases = 0;\n static public void MakeTestCase(List _input, List _output, ref Func _outputChecker)\n {\n }\n static public void Solve()\n {\n var n = NN;\n var m = NN;\n LIB_Mod._mod = m;\n LIB_Mod ans = 0L;\n for (var i = 1; i <= n; i++)\n {\n LIB_Mod tmp = (n - i + 1);\n tmp.Mul(n - i + 1);\n tmp.Mul(LIB_Mod.Perm(i, i));\n tmp.Mul(LIB_Mod.Perm(n - i, n - i));\n ans += tmp;\n }\n Console.WriteLine(ans);\n }\n static class Console_\n {\n static Queue param = new Queue();\n public static string NextString() { if (param.Count == 0) foreach (var item in Console.ReadLine().Split(' ')) param.Enqueue(item); return param.Dequeue(); }\n }\n class Printer : StreamWriter\n {\n public override IFormatProvider FormatProvider { get { return CultureInfo.InvariantCulture; } }\n public Printer(Stream stream) : base(stream, new UTF8Encoding(false, true)) { base.AutoFlush = false; }\n public Printer(Stream stream, Encoding encoding) : base(stream, encoding) { base.AutoFlush = false; }\n }\n static public void Main(string[] args) { if (args.Length == 0) { Console.SetOut(new Printer(Console.OpenStandardOutput())); } var t = new Thread(Solve, 134217728); t.Start(); t.Join(); Console.Out.Flush(); }\n static long NN => long.Parse(Console_.NextString());\n static double ND => double.Parse(Console_.NextString());\n static string NS => Console_.NextString();\n static long[] NNList(long N) => Repeat(0, N).Select(_ => NN).ToArray();\n static double[] NDList(long N) => Repeat(0, N).Select(_ => ND).ToArray();\n static string[] NSList(long N) => Repeat(0, N).Select(_ => NS).ToArray();\n static IEnumerable OrderByRand(this IEnumerable x) => x.OrderBy(_ => xorshift);\n static long Count(this IEnumerable x, Func pred) => Enumerable.Count(x, pred);\n static IEnumerable Repeat(T v, long n) => Enumerable.Repeat(v, (int)n);\n static IEnumerable Range(long s, long c) => Enumerable.Range((int)s, (int)c);\n static uint xorshift { get { _xsi.MoveNext(); return _xsi.Current; } }\n static IEnumerator _xsi = _xsc();\n static IEnumerator _xsc() { uint x = 123456789, y = 362436069, z = 521288629, w = (uint)(DateTime.Now.Ticks & 0xffffffff); while (true) { var t = x ^ (x << 11); x = y; y = z; z = w; w = (w ^ (w >> 19)) ^ (t ^ (t >> 8)); yield return w; } }\n }\n}\nnamespace Library {\n struct LIB_Mod : IEquatable, IEquatable\n {\n static public long _mod = 1000000007; long v;\n [MethodImpl(MethodImplOptions.AggressiveInlining)]\n public LIB_Mod(long x)\n {\n if (x < _mod && x >= 0) v = x;\n else if ((v = x % _mod) < 0) v += _mod;\n }\n [MethodImpl(MethodImplOptions.AggressiveInlining)]\n static public implicit operator LIB_Mod(long x) => new LIB_Mod(x);\n [MethodImpl(MethodImplOptions.AggressiveInlining)]\n static public implicit operator long(LIB_Mod x) => x.v;\n [MethodImpl(MethodImplOptions.AggressiveInlining)]\n public void Add(LIB_Mod x) { if ((v += x.v) >= _mod) v -= _mod; }\n [MethodImpl(MethodImplOptions.AggressiveInlining)]\n public void Sub(LIB_Mod x) { if ((v -= x.v) < 0) v += _mod; }\n [MethodImpl(MethodImplOptions.AggressiveInlining)]\n public void Mul(LIB_Mod x) => v = (v * x.v) % _mod;\n [MethodImpl(MethodImplOptions.AggressiveInlining)]\n public void Div(LIB_Mod x) => v = (v * Inverse(x.v)) % _mod;\n [MethodImpl(MethodImplOptions.AggressiveInlining)]\n static public LIB_Mod operator +(LIB_Mod x, LIB_Mod y) { var t = x.v + y.v; return t >= _mod ? new LIB_Mod { v = t - _mod } : new LIB_Mod { v = t }; }\n [MethodImpl(MethodImplOptions.AggressiveInlining)]\n static public LIB_Mod operator -(LIB_Mod x, LIB_Mod y) { var t = x.v - y.v; return t < 0 ? new LIB_Mod { v = t + _mod } : new LIB_Mod { v = t }; }\n [MethodImpl(MethodImplOptions.AggressiveInlining)]\n static public LIB_Mod operator *(LIB_Mod x, LIB_Mod y) => x.v * y.v;\n [MethodImpl(MethodImplOptions.AggressiveInlining)]\n static public LIB_Mod operator /(LIB_Mod x, LIB_Mod y) => x.v * Inverse(y.v);\n [MethodImpl(MethodImplOptions.AggressiveInlining)]\n static public bool operator ==(LIB_Mod x, LIB_Mod y) => x.v == y.v;\n [MethodImpl(MethodImplOptions.AggressiveInlining)]\n static public bool operator !=(LIB_Mod x, LIB_Mod y) => x.v != y.v;\n [MethodImpl(MethodImplOptions.AggressiveInlining)]\n static public long Inverse(long x)\n {\n long b = _mod, r = 1, u = 0, t = 0;\n while (b > 0)\n {\n var q = x / b;\n t = u;\n u = r - q * u;\n r = t;\n t = b;\n b = x - q * b;\n x = t;\n }\n return r < 0 ? r + _mod : r;\n }\n [MethodImpl(MethodImplOptions.AggressiveInlining)]\n public bool Equals(LIB_Mod x) => v == x.v;\n [MethodImpl(MethodImplOptions.AggressiveInlining)]\n public bool Equals(long x) => v == x;\n [MethodImpl(MethodImplOptions.AggressiveInlining)]\n public override bool Equals(object x) => x == null ? false : Equals((LIB_Mod)x);\n [MethodImpl(MethodImplOptions.AggressiveInlining)]\n public override int GetHashCode() => v.GetHashCode();\n [MethodImpl(MethodImplOptions.AggressiveInlining)]\n public override string ToString() => v.ToString();\n static List _fact = new List() { 1 };\n static long _factm = _mod;\n [MethodImpl(MethodImplOptions.AggressiveInlining)]\n static void B(long n)\n {\n if (_factm != _mod) _fact = new List() { 1 };\n if (n >= _fact.Count)\n for (int i = _fact.Count; i <= n; ++i)\n _fact.Add(_fact[i - 1] * i);\n }\n [MethodImpl(MethodImplOptions.AggressiveInlining)]\n static public LIB_Mod Comb(long n, long k)\n {\n B(n);\n if (n == 0 && k == 0) return 1;\n if (n < k || n < 0) return 0;\n return _fact[(int)n] / _fact[(int)(n - k)] / _fact[(int)k];\n }\n [MethodImpl(MethodImplOptions.AggressiveInlining)]\n static public LIB_Mod Perm(long n, long k)\n {\n B(n);\n if (n == 0 && k == 0) return 1;\n if (n < k || n < 0) return 0;\n return _fact[(int)n] / _fact[(int)(n - k)];\n }\n [MethodImpl(MethodImplOptions.AggressiveInlining)]\n static public LIB_Mod Pow(LIB_Mod x, long y)\n {\n LIB_Mod a = 1;\n while (y != 0)\n {\n if ((y & 1) == 1) a.Mul(x);\n x.Mul(x);\n y >>= 1;\n }\n return a;\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "cdfa4688ab2e40f80f7605f3ec81b99f", "src_uid": "020d5dae7157d937c3f58554c9b155f9", "apr_id": "203a3200de63f574bbf7e2d802b8f6d3", "difficulty": 1600, "tags": ["math", "combinatorics"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.9907149489322191, "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;\n\nnamespace edabit\n{\n public class BoringApartments\n {\n\n static Dictionary Pairs = new Dictionary();\n\n static BoringApartments() {\n Pairs[1]=1;\n Pairs[11]=3;\n Pairs[111]=6;\n Pairs[1111]=10;\n Pairs[2]=11;\n Pairs[22]=13;\n Pairs[222]=16;\n Pairs[2222]=20;\n Pairs[3]=21;\n Pairs[33]=23;\n Pairs[333]=26;\n Pairs[3333]=30;\n Pairs[4]=31;\n Pairs[44]=33;\n Pairs[444]=36;\n Pairs[4444]=40;\n Pairs[5]=41;\n Pairs[55]=43;\n Pairs[555]=46;\n Pairs[5555]=50;\n Pairs[6]=51;\n Pairs[66]=53;\n Pairs[666]=56;\n Pairs[6666]=60;\n Pairs[7]=61;\n Pairs[77]=63;\n Pairs[777]=66;\n Pairs[7777]=70;\n Pairs[8]=71;\n Pairs[88]=73;\n Pairs[888]=76;\n Pairs[8888]=80;\n Pairs[9]=81;\n Pairs[99]=83;\n Pairs[999]=86;\n Pairs[9999]=90;\n }\n\n static void Main(string[] args)\n {\n var line=\"\";\n var numTests = -1;\n int count = 0;\n int[] nums= null;\n do\n {\n line = Console.ReadLine();\n if (numTests == -1) {\n numTests = Int32.Parse(line);\n nums = new int[numTests];\n \n } else {\n if (count < numTests) {\n nums[count]=Int32.Parse(line);\n count++;\n }\n else if (count == numTests) {\n process(numTests, nums);\n }\n }\n } while (line != null);\n System.Environment.Exit(1);\n }\n\n static void process(int numTests, int[] input)\n {\n foreach (var item in input)\n {\n Console.WriteLine(Pairs[item]);\n }\n }\n }\n}", "lang": ".NET Core C#", "bug_code_uid": "ddad7d9de7bd1f7f1fc25d1710a5d955", "src_uid": "289a55128be89bb86a002d218d31b57f", "apr_id": "fa29db76756989a4626a49921e262a02", "difficulty": 800, "tags": ["math", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C#"} {"similarity_score": 0.011353711790393014, "equal_cnt": 12, "replace_cnt": 12, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 12, "bug_source_code": "\nMicrosoft Visual Studio Solution File, Format Version 12.00\n# Visual Studio Version 16\nVisualStudioVersion = 16.0.30611.23\nMinimumVisualStudioVersion = 10.0.40219.1\nProject(\"{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}\") = \"Boring Apartments\", \"Boring Apartments\\Boring Apartments.csproj\", \"{69A789E0-B204-4CC1-A7FE-A091E45AD0F2}\"\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{69A789E0-B204-4CC1-A7FE-A091E45AD0F2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{69A789E0-B204-4CC1-A7FE-A091E45AD0F2}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{69A789E0-B204-4CC1-A7FE-A091E45AD0F2}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{69A789E0-B204-4CC1-A7FE-A091E45AD0F2}.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 = {510506D6-1FE9-4D61-8675-322580D41B76}\n\tEndGlobalSection\nEndGlobal\n", "lang": ".NET Core C#", "bug_code_uid": "e3097544bad51cb687b4ae8597339f87", "src_uid": "289a55128be89bb86a002d218d31b57f", "apr_id": "2b57407cf98519aeeacbe80f3e573580", "difficulty": 800, "tags": ["math", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.49730700179533216, "equal_cnt": 17, "replace_cnt": 12, "delete_cnt": 3, "insert_cnt": 2, "fix_ops_cnt": 17, "bug_source_code": "using System;\nusing System.Linq;\nusing System.Runtime.InteropServices;\nusing System.Security.Cryptography;\n\nnamespace Olimp\n{\n class Program\n {\n \n static void Main(string[] args)\n {\n int a = int.Parse(Console.ReadLine());\n int c;\n int b = 0;\n int help = 1;\n int help2 = 0;\n int answer = 0;\n //int[] arr;\n\n for (int i = 0; i < a; i++)\n {\n //arr = Array.ConvertAll(Console.ReadLine().Trim().Split(), int.Parse);\n c = int.Parse(Console.ReadLine());\n\n while (true)\n {\n \n b = b * 10 + help;\n \n help2++;\n answer += help2;\n if (b == c) break;\n if (help2 == 4)\n {\n\n help++;\n b = help;\n answer++;\n help2 = 1;\n }\n \n }\n\n Console.WriteLine(answer);\n b = 0;\n help = 1;\n help2 = 0;\n answer = 0;\n\n }\n\n\n\n\n\n }\n }\n}\n \n\n", "lang": "Mono C#", "bug_code_uid": "5d1cf7d52b5269d20384cf5e569c7612", "src_uid": "289a55128be89bb86a002d218d31b57f", "apr_id": "93e7111712ce4faa882bba2f026aae88", "difficulty": 800, "tags": ["math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9990712485073636, "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.Diagnostics;\nusing System.IO;\nusing System.Linq;\nusing System.Numerics;\nusing System.Text;\n\nnamespace CodeforcesTemplate\n{\n public static class Permutation\n {\n private static bool Next(ref int[] arr)\n {\n int k, j, l;\n for (j = arr.Length - 2; (j >= 0) && (arr[j] >= arr[j + 1]); j--) { }\n if (j == -1)\n {\n arr = arr.OrderBy(c => c).ToArray();\n return false;\n }\n for (l = arr.Length - 1; (arr[j] >= arr[l]) && (l >= 0); l--) { }\n var tmp = arr[j];\n arr[j] = arr[l];\n arr[l] = tmp;\n for (k = j + 1, l = arr.Length - 1; k < l; k++, l--)\n {\n tmp = arr[k];\n arr[k] = arr[l];\n arr[l] = tmp;\n }\n return true;\n }\n public static IEnumerable AllPermutations(int[] arr)\n {\n do yield return arr;\n while (Next(ref arr));\n }\n }\n\n class Program\n {\n private const string FILENAME = \"distance4\";\n\n private const string INPUT = FILENAME + \".in\";\n\n private const string OUTPUT = FILENAME + \".out\";\n\n private static Stopwatch _stopwatch = new Stopwatch();\n\n private static StreamReader _reader = null;\n private static StreamWriter _writer = null;\n\n private static string[] _curLine;\n private static int _curTokenIdx;\n\n private static char[] _whiteSpaces = new char[] { ' ', '\\t', '\\r', '\\n' };\n\n private static string ReadNextToken()\n {\n if (_curTokenIdx >= _curLine.Length)\n {\n //Read next line\n string line = _reader.ReadLine();\n if (line != null)\n _curLine = line.Split(_whiteSpaces, StringSplitOptions.RemoveEmptyEntries);\n else\n _curLine = new string[] { };\n _curTokenIdx = 0;\n }\n\n if (_curTokenIdx >= _curLine.Length)\n return null;\n\n return _curLine[_curTokenIdx++];\n }\n\n private static int ReadNextInt()\n {\n return int.Parse(ReadNextToken());\n }\n\n private static void RunTimer()\n {\n#if (DEBUG)\n\n _stopwatch.Start();\n\n#endif\n }\n\n private static void Main(string[] args)\n {\n\n#if (DEBUG)\n double before = GC.GetTotalMemory(false);\n#endif\n\n int[] arr = Console.ReadLine().Split().Select(int.Parse).ToArray();\n\n long n = arr[0];\n long k = arr[1];\n\n for (int i = 1; i <= k; i++)\n {\n if ((n + 1) % i != 0)\n {\n Console.WriteLine(\"No\");\n return;\n }\n else if (i == k)\n {\n Console.WriteLine(\"Yes\");\n return;\n }\n }\n\n\n\n#if (DEBUG)\n _stopwatch.Stop();\n\n double after = GC.GetTotalMemory(false);\n\n double consumedInMegabytes = (after - before) / (1024 * 1024);\n\n Console.WriteLine($\"Time elapsed: {_stopwatch.Elapsed}\");\n\n Console.WriteLine($\"Consumed memory (MB): {consumedInMegabytes}\");\n\n Console.ReadKey();\n#endif\n\n\n }\n\n private static int CountLeadZeros(string source)\n {\n int countZero = 0;\n\n for (int i = source.Length - 1; i >= 0; i--)\n {\n if (source[i] == '0')\n {\n countZero++;\n }\n\n else\n {\n break;\n }\n\n }\n\n return countZero;\n }\n\n private static string ReverseString(string source)\n {\n char[] reverseArray = source.ToCharArray();\n\n Array.Reverse(reverseArray);\n\n string reversedString = new string(reverseArray);\n\n return reversedString;\n }\n\n\n private static int[] CopyOfRange(int[] src, int start, int end)\n {\n int len = end - start;\n int[] dest = new int[len];\n Array.Copy(src, start, dest, 0, len);\n return dest;\n }\n\n private static string StreamReader()\n {\n\n if (_reader == null)\n _reader = new StreamReader(INPUT);\n string response = _reader.ReadLine();\n if (_reader.EndOfStream)\n _reader.Close();\n return response;\n\n\n }\n\n private static void StreamWriter(string text)\n {\n\n if (_writer == null)\n _writer = new StreamWriter(OUTPUT);\n _writer.WriteLine(text);\n\n\n }\n\n\n\n\n\n private static int BFS(int start, int end, int[,] arr)\n {\n Queue> queue = new Queue>();\n List visited = new List();\n for (int i = 0; i < arr.GetLength(0); i++)\n {\n visited.Add(false);\n }\n\n queue.Enqueue(new KeyValuePair(start, 0));\n KeyValuePair node;\n int level = 0;\n bool flag = false;\n\n while (queue.Count != 0)\n {\n node = queue.Dequeue();\n if (node.Key == end)\n {\n return node.Value;\n }\n flag = false;\n for (int i = 0; i < arr.GetLength(0); i++)\n {\n\n if (arr[node.Key, i] == 1)\n {\n if (visited[i] == false)\n {\n if (!flag)\n {\n level = node.Value + 1;\n flag = true;\n }\n queue.Enqueue(new KeyValuePair(i, level));\n visited[i] = true;\n }\n }\n }\n\n }\n return 0;\n\n }\n\n\n\n private static void Write(string source)\n {\n File.WriteAllText(OUTPUT, source);\n }\n\n private static string ReadString()\n {\n return File.ReadAllText(INPUT);\n }\n\n private static void WriteStringArray(string[] source)\n {\n File.WriteAllLines(OUTPUT, source);\n }\n\n private static string[] ReadStringArray()\n {\n return File.ReadAllLines(INPUT);\n }\n\n private static int[] GetIntArray()\n {\n return ReadString().Split(' ').Select(int.Parse).ToArray();\n }\n\n private static double[] GetDoubleArray()\n {\n return ReadString().Split(' ').Select(double.Parse).ToArray();\n }\n\n private static int[,] ReadINT2XArray(List lines)\n {\n int[,] arr = new int[lines.Count, lines.Count];\n\n for (int i = 0; i < lines.Count; i++)\n {\n int[] row = lines[i].Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries).Select(int.Parse).ToArray();\n\n for (int j = 0; j < lines.Count; j++)\n {\n arr[i, j] = row[j];\n }\n }\n\n return arr;\n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "3dc2923637e5b114025061176bb20fb4", "src_uid": "5271c707c9c72ef021a0baf762bf3eb2", "apr_id": "5cc44a1944c260a3a22d13d3f37f0e7b", "difficulty": 1600, "tags": ["brute force", "number theory"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.8944099378881988, "equal_cnt": 3, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 4, "bug_source_code": " class Program\n {\n static void Main(string[] args)\n {\n var input = Console.ReadLine().Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries);\n\n var n = int.Parse(input[0]);\n var k = int.Parse(input[1]);\n\n if(k >= 43)\n {\n Console.WriteLine(\"No\");\n return;\n }\n\n for (var i = 1; i <= k; i++)\n {\n if (n % i != i - 1)\n {\n Console.WriteLine(\"No\");\n return;\n }\n }\n\n Console.WriteLine(\"Yes\");\n }\n }\n", "lang": "MS C#", "bug_code_uid": "f29bddd9aae3d79ee0d35abf7a3c99ec", "src_uid": "5271c707c9c72ef021a0baf762bf3eb2", "apr_id": "793759a389d87bc4d9060c10311ecd3f", "difficulty": 1600, "tags": ["brute force", "number theory"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.7233160621761658, "equal_cnt": 9, "replace_cnt": 5, "delete_cnt": 0, "insert_cnt": 4, "fix_ops_cnt": 9, "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 string[]y=Console.ReadLine().Split(' ');\n \n Console.WriteLine(Math.Pow(2,int.Parse(y[0])+int.Parse(y[1]))%998244353);\n \n }\n \n }\n}\n", "lang": "Mono C#", "bug_code_uid": "40503b870e3a03fc25fb669e725dc394", "src_uid": "8b2a9ae21740c89079a6011a30cd6aee", "apr_id": "8661fc33053a3370c833b7fe5e064b18", "difficulty": 1300, "tags": ["math", "combinatorics", "greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9847634322373697, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "using System;\nusing System.Collections;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\n\nnamespace Contest\n{\n class Program\n {\n static void Main(string[] args)\n {\n var wh = Array.ConvertAll(Console.ReadLine().Split(), Convert.ToInt32);\n int w = wh[0], h = wh[1];\n int t = Math.Max(w, h) + 2;\n Console.WriteLine(kq(t));\n }\n\n private static int kq(int t)\n {\n int mod = 998244353;\n int res = 1;\n while (t-- > 0)\n res = res * 2 % mod;\n return res;\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "de5f9b44bb1a8afe37cd0bbb352ce00b", "src_uid": "8b2a9ae21740c89079a6011a30cd6aee", "apr_id": "6d953a3fc87ebf5a37e7bfacf29e0302", "difficulty": 1300, "tags": ["math", "combinatorics", "greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9970414201183432, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "using System;\nclass Program\n{\n static void Main()\n {\n int n = int.Parse(Console.ReadLine());\n int j = 0;\n bool ans = false;\n while (++j < n)\n {\n int x = j * (j + 1) / 2;\n if (x == n)\n ans = true;\n }\n Console.WriteLine(ans ? \"YES\" : \"NO\");\n }\n}", "lang": "Mono C#", "bug_code_uid": "5fd0b12b0b35acbfd3bdcd91768afc6b", "src_uid": "587d4775dbd6a41fc9e4b81f71da7301", "apr_id": "6a4e4cd983552b42cb3134da323e0bb8", "difficulty": 800, "tags": ["math", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "C#"} {"similarity_score": 0.9433384379785605, "equal_cnt": 2, "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;\n\nnamespace CodeForce\n{\n class Program\n {\n static void Main(string[] args)\n {\n string InPut = Console.ReadLine();\n long Out = 0;\n long Value = long.Parse(InPut);\n Out = ((InPut.Length - 1) * 9);\n string Big_num = new string('9', (int)(InPut.Length - 1));\n string new_value = (Value - long.Parse(Big_num)).ToString();\n foreach (var i in new_value) Out += long.Parse(i.ToString());\n Console.WriteLine(Out);\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "18bfcd373579e56d223a6c86e4151459", "src_uid": "5c61b4a4728070b9de49d72831cd2329", "apr_id": "162fcd97650d603d385bfed420cd5df4", "difficulty": 1100, "tags": ["greedy"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.9981255857544518, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "using System;\nusing System.IO;\nusing System.Text;\n\nnamespace Maximum_Sum_of_Digits\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());\n writer.Flush();\n }\n\n private static int Solve()\n {\n string s = reader.ReadLine();\n\n int ans = s[0] - '0';\n bool fn9 = false;\n for (int i = s.Length - 1; i > 0; i++)\n {\n if (fn9 || s[i] != '9')\n {\n ans += 9;\n ans += s[i] - '0';\n fn9 = true;\n }\n else\n {\n ans += 9;\n }\n }\n\n return ans;\n }\n }\n}", "lang": "Mono C#", "bug_code_uid": "e1e4c716b4813f03c9947d069a3cab73", "src_uid": "5c61b4a4728070b9de49d72831cd2329", "apr_id": "52b20ea2ad8519a839c3a6612014d310", "difficulty": 1100, "tags": ["greedy"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.39800995024875624, "equal_cnt": 10, "replace_cnt": 5, "delete_cnt": 4, "insert_cnt": 1, "fix_ops_cnt": 10, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\n\nnamespace ProblemSolving\n{\n class Program\n {\n static void Main(string[] args)\n {\n int[] num = new int[3];\n while ((num[0] = Convert.ToInt16(Console.ReadLine()))!=null)\n {\n for (int i = 1; i < 3; i++)\n {\n num[i] = Convert.ToInt16(Console.ReadLine());\n }\n \n int a = Math.Max(num[0] + num[1] + num[2], Math.Max(num[0] * num[1] * num[2],\n Math.Max(num[0] + num[1] * num[2],Math.Max((num[0] + num[1]) * num[2], num[0] * (num[1] + num[2])))));\n Console.WriteLine(a.ToString());\n }\n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "2a5d19d71a203e0c495e1e1537896df4", "src_uid": "1cad9e4797ca2d80a12276b5a790ef27", "apr_id": "38cd8a97254d03f05c9e46f91fdec827", "difficulty": 1000, "tags": ["math", "brute force"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.8182166092613854, "equal_cnt": 40, "replace_cnt": 9, "delete_cnt": 11, "insert_cnt": 19, "fix_ops_cnt": 39, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.ComponentModel;\nusing System.Linq;\n\nnamespace ConsoleApplication13\n{\n class Program\n {\n static void Main(string[] args)\n {\n int n = Int32.Parse(Console.ReadLine());\n\n int spin = 0;\n int bicz = 0;\n int grud = 0;\n \n string fd = Console.ReadLine();\n\n int[] arrayiNT = new int[n];\n\n for (int i = 1; i < n + 1; i++)\n {\n arrayiNT[i-1] = Int32.Parse(fd.Split(' ')[i-1]);\n if (i % 3 == 0)\n {\n spin += arrayiNT[i-1];\n }\n if (i % 3 == 1)\n {\n grud += arrayiNT[i-1];\n }\n if (i % 3 == 2)\n {\n bicz += arrayiNT[i-1];\n }\n }\n\n Dictionary slovar = new Dictionary() { { spin, \"back\" }, { bicz, \"biceps\" }, { grud, \"chest\" } };\n List upra = new List();\n\n upra.Add(spin);\n upra.Add(grud);\n upra.Add(bicz);\n\n Console.WriteLine(slovar[upra.Max()]);\n }\n }\n}", "lang": "MS C#", "bug_code_uid": "4aa40ae7a25bc1120fb267b50e3cccb5", "src_uid": "579021de624c072f5e0393aae762117e", "apr_id": "17614657f31d0ce604d333ab7164ef8c", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.9827387802071347, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Collections;\n\nnamespace checkForSplit\n{\n\n class Program\n {\n\n static void Main(string[] args)\n {\n int n = int.Parse(Console.ReadLine());\n // List[]lst = new List[1000];\n List lst = new List();\n int k = 0;\n int beg = n / 2;\n lst.Add(n);\n while (beg != 1)\n {\n if (lst[lst.Count - 1] % beg == 0)\n {\n lst.Add(beg);\n beg /= 2;\n }\n else beg--;\n }\n lst.Add(1);\n foreach (var i in lst)\n {\n Console.Write(i+\" \");\n }\n Console.WriteLine();\n }\n }\n \n}\n", "lang": "Mono C#", "bug_code_uid": "4250884ff36934fdc990a1ddf4499f18", "src_uid": "2fc946bb72f56b6d86eabfaf60f9fa63", "apr_id": "3787fd4d770a7bf06e9100b0bb1cfa27", "difficulty": 1300, "tags": ["greedy"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.971542025148908, "equal_cnt": 6, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 5, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\n\nnamespace CF_058B {\n class Program {\n static void Main(string[] args) {\n int[] p=new int[1000]; p[0]=2;\n int t=1,u=1,j;while(t<=1000){t+=2;p[u]=t;\n j=1;while(t%p[j]!=0)j++;\n if(j==u)u++;\n }\n int n=int.Parse(Console.ReadLine());\n p[u]=n;\n int mlu=0; int[] m=new int[10],l=new int[10];\n for(j=0;p[u]!=1;j++) {\n if(p[u]%p[j]!=0) continue;\n m[mlu]=p[j];\n while(p[u]%p[j]==0) { l[mlu]++; p[u]/=p[j]; };\n mlu++;\n }\n for(j=0;j0){\n Console.Write(\"{0} \",n);\n n/=m[j];l[j]--;\n }\n Console.WriteLine(1);\n\n\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "0228966caf89c73e84ead933761d88a1", "src_uid": "2fc946bb72f56b6d86eabfaf60f9fa63", "apr_id": "317fa2cb58c9d8a276acb9dd22ab4c37", "difficulty": 1300, "tags": ["greedy"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.9038709677419355, "equal_cnt": 11, "replace_cnt": 6, "delete_cnt": 1, "insert_cnt": 3, "fix_ops_cnt": 10, "bug_source_code": "using System;\n\npublic class Coins\n{\n private static void Main()\n {\n\n const int max = 1000;\n int n = Convert.ToInt32(Console.ReadLine());\n int[] primes = new int[max + 1];\n primes[1] = 2;\n primes[2] = 3;\n int curr_prime = 3;\n int sqrt = 1;\n for (int i = 4; (curr_prime <= max && i < Int32.MaxValue); i++)\n {\n if ((sqrt + 1) * (sqrt + 1) == i)\n sqrt++;\n\n bool f = true;\n for (int j = 1; primes[j] <= sqrt; j++)\n {\n if (i % primes[j] == 0)\n {\n f = false;\n break;\n }\n }\n\n if (f)\n {\n primes[curr_prime] = i;\n curr_prime++;\n }\n }\n\n bool f = true;\n while (n > 1 && f)\n {\n sqrt = (int)Math.Sqrt(n);\n f = false;\n for (int i = 1; primes[i] <= n; i++)\n {\n if (n % primes[i] == 0)\n {\n Console.WriteLine(primes[i].ToString());\n n /= primes[i];\n f = true;\n break;\n }\n }\n }\n Console.WriteLine(primes[0].ToString()); \n\n }\n}", "lang": "Mono C#", "bug_code_uid": "64c26d512874d98ff13549dad79776b9", "src_uid": "2fc946bb72f56b6d86eabfaf60f9fa63", "apr_id": "19ac3c696e3b530b55cac999de452c30", "difficulty": 1300, "tags": ["greedy"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.6704953338119167, "equal_cnt": 14, "replace_cnt": 9, "delete_cnt": 5, "insert_cnt": 0, "fix_ops_cnt": 14, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\n\nnamespace CR_111_A\n{\n class Program\n {\n \n static void Main()\n {\n //int k = int.Parse(Console.ReadLine());\n //string[] tmp = Console.ReadLine().Split(' '); \n int k = int.Parse(Console.ReadLine());\n int[] ans = new int[k];\n int j = k - 1 ;\n while (k % j != 0)\n j--;\n if (j != 1)\n {\n for (int i = k, p = 0; i >= j; i -= j, p++)\n Console.Write(\"{0} \", k - p * j);\n Console.Write(1);\n\n }\n else\n Console.Write(\"{0} {1}\", k, 1);\n \n \n \n \n }\n\n\n\n }\n}", "lang": "Mono C#", "bug_code_uid": "1b22ee511f54d113bcdec0148a99a880", "src_uid": "2fc946bb72f56b6d86eabfaf60f9fa63", "apr_id": "04336230af13dc5e847571232b48ae6e", "difficulty": 1300, "tags": ["greedy"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.08990515785370924, "equal_cnt": 80, "replace_cnt": 56, "delete_cnt": 7, "insert_cnt": 17, "fix_ops_cnt": 80, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\nusing Tidbits;\n\nclass testcodeforces\n{\n int N;\n int[,] board;\n Dictionary> locations;\n\n public static void Main()\n {\n testcodeforces obj = new testcodeforces();\n obj.ThreePieces();\n }\n\n enum Pawn\n {\n Bishop = 0,\n Knight,\n Rook\n }\n class Move : IComparable\n {\n public int Moves { get; set; }\n public int Rep { get; set; }\n\n public int Num { get; set; }\n public Pawn pawn { get; set; }\n public int CompareTo(Move other)\n {\n if (Moves < other.Moves) return -1;\n if (Moves > other.Moves) return 1;\n\n if (Moves == other.Moves) return Rep.CompareTo(other.Rep);\n\n return 0;\n }\n }\n private void ThreePieces()\n {\n N = int.Parse(Console.ReadLine());\n\n board = new int[N, N];\n locations = new Dictionary>();\n\n for (int i = 0; i < N; i++)\n {\n var array = Array.ConvertAll(Console.ReadLine().Split(new char[] { ' ' }), int.Parse);\n\n for (int j = 0; j < N; j++)\n {\n board[i, j] = array[j];\n locations.Add(array[j], Tuple.Create(i + 1, j + 1));\n }\n }\n\n //Min of all\n #region rook Distances\n //Find rook distances\n var rook_distances = new Tuple[(N * N) + 1];\n rook_distances[1] = Tuple.Create(0, 0);\n\n for (int i = 2; i <= N * N; i++)\n {\n var current_location = locations[i - 1];\n var new_location = locations[i];\n\n if (current_location.Item1 == new_location.Item1 ||\n current_location.Item2 == new_location.Item2)\n rook_distances[i] = Tuple.Create(1, 0);\n else\n rook_distances[i] = Tuple.Create(2, 0);\n }\n #endregion\n\n #region Bishop Distances\n //Find Bishop Distances\n var bishop_distances = new Tuple[(N * N) + 1];\n bishop_distances[1] = Tuple.Create(0, 0);\n\n for (int i = 2; i <= N * N; i++)\n {\n var current_location = locations[i - 1];\n var new_location = locations[i];\n\n if ((current_location.Item1 + current_location.Item2) % 2 != (new_location.Item1 + new_location.Item2) % 2)\n bishop_distances[i] = Tuple.Create(int.MaxValue, 0);\n else\n {\n bool found = false;\n //Move North East\n for (int k = 1; k <= Math.Min(current_location.Item1 - 1, N - current_location.Item2); k++)\n {\n if (new_location.Item1 == current_location.Item1 - k && new_location.Item2 == current_location.Item2 + k)\n {\n bishop_distances[i] = Tuple.Create(1, 0);\n found = true;\n break;\n }\n }\n\n //Move South west\n if (!found)\n {\n for (int k = 1; k <= Math.Min(N - current_location.Item1, current_location.Item2 - 1); k++)\n {\n if (new_location.Item1 == current_location.Item1 + k && new_location.Item2 == current_location.Item2 - k)\n {\n bishop_distances[i] = Tuple.Create(1, 0);\n found = true;\n break;\n }\n }\n }\n\n //Move South east\n if (!found)\n {\n for (int k = 1; k <= Math.Min(N - current_location.Item1, N - current_location.Item2 - 1); k++)\n {\n if (new_location.Item1 == current_location.Item1 + k && new_location.Item2 == current_location.Item2 + k)\n {\n bishop_distances[i] = Tuple.Create(1, 0);\n found = true;\n break;\n }\n }\n }\n\n //Move North West\n if (!found)\n {\n for (int k = 1; k <= Math.Min(current_location.Item1 - 1, current_location.Item2 - 1); k++)\n {\n if (new_location.Item1 == current_location.Item1 - k && new_location.Item2 == current_location.Item2 - k)\n {\n bishop_distances[i] = Tuple.Create(1, 0);\n found = true;\n break;\n }\n }\n }\n\n if (!found)\n {\n bishop_distances[i] = Tuple.Create(2, 0);\n }\n }\n }\n #endregion\n\n #region Knight Distances\n //Find Knight Distances\n var X = new int[] { 2, 2, -2, -2, 1, 1, -1, -1 };\n var Y = new int[] { -1, 1, -1, 1, 2, -2, 2, -2 };\n\n var Knight_distances = new Tuple[(N * N) + 1];\n Knight_distances[1] = Tuple.Create(0, 0);\n\n for (int i = 2; i <= N * N; i++)\n {\n var current_location = locations[i - 1];\n var new_location = locations[i];\n\n var list = new List>();\n\n bool found = false;\n\n for (int t = 0; t < 8; t++)\n {\n var new_X = current_location.Item1 + X[t];\n var new_Y = current_location.Item2 + Y[t];\n if (new_X == new_location.Item1 && new_Y == new_location.Item2)\n {\n Knight_distances[i] = Tuple.Create(1, 0);\n found = true;\n break;\n }\n else\n {\n if (new_X >= 1 && new_X <= N && new_Y >= 1 && new_Y <= N)\n list.Add(Tuple.Create(new_X, new_Y));\n }\n }\n\n if (!found)\n {\n for (int l = 0; l < list.Count; l++)\n {\n for (int t = 0; t < 8; t++)\n {\n var new_X = list[l].Item1 + X[t];\n var new_Y = list[l].Item2 + Y[t];\n if (new_X == new_location.Item1 && new_Y == new_location.Item2)\n {\n Knight_distances[i] = Tuple.Create(2, 0);\n found = true;\n break;\n }\n }\n }\n }\n\n if (!found) Knight_distances[i] = Tuple.Create(int.MaxValue, 0);\n\n }\n #endregion\n\n var minheap = new MinHeap();\n\n var states = new Move[3][];\n states[0] = new Move[(N * N) + 1];\n states[1] = new Move[(N * N) + 1];\n states[2] = new Move[(N * N) + 1];\n\n for (int j = 1; j <= N * N; j++)\n states[0][j] = new Move() { pawn = Pawn.Bishop, Num = j, Moves = int.MaxValue, Rep = int.MaxValue };\n for (int j = 1; j <= N * N; j++)\n states[1][j] = new Move() { pawn = Pawn.Knight, Num = j, Moves = int.MaxValue, Rep = int.MaxValue };\n for (int j = 1; j <= N * N; j++)\n states[2][j] = new Move() { pawn = Pawn.Rook, Num = j, Moves = int.MaxValue, Rep = int.MaxValue };\n\n states[0][1] = new Move() { pawn = Pawn.Bishop, Num = 1, Moves = 0, Rep = 0 };\n states[1][1] = new Move() { pawn = Pawn.Knight, Num = 1, Moves = 0, Rep = 0 };\n states[2][1] = new Move() { pawn = Pawn.Rook, Num = 1, Moves = 0, Rep = 0 };\n\n minheap.Add(states[0][1]);\n minheap.Add(states[1][1]);\n minheap.Add(states[2][1]);\n\n while (minheap.Count > 0)\n {\n var item = minheap.ExtractMin();\n\n Pawn p = item.pawn;\n int currentnum = item.Num;\n int intPaws = (int)p;\n\n Console.WriteLine(\"*******************\");\n Console.WriteLine(\"\" + p + \" currentnum \" + currentnum);\n\n if (currentnum == N * N) break;\n\n if (p == Pawn.Bishop)\n {\n //Get Bishop distance\n var dist = bishop_distances[currentnum + 1];\n if (dist.Item1 != int.MaxValue)\n {\n if (item.Moves + dist.Item1 < states[0][currentnum + 1].Moves\n || (item.Moves + dist.Item1 == states[0][currentnum + 1].Moves && item.Rep < states[0][currentnum + 1].Rep))\n {\n states[0][currentnum + 1] = new Move()\n {\n Num = currentnum + 1,\n Moves = item.Moves + dist.Item1,\n pawn = Pawn.Bishop,\n Rep = item.Rep\n };\n\n minheap.Add(states[0][currentnum + 1]);\n }\n }\n\n //Get Knight distance\n dist = Knight_distances[currentnum + 1];\n if (dist.Item1 != int.MaxValue)\n {\n if (item.Moves + dist.Item1 + 1 < states[1][currentnum + 1].Moves\n || (item.Moves + dist.Item1 + 1 == states[1][currentnum + 1].Moves && item.Rep + 1 < states[1][currentnum + 1].Rep))\n {\n states[1][currentnum + 1] = new Move()\n {\n Num = currentnum + 1,\n Moves = item.Moves + dist.Item1 + 1,\n pawn = Pawn.Knight,\n Rep = item.Rep + 1\n };\n\n minheap.Add(states[1][currentnum + 1]);\n }\n }\n\n //Get Rook distance\n dist = rook_distances[currentnum + 1];\n if (dist.Item1 != int.MaxValue)\n {\n if (item.Moves + dist.Item1 + 1 < states[2][currentnum + 1].Moves\n || (item.Moves + dist.Item1 + 1 == states[2][currentnum + 1].Moves && item.Rep + 1 < states[2][currentnum + 1].Rep))\n {\n states[2][currentnum + 1] = new Move()\n {\n Num = currentnum + 1,\n Moves = item.Moves + dist.Item1 + 1,\n pawn = Pawn.Rook,\n Rep = item.Rep + 1\n };\n\n minheap.Add(states[2][currentnum + 1]);\n }\n }\n }\n else if (p == Pawn.Knight)\n {\n var dist = Knight_distances[currentnum + 1];\n if (dist.Item1 != int.MaxValue)\n {\n if (item.Moves + dist.Item1 < states[1][currentnum + 1].Moves\n || (item.Moves + dist.Item1 == states[1][currentnum + 1].Moves && item.Rep < states[1][currentnum + 1].Rep))\n {\n states[1][currentnum + 1] = new Move()\n {\n Num = currentnum + 1,\n Moves = item.Moves + dist.Item1,\n pawn = Pawn.Knight,\n Rep = item.Rep\n };\n\n minheap.Add(states[1][currentnum + 1]);\n }\n }\n\n dist = rook_distances[currentnum + 1];\n if (dist.Item1 != int.MaxValue)\n {\n if (item.Moves + dist.Item1 + 1 < states[2][currentnum + 1].Moves\n || (item.Moves + dist.Item1 + 1 == states[2][currentnum + 1].Moves && item.Rep + 1 < states[2][currentnum + 1].Rep))\n {\n states[2][currentnum + 1] = new Move()\n {\n Num = currentnum + 1,\n Moves = item.Moves + dist.Item1 + 1,\n pawn = Pawn.Rook,\n Rep = item.Rep + 1\n };\n\n minheap.Add(states[2][currentnum + 1]);\n }\n }\n\n dist = bishop_distances[currentnum + 1];\n if (dist.Item1 != int.MaxValue)\n {\n if (item.Moves + dist.Item1 + 1 < states[0][currentnum + 1].Moves\n || (item.Moves + dist.Item1 + 1 == states[0][currentnum + 1].Moves && item.Rep + 1 < states[0][currentnum + 1].Rep))\n {\n states[0][currentnum + 1] = new Move()\n {\n Num = currentnum + 1,\n Moves = item.Moves + dist.Item1 + 1,\n pawn = Pawn.Bishop,\n Rep = item.Rep + 1\n };\n\n minheap.Add(states[0][currentnum + 1]);\n }\n }\n }\n else if (p == Pawn.Rook)\n {\n var dist = rook_distances[currentnum + 1];\n if (dist.Item1 != int.MaxValue)\n {\n if (item.Moves + dist.Item1 < states[2][currentnum + 1].Moves\n || (item.Moves + dist.Item1 == states[2][currentnum + 1].Moves && item.Rep < states[2][currentnum + 1].Rep))\n {\n states[2][currentnum + 1] = new Move()\n {\n Num = currentnum + 1,\n Moves = item.Moves + dist.Item1,\n pawn = Pawn.Rook,\n Rep = item.Rep\n };\n\n minheap.Add(states[2][currentnum + 1]);\n }\n }\n\n dist = bishop_distances[currentnum + 1];\n if (dist.Item1 != int.MaxValue)\n {\n if (item.Moves + dist.Item1 + 1 < states[0][currentnum + 1].Moves\n || (item.Moves + dist.Item1 + 1 == states[0][currentnum + 1].Moves && item.Rep + 1 < states[0][currentnum + 1].Rep))\n {\n states[0][currentnum + 1] = new Move()\n {\n Num = currentnum + 1,\n Moves = item.Moves + dist.Item1 + 1,\n pawn = Pawn.Bishop,\n Rep = item.Rep + 1\n };\n\n minheap.Add(states[0][currentnum + 1]);\n }\n }\n\n dist = Knight_distances[currentnum + 1];\n if (dist.Item1 != int.MaxValue)\n {\n if (item.Moves + dist.Item1 + 1 < states[2][currentnum + 1].Moves\n || (item.Moves + dist.Item1 + 1 == states[2][currentnum + 1].Moves && item.Rep + 1 < states[2][currentnum + 1].Rep))\n {\n states[2][currentnum + 1] = new Move()\n {\n Num = currentnum + 1,\n Moves = item.Moves + dist.Item1 + 1,\n pawn = Pawn.Knight,\n Rep = item.Rep + 1\n };\n\n minheap.Add(states[2][currentnum + 1]);\n }\n }\n }\n }\n\n int res = int.MaxValue;\n\n res = Math.Min(states[1][N * N].Moves, res);\n res = Math.Min(states[2][N * N].Moves, res);\n res = Math.Min(states[0][N * N].Moves, res);\n\n int moves = int.MaxValue;\n\n if (res == states[0][N * N].Moves)\n moves = Math.Min(states[0][N * N].Rep, moves);\n\n if (res == states[1][N * N].Moves)\n moves = Math.Min(states[1][N * N].Rep, moves);\n if (res == states[2][N * N].Moves)\n moves = Math.Min(states[2][N * N].Rep, moves);\n\n Console.WriteLine(\"\" + res + \" \" + moves);\n }\n}", "lang": "Mono C#", "bug_code_uid": "ef6d34bbe66871541ba79854821d4536", "src_uid": "5fe44b6cd804e0766a0e993eca1846cd", "apr_id": "3107e881ee7f2042ecff3bb9d807f728", "difficulty": 2200, "tags": ["dp", "dfs and similar", "shortest paths"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.07912860154602952, "equal_cnt": 91, "replace_cnt": 66, "delete_cnt": 14, "insert_cnt": 10, "fix_ops_cnt": 90, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\n\nnamespace ConsoleTidbits\n{\n class MinHeap where T : IComparable\n {\n public IList m_array;\n\n public MinHeap()\n {\n m_array = new List();\n }\n public T GetRoot()\n {\n return m_array[0];\n }\n\n public T ExtractMin()\n {\n var result = m_array[0];\n m_array[0] = m_array[Count - 1];\n m_array.RemoveAt(m_array.Count - 1);\n ShiftDown(0);\n\n return result;\n }\n\n public void Remove(int index)\n {\n }\n\n public void ShiftDown(int index)\n {\n int left = 2 * index + 1;\n int right = 2 * index + 2;\n int Index = index;\n\n if (left < Count && m_array[index].CompareTo(m_array[left]) > 0)\n {\n index = left;\n }\n\n if (right < Count && m_array[index].CompareTo(m_array[right]) > 0)\n {\n index = right;\n }\n\n if (index != Index)\n {\n var temp = m_array[Index];\n m_array[Index] = m_array[index];\n m_array[index] = temp;\n\n ShiftDown(index);\n }\n }\n\n public int Count\n {\n get\n {\n return m_array.Count();\n }\n }\n\n private void Balance(int index)\n {\n if (index < 0)\n {\n return;\n }\n\n int parent = (index - 1) / 2;\n\n if (m_array[parent].CompareTo(m_array[index]) > 0)\n {\n var temp = m_array[parent];\n m_array[parent] = m_array[index];\n m_array[index] = temp;\n Balance(parent);\n }\n }\n\n public void Add(T number)\n {\n m_array.Add(number);\n //BuildHeap();\n Balance(m_array.Count - 1);\n }\n\n private void BuildHeap()\n {\n for (int i = Count / 2; i >= 0; i--)\n {\n Heapify(m_array, i);\n }\n }\n private void Heapify(IList array, int index)\n {\n int N = array.Count;\n\n int Index = index;\n int left = 2 * index + 1;\n int right = 2 * index + 2;\n\n if (left < N && array[left].CompareTo(array[index]) < 0)\n {\n index = left;\n }\n\n if (right < N && array[right].CompareTo(array[index]) < 0)\n {\n index = right;\n }\n\n if (index != Index)\n {\n var temp = array[Index];\n array[Index] = array[index];\n array[index] = temp;\n\n Heapify(array, index);\n }\n\n }\n }\n \n class JustCodeForces\n {\n int N;\n int[,] board;\n Dictionary> locations;\n\n public static void Main()\n {\n JustCodeForces obj = new JustCodeForces();\n\n while (true)\n obj.ThreePieces();\n }\n\n enum Pawn\n {\n Bishop = 0,\n Knight,\n Rook\n }\n class Move : IComparable\n {\n public int Moves { get; set; }\n public int Rep { get; set; }\n\n public int Num { get; set; }\n public Pawn pawn { get; set; }\n public int CompareTo(object o)\n {\n var other = o as Move;\n if (Moves < other.Moves) return -1;\n if (Moves > other.Moves) return 1;\n\n if (Moves == other.Moves) return Rep.CompareTo(other.Rep);\n\n return -1;\n }\n }\n private void ThreePieces()\n {\n N = int.Parse(Console.ReadLine());\n\n board = new int[N, N];\n locations = new Dictionary>();\n\n for (int i = 0; i < N; i++)\n {\n var array = Array.ConvertAll(Console.ReadLine().Split(new char[] { ' ' }), int.Parse);\n\n for (int j = 0; j < N; j++)\n {\n board[i, j] = array[j];\n locations.Add(array[j], Tuple.Create(i + 1, j + 1));\n }\n }\n\n //Min of all\n #region rook Distances\n //Find rook distances\n var rook_distances = new Tuple[(N * N) + 1];\n rook_distances[1] = Tuple.Create(0, 0);\n\n for (int i = 2; i <= N * N; i++)\n {\n var current_location = locations[i - 1];\n var new_location = locations[i];\n\n if (current_location.Item1 == new_location.Item1 ||\n current_location.Item2 == new_location.Item2)\n rook_distances[i] = Tuple.Create(1, 0);\n else\n rook_distances[i] = Tuple.Create(2, 0);\n }\n #endregion\n\n #region Bishop Distances\n //Find Bishop Distances\n var bishop_distances = new Tuple[(N * N) + 1];\n bishop_distances[1] = Tuple.Create(0, 0);\n\n for (int i = 2; i <= N * N; i++)\n {\n var current_location = locations[i - 1];\n var new_location = locations[i];\n\n if ((current_location.Item1 + current_location.Item2) % 2 != (new_location.Item1 + new_location.Item2) % 2)\n bishop_distances[i] = Tuple.Create(int.MaxValue, 0);\n else\n {\n bool found = false;\n //Move North East\n for (int k = 1; k <= Math.Min(current_location.Item1 - 1, N - current_location.Item2); k++)\n {\n if (new_location.Item1 == current_location.Item1 - k && new_location.Item2 == current_location.Item2 + k)\n {\n bishop_distances[i] = Tuple.Create(1, 0);\n found = true;\n break;\n }\n }\n\n //Move South west\n if (!found)\n {\n for (int k = 1; k <= Math.Min(N - current_location.Item1, current_location.Item2 - 1); k++)\n {\n if (new_location.Item1 == current_location.Item1 + k && new_location.Item2 == current_location.Item2 - k)\n {\n bishop_distances[i] = Tuple.Create(1, 0);\n found = true;\n break;\n }\n }\n }\n\n //Move South east\n if (!found)\n {\n for (int k = 1; k <= Math.Min(N - current_location.Item1, N - current_location.Item2); k++)\n {\n if (new_location.Item1 == current_location.Item1 + k && new_location.Item2 == current_location.Item2 + k)\n {\n bishop_distances[i] = Tuple.Create(1, 0);\n found = true;\n break;\n }\n }\n }\n\n //Move North West\n if (!found)\n {\n for (int k = 1; k <= Math.Min(current_location.Item1 - 1, current_location.Item2 - 1); k++)\n {\n if (new_location.Item1 == current_location.Item1 - k && new_location.Item2 == current_location.Item2 - k)\n {\n bishop_distances[i] = Tuple.Create(1, 0);\n found = true;\n break;\n }\n }\n }\n\n if (!found)\n {\n bishop_distances[i] = Tuple.Create(2, 0);\n }\n }\n }\n #endregion\n\n #region Knight Distances\n //Find Knight Distances\n var X = new int[] { 2, 2, -2, -2, 1, 1, -1, -1 };\n var Y = new int[] { -1, 1, -1, 1, 2, -2, 2, -2 };\n\n var Knight_distances = new Tuple[(N * N) + 1];\n Knight_distances[1] = Tuple.Create(0, 0);\n\n for (int i = 2; i <= N * N; i++)\n {\n var current_location = locations[i - 1];\n var new_location = locations[i];\n\n var list = new List>();\n\n bool found = false;\n\n for (int t = 0; t < 8; t++)\n {\n var new_X = current_location.Item1 + X[t];\n var new_Y = current_location.Item2 + Y[t];\n if (new_X == new_location.Item1 && new_Y == new_location.Item2)\n {\n Knight_distances[i] = Tuple.Create(1, 0);\n found = true;\n break;\n }\n else\n {\n if (new_X >= 1 && new_X <= N && new_Y >= 1 && new_Y <= N)\n list.Add(Tuple.Create(new_X, new_Y));\n }\n }\n\n var new_list = new List>();\n\n if (!found)\n {\n for (int l = 0; l < list.Count; l++)\n {\n for (int t = 0; t < 8; t++)\n {\n var new_X = list[l].Item1 + X[t];\n var new_Y = list[l].Item2 + Y[t];\n if (new_X == new_location.Item1 && new_Y == new_location.Item2)\n {\n Knight_distances[i] = Tuple.Create(2, 0);\n found = true;\n break;\n }\n else\n {\n if (new_X >= 1 && new_X <= N && new_Y >= 1 && new_Y <= N)\n new_list.Add(Tuple.Create(new_X, new_Y));\n }\n }\n }\n }\n\n if (!found)\n {\n for (int l = 0; l < new_list.Count; l++)\n {\n for (int t = 0; t < 8; t++)\n {\n var new_X = new_list[l].Item1 + X[t];\n var new_Y = new_list[l].Item2 + Y[t];\n if (new_X == new_location.Item1 && new_Y == new_location.Item2)\n {\n Knight_distances[i] = Tuple.Create(3, 0);\n found = true;\n break;\n }\n }\n }\n }\n\n if (!found) Knight_distances[i] = Tuple.Create(int.MaxValue, 0);\n\n }\n #endregion\n\n var minheap = new MinHeap();\n\n var states = new Move[3][];\n states[0] = new Move[(N * N) + 1];\n states[1] = new Move[(N * N) + 1];\n states[2] = new Move[(N * N) + 1];\n\n for (int j = 1; j <= N * N; j++)\n states[0][j] = new Move() { pawn = Pawn.Bishop, Num = j, Moves = int.MaxValue, Rep = int.MaxValue };\n for (int j = 1; j <= N * N; j++)\n states[1][j] = new Move() { pawn = Pawn.Knight, Num = j, Moves = int.MaxValue, Rep = int.MaxValue };\n for (int j = 1; j <= N * N; j++)\n states[2][j] = new Move() { pawn = Pawn.Rook, Num = j, Moves = int.MaxValue, Rep = int.MaxValue };\n\n states[0][1] = new Move() { pawn = Pawn.Bishop, Num = 1, Moves = 0, Rep = 0 };\n states[1][1] = new Move() { pawn = Pawn.Knight, Num = 1, Moves = 0, Rep = 0 };\n states[2][1] = new Move() { pawn = Pawn.Rook, Num = 1, Moves = 0, Rep = 0 };\n\n minheap.Add(states[0][1]);\n minheap.Add(states[1][1]);\n minheap.Add(states[2][1]);\n\n while (minheap.Count > 0)\n {\n var item = minheap.ExtractMin();\n\n Pawn p = item.pawn;\n int currentnum = item.Num;\n int intPaws = (int)p;\n\n // Console.WriteLine(\"*******************\");\n // Console.WriteLine(\"\" + p + \" currentnum \" + currentnum);\n\n if (currentnum == N * N) break;\n\n if (p == Pawn.Bishop)\n {\n //Get Bishop distance\n var dist = bishop_distances[currentnum + 1];\n if (dist.Item1 != int.MaxValue)\n {\n if (item.Moves + dist.Item1 < states[0][currentnum + 1].Moves\n || (item.Moves + dist.Item1 == states[0][currentnum + 1].Moves && item.Rep < states[0][currentnum + 1].Rep))\n {\n states[0][currentnum + 1] = new Move()\n {\n Num = currentnum + 1,\n Moves = item.Moves + dist.Item1,\n pawn = Pawn.Bishop,\n Rep = item.Rep\n };\n\n minheap.Add(states[0][currentnum + 1]);\n }\n }\n\n //Get Knight distance\n dist = Knight_distances[currentnum + 1];\n if (dist.Item1 != int.MaxValue)\n {\n if (item.Moves + dist.Item1 + 1 < states[1][currentnum + 1].Moves\n || (item.Moves + dist.Item1 + 1 == states[1][currentnum + 1].Moves && item.Rep + 1 < states[1][currentnum + 1].Rep))\n {\n states[1][currentnum + 1] = new Move()\n {\n Num = currentnum + 1,\n Moves = item.Moves + dist.Item1 + 1,\n pawn = Pawn.Knight,\n Rep = item.Rep + 1\n };\n\n minheap.Add(states[1][currentnum + 1]);\n }\n }\n\n //Get Rook distance\n dist = rook_distances[currentnum + 1];\n if (dist.Item1 != int.MaxValue)\n {\n if (item.Moves + dist.Item1 + 1 < states[2][currentnum + 1].Moves\n || (item.Moves + dist.Item1 + 1 == states[2][currentnum + 1].Moves && item.Rep + 1 < states[2][currentnum + 1].Rep))\n {\n states[2][currentnum + 1] = new Move()\n {\n Num = currentnum + 1,\n Moves = item.Moves + dist.Item1 + 1,\n pawn = Pawn.Rook,\n Rep = item.Rep + 1\n };\n\n minheap.Add(states[2][currentnum + 1]);\n }\n }\n }\n else if (p == Pawn.Knight)\n {\n var dist = Knight_distances[currentnum + 1];\n if (dist.Item1 != int.MaxValue)\n {\n if (item.Moves + dist.Item1 < states[1][currentnum + 1].Moves\n || (item.Moves + dist.Item1 == states[1][currentnum + 1].Moves && item.Rep < states[1][currentnum + 1].Rep))\n {\n states[1][currentnum + 1] = new Move()\n {\n Num = currentnum + 1,\n Moves = item.Moves + dist.Item1,\n pawn = Pawn.Knight,\n Rep = item.Rep\n };\n\n minheap.Add(states[1][currentnum + 1]);\n }\n }\n\n dist = rook_distances[currentnum + 1];\n if (dist.Item1 != int.MaxValue)\n {\n if (item.Moves + dist.Item1 + 1 < states[2][currentnum + 1].Moves\n || (item.Moves + dist.Item1 + 1 == states[2][currentnum + 1].Moves && item.Rep + 1 < states[2][currentnum + 1].Rep))\n {\n states[2][currentnum + 1] = new Move()\n {\n Num = currentnum + 1,\n Moves = item.Moves + dist.Item1 + 1,\n pawn = Pawn.Rook,\n Rep = item.Rep + 1\n };\n\n minheap.Add(states[2][currentnum + 1]);\n }\n }\n\n dist = bishop_distances[currentnum + 1];\n if (dist.Item1 != int.MaxValue)\n {\n if (item.Moves + dist.Item1 + 1 < states[0][currentnum + 1].Moves\n || (item.Moves + dist.Item1 + 1 == states[0][currentnum + 1].Moves && item.Rep + 1 < states[0][currentnum + 1].Rep))\n {\n states[0][currentnum + 1] = new Move()\n {\n Num = currentnum + 1,\n Moves = item.Moves + dist.Item1 + 1,\n pawn = Pawn.Bishop,\n Rep = item.Rep + 1\n };\n\n minheap.Add(states[0][currentnum + 1]);\n }\n }\n }\n else if (p == Pawn.Rook)\n {\n var dist = rook_distances[currentnum + 1];\n if (dist.Item1 != int.MaxValue)\n {\n if (item.Moves + dist.Item1 < states[2][currentnum + 1].Moves\n || (item.Moves + dist.Item1 == states[2][currentnum + 1].Moves && item.Rep < states[2][currentnum + 1].Rep))\n {\n states[2][currentnum + 1] = new Move()\n {\n Num = currentnum + 1,\n Moves = item.Moves + dist.Item1,\n pawn = Pawn.Rook,\n Rep = item.Rep\n };\n\n minheap.Add(states[2][currentnum + 1]);\n }\n }\n\n dist = bishop_distances[currentnum + 1];\n if (dist.Item1 != int.MaxValue)\n {\n if (item.Moves + dist.Item1 + 1 < states[0][currentnum + 1].Moves\n || (item.Moves + dist.Item1 + 1 == states[0][currentnum + 1].Moves && item.Rep + 1 < states[0][currentnum + 1].Rep))\n {\n states[0][currentnum + 1] = new Move()\n {\n Num = currentnum + 1,\n Moves = item.Moves + dist.Item1 + 1,\n pawn = Pawn.Bishop,\n Rep = item.Rep + 1\n };\n\n minheap.Add(states[0][currentnum + 1]);\n }\n }\n\n dist = Knight_distances[currentnum + 1];\n if (dist.Item1 != int.MaxValue)\n {\n if (item.Moves + dist.Item1 + 1 < states[1][currentnum + 1].Moves\n || (item.Moves + dist.Item1 + 1 == states[1][currentnum + 1].Moves && item.Rep + 1 < states[1][currentnum + 1].Rep))\n {\n states[1][currentnum + 1] = new Move()\n {\n Num = currentnum + 1,\n Moves = item.Moves + dist.Item1 + 1,\n pawn = Pawn.Knight,\n Rep = item.Rep + 1\n };\n\n minheap.Add(states[1][currentnum + 1]);\n }\n }\n }\n }\n\n int res = int.MaxValue;\n\n res = Math.Min(states[1][N * N].Moves, res);\n res = Math.Min(states[2][N * N].Moves, res);\n res = Math.Min(states[0][N * N].Moves, res);\n\n int moves = int.MaxValue;\n\n if (res == states[0][N * N].Moves)\n moves = Math.Min(states[0][N * N].Rep, moves);\n\n if (res == states[1][N * N].Moves)\n moves = Math.Min(states[1][N * N].Rep, moves);\n if (res == states[2][N * N].Moves)\n moves = Math.Min(states[2][N * N].Rep, moves);\n\n Console.WriteLine(\"\" + res + \" \" + moves);\n }\n\n }\n}", "lang": "Mono C#", "bug_code_uid": "24cfc069927d8ec1ed4d5bc74ca24251", "src_uid": "5fe44b6cd804e0766a0e993eca1846cd", "apr_id": "3107e881ee7f2042ecff3bb9d807f728", "difficulty": 2200, "tags": ["dp", "dfs and similar", "shortest paths"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9911754911754912, "equal_cnt": 4, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 3, "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 Scanner sc = new Scanner();\n //\n\n public void Solve()\n {\n var a = ReadLine();\n var b = ReadLine();\n if (a.Length < b.Length) Fail(new string(a.OrderByDescending(c => c).ToArray()));\n if (a==b) Fail(a);\n var max = 0L;\n for (var j = 0; j <= a.Length; j++)\n {\n var u = new List();\n for (var i = 0; i < a.Length; i++)\n u.Add(a[i]);\n var res = \"\";\n for(var i = 0; i < j; i++)\n {\n u.Sort((c, d) => d - c);\n var idx = 0;\n while (idx!=a.Length&&b[i] < u[idx]) idx++;\n if (idx == a.Length || u[idx] != b[i]) goto END;\n res += u[idx]; u.RemoveAt(idx);\n }\n if (j == a.Length)\n {\n chmax(ref max, long.Parse(res));break;\n }\n u.Sort((c, d) => d - c);\n var id = 0;\n while (id != u.Count && b[j] <= u[id]) id++;\n if (id == u.Count) continue;\n res += u[id];u.RemoveAt(id);\n u.Sort((c, d) => d - c);\n for (var i = 0; i < u.Count; i++)\n res += u[i];\n chmax(ref max, long.Parse(res));\n }\n END:;\n WriteLine(max);\n }\n}\n\n#region Template\npublic class Template\n{\n static void Main(string[] args)\n {\n Console.SetOut(new StreamWriter(Console.OpenStandardOutput()) { AutoFlush = false });\n new Solver().Solve();\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 void Fail(T s) { Console.WriteLine(s); Console.Out.Close(); Environment.Exit(0); }\n}\n\npublic class Scanner\n{\n public string Str => 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 public Pair PairMake() => new Pair(Next(), Next());\n public Pair PairMake() => new Pair(Next(), Next(), Next());\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}\n\npublic class Pair : IComparable>\n{\n public T1 v1;\n public T2 v2;\n public Pair() { }\n public Pair(T1 v1, T2 v2)\n { this.v1 = v1; this.v2 = v2; }\n\n [MethodImpl(MethodImplOptions.AggressiveInlining)]\n public int CompareTo(Pair p)\n {\n var c = Comparer.Default.Compare(v1, p.v1);\n if (c == 0)\n c = Comparer.Default.Compare(v2, p.v2);\n return c;\n }\n public override string ToString() => $\"{v1.ToString()} {v2.ToString()}\";\n public void Tie(out T1 a, out T2 b) { a = v1; b = v2; }\n}\n\npublic class Pair : Pair, IComparable>\n{\n public T3 v3;\n public Pair() : base() { }\n public Pair(T1 v1, T2 v2, T3 v3) : base(v1, v2)\n { this.v3 = v3; }\n\n [MethodImpl(MethodImplOptions.AggressiveInlining)]\n public int CompareTo(Pair p)\n {\n var c = base.CompareTo(p);\n if (c == 0)\n c = Comparer.Default.Compare(v3, p.v3);\n return c;\n }\n public override string ToString() => $\"{base.ToString()} {v3.ToString()}\";\n public void Tie(out T1 a, out T2 b, out T3 c) { Tie(out a, out b); c = v3; }\n}\n#endregion\n", "lang": "Mono C#", "bug_code_uid": "dcb1be46fe837df49f5edcdbc05b9dae", "src_uid": "bc31a1d4a02a0011eb9f5c754501cd44", "apr_id": "052ee18c91546081515c0c6345bf8d31", "difficulty": 1700, "tags": ["dp", "greedy"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9981800132362674, "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.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 Scanner sc = new Scanner();\n //\n\n public void Solve()\n {\n var a = ReadLine();\n var b = ReadLine();\n if (a.Length < b.Length) Fail(new string(a.OrderByDescending(c => c).ToArray()));\n if (a==b) Fail(a);\n var max = 0L;\n for (var j = 0; j <= a.Length; j++)\n {\n var u = new List();\n for (var i = 0; i < a.Length; i++)\n u.Add(a[i]);\n var res = \"\";\n for(var i = 0; i < j; i++)\n {\n u.Sort((c, d) => d - c);\n var idx = 0;\n while (idx!=u.Length&&b[i] < u[idx]) idx++;\n if (idx == u.Length || u[idx] != b[i]) goto END;\n res += u[idx]; u.RemoveAt(idx);\n }\n if (j == a.Length)\n {\n chmax(ref max, long.Parse(res));break;\n }\n u.Sort((c, d) => d - c);\n var id = 0;\n while (id != u.Count && b[j] <= u[id]) id++;\n if (id == u.Count) continue;\n res += u[id];u.RemoveAt(id);\n if (u.Count == 0) { chmax(ref max, long.Parse(res));continue; }\n u.Sort((c, d) => d - c);\n for (var i = 0; i < u.Count; i++)\n res += u[i];\n chmax(ref max, long.Parse(res));\n }\n END:;\n WriteLine(max);\n }\n}\n\n#region Template\npublic class Template\n{\n static void Main(string[] args)\n {\n Console.SetOut(new StreamWriter(Console.OpenStandardOutput()) { AutoFlush = false });\n new Solver().Solve();\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 void Fail(T s) { Console.WriteLine(s); Console.Out.Close(); Environment.Exit(0); }\n}\n\npublic class Scanner\n{\n public string Str => 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 public Pair PairMake() => new Pair(Next(), Next());\n public Pair PairMake() => new Pair(Next(), Next(), Next());\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}\n\npublic class Pair : IComparable>\n{\n public T1 v1;\n public T2 v2;\n public Pair() { }\n public Pair(T1 v1, T2 v2)\n { this.v1 = v1; this.v2 = v2; }\n\n [MethodImpl(MethodImplOptions.AggressiveInlining)]\n public int CompareTo(Pair p)\n {\n var c = Comparer.Default.Compare(v1, p.v1);\n if (c == 0)\n c = Comparer.Default.Compare(v2, p.v2);\n return c;\n }\n public override string ToString() => $\"{v1.ToString()} {v2.ToString()}\";\n public void Tie(out T1 a, out T2 b) { a = v1; b = v2; }\n}\n\npublic class Pair : Pair, IComparable>\n{\n public T3 v3;\n public Pair() : base() { }\n public Pair(T1 v1, T2 v2, T3 v3) : base(v1, v2)\n { this.v3 = v3; }\n\n [MethodImpl(MethodImplOptions.AggressiveInlining)]\n public int CompareTo(Pair p)\n {\n var c = base.CompareTo(p);\n if (c == 0)\n c = Comparer.Default.Compare(v3, p.v3);\n return c;\n }\n public override string ToString() => $\"{base.ToString()} {v3.ToString()}\";\n public void Tie(out T1 a, out T2 b, out T3 c) { Tie(out a, out b); c = v3; }\n}\n#endregion\n", "lang": "Mono C#", "bug_code_uid": "39f2654c381bac570d213a74f2810c9e", "src_uid": "bc31a1d4a02a0011eb9f5c754501cd44", "apr_id": "052ee18c91546081515c0c6345bf8d31", "difficulty": 1700, "tags": ["dp", "greedy"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.6748057713651499, "equal_cnt": 15, "replace_cnt": 10, "delete_cnt": 4, "insert_cnt": 1, "fix_ops_cnt": 15, "bug_source_code": "using System;\nusing System.Linq;\nclass Program\n{\n static void Main()\n {\n int[] alm = Console.ReadLine().Split(' ').Select(x=>int.Parse(x)).ToArray();\n int[] oil = Console.ReadLine().Split(' ').Select(x => int.Parse(x)).ToArray();\n oil[0] = oil[0] * 2 + oil[1];\n oil[1] = oil[2] * 3 + oil[1];\n oil[2] = 0;\n var result = oil.Sum() - alm.Sum();\n Console.WriteLine(result);\n }\n}", "lang": "MS C#", "bug_code_uid": "4fa2e2cb6d0f31a56f514acbf31d723d", "src_uid": "35202a4601a03d25e18dda1539c5beba", "apr_id": "eef32bee3e9931e81b4cec49cb9b0345", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9992464204973625, "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 _869C\n{\n class Program\n {\n public static void Swap(ref T lhs, ref T rhs)\n {\n T temp = lhs;\n lhs = rhs;\n rhs = temp;\n }\n\n static void Main(string[] args)\n {\n int[] tmp = Console.ReadLine().Split().Select(i => int.Parse(i)).ToArray();\n if (tmp[1] < tmp[0])\n {\n Swap(ref tmp[0], ref tmp[1]);\n }\n if (tmp[2] < tmp[0])\n {\n Swap(ref tmp[0], ref tmp[1]);\n }\n\n long[,] dp = new long[tmp[1] + 1, tmp[2] + 1];\n for (int i = 0; i <= tmp[1]; i++)\n {\n for (int j = 0; j <= tmp[2]; j++)\n {\n if (i == 0 || j == 0)\n {\n dp[i, j] = 1;\n }\n else\n {\n dp[i, j] = (dp[i - 1, j] + dp[i - 1, j - 1] * j) % 998244353;\n }\n }\n }\n\n long r = (((dp[tmp[1], tmp[0]] * dp[tmp[1], tmp[2]]) % 998244353) * dp[tmp[0], tmp[2]]) % 998244353;\n Console.WriteLine(r);\n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "648febd50df40acbec6233690cb52657", "src_uid": "b6dc5533fbf285d5ef4cf60ef6300383", "apr_id": "e76de61d9f029a9a5374feda3116b516", "difficulty": 1800, "tags": ["dp", "math", "combinatorics"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9617945303697634, "equal_cnt": 13, "replace_cnt": 4, "delete_cnt": 4, "insert_cnt": 4, "fix_ops_cnt": 12, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Globalization;\nusing System.IO;\nusing System.Linq;\n\nnamespace CF\n{\n internal class Program\n {\n private static void Main(string[] args)\n {\n using (var sr = new InputReader(Console.In))\n//\t\t\tusing (var sr = new InputReader(new StreamReader(\"input.txt\")))\n using (var sw = Console.Out)\n //using (var sw = new StreamWriter(\"output.txt\"))\n using (var task = new Task(sr, sw)) {\n task.Solve();\n// Console.ReadKey();\n }\n }\n }\n\n internal class Task : IDisposable\n {\n private readonly InputReader sr;\n private readonly TextWriter sw;\n private bool isDispose;\n \n const long mod = 998244353L;\n\n public Task(InputReader sr, TextWriter sw)\n {\n this.sr = sr;\n this.sw = sw;\n }\n \n public void Solve()\n {\n var a = sr.NextInt32();\n var b = sr.NextInt32();\n var c = sr.NextInt32();\n var facts = Facts(2*Math.Max(a, Math.Max(b, c)));\n var coeffs = BinCoeff(2*Math.Max(a, Math.Max(b, c)));\n sw.WriteLine((Func(a, b, facts, coeffs)*Func(b, c, facts, coeffs)*Func(c, a, facts, coeffs))%mod);\n }\n\n private long[] Facts(int max)\n {\n var facts = new long[max + 1];\n facts[0] = 1L;\n for (var i = 1; i <= max; i++) {\n facts[i] = (facts[i - 1] * i) % mod;\n }\n\n return facts;\n }\n\n private long Func(long a, long b, long[] facts, long[,] binCoeff)\n {\n var r = binCoeff[b, 0] * facts[0] + binCoeff[b, 1] * facts[0];\n for (var i = 2; i <= a; i++) {\n for (var j = 0; j < i; j++) {\n r = (r + b * binCoeff[b - 1, j] * binCoeff[i - 1, j] * facts[j] % mod) % mod;\n }\n }\n\n return r;\n }\n\n private long[,] BinCoeff(int max)\n {\n var coeff = new long[max + 1, max + 1];\n for (var i = 0; i <= max; i++) {\n coeff[i, 0] = 1;\n coeff[i, i] = 1;\n }\n for (var i = 1; i <= max; i++) {\n for (var j = 1; j <= max; j++) {\n coeff[i, j] = (coeff[i - 1, j] + coeff[i - 1, j - 1])%mod;\n }\n }\n\n return coeff;\n }\n\n ~Task()\n {\n Dispose(false);\n }\n\n public void Dispose()\n {\n Dispose(true);\n GC.SuppressFinalize(this);\n }\n\n private void Dispose(bool disposing)\n {\n if (!isDispose) {\n if (disposing) {\n if(sr != null)\n sr.Dispose();\n \n if(sw != null)\n sw.Dispose();\n }\n\n isDispose = true;\n } \n }\n }\n}\n\ninternal class InputReader : IDisposable\n{\n private bool isDispose;\n private readonly TextReader sr;\n private string[] buffer;\n private int seek;\n\n public InputReader(TextReader stream)\n {\n sr = stream;\n }\n\n public void Dispose()\n {\n Dispose(true);\n GC.SuppressFinalize(this);\n }\n\n public string NextString()\n {\n var result = sr.ReadLine();\n return result;\n }\n\n public int NextInt32()\n {\n return Int32.Parse(ReadNextToken());\n }\n\n private string ReadNextToken()\n {\n if (buffer == null || seek == buffer.Length) {\n seek = 0;\n buffer = NextSplitStrings();\n }\n\n return buffer[seek++];\n }\n\n public long NextInt64()\n {\n return Int64.Parse(ReadNextToken());\n }\n \n public int[] ReadArrayOfInt32()\n {\n return ReadArray(Int32.Parse);\n }\n\n public long[] ReadArrayOfInt64()\n {\n return ReadArray(Int64.Parse);\n }\n\n public string[] NextSplitStrings()\n {\n return NextString()\n .Split(new[] { ' ' }, StringSplitOptions.RemoveEmptyEntries);\n }\n\n public T[] ReadArray(Func func)\n {\n return NextSplitStrings()\n .Select(s => func(s, CultureInfo.InvariantCulture))\n .ToArray();\n }\n\n public T[] ReadArrayFromString(Func func, string str)\n {\n return\n str.Split(new[] { ' ' }, StringSplitOptions.RemoveEmptyEntries)\n .Select(s => func(s, CultureInfo.InvariantCulture))\n .ToArray();\n }\n\n protected void Dispose(bool dispose)\n {\n if (!isDispose)\n {\n if (dispose)\n sr.Close();\n \n isDispose = true;\n }\n }\n\n ~InputReader()\n {\n Dispose(false);\n }\n}", "lang": "MS C#", "bug_code_uid": "80973a1cf8bbe2bec3bab00c9013a8ed", "src_uid": "b6dc5533fbf285d5ef4cf60ef6300383", "apr_id": "860889ebc9648a54618e02403d28e8d0", "difficulty": 1800, "tags": ["dp", "math", "combinatorics"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.6929133858267716, "equal_cnt": 20, "replace_cnt": 6, "delete_cnt": 0, "insert_cnt": 13, "fix_ops_cnt": 19, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace Suffix_Structures\n{\n class Program\n {\n static bool chec( string ss, string tt)\n {\n char[] s = ss.ToCharArray();\n char[] t = tt.ToCharArray();\n for (int i = 0; i < t.Count(); i++)\n {\n bool ddd = false;\n for (int c = 0; c < s.Count(); c++)\n {\n if (t[i] == s[c])\n { ddd = true; \n \n s[c] = ',';\n \n break; }\n }\n\n if (!ddd)\n {\n return false;\n }\n }\n return true;\n }\n static void Main(string[] args)\n {\n // var bb = chec(\"arary\", \"array\");\n\n \n Console.WriteLine(ss);\n string s, t;\n s = Console.ReadLine();\n \n t= Console.ReadLine();\n int cc, rr;\n cc = s.Count();\n rr = t.Count();\n if (chec(s,t)&&rr==cc)\n {\n Console.WriteLine(\"array\"); return;\n }\n \n int column = 0,i;\n for ( i = 0; i < rr; i++)\n {\n while (column 0) blue = 0;\n else blue = blue - blue - blue;\n if (yellow > 0) yellow = 0;\n else yellow = yellow - yellow - yellow;\n\n ans = yellow + blue;\n\n Console.WriteLine(ans);\n\n\n }\n }\n}", "lang": "Mono C#", "bug_code_uid": "694f26a4ad214096e24c3b7f0adca4cc", "src_uid": "35202a4601a03d25e18dda1539c5beba", "apr_id": "7c9ccc0f82b0384238d02c77c868fbc0", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9991181657848325, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "using System;\nusing System.Linq;\nusing CompLib.Util;\n\npublic class Program\n{\n\n public void Solve()\n {\n var sc = new Scanner();\n int a = sc.NextInt();\n for (int n = a; ; n++)\n {\n var str = n.ToString();\n var sum = 0;\n foreach (var c in sum)\n {\n sum += c - '0';\n }\n\n if (sum % 4 == 0)\n {\n Console.WriteLine(n);\n return;\n }\n }\n }\n\n public static void Main(string[] args) => new Program().Solve();\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}\n", "lang": "Mono C#", "bug_code_uid": "61499e1fed91c81c34dbde69587f5f48", "src_uid": "bb6fb9516b2c55d1ee47a30d423562d7", "apr_id": "b9b24652831529ffa69e84353e5709e2", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.025120772946859903, "equal_cnt": 32, "replace_cnt": 23, "delete_cnt": 1, "insert_cnt": 8, "fix_ops_cnt": 32, "bug_source_code": "\nMicrosoft Visual Studio Solution File, Format Version 12.00\n# Visual Studio Version 16\nVisualStudioVersion = 16.0.30011.22\nMinimumVisualStudioVersion = 10.0.40219.1\nProject(\"{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}\") = \"CodeForces\", \"CodeForces\\CodeForces.csproj\", \"{EED76156-CCE4-42C9-A987-930CFF62AF5F}\"\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{EED76156-CCE4-42C9-A987-930CFF62AF5F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{EED76156-CCE4-42C9-A987-930CFF62AF5F}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{EED76156-CCE4-42C9-A987-930CFF62AF5F}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{EED76156-CCE4-42C9-A987-930CFF62AF5F}.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 = {1C1D43E7-DF4C-4656-AEE4-ABD77639473E}\n\tEndGlobalSection\nEndGlobal\n", "lang": "Mono C#", "bug_code_uid": "927e356871c4ddb3b9c49042b9e341ec", "src_uid": "bb6fb9516b2c55d1ee47a30d423562d7", "apr_id": "17c7b4307f082ca079a06b953beade66", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.8947117675083373, "equal_cnt": 12, "replace_cnt": 6, "delete_cnt": 4, "insert_cnt": 1, "fix_ops_cnt": 11, "bug_source_code": "using System;\nusing System.IO;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\nusing Codeforces.Codeforces;\n\nnamespace Codeforces\n{\n class Program\n {\n public static void Main(string[] args)\n {\n int n = Convert.ToInt32(Console.ReadLine());\n\n for (int i = n; i <= 1000; i++)\n {\n int[] arr = IntArray(i);\n int total = 0;\n\n for (int k = 0; k < arr.Length; k++)\n { \n total += arr[k];\n }\n\n if (total % 4 == 0)\n {\n Console.WriteLine(i);\n break;\n }\n }\n }\n\n public static int[] IntArray(int num)\n {\n List listOfInts = new List();\n while (num > 0)\n {\n listOfInts.Add(num % 10);\n num = num / 10;\n }\n listOfInts.Reverse();\n return listOfInts.ToArray();\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "279e6479aa5b1531dd66a95a1a0784cc", "src_uid": "bb6fb9516b2c55d1ee47a30d423562d7", "apr_id": "3d1c4037bb5191b834a709909c295c24", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9719020172910663, "equal_cnt": 6, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 4, "fix_ops_cnt": 5, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Globalization;\nusing System.IO;\nusing System.Linq;\nusing System.Text;\nusing System.Threading;\n\nnamespace CodeJam\n{\n class Solution4\n {\n static void Main()\n {\n new Thread(new Solution4().run, 64 * 1024 * 1024).Start();\n }\n long x0, y0, ax, ay, bx, by, xs, ys, t;\n List xC;\n List yC;\n long answer = 0;\n void ReadData()\n {\n x0 = NextLong();\n y0 = NextLong();\n ax = NextLong();\n ay = NextLong();\n bx = NextLong();\n by = NextLong();\n xs = NextLong();\n ys = NextLong();\n t = NextLong();\n xC = new List();\n yC = new List();\n xC.Add(x0);\n yC.Add(y0);\n\n do\n {\n long newX = ax * xC[xC.Count - 1] + bx;\n long newY = ay * yC[yC.Count - 1] + by;\n if (newX > 1.16e18 || newY > 1.16e18)\n break;\n xC.Add(newX);\n yC.Add(newY);\n } while (true);\n }\n long mhDist(long x1, long x2, long y1, long y2)\n {\n return Math.Abs(x1 - x2) + Math.Abs(y1 - y2);\n }\n\n void Solve()\n {\n \n for (int i=0; i=0;i--)\n {\n localTime -= mhDist(xC[i], xC[i + 1], yC[i], yC[i + 1]);\n if (localTime < 0)\n break;\n res++;\n }\n if (startDevice == xC.Count - 1)\n return res;\n localTime -= mhDist(xC[0], xC[startDevice], yC[0], yC[startDevice]);\n for (int i=startDevice; i 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\n\n\n \n\n #endregion\n }\n}", "lang": "Mono C#", "bug_code_uid": "5764ffbcb59b6482d906d2d522ad3eda", "src_uid": "d8a7ae2959b3781a8a4566a2f75a4e28", "apr_id": "c4c17ed87e47f07872e4d70e5b11a6e8", "difficulty": 1700, "tags": ["brute force", "constructive algorithms", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.8469631084303549, "equal_cnt": 24, "replace_cnt": 8, "delete_cnt": 0, "insert_cnt": 15, "fix_ops_cnt": 23, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\nusing System.IO;\n\nnamespace ConsoleApp2\n{\n class Program\n {\n struct point\n {\n public long x;\n public long y;\n }\n\n static int count(long X0, long Y0, long Ax, long Ay, long Bx, long By, long Xs,\n long Ys, List Needpoints, long t)\n {\n int Result = 0;\n long CurX = Xs;\n long CurY = Ys;\n for (int i = Needpoints.Count - 1; i >= 0; i--)\n {\n if ((CurX - Needpoints[i].x) + (CurY - Needpoints[i].y) <= t)\n {\n t -= (CurX - Needpoints[i].x) + (CurY - Needpoints[i].y);\n Result++;\n CurX = Needpoints[i].x;\n CurY = Needpoints[i].y;\n }\n else\n {\n return Result;\n }\n }\n CurX = X0;\n CurY = Y0;\n long NextX = Ax * Needpoints[Needpoints.Count - 1].x + Bx;\n long NextY = Ay * Needpoints[Needpoints.Count - 1].y + By;\n while (true)\n {\n if ((NextX - CurX) + (NextY - CurY) <= t)\n {\n t -= (NextX - CurX) + (NextY - CurY);\n Result++;\n CurX = NextX;\n CurY = NextY;\n NextX = Ax * NextX + Bx;\n NextY = Ay * NextY + By;\n }\n else\n {\n return Result;\n }\n }\n }\n static void Main(string[] args)\n {\n string[] str = Console.ReadLine().Split();\n long X0 = long.Parse(str[0]);\n long Y0 = long.Parse(str[1]);\n long Ax = long.Parse(str[2]);\n long Ay = long.Parse(str[3]);\n long Bx = long.Parse(str[4]);\n long By = long.Parse(str[5]);\n str = Console.ReadLine().Split();\n long Xs = long.Parse(str[0]);\n long Ys = long.Parse(str[1]);\n long t = long.Parse(str[2]);\n List Needpoints = new List();\n long CurX = X0, CurY = Y0;\n while (true)\n {\n if (CurX <= Xs && CurY <= Ys)\n {\n Needpoints.Add(new point() { x = CurX, y = CurY });\n }\n else\n {\n break;\n }\n CurX = Ax * CurX + Bx;\n CurY = Ay * CurY + By;\n }\n int count1 = count(X0, Y0, Ax, Ay, Bx, By, Xs, Ys, Needpoints, t);\n long NextX = Ax * Needpoints[Needpoints.Count - 1].x + Bx;\n long NextY = Ay * Needpoints[Needpoints.Count - 1].y + By;\n int count2 = 0;\n if (Math.Abs(NextX - Xs) + Math.Abs(NextY - Ys) <= t)\n {\n t -= Math.Abs(NextX - Xs) + Math.Abs(NextY - Ys);\n Xs = NextX;\n Ys = NextY;\n Needpoints.Add(new point() { x = NextX, y = NextY });\n count2 = count(X0, Y0, Ax, Ay, Bx, By, Xs, Ys, Needpoints, t);\n }\n Console.WriteLine(Math.Max(count1, count2));\n }\n }\n}", "lang": "Mono C#", "bug_code_uid": "11bd21fd16a2a618acd4a4ebf92e049a", "src_uid": "d8a7ae2959b3781a8a4566a2f75a4e28", "apr_id": "746f8a803335afe2ba19a48f9e3ac057", "difficulty": 1700, "tags": ["brute force", "constructive algorithms", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.9823687618288675, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "using System;\nusing System.IO;\nusing System.Collections.Generic;\nusing System.Globalization;\nusing System.Linq;\n\n\n\nclass Program\n{\n\n\n //////////////////////////////////////////////////\n void Solution()\n {\n var d = rl;\n var k = rl;\n var a = rl;\n var b = rl;\n var t = rl;\n\n\n d -= k;\n if (d <= 0)\n {\n wln(d * a);\n return;\n }\n\n long pesh = d * b;\n long auto = (d / k) * (k * a + t);\n long s = auto + (d % k) * b;\n if (d % k != 0)\n {\n auto += (d % k) * a + t;\n }\n\n\n\n long res = Math.Min(pesh, Math.Min(auto, s));\n wln(k * a + res);\n\n }\n //////////////////////////////////////////////////\n\n static void swap(ref object o1, ref object o2) { var o = o1; o1 = o2; o2 = o; }\n static void wln(object o = null) { Console.WriteLine(o); }\n static void wsp(object o) { Console.Write(o + \" \"); }\n static void wrt(object o) { Console.Write(o); }\n //Console.Write(string.Format(CultureInfo.InvariantCulture, \"{0:F12}\", o));\n\n static long gcd(long a, long b) { return (b != 0) ? gcd(b, a % b) : a; }\n static long lcm(long a, long b) { return a / gcd(a, b) * b; }\n\n int ri\n {\n get\n {\n _read(); while (_str[_ind] == ' ') ++_ind;\n int sign = 1; if (_str[_ind] == '-') { sign = -1; ++_ind; }\n int p = 0;\n while (_ind < _count && _str[_ind] != ' ') p = p * 10 + _str[_ind++] - '0';\n while (_ind < _count && _str[_ind] == ' ') ++_ind; return p * sign;\n }\n }\n long rl\n {\n get\n {\n _read(); while (_str[_ind] == ' ') ++_ind;\n int sign = 1; if (_str[_ind] == '-') { sign = -1; ++_ind; }\n long p = 0;\n while (_ind < _count && _str[_ind] != ' ') p = p * 10 + _str[_ind++] - '0';\n while (_ind < _count && _str[_ind] == ' ') ++_ind; return p * sign;\n }\n }\n double rd\n {\n get\n {\n _read(); while (_str[_ind] == ' ') ++_ind; int sign = 1; if (_str[_ind] == '-') { sign = -1; ++_ind; }\n long p = 0, q = 1; while (_ind < _count && _str[_ind] != ' ' && _str[_ind] != '.') p = p * 10 + _str[_ind++] - '0';\n if (_ind < _count && _str[_ind] == '.') { ++_ind; while (_ind < _count && _str[_ind] != ' ') { p = p * 10 + _str[_ind++] - '0'; q *= 10; } }\n while (_ind < _count && _str[_ind] == ' ') ++_ind; return (double)p / q * sign;\n }\n }\n string rs\n {\n get\n {\n _read(); while (_ind < _count && _str[_ind] == ' ') ++_ind;\n var tmp = _str.IndexOf(' ', _ind);\n if (tmp == -1) { _count = 0; _ind = 0; return _str.Substring(_ind); }\n var s = _str.Substring(_ind, tmp - _ind); _ind = tmp + 1;\n while (_ind < _count && _str[_ind] == ' ') ++_ind; return s;\n }\n }\n\n int[] ria(int n)\n {\n var res = new int[n];\n for (int k = 0; k < n;)\n {\n var s = Console.ReadLine(); var m = s.Length;\n for (int i = 0; i < m && k < n; ++i)\n {\n while (i < m && s[i] == ' ') ++i; if (i == m) break; int sign = 1; if (s[i] == '-') { sign = -1; ++i; }\n int p = 0; while (i < m && s[i] != ' ') p = p * 10 + s[i++] - '0'; res[k++] = p * sign;\n }\n }\n _count = 0; _ind = 0; return res;\n }\n long[] rla(int n)\n {\n var res = new long[n];\n for (int k = 0; k < n;)\n {\n var s = Console.ReadLine(); var m = s.Length;\n for (int i = 0; i < m && k < n; ++i)\n {\n while (i < m && s[i] == ' ') ++i; if (i == m) break; int sign = 1; if (s[i] == '-') { sign = -1; ++i; }\n long p = 0; while (i < m && s[i] != ' ') p = p * 10 + s[i++] - '0'; res[k++] = p * sign;\n }\n }\n _count = 0; _ind = 0; return res;\n }\n double[] rda(int n)\n {\n var res = new double[n];\n for (int k = 0; k < n;)\n {\n var s = Console.ReadLine(); var m = s.Length;\n for (int i = 0; i < m && k < n; ++i)\n {\n while (i < m && s[i] == ' ') ++i; if (i == m) break; int sign = 1; if (s[i] == '-') { sign = -1; ++i; }\n long p = 0, q = 1; while (i < m && s[i] != ' ' && s[i] != '.') p = p * 10 + s[i++] - '0';\n if (i < m && s[i] == '.') { ++i; while (i < m && s[i] != ' ') { p = p * 10 + s[i++] - '0'; q *= 10; } }\n res[k++] = (double)p / q * sign;\n }\n }\n _count = 0; _ind = 0; return res;\n }\n string[] rsa(int n) { var res = new string[n]; for (int k = 0; k < n; ++k) res[k] = Console.ReadLine(); _count = 0; _ind = 0; return res; }\n string _str = null; int _count = 0; int _ind = 0;\n void _read() { if (_ind == _count) { _str = Console.ReadLine(); _count = _str.Length; _ind = 0; } }\n static void Main() { new Program().Solution(); }\n}", "lang": "MS C#", "bug_code_uid": "345b700f7be7bb5d3ce5a93dacada235", "src_uid": "359ddf1f1aed9b3256836e5856fe3466", "apr_id": "63a05eb2cb42e9d3b8be09c632afb54c", "difficulty": 1900, "tags": ["math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "C#"} {"similarity_score": 0.9953488372093023, "equal_cnt": 5, "replace_cnt": 2, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 4, "bug_source_code": "using System;\nusing System.Linq;\nusing System.Collections.Generic;\n\nnamespace Task55A\n{\n class Program\n {\n static void Main(string[] args)\n {\n int n = int.Parse(Console.ReadLine());\n int ct = 0;\n int omit = 0;\n int sit = 1;\n HashSet container = new HashSet() { sit };\n string ans = \"No\";\n while (true)\n {\n if (container.Count == n)\n {\n ans = \"Yes\";\n break;\n }\n else if (omit > 2 * n)\n break;\n\n\n\n sit += omit;\n if (sit > n) sit %= n;\n container.Add(sit);\n omit++;\n\n }\n Console.WriteLine(ans);\n // Console.ReadKey();\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "1a75888dd53eefbbecf1fd84d7482b87", "src_uid": "4bd174a997707ed3a368bd0f2424590f", "apr_id": "a516730a6803f83c02a77ab1462505f7", "difficulty": 1200, "tags": ["math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9996904982977406, "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;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace ConsoleApplication6\n{\n class Program\n {\n static void Main(string[] args)\n {\n int n = 1,n2, pad,Ln,Rn,L = 0,R = 0,timel,timer;\n string[] s1, s2, s3;\n s1 = Console.ReadLine().Split();\n s2 = Console.ReadLine().Split();\n s3 = Console.ReadLine().Split();\n pad = Convert.ToInt32(s1[1]);\n timel = Convert.ToInt32(s3[0]);\n timer = Convert.ToInt32(s3[s3.Length-1]);\n n2 = s3.Length - 2;\n for(int m = 0;m0)\n {\n L = L+Ln;\n }\n \n if (n < s2.Length)\n {\n timel = timel + Convert.ToInt32(s3[n]);\n n++;\n }\n Rn = Convert.ToInt32(s2[s2.Length - 1 - m]) - pad * timer;\n if(Rn>0)\n {\n R = R+Rn;\n }\n if (n2>=0)\n {\n timer = timer + Convert.ToInt32(s3[n2]);\n n2--;\n }\n }\n if (L > R)\n {\n Console.Write(\"Limark\");\n }\n if(L0)\n {\n Limak += indPoints;\n }\n }\n ttimes = 0;\n for (int i = length-1; i > 0; i--)\n {\n ttimes += Convert.ToDecimal(times[i]);\n\n var indPoints = Convert.ToDecimal(secores[i]) - ttimes * dp;\n\n if (indPoints > 0)\n {\n Radewoosh += indPoints;\n }\n }\n if(Limak> Radewoosh)\n {\n Console.WriteLine(\"Limak\");\n }\n else if (Limak < Radewoosh)\n {\n Console.WriteLine(\"Radewoosh\");\n }\n else\n {\n Console.WriteLine(\"Tie\");\n }\n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "90f2ca2492f7f4bd8660685895e5feab", "src_uid": "8c704de75ab85f9e2c04a926143c8b4a", "apr_id": "b8fb39b44a67a161f22ee9079e1dc196", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.9929032258064516, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "using System;\nusing System.IO;\nusing System.Text;\n\nnamespace Colorful_Bricks\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 long Solve(string[] args)\n {\n int n = Next();\n int m = Next();\n int k = Next();\n\n const int mod = 998244353;\n\n var dp = new long[k + 1];\n dp[0] = m;\n\n for (int i = 2; i <= n; i++)\n {\n for (int j = 1; j < dp.Length; j++)\n {\n dp[j] = (dp[j] + dp[j - 1]*(m - 1))%mod;\n }\n }\n\n return dp[k];\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": "Mono C#", "bug_code_uid": "13e97d002923ff93c9fd077874eae1a1", "src_uid": "b2b9bee53e425fab1aa4d5468b9e578b", "apr_id": "cf1f4850b1261ddacf3db7ee33ba85bb", "difficulty": 1500, "tags": ["dp", "math", "combinatorics"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.32154848903811967, "equal_cnt": 38, "replace_cnt": 18, "delete_cnt": 10, "insert_cnt": 10, "fix_ops_cnt": 38, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\n\nclass Program\n{\n static void Main(string[] args)\n {\n var q = int.Parse(Console.ReadLine());\n\n\n var answer = new char[q];\n for (var i = 0; i < q; ++i)\n {\n string[] input = Console.ReadLine().Split(' ');\n int n = int.Parse(input[0]);\n long k = long.Parse(input[1]) - 1;\n\n char c;\n if (Scan(n, k, out c, out k))\n {\n answer[i] = c;\n\n }\n else\n {\n answer[i] = '.';\n }\n }\n Console.WriteLine(string.Join(string.Empty, answer));\n }\n\n\n static readonly string f0 = \"What are you doing at the end of the world? Are you busy? Will you save us?\";\n static readonly string pa1 = \"What are you doing while sending \\\"\";\n static readonly string pa2 = \"\\\"? Are you busy? Will you send \\\"\";\n static readonly string pa3 = \"\\\"?\";\n static bool Scan(int n, long k, out char c, out long newK)\n {\n newK = k;\n c = '.';\n if (n == 0)\n {\n if (k > f0.Length)\n {\n newK = k - f0.Length;\n return false;\n }\n c = f0[(int)k];\n return true;\n }\n\n if (k < pa1.Length)\n {\n c = pa1[(int)k];\n return true;\n }\n\n if (Scan(n - 1, k - pa1.Length, out c, out newK))\n {\n return true;\n }\n\n if (newK < pa2.Length)\n {\n c = pa2[(int)newK];\n return true;\n }\n\n if (Scan(n - 1, newK - pa2.Length, out c, out newK))\n {\n return true;\n }\n\n if (newK < pa3.Length)\n {\n c = pa3[(int)newK];\n return true;\n }\n newK = newK - pa3.Length;\n return false;\n }\n}\n", "lang": "MS C#", "bug_code_uid": "d536ce53c5a2afa3cc21733772aa0534", "src_uid": "da09a893a33f2bf8fd00e321e16ab149", "apr_id": "c481f140aa8fa6e6ec13391063190134", "difficulty": 1700, "tags": ["dfs and similar", "binary search"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9963048498845266, "equal_cnt": 5, "replace_cnt": 0, "delete_cnt": 3, "insert_cnt": 1, "fix_ops_cnt": 4, "bug_source_code": "using System;\n\nclass Program\n{\n const int nMax = 53; // NOTE: Levels greater that 53 will be definately greater that any k.\n static string f0 = \"What are you doing at the end of the world? Are you busy? Will you save us?\";\n static string pa1 = \"What are you doing while sending \\\"\";\n static string pa2 = \"\\\"? Are you busy? Will you send \\\"\";\n static string pa3 = \"\\\"?\";\n static long[] fnLen = new long[nMax + 1];\n\n static void Main(string[] args)\n {\n fnLen[0] = f0.Length;\n for (var i = 1; i <= nMax; ++i)\n {\n fnLen[i] = 2 * fnLen[i - 1] + pa1.Length + pa2.Length + pa3.Length;\n }\n\n var q = int.Parse(Console.ReadLine());\n for (var i = 0; i < q; ++i)\n {\n string[] input = Console.ReadLine().Split(' ');\n int n = int.Parse(input[0]);\n long k = long.Parse(input[1]) - 1;\n\n Console.Write(Scan(n, k) ?? '.');\n\n }\n Console.Out.Flush();\n }\n\n static char? Scan(int n, long k)\n {\n if (n <= nMax && fnLen[n] <= k)\n return null;\n\n if (n == 0)\n {\n return f0[(int)k];\n }\n\n if (pa1.Length > k)\n {\n return pa1[(int)k];\n }\n if (n - 1 > nMax || fnLen[n - 1] > k)\n {\n return Scan(n - 1, k - pa1.Length);\n }\n if (pa2.Length > k - pa1.Length - fnLen[n - 1])\n {\n return pa2[(int)(k - pa1.Length - fnLen[n - 1])];\n }\n if (n - 1 > nMax || fnLen[n - 1] > (k - pa1.Length - fnLen[n - 1] - pa2.Length))\n {\n return Scan(n - 1, k - pa1.Length - fnLen[n - 1] - pa2.Length);\n }\n return pa3[(int)(k - pa1.Length - fnLen[n - 1] - pa2.Length - fnLen[n - 1])];\n }\n}\n", "lang": "MS C#", "bug_code_uid": "4cdfb14285e0a50ae56fe741f0b5fb2d", "src_uid": "da09a893a33f2bf8fd00e321e16ab149", "apr_id": "c481f140aa8fa6e6ec13391063190134", "difficulty": 1700, "tags": ["dfs and similar", "binary search"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C#"} {"similarity_score": 0.9457530144640804, "equal_cnt": 39, "replace_cnt": 29, "delete_cnt": 4, "insert_cnt": 5, "fix_ops_cnt": 38, "bug_source_code": "using System;\nusing System.IO;\nusing System.Collections;\nusing System.Collections.Generic;\nusing System.Text;\nusing System.Reflection;\nusing System.Net.Sockets;\nusing System.Xml;\nusing System.Diagnostics;\nusing System.Linq;\nusing System.Threading;\n\nstatic class Program\n{\n #region IO\n public delegate ReadDelegate ReadDelegate(out T value);\n public delegate bool ParserDelegate(string word, out T item);\n\n public class Input : IDisposable\n {\n private static EventArgs DefaultEventArgs = new EventArgs();\n\n public TextReader TextReader { get; private set; }\n\n public event EventHandler OnEndOfStream;\n public event EventHandler OnParseError;\n public event EventHandler OnReadError;\n\n public bool CanRead { get; private set; }\n public bool ThrowExceptions { get; set; }\n\n string line = string.Empty;\n int pos = 0;\n\n static EventHandler emptyHandler;\n\n public Input(string path)\n : this(File.OpenRead(path))\n {\n }\n public Input(Stream s)\n : this(new StreamReader(s))\n {\n\n }\n public Input(TextReader tr)\n {\n TextReader = tr;\n\n if (emptyHandler == null)\n emptyHandler = (a, b) => { };\n\n OnEndOfStream = emptyHandler;\n OnParseError = emptyHandler;\n OnReadError = emptyHandler;\n\n CanRead = true;\n }\n\n public static implicit operator Input(Stream s)\n {\n return new Input(s);\n }\n public static implicit operator Input(TextReader tr)\n {\n return new Input(tr);\n }\n\n private bool ReadStream()\n {\n if (!CanRead) return false;\n if (pos < line.Length) return true;\n\n Clear();\n\n string s = TextReader.ReadLine();\n if (s == null)\n {\n CanRead = false;\n return false;\n }\n\n line = s;\n return true;\n }\n\n public ReadDelegate r(out T value)\n {\n value = ReadData();\n return r;\n }\n\n public void SkipChar()\n {\n if (pos < line.Length) pos++;\n else\n {\n ReadStream();\n }\n }\n public void SkipChars(int length)\n {\n while (length > 0)\n {\n int dt = line.Length - pos;\n if (dt <= 0)\n {\n length--;\n if (!ReadStream()) return;\n }\n dt = Math.Min(length, dt);\n pos += dt;\n length -= dt;\n }\n }\n\n public void SkipWhiteSpace()\n {\n while (true)\n {\n for (; pos < line.Length; pos++)\n {\n if (!char.IsWhiteSpace(line[pos])) return;\n }\n if (!ReadStream())\n {\n OnEndOfStream(this, DefaultEventArgs);\n return;\n }\n }\n }\n public bool CanReadData()\n {\n SkipWhiteSpace();\n return CanRead;\n }\n\n public T[] ReadArray()\n {\n int length = ReadInt32();\n return ReadArray(length);\n }\n public T[] ReadArray(int length)\n {\n ParserDelegate parser = Parser.GetPrimitiveParser();\n return ReadArray(length, parser);\n }\n public T[] ReadArray(ParserDelegate parser)\n {\n int length = ReadInt32();\n return ReadArray(length, parser);\n }\n public T[] ReadArray(int length, ParserDelegate parser)\n {\n T[] res = new T[length];\n for (int i = 0; i < length; i++)\n {\n res[i] = ReadData(parser);\n }\n return res;\n }\n\n public Decimal ReadDecimal()\n {\n return ReadData(Parser.DecimalParser);\n }\n public Double ReadDouble()\n {\n return ReadData(Parser.DoubleParser);\n }\n public Single ReadSingle()\n {\n return ReadData(Parser.SingleParser);\n }\n public UInt64 ReadUInt64()\n {\n return ReadData(UInt64.TryParse);\n }\n public UInt32 ReadUInt32()\n {\n return ReadData(UInt32.TryParse);\n }\n public UInt16 ReadUInt16()\n {\n return ReadData(UInt16.TryParse);\n }\n public Int64 ReadInt64()\n {\n return ReadData(Int64.TryParse);\n }\n public Int32 ReadInt32()\n {\n return ReadData(Int32.TryParse);\n }\n public Int16 ReadInt16()\n {\n return ReadData(Int16.TryParse);\n }\n public Boolean ReadYesNo()\n {\n return ReadData(Parser.YesNoParser);\n }\n public Boolean ReadBoolean()\n {\n return ReadData(Boolean.TryParse);\n }\n public Byte ReadByte()\n {\n return ReadData(Byte.TryParse);\n }\n\n private bool ReadCheck()\n {\n if (!CanRead)\n {\n OnReadError(this, DefaultEventArgs);\n if (ThrowExceptions)\n {\n throw new Exception(\"!CanRead\");\n }\n return false;\n }\n return true;\n }\n public T ReadData()\n {\n return ReadData(true);\n }\n public T ReadData(bool skipWhiteSpace)\n {\n ParserDelegate parser = Parser.GetPrimitiveParser();\n return ReadData(parser, skipWhiteSpace);\n }\n public T ReadData(ParserDelegate parser)\n {\n return ReadData(parser, true);\n }\n public T ReadData(ParserDelegate parser, bool skipWhiteSpace)\n {\n if (skipWhiteSpace)\n SkipWhiteSpace();\n\n if (!ReadCheck()) return default(T);\n\n string s = ReadWord(false);\n\n T res;\n if (!parser.Invoke(s, out res))\n {\n OnParseError(this, DefaultEventArgs);\n if (ThrowExceptions)\n {\n throw new Exception(\"!validate, word = \" + Output.ToString(s, 256));\n }\n }\n return res;\n }\n\n public string ReadWord()\n {\n return ReadWord(true);\n }\n public string ReadWord(bool skipWhiteSpace)\n {\n if (skipWhiteSpace)\n SkipWhiteSpace();\n\n if (!ReadCheck()) return string.Empty;\n\n int from = pos;\n int to = pos;\n for (int i = pos; i < line.Length; i++)\n {\n if (char.IsWhiteSpace(line[i])) break;\n to = i + 1;\n }\n pos = to;\n\n return line.Substring(from, to - from);\n }\n\n public string ReadLine()\n {\n if (!ReadCheck()) return string.Empty;\n\n ReadStream();\n string res = line.Substring(pos);\n pos = line.Length;\n\n return res;\n }\n\n public void Close()\n {\n TextReader.Close();\n }\n public void Clear()\n {\n pos = 0;\n line = string.Empty;\n }\n\n private bool disposed = false;\n public void Dispose()\n {\n Dispose(true);\n GC.SuppressFinalize(this);\n }\n\n protected virtual void Dispose(bool disposing)\n {\n if (!this.disposed)\n {\n if (disposing)\n {\n line = string.Empty;\n TextReader.Dispose();\n }\n disposed = true;\n }\n }\n ~Input()\n {\n Dispose(false);\n }\n }\n public class Output : IDisposable\n {\n static char[] space = new char[] { ' ' };\n\n public TextWriter TextWriter { get; private set; }\n public bool AutoFlush { get; set; }\n\n\n public static string ToString(object obj, int maxLength)\n {\n return ToString(FormatReal(obj), maxLength);\n }\n public static string ToString(string s, int maxLength)\n {\n if (s.Length <= maxLength) return s;\n else return s.Substring(0, maxLength) + \"...\";\n }\n public static object FormatReal(object v, string format)\n {\n if (v is decimal) return ((decimal)v).ToString(format).Replace(',', '.');\n if (v is double) return ((double)v).ToString(format).Replace(',', '.');\n if (v is float) return ((float)v).ToString(format).Replace(',', '.');\n\n return v;\n }\n public static object FormatReal(object v)\n {\n if (v is decimal || v is double || v is float)\n {\n return v.ToString().Replace(',', '.');\n }\n return v;\n }\n\n public Output()\n : this(new MemoryStream())\n {\n }\n public Output(string path)\n : this(File.Create(path))\n {\n\n }\n public Output(Stream s)\n : this(new StreamWriter(s))\n {\n }\n public Output(TextWriter tw)\n {\n TextWriter = tw;\n }\n\n public static implicit operator Output(Stream s)\n {\n return new Output(s);\n }\n\n public static implicit operator Output(TextWriter tw)\n {\n return new Output(tw);\n }\n\n public static Output operator +(Output output, object obj)\n {\n output.Write(obj);\n return output;\n }\n public Output WriteArray(params T[] array)\n {\n return WriteArray(array, false);\n }\n public Output WriteArray(T[] array, bool appendLength)\n {\n return WriteArray(array, 0, array.Length, appendLength);\n }\n public Output WriteArray(T[] array, int index, int count)\n {\n return WriteArray(array, index, count, false);\n }\n public Output WriteArray(T[] array, int index, int count, bool appendLength)\n {\n if (index + count > array.Length)\n {\n string message = string.Format(\n \"Index out of range: {0} + {1} >= {2}\",\n index,\n count,\n array.Length);\n throw new Exception(message);\n }\n if (appendLength)\n {\n WriteLine(count);\n }\n for (int i = 0; i < count; i++)\n {\n Write(array[i + index]);\n Write(space, 0, space.Length);\n }\n WriteLine();\n\n return this;\n }\n public Output WriteLine(object obj)\n {\n obj = FormatReal(obj);\n return WriteLine(obj.ToString());\n }\n public Output WriteLine(string format, params object[] args)\n {\n return WriteLine(string.Format(format, args));\n }\n public Output WriteLine(string s)\n {\n return WriteLine(s.ToCharArray());\n }\n public Output WriteLine(char[] buffer)\n {\n return WriteLine(buffer, 0, buffer.Length);\n }\n public Output WriteLine(char[] buffer, int index, int count)\n {\n TextWriter.WriteLine(buffer, index, count);\n if (AutoFlush) TextWriter.Flush();\n return this;\n }\n public Output WriteLine()\n {\n TextWriter.WriteLine();\n if (AutoFlush) TextWriter.Flush();\n return this;\n }\n public Output Write(object obj)\n {\n obj = FormatReal(obj);\n return Write(obj.ToString());\n }\n public Output Write(string format, params object[] args)\n {\n return Write(string.Format(format, args));\n }\n public Output Write(string s)\n {\n return Write(s.ToCharArray());\n }\n public Output Write(char[] buffer)\n {\n return Write(buffer, 0, buffer.Length);\n }\n public Output Write(char[] buffer, int index, int count)\n {\n TextWriter.Write(buffer, index, count);\n if (AutoFlush) TextWriter.Flush();\n return this;\n }\n\n public void Close()\n {\n TextWriter.Close();\n }\n public void Flush()\n {\n TextWriter.Flush();\n }\n\n\n private bool disposed = false;\n public void Dispose()\n {\n Dispose(true);\n GC.SuppressFinalize(this);\n }\n\n protected virtual void Dispose(bool disposing)\n {\n if (!this.disposed)\n {\n if (disposing)\n {\n TextWriter.Dispose();\n }\n disposed = true;\n }\n }\n ~Output()\n {\n Dispose(false);\n }\n }\n public static class Parser\n {\n public static ParserDelegate GetPrimitiveParser()\n {\n if (!typeof(T).IsPrimitive) throw new Exception(\"Unknown type\");\n else if (default(T) is Byte) return new ParserDelegate(Byte.TryParse) as ParserDelegate;\n else if (default(T) is Boolean) return new ParserDelegate(Boolean.TryParse) as ParserDelegate;\n else if (default(T) is Int16) return new ParserDelegate(Int16.TryParse) as ParserDelegate;\n else if (default(T) is Int32) return new ParserDelegate(Int32.TryParse) as ParserDelegate;\n else if (default(T) is Int64) return new ParserDelegate(Int64.TryParse) as ParserDelegate;\n else if (default(T) is UInt16) return new ParserDelegate(UInt16.TryParse) as ParserDelegate;\n else if (default(T) is UInt32) return new ParserDelegate(UInt32.TryParse) as ParserDelegate;\n else if (default(T) is UInt64) return new ParserDelegate(UInt64.TryParse) as ParserDelegate;\n else if (default(T) is Single) return new ParserDelegate(Parser.SingleParser) as ParserDelegate;\n else if (default(T) is Double) return new ParserDelegate(Parser.DoubleParser) as ParserDelegate;\n else if (default(T) is Decimal) return new ParserDelegate(Parser.DecimalParser) as ParserDelegate;\n else if (default(T) is String) return new ParserDelegate(Parser.StringParser) as ParserDelegate;\n else throw new Exception(\"Unknown type\");\n }\n public static bool YesNoParser(string s, out Boolean result)\n {\n s = s.ToLower();\n if (s == \"yes\") result = true;\n else if (s == \"no\") result = false;\n else\n {\n result = false;\n return false;\n }\n return true;\n }\n public static bool ReplaceDot;\n public static bool StringParser(string s, out string result)\n {\n result = s;\n return string.IsNullOrEmpty(s);\n }\n private static string fs(string s)\n {\n if (ReplaceDot) return s.Replace(',', '.');\n else return s;\n }\n public static bool DecimalParser(string s, out Decimal result)\n {\n return Decimal.TryParse(fs(s), out result);\n }\n public static bool DoubleParser(string s, out Double result)\n {\n return Double.TryParse(fs(s), out result);\n }\n public static bool SingleParser(string s, out Single result)\n {\n return Single.TryParse(fs(s), out result);\n }\n }\n #endregion\n #region Streams\n static string endl = Environment.NewLine;\n static Input cin = new Input(Console.In);\n static Output cout = new Output(Console.Out);\n static Output cerr = new Output(Console.Error);\n static StringBuilder sb = new StringBuilder();\n #endregion\n #region Time\n //*\n static Stopwatch sw = new Stopwatch();\n static void Start()\n {\n sw.Reset();\n sw.Start();\n }\n static void Restart(string text = \"\")\n {\n Stop(text);\n Start();\n }\n static void Time(string text = \"\")\n {\n if (string.IsNullOrEmpty(text))\n {\n cerr.WriteLine(sw.Elapsed);\n }\n else\n {\n cerr.WriteLine(text + \": \" + sw.Elapsed);\n }\n }\n static void Stop(string text = \"\")\n {\n sw.Stop();\n Time(text);\n }\n //*/\n #endregion\n\n static void InitIO(string name)\n {\n#if DEBUG\n#else\n cin = new Input(name + \".in\");\n cout = new Output(name + \".out\");\n Parser.ReplaceDot = false;\n#endif\n }\n static long[] fact = new long[50];\n\n static long Search(int[] a, int p, long x, long s, int k)\n {\n if (x == s) return 1;\n if (x > s) return 0;\n if (p == a.Length) return 0;\n\n long res = Search(a, p + 1, x, s, k);\n if (k == 0 || a[p] >= 20)\n {\n res = Search(a, p + 1, x + a[p], s, k);\n }\n else\n {\n res += Search(a, p + 1, x + a[p], s, k);\n res += Search(a, p + 1, x + fact[a[p]], s, k - 1);\n }\n return res;\n }\n static void Main()\n {\n fact[0] = 1;\n for (var i = 1; i < 50; i++)\n {\n fact[i] = fact[i - 1] * i;\n }\n\n var n = cin.ReadInt32();\n var k = cin.ReadInt32();\n var s = cin.ReadInt64();\n\n var a = cin.ReadArray(n);\n\n var ans = Search(a, 0, 0, s, k);\n cout += ans + endl;\n }\n}", "lang": "MS C#", "bug_code_uid": "1c4f903f506d8f9f9033d76cf5158cd5", "src_uid": "2821a11066dffc7e8f6a60a8751cea37", "apr_id": "0c0edccae666948ed1313c96776b56c5", "difficulty": 2100, "tags": ["dp", "meet-in-the-middle", "bitmasks", "math", "brute force", "binary search"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9068152371080591, "equal_cnt": 27, "replace_cnt": 21, "delete_cnt": 4, "insert_cnt": 2, "fix_ops_cnt": 27, "bug_source_code": "using System;\nusing System.IO;\nusing System.Collections;\nusing System.Collections.Generic;\nusing System.Text;\nusing System.Reflection;\nusing System.Net.Sockets;\nusing System.Xml;\nusing System.Diagnostics;\nusing System.Linq;\nusing System.Threading;\n\nstatic class Program\n{\n #region IO\n public delegate ReadDelegate ReadDelegate(out T value);\n public delegate bool ParserDelegate(string word, out T item);\n\n public class Input : IDisposable\n {\n private static EventArgs DefaultEventArgs = new EventArgs();\n\n public TextReader TextReader { get; private set; }\n\n public event EventHandler OnEndOfStream;\n public event EventHandler OnParseError;\n public event EventHandler OnReadError;\n\n public bool CanRead { get; private set; }\n public bool ThrowExceptions { get; set; }\n\n string line = string.Empty;\n int pos = 0;\n\n static EventHandler emptyHandler;\n\n public Input(string path)\n : this(File.OpenRead(path))\n {\n }\n public Input(Stream s)\n : this(new StreamReader(s))\n {\n\n }\n public Input(TextReader tr)\n {\n TextReader = tr;\n\n if (emptyHandler == null)\n emptyHandler = (a, b) => { };\n\n OnEndOfStream = emptyHandler;\n OnParseError = emptyHandler;\n OnReadError = emptyHandler;\n\n CanRead = true;\n }\n\n public static implicit operator Input(Stream s)\n {\n return new Input(s);\n }\n public static implicit operator Input(TextReader tr)\n {\n return new Input(tr);\n }\n\n private bool ReadStream()\n {\n if (!CanRead) return false;\n if (pos < line.Length) return true;\n\n Clear();\n\n string s = TextReader.ReadLine();\n if (s == null)\n {\n CanRead = false;\n return false;\n }\n\n line = s;\n return true;\n }\n\n public ReadDelegate r(out T value)\n {\n value = ReadData();\n return r;\n }\n\n public void SkipChar()\n {\n if (pos < line.Length) pos++;\n else\n {\n ReadStream();\n }\n }\n public void SkipChars(int length)\n {\n while (length > 0)\n {\n int dt = line.Length - pos;\n if (dt <= 0)\n {\n length--;\n if (!ReadStream()) return;\n }\n dt = Math.Min(length, dt);\n pos += dt;\n length -= dt;\n }\n }\n\n public void SkipWhiteSpace()\n {\n while (true)\n {\n for (; pos < line.Length; pos++)\n {\n if (!char.IsWhiteSpace(line[pos])) return;\n }\n if (!ReadStream())\n {\n OnEndOfStream(this, DefaultEventArgs);\n return;\n }\n }\n }\n public bool CanReadData()\n {\n SkipWhiteSpace();\n return CanRead;\n }\n\n public T[] ReadArray()\n {\n int length = ReadInt32();\n return ReadArray(length);\n }\n public T[] ReadArray(int length)\n {\n ParserDelegate parser = Parser.GetPrimitiveParser();\n return ReadArray(length, parser);\n }\n public T[] ReadArray(ParserDelegate parser)\n {\n int length = ReadInt32();\n return ReadArray(length, parser);\n }\n public T[] ReadArray(int length, ParserDelegate parser)\n {\n T[] res = new T[length];\n for (int i = 0; i < length; i++)\n {\n res[i] = ReadData(parser);\n }\n return res;\n }\n\n public Decimal ReadDecimal()\n {\n return ReadData(Parser.DecimalParser);\n }\n public Double ReadDouble()\n {\n return ReadData(Parser.DoubleParser);\n }\n public Single ReadSingle()\n {\n return ReadData(Parser.SingleParser);\n }\n public UInt64 ReadUInt64()\n {\n return ReadData(UInt64.TryParse);\n }\n public UInt32 ReadUInt32()\n {\n return ReadData(UInt32.TryParse);\n }\n public UInt16 ReadUInt16()\n {\n return ReadData(UInt16.TryParse);\n }\n public Int64 ReadInt64()\n {\n return ReadData(Int64.TryParse);\n }\n public Int32 ReadInt32()\n {\n return ReadData(Int32.TryParse);\n }\n public Int16 ReadInt16()\n {\n return ReadData(Int16.TryParse);\n }\n public Boolean ReadYesNo()\n {\n return ReadData(Parser.YesNoParser);\n }\n public Boolean ReadBoolean()\n {\n return ReadData(Boolean.TryParse);\n }\n public Byte ReadByte()\n {\n return ReadData(Byte.TryParse);\n }\n\n private bool ReadCheck()\n {\n if (!CanRead)\n {\n OnReadError(this, DefaultEventArgs);\n if (ThrowExceptions)\n {\n throw new Exception(\"!CanRead\");\n }\n return false;\n }\n return true;\n }\n public T ReadData()\n {\n return ReadData(true);\n }\n public T ReadData(bool skipWhiteSpace)\n {\n ParserDelegate parser = Parser.GetPrimitiveParser();\n return ReadData(parser, skipWhiteSpace);\n }\n public T ReadData(ParserDelegate parser)\n {\n return ReadData(parser, true);\n }\n public T ReadData(ParserDelegate parser, bool skipWhiteSpace)\n {\n if (skipWhiteSpace)\n SkipWhiteSpace();\n\n if (!ReadCheck()) return default(T);\n\n string s = ReadWord(false);\n\n T res;\n if (!parser.Invoke(s, out res))\n {\n OnParseError(this, DefaultEventArgs);\n if (ThrowExceptions)\n {\n throw new Exception(\"!validate, word = \" + Output.ToString(s, 256));\n }\n }\n return res;\n }\n\n public string ReadWord()\n {\n return ReadWord(true);\n }\n public string ReadWord(bool skipWhiteSpace)\n {\n if (skipWhiteSpace)\n SkipWhiteSpace();\n\n if (!ReadCheck()) return string.Empty;\n\n int from = pos;\n int to = pos;\n for (int i = pos; i < line.Length; i++)\n {\n if (char.IsWhiteSpace(line[i])) break;\n to = i + 1;\n }\n pos = to;\n\n return line.Substring(from, to - from);\n }\n\n public string ReadLine()\n {\n if (!ReadCheck()) return string.Empty;\n\n ReadStream();\n string res = line.Substring(pos);\n pos = line.Length;\n\n return res;\n }\n\n public void Close()\n {\n TextReader.Close();\n }\n public void Clear()\n {\n pos = 0;\n line = string.Empty;\n }\n\n private bool disposed = false;\n public void Dispose()\n {\n Dispose(true);\n GC.SuppressFinalize(this);\n }\n\n protected virtual void Dispose(bool disposing)\n {\n if (!this.disposed)\n {\n if (disposing)\n {\n line = string.Empty;\n TextReader.Dispose();\n }\n disposed = true;\n }\n }\n ~Input()\n {\n Dispose(false);\n }\n }\n public class Output : IDisposable\n {\n static char[] space = new char[] { ' ' };\n\n public TextWriter TextWriter { get; private set; }\n public bool AutoFlush { get; set; }\n\n\n public static string ToString(object obj, int maxLength)\n {\n return ToString(FormatReal(obj), maxLength);\n }\n public static string ToString(string s, int maxLength)\n {\n if (s.Length <= maxLength) return s;\n else return s.Substring(0, maxLength) + \"...\";\n }\n public static object FormatReal(object v, string format)\n {\n if (v is decimal) return ((decimal)v).ToString(format).Replace(',', '.');\n if (v is double) return ((double)v).ToString(format).Replace(',', '.');\n if (v is float) return ((float)v).ToString(format).Replace(',', '.');\n\n return v;\n }\n public static object FormatReal(object v)\n {\n if (v is decimal || v is double || v is float)\n {\n return v.ToString().Replace(',', '.');\n }\n return v;\n }\n\n public Output()\n : this(new MemoryStream())\n {\n }\n public Output(string path)\n : this(File.Create(path))\n {\n\n }\n public Output(Stream s)\n : this(new StreamWriter(s))\n {\n }\n public Output(TextWriter tw)\n {\n TextWriter = tw;\n }\n\n public static implicit operator Output(Stream s)\n {\n return new Output(s);\n }\n\n public static implicit operator Output(TextWriter tw)\n {\n return new Output(tw);\n }\n\n public static Output operator +(Output output, object obj)\n {\n output.Write(obj);\n return output;\n }\n public Output WriteArray(params T[] array)\n {\n return WriteArray(array, false);\n }\n public Output WriteArray(T[] array, bool appendLength)\n {\n return WriteArray(array, 0, array.Length, appendLength);\n }\n public Output WriteArray(T[] array, int index, int count)\n {\n return WriteArray(array, index, count, false);\n }\n public Output WriteArray(T[] array, int index, int count, bool appendLength)\n {\n if (index + count > array.Length)\n {\n string message = string.Format(\n \"Index out of range: {0} + {1} >= {2}\",\n index,\n count,\n array.Length);\n throw new Exception(message);\n }\n if (appendLength)\n {\n WriteLine(count);\n }\n for (int i = 0; i < count; i++)\n {\n Write(array[i + index]);\n Write(space, 0, space.Length);\n }\n WriteLine();\n\n return this;\n }\n public Output WriteLine(object obj)\n {\n obj = FormatReal(obj);\n return WriteLine(obj.ToString());\n }\n public Output WriteLine(string format, params object[] args)\n {\n return WriteLine(string.Format(format, args));\n }\n public Output WriteLine(string s)\n {\n return WriteLine(s.ToCharArray());\n }\n public Output WriteLine(char[] buffer)\n {\n return WriteLine(buffer, 0, buffer.Length);\n }\n public Output WriteLine(char[] buffer, int index, int count)\n {\n TextWriter.WriteLine(buffer, index, count);\n if (AutoFlush) TextWriter.Flush();\n return this;\n }\n public Output WriteLine()\n {\n TextWriter.WriteLine();\n if (AutoFlush) TextWriter.Flush();\n return this;\n }\n public Output Write(object obj)\n {\n obj = FormatReal(obj);\n return Write(obj.ToString());\n }\n public Output Write(string format, params object[] args)\n {\n return Write(string.Format(format, args));\n }\n public Output Write(string s)\n {\n return Write(s.ToCharArray());\n }\n public Output Write(char[] buffer)\n {\n return Write(buffer, 0, buffer.Length);\n }\n public Output Write(char[] buffer, int index, int count)\n {\n TextWriter.Write(buffer, index, count);\n if (AutoFlush) TextWriter.Flush();\n return this;\n }\n\n public void Close()\n {\n TextWriter.Close();\n }\n public void Flush()\n {\n TextWriter.Flush();\n }\n\n\n private bool disposed = false;\n public void Dispose()\n {\n Dispose(true);\n GC.SuppressFinalize(this);\n }\n\n protected virtual void Dispose(bool disposing)\n {\n if (!this.disposed)\n {\n if (disposing)\n {\n TextWriter.Dispose();\n }\n disposed = true;\n }\n }\n ~Output()\n {\n Dispose(false);\n }\n }\n public static class Parser\n {\n public static ParserDelegate GetPrimitiveParser()\n {\n if (!typeof(T).IsPrimitive) throw new Exception(\"Unknown type\");\n else if (default(T) is Byte) return new ParserDelegate(Byte.TryParse) as ParserDelegate;\n else if (default(T) is Boolean) return new ParserDelegate(Boolean.TryParse) as ParserDelegate;\n else if (default(T) is Int16) return new ParserDelegate(Int16.TryParse) as ParserDelegate;\n else if (default(T) is Int32) return new ParserDelegate(Int32.TryParse) as ParserDelegate;\n else if (default(T) is Int64) return new ParserDelegate(Int64.TryParse) as ParserDelegate;\n else if (default(T) is UInt16) return new ParserDelegate(UInt16.TryParse) as ParserDelegate;\n else if (default(T) is UInt32) return new ParserDelegate(UInt32.TryParse) as ParserDelegate;\n else if (default(T) is UInt64) return new ParserDelegate(UInt64.TryParse) as ParserDelegate;\n else if (default(T) is Single) return new ParserDelegate(Parser.SingleParser) as ParserDelegate;\n else if (default(T) is Double) return new ParserDelegate(Parser.DoubleParser) as ParserDelegate;\n else if (default(T) is Decimal) return new ParserDelegate(Parser.DecimalParser) as ParserDelegate;\n else if (default(T) is String) return new ParserDelegate(Parser.StringParser) as ParserDelegate;\n else throw new Exception(\"Unknown type\");\n }\n public static bool YesNoParser(string s, out Boolean result)\n {\n s = s.ToLower();\n if (s == \"yes\") result = true;\n else if (s == \"no\") result = false;\n else\n {\n result = false;\n return false;\n }\n return true;\n }\n public static bool ReplaceDot;\n public static bool StringParser(string s, out string result)\n {\n result = s;\n return string.IsNullOrEmpty(s);\n }\n private static string fs(string s)\n {\n if (ReplaceDot) return s.Replace(',', '.');\n else return s;\n }\n public static bool DecimalParser(string s, out Decimal result)\n {\n return Decimal.TryParse(fs(s), out result);\n }\n public static bool DoubleParser(string s, out Double result)\n {\n return Double.TryParse(fs(s), out result);\n }\n public static bool SingleParser(string s, out Single result)\n {\n return Single.TryParse(fs(s), out result);\n }\n }\n #endregion\n #region Streams\n static string endl = Environment.NewLine;\n static Input cin = new Input(Console.In);\n static Output cout = new Output(Console.Out);\n static Output cerr = new Output(Console.Error);\n static StringBuilder sb = new StringBuilder();\n #endregion\n #region Time\n //*\n static Stopwatch sw = new Stopwatch();\n static void Start()\n {\n sw.Reset();\n sw.Start();\n }\n static void Restart(string text = \"\")\n {\n Stop(text);\n Start();\n }\n static void Time(string text = \"\")\n {\n if (string.IsNullOrEmpty(text))\n {\n cerr.WriteLine(sw.Elapsed);\n }\n else\n {\n cerr.WriteLine(text + \": \" + sw.Elapsed);\n }\n }\n static void Stop(string text = \"\")\n {\n sw.Stop();\n Time(text);\n }\n //*/\n #endregion\n\n static void InitIO(string name)\n {\n#if DEBUG\n#else\n cin = new Input(name + \".in\");\n cout = new Output(name + \".out\");\n Parser.ReplaceDot = false;\n#endif\n }\n static long[] fact = new long[50];\n static long[] sum;\n static long[] hashtable = new long[29999999];\n static long[] hashs = new long[29999999];\n\n static long Search(int[] a, int p, long x, long s, int k)\n {\n if (x == s) return 1;\n if (x > s) return 0;\n if (p == a.Length) return 0;\n if (a[p] >= 19 && sum[p] + x < s) return 0;\n\n long hash = x % hashtable.Length;\n if (hash < 0) hash += hashtable.Length;\n if (a[p] < 19)\n {\n //while (hashtable[hash] != -1 && hashs[hash] != hash) hash = (hash + 1) % hashtable.Length;\n if(hashtable[hash] != -1)\n {\n return hashtable[hash];\n }\n }\n\n long res = Search(a, p + 1, x, s, k);\n if (k == 0 || a[p] >= 19)\n {\n res = Search(a, p + 1, x + a[p], s, k);\n }\n else\n {\n res += Search(a, p + 1, x + a[p], s, k);\n res += Search(a, p + 1, x + fact[a[p]], s, k - 1);\n }\n if (a[p] < 19)\n {\n hashtable[hash] = hash;\n }\n\n return res;\n }\n static void Main()\n {\n fact[0] = 1;\n for (var i = 1; i < 50; i++)\n {\n fact[i] = fact[i - 1] * i;\n }\n for(var i = 0; i < hashtable.Length; i++)\n {\n hashtable[i] = -1;\n }\n\n var n = cin.ReadInt32();\n var k = cin.ReadInt32();\n var s = cin.ReadInt64();\n\n var a = cin.ReadArray(n);\n Array.Sort(a);\n if (a[n - 1] < 19)\n {\n Array.Reverse(a);\n }\n else\n {\n for (var i = 0; i < a.Length - 1; i++)\n {\n if (a[i + 1] >= 19)\n {\n Array.Reverse(a, 0, i + 1);\n break;\n }\n }\n }\n sum = new long[n + 1];\n for(var i = n - 1; i >= 0; i--)\n {\n sum[i] = a[i] + sum[i + 1];\n }\n\n var ans = Search(a, 0, 0, s, k);\n cout += ans + endl;\n }\n}", "lang": "MS C#", "bug_code_uid": "ff21ec0982decabc18db0fcb2fb2cc61", "src_uid": "2821a11066dffc7e8f6a60a8751cea37", "apr_id": "0c0edccae666948ed1313c96776b56c5", "difficulty": 2100, "tags": ["dp", "meet-in-the-middle", "bitmasks", "math", "brute force", "binary search"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9961738036584726, "equal_cnt": 18, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 14, "fix_ops_cnt": 17, "bug_source_code": "using System;\nusing System.IO;\nusing System.Collections;\nusing System.Collections.Generic;\nusing System.Text;\nusing System.Reflection;\nusing System.Net.Sockets;\nusing System.Xml;\nusing System.Diagnostics;\nusing System.Linq;\nusing System.Threading;\n\nstatic class Program\n{\n #region IO\n public delegate ReadDelegate ReadDelegate(out T value);\n public delegate bool ParserDelegate(string word, out T item);\n\n public class Input : IDisposable\n {\n private static EventArgs DefaultEventArgs = new EventArgs();\n\n public TextReader TextReader { get; private set; }\n\n public event EventHandler OnEndOfStream;\n public event EventHandler OnParseError;\n public event EventHandler OnReadError;\n\n public bool CanRead { get; private set; }\n public bool ThrowExceptions { get; set; }\n\n string line = string.Empty;\n int pos = 0;\n\n static EventHandler emptyHandler;\n\n public Input(string path)\n : this(File.OpenRead(path))\n {\n }\n public Input(Stream s)\n : this(new StreamReader(s))\n {\n\n }\n public Input(TextReader tr)\n {\n TextReader = tr;\n\n if (emptyHandler == null)\n emptyHandler = (a, b) => { };\n\n OnEndOfStream = emptyHandler;\n OnParseError = emptyHandler;\n OnReadError = emptyHandler;\n\n CanRead = true;\n }\n\n public static implicit operator Input(Stream s)\n {\n return new Input(s);\n }\n public static implicit operator Input(TextReader tr)\n {\n return new Input(tr);\n }\n\n private bool ReadStream()\n {\n if (!CanRead) return false;\n if (pos < line.Length) return true;\n\n Clear();\n\n string s = TextReader.ReadLine();\n if (s == null)\n {\n CanRead = false;\n return false;\n }\n\n line = s;\n return true;\n }\n\n public ReadDelegate r(out T value)\n {\n value = ReadData();\n return r;\n }\n\n public void SkipChar()\n {\n if (pos < line.Length) pos++;\n else\n {\n ReadStream();\n }\n }\n public void SkipChars(int length)\n {\n while (length > 0)\n {\n int dt = line.Length - pos;\n if (dt <= 0)\n {\n length--;\n if (!ReadStream()) return;\n }\n dt = Math.Min(length, dt);\n pos += dt;\n length -= dt;\n }\n }\n\n public void SkipWhiteSpace()\n {\n while (true)\n {\n for (; pos < line.Length; pos++)\n {\n if (!char.IsWhiteSpace(line[pos])) return;\n }\n if (!ReadStream())\n {\n OnEndOfStream(this, DefaultEventArgs);\n return;\n }\n }\n }\n public bool CanReadData()\n {\n SkipWhiteSpace();\n return CanRead;\n }\n\n public T[] ReadArray()\n {\n int length = ReadInt32();\n return ReadArray(length);\n }\n public T[] ReadArray(int length)\n {\n ParserDelegate parser = Parser.GetPrimitiveParser();\n return ReadArray(length, parser);\n }\n public T[] ReadArray(ParserDelegate parser)\n {\n int length = ReadInt32();\n return ReadArray(length, parser);\n }\n public T[] ReadArray(int length, ParserDelegate parser)\n {\n T[] res = new T[length];\n for (int i = 0; i < length; i++)\n {\n res[i] = ReadData(parser);\n }\n return res;\n }\n\n public Decimal ReadDecimal()\n {\n return ReadData(Parser.DecimalParser);\n }\n public Double ReadDouble()\n {\n return ReadData(Parser.DoubleParser);\n }\n public Single ReadSingle()\n {\n return ReadData(Parser.SingleParser);\n }\n public UInt64 ReadUInt64()\n {\n return ReadData(UInt64.TryParse);\n }\n public UInt32 ReadUInt32()\n {\n return ReadData(UInt32.TryParse);\n }\n public UInt16 ReadUInt16()\n {\n return ReadData(UInt16.TryParse);\n }\n public Int64 ReadInt64()\n {\n return ReadData(Int64.TryParse);\n }\n public Int32 ReadInt32()\n {\n return ReadData(Int32.TryParse);\n }\n public Int16 ReadInt16()\n {\n return ReadData(Int16.TryParse);\n }\n public Boolean ReadYesNo()\n {\n return ReadData(Parser.YesNoParser);\n }\n public Boolean ReadBoolean()\n {\n return ReadData(Boolean.TryParse);\n }\n public Byte ReadByte()\n {\n return ReadData(Byte.TryParse);\n }\n\n private bool ReadCheck()\n {\n if (!CanRead)\n {\n OnReadError(this, DefaultEventArgs);\n if (ThrowExceptions)\n {\n throw new Exception(\"!CanRead\");\n }\n return false;\n }\n return true;\n }\n public T ReadData()\n {\n return ReadData(true);\n }\n public T ReadData(bool skipWhiteSpace)\n {\n ParserDelegate parser = Parser.GetPrimitiveParser();\n return ReadData(parser, skipWhiteSpace);\n }\n public T ReadData(ParserDelegate parser)\n {\n return ReadData(parser, true);\n }\n public T ReadData(ParserDelegate parser, bool skipWhiteSpace)\n {\n if (skipWhiteSpace)\n SkipWhiteSpace();\n\n if (!ReadCheck()) return default(T);\n\n string s = ReadWord(false);\n\n T res;\n if (!parser.Invoke(s, out res))\n {\n OnParseError(this, DefaultEventArgs);\n if (ThrowExceptions)\n {\n throw new Exception(\"!validate, word = \" + Output.ToString(s, 256));\n }\n }\n return res;\n }\n\n public string ReadWord()\n {\n return ReadWord(true);\n }\n public string ReadWord(bool skipWhiteSpace)\n {\n if (skipWhiteSpace)\n SkipWhiteSpace();\n\n if (!ReadCheck()) return string.Empty;\n\n int from = pos;\n int to = pos;\n for (int i = pos; i < line.Length; i++)\n {\n if (char.IsWhiteSpace(line[i])) break;\n to = i + 1;\n }\n pos = to;\n\n return line.Substring(from, to - from);\n }\n\n public string ReadLine()\n {\n if (!ReadCheck()) return string.Empty;\n\n ReadStream();\n string res = line.Substring(pos);\n pos = line.Length;\n\n return res;\n }\n\n public void Close()\n {\n TextReader.Close();\n }\n public void Clear()\n {\n pos = 0;\n line = string.Empty;\n }\n\n private bool disposed = false;\n public void Dispose()\n {\n Dispose(true);\n GC.SuppressFinalize(this);\n }\n\n protected virtual void Dispose(bool disposing)\n {\n if (!this.disposed)\n {\n if (disposing)\n {\n line = string.Empty;\n TextReader.Dispose();\n }\n disposed = true;\n }\n }\n ~Input()\n {\n Dispose(false);\n }\n }\n public class Output : IDisposable\n {\n static char[] space = new char[] { ' ' };\n\n public TextWriter TextWriter { get; private set; }\n public bool AutoFlush { get; set; }\n\n\n public static string ToString(object obj, int maxLength)\n {\n return ToString(FormatReal(obj), maxLength);\n }\n public static string ToString(string s, int maxLength)\n {\n if (s.Length <= maxLength) return s;\n else return s.Substring(0, maxLength) + \"...\";\n }\n public static object FormatReal(object v, string format)\n {\n if (v is decimal) return ((decimal)v).ToString(format).Replace(',', '.');\n if (v is double) return ((double)v).ToString(format).Replace(',', '.');\n if (v is float) return ((float)v).ToString(format).Replace(',', '.');\n\n return v;\n }\n public static object FormatReal(object v)\n {\n if (v is decimal || v is double || v is float)\n {\n return v.ToString().Replace(',', '.');\n }\n return v;\n }\n\n public Output()\n : this(new MemoryStream())\n {\n }\n public Output(string path)\n : this(File.Create(path))\n {\n\n }\n public Output(Stream s)\n : this(new StreamWriter(s))\n {\n }\n public Output(TextWriter tw)\n {\n TextWriter = tw;\n }\n\n public static implicit operator Output(Stream s)\n {\n return new Output(s);\n }\n\n public static implicit operator Output(TextWriter tw)\n {\n return new Output(tw);\n }\n\n public static Output operator +(Output output, object obj)\n {\n output.Write(obj);\n return output;\n }\n public Output WriteArray(params T[] array)\n {\n return WriteArray(array, false);\n }\n public Output WriteArray(T[] array, bool appendLength)\n {\n return WriteArray(array, 0, array.Length, appendLength);\n }\n public Output WriteArray(T[] array, int index, int count)\n {\n return WriteArray(array, index, count, false);\n }\n public Output WriteArray(T[] array, int index, int count, bool appendLength)\n {\n if (index + count > array.Length)\n {\n string message = string.Format(\n \"Index out of range: {0} + {1} >= {2}\",\n index,\n count,\n array.Length);\n throw new Exception(message);\n }\n if (appendLength)\n {\n WriteLine(count);\n }\n for (int i = 0; i < count; i++)\n {\n Write(array[i + index]);\n Write(space, 0, space.Length);\n }\n WriteLine();\n\n return this;\n }\n public Output WriteLine(object obj)\n {\n obj = FormatReal(obj);\n return WriteLine(obj.ToString());\n }\n public Output WriteLine(string format, params object[] args)\n {\n return WriteLine(string.Format(format, args));\n }\n public Output WriteLine(string s)\n {\n return WriteLine(s.ToCharArray());\n }\n public Output WriteLine(char[] buffer)\n {\n return WriteLine(buffer, 0, buffer.Length);\n }\n public Output WriteLine(char[] buffer, int index, int count)\n {\n TextWriter.WriteLine(buffer, index, count);\n if (AutoFlush) TextWriter.Flush();\n return this;\n }\n public Output WriteLine()\n {\n TextWriter.WriteLine();\n if (AutoFlush) TextWriter.Flush();\n return this;\n }\n public Output Write(object obj)\n {\n obj = FormatReal(obj);\n return Write(obj.ToString());\n }\n public Output Write(string format, params object[] args)\n {\n return Write(string.Format(format, args));\n }\n public Output Write(string s)\n {\n return Write(s.ToCharArray());\n }\n public Output Write(char[] buffer)\n {\n return Write(buffer, 0, buffer.Length);\n }\n public Output Write(char[] buffer, int index, int count)\n {\n TextWriter.Write(buffer, index, count);\n if (AutoFlush) TextWriter.Flush();\n return this;\n }\n\n public void Close()\n {\n TextWriter.Close();\n }\n public void Flush()\n {\n TextWriter.Flush();\n }\n\n\n private bool disposed = false;\n public void Dispose()\n {\n Dispose(true);\n GC.SuppressFinalize(this);\n }\n\n protected virtual void Dispose(bool disposing)\n {\n if (!this.disposed)\n {\n if (disposing)\n {\n TextWriter.Dispose();\n }\n disposed = true;\n }\n }\n ~Output()\n {\n Dispose(false);\n }\n }\n public static class Parser\n {\n public static ParserDelegate GetPrimitiveParser()\n {\n if (!typeof(T).IsPrimitive) throw new Exception(\"Unknown type\");\n else if (default(T) is Byte) return new ParserDelegate(Byte.TryParse) as ParserDelegate;\n else if (default(T) is Boolean) return new ParserDelegate(Boolean.TryParse) as ParserDelegate;\n else if (default(T) is Int16) return new ParserDelegate(Int16.TryParse) as ParserDelegate;\n else if (default(T) is Int32) return new ParserDelegate(Int32.TryParse) as ParserDelegate;\n else if (default(T) is Int64) return new ParserDelegate(Int64.TryParse) as ParserDelegate;\n else if (default(T) is UInt16) return new ParserDelegate(UInt16.TryParse) as ParserDelegate;\n else if (default(T) is UInt32) return new ParserDelegate(UInt32.TryParse) as ParserDelegate;\n else if (default(T) is UInt64) return new ParserDelegate(UInt64.TryParse) as ParserDelegate;\n else if (default(T) is Single) return new ParserDelegate(Parser.SingleParser) as ParserDelegate;\n else if (default(T) is Double) return new ParserDelegate(Parser.DoubleParser) as ParserDelegate;\n else if (default(T) is Decimal) return new ParserDelegate(Parser.DecimalParser) as ParserDelegate;\n else if (default(T) is String) return new ParserDelegate(Parser.StringParser) as ParserDelegate;\n else throw new Exception(\"Unknown type\");\n }\n public static bool YesNoParser(string s, out Boolean result)\n {\n s = s.ToLower();\n if (s == \"yes\") result = true;\n else if (s == \"no\") result = false;\n else\n {\n result = false;\n return false;\n }\n return true;\n }\n public static bool ReplaceDot;\n public static bool StringParser(string s, out string result)\n {\n result = s;\n return string.IsNullOrEmpty(s);\n }\n private static string fs(string s)\n {\n if (ReplaceDot) return s.Replace(',', '.');\n else return s;\n }\n public static bool DecimalParser(string s, out Decimal result)\n {\n return Decimal.TryParse(fs(s), out result);\n }\n public static bool DoubleParser(string s, out Double result)\n {\n return Double.TryParse(fs(s), out result);\n }\n public static bool SingleParser(string s, out Single result)\n {\n return Single.TryParse(fs(s), out result);\n }\n }\n #endregion\n #region Streams\n static string endl = Environment.NewLine;\n static Input cin = new Input(Console.In);\n static Output cout = new Output(Console.Out);\n static Output cerr = new Output(Console.Error);\n static StringBuilder sb = new StringBuilder();\n #endregion\n #region Time\n //*\n static Stopwatch sw = new Stopwatch();\n static void Start()\n {\n sw.Reset();\n sw.Start();\n }\n static void Restart(string text = \"\")\n {\n Stop(text);\n Start();\n }\n static void Time(string text = \"\")\n {\n if (string.IsNullOrEmpty(text))\n {\n cerr.WriteLine(sw.Elapsed);\n }\n else\n {\n cerr.WriteLine(text + \": \" + sw.Elapsed);\n }\n }\n static void Stop(string text = \"\")\n {\n sw.Stop();\n Time(text);\n }\n //*/\n #endregion\n\n static void InitIO(string name)\n {\n#if DEBUG\n#else\n cin = new Input(name + \".in\");\n cout = new Output(name + \".out\");\n Parser.ReplaceDot = false;\n#endif\n }\n\n static long[] fact =\n {\n 1, 1, 2, 6, 24,\n 120, 720, 5040, 40320, 362880,\n 3628800, 39916800, 479001600, 6227020800, 87178291200,\n 1307674368000, 20922789888000, 355687428096000, 6402373705728000, 121645100408832000\n };\n\n static Dictionary[] dm;\n static void Build(int[] a, int p, int k, long s)\n {\n if (p == a.Length)\n {\n if (!dm[k].ContainsKey(s))\n {\n dm[k][s] = 0;\n }\n dm[k][s]++;\n return;\n }\n\n var x = a[p];\n if(x < 19)\n {\n Build(a, p + 1, k - 1, s + fact[x]);\n }\n Build(a, p + 1, k, s + x);\n Build(a, p + 1, k, s);\n }\n static long Search(int[] a, int p, int to, int k, long s)\n {\n if (s < 0) return 0;\n if(p == to)\n {\n long r;\n dm[k].TryGetValue(s, out r);\n return r;\n }\n\n long res = 0;\n if(a[p] < 19)\n {\n res += Search(a, p + 1, to, k - 1, s - fact[a[p]]);\n }\n res += Search(a, p + 1, to, k, s);\n res += Search(a, p + 1, to, k, s - a[p]);\n\n return res;\n }\n\n static void Main()\n {\n var n = cin.ReadInt32();\n var k = cin.ReadInt32();\n var s = cin.ReadInt64();\n\n var a = cin.ReadArray(n);\n\n dm = new Dictionary[k + 1];\n for(var i = 0; i <= k; i++)\n {\n dm[i] = new Dictionary();\n }\n\n var p = n / 2;\n Build(a, p, k, 0);\n\n var ans = Search(a, 0, p, k, s);\n cout += ans + endl;\n }\n}", "lang": "MS C#", "bug_code_uid": "e77b4489e6eaae85dab2a49f2f731858", "src_uid": "2821a11066dffc7e8f6a60a8751cea37", "apr_id": "0c0edccae666948ed1313c96776b56c5", "difficulty": 2100, "tags": ["dp", "meet-in-the-middle", "bitmasks", "math", "brute force", "binary search"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.9859649122807017, "equal_cnt": 3, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "using System;\nusing System.Linq;\n\nclass Program {\n static void Main() {\n var n = int.Parse(Console.ReadLine());\n var x = Console.ReadLine().Split(' ').Select(int.Parse).Sum();\n var res = Enumerable.Range(1, 5).Count(i => (i + x) % n != 1);\n Console.WriteLike(res);\n }\n}", "lang": "MS C#", "bug_code_uid": "93d7b8be6c990aa7e3d06c53911f13ae", "src_uid": "ff6b3fd358c758324c19a26283ab96a4", "apr_id": "75b1561e82d11a498e101cf79ee539b0", "difficulty": 1000, "tags": ["math", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.917891583185095, "equal_cnt": 24, "replace_cnt": 8, "delete_cnt": 11, "insert_cnt": 4, "fix_ops_cnt": 23, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Globalization;\nusing System.IO;\nusing System.Linq;\nusing System.Text;\nusing System.Threading;\n\n// (づ°ω°)づミe★゜・。。・゜゜・。。・゜☆゜・。。・゜゜・。。・゜\npublic class Solver\n{\n int[] primes = { 2, 3, 5, 7, 11, 13, 17, 19, 23 };\n long?[,,] mem;\n const long MAX = 2000000000000000000;\n long Mult(long a, int b)\n {\n if (1.0 * a * b > MAX)\n return MAX;\n return a * b;\n }\n long Fun(int p, int c, int mask, List d)\n {\n if (p == primes.Length)\n return long.MaxValue;\n if (mask == (1 << d.Count) - 1)\n return 1;\n if (mem[p, c, mask].HasValue)\n return mem[p, c, mask].Value;\n\n long ret = long.MaxValue;\n if (c == 0)\n {\n for (int i = 0; i < d.Count; i++)\n if ((mask >> i & 1) == 0)\n {\n long v = Fun(p, 1, mask | 1 << i, d);\n for (int j = 1; j < d[i]; j++)\n v = Mult(v, primes[p]);\n ret = Math.Min(ret, v);\n }\n }\n else\n {\n ret = Fun(p + 1, 0, mask, d);\n for (int i = 0; i < d.Count; i++)\n if ((mask >> i & 1) == 0)\n {\n long v = Fun(p, 1, mask | 1 << i, d);\n for (int j = 0; j < d[i]; j++)\n v = Mult(v, primes[p]);\n ret = Math.Min(ret, v);\n }\n }\n\n return (mem[p, c, mask] = ret).Value;\n }\n\n public void Solve()\n {\n int n = ReadInt();\n\n if (n == 1)\n {\n Write(1);\n return;\n }\n if (n == 2)\n {\n Write(2);\n return;\n }\n\n var d = new List();\n for (int i = 2; i * i <= n; i++)\n while (n % i == 0)\n {\n d.Add(i);\n n /= i;\n }\n if (n > 1)\n d.Add(n);\n\n mem = new long?[9, 2, 1 << d.Count];\n Write(Fun(0, 0, 0, d));\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 new Solver().Solve();\n //var thread = new Thread(new Solver().Solve, 1024 * 1024 * 128);\n //thread.Start();\n //thread.Join();\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": "d1f58871843c3ffd8c88729cf4b725cd", "src_uid": "62db589bad3b7023418107de05b7a8ee", "apr_id": "4f3a4d19b0d9d16aac77b21652ca2ec1", "difficulty": 2000, "tags": ["dp", "brute force", "number theory"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "C#"} {"similarity_score": 0.995096190116937, "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.IO;\nusing System.Linq;\n\nnamespace CodeForces\n{\n\tinternal class Template\n\t{\n\t\tprivate static readonly Scanner cin = new Scanner();\n\n\t\tprivate static void Main()\n\t\t{\n\t\t\t//Console.SetIn(new StreamReader(@\"C:\\CodeForces\\input.txt\"));\n\t\t\tnew Template().Solve();\n\t\t\tConsole.ReadLine();\n\t\t}\n\n\t\tprivate void Solve()\n\t\t{\n\t\t\tvar n = cin.NextInt();\n\t\t\tvar m = cin.NextInt();\n\t\t\tvar k = cin.NextInt();\n\t\t\tvar a = new int[n];\n\t\t\tfor (var i = 0; i < a.Length; i++)\n\t\t\t{\n\t\t\t\ta[i] = cin.NextInt();\n\t\t\t}\n\t\t\tArray.Sort(a);\n\t\t\tArray.Reverse(a);\n\t\t\tfor (var i = 0; i <= n; i++)\n\t\t\t{\n\t\t\t\tif (k >= m)\n\t\t\t\t{\n\t\t\t\t\tConsole.WriteLine(i);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tif (i == n)\n\t\t\t\t{\n\t\t\t\t\tConsole.WriteLine(-1);\n\t\t\t\t}\n\t\t\t\tk += a[i] - 1;\n\t\t\t}\n\t\t}\n\t}\n\n\tinternal class Scanner\n\t{\n\t\tprivate string[] s = new string[0];\n\t\tprivate int i;\n\t\tprivate readonly char[] cs = new[] { ' ' };\n\n\t\tpublic string Next()\n\t\t{\n\t\t\tif (i < s.Length) return s[i++];\n\t\t\tvar line = Console.ReadLine() ?? string.Empty;\n\t\t\ts = line.Split(cs, StringSplitOptions.RemoveEmptyEntries);\n\t\t\ti = 1;\n\t\t\treturn s.First();\n\t\t}\n\n\t\tpublic double NextDouble()\n\t\t{\n\t\t\treturn double.Parse(Next());\n\t\t}\n\n\t\tpublic int NextInt()\n\t\t{\n\t\t\treturn int.Parse(Next());\n\t\t}\n\n\t\tpublic long NextLong()\n\t\t{\n\t\t\treturn long.Parse(Next());\n\t\t}\n\t}\n}", "lang": "Mono C#", "bug_code_uid": "bfa35fcb919c6110fe7d36f48ca9497c", "src_uid": "b32ab27503ee3c4196d6f0d0f133d13c", "apr_id": "1c312e386339be57cfd648c20c76b920", "difficulty": 1100, "tags": ["greedy", "sortings", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.9991624790619765, "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;\n\nnamespace Round159\n{\n class ProgramA\n {\n static void Main(string[] args)\n {\n Console.SetIn(System.IO.File.OpenText(\"input.txt\"));\n\n string[] ar = Console.ReadLine().Split();\n int n = int.Parse(ar[0]);\n int m = int.Parse(ar[1]);\n int k = int.Parse(ar[2]);\n\n ar = Console.ReadLine().Split();\n List sockets = new List();\n\n for(int i = 0; i < n; i++)\n sockets.Add(int.Parse(ar[i]));\n\n sockets.Sort();\n\n int ans = -1;\n if (m <= k)\n ans = 0;\n else\n {\n int rem = m - k;\n int used = 0;\n for (int i = sockets.Count - 1; i >= 0; i--)\n {\n rem = rem - sockets[i] + 1;\n if (rem <= 0)\n {\n used = sockets.Count - i;\n break;\n }\n }\n if(used > 0)\n ans = used;\n }\n Console.WriteLine(ans);\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "90f0027bd1fa5e22d93b9b0ad6fe2a00", "src_uid": "b32ab27503ee3c4196d6f0d0f133d13c", "apr_id": "a6f9e1046d30fce53a92b2876f2b21c3", "difficulty": 1100, "tags": ["greedy", "sortings", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.6175213675213675, "equal_cnt": 13, "replace_cnt": 8, "delete_cnt": 1, "insert_cnt": 3, "fix_ops_cnt": 12, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing static System.Console;\nusing static System.Math;\n\npublic class Hello{\n public static void Main(){\n string[] input = ReadLine().Split(' ');\n int tyouten = int.Parse(input[0]);\n int hen = int.Parse(input[1]);\n \n if(tyouten == 1){\n WriteLine(\"1 1\");\n }else if(hen == 0){\n WriteLine(\"{0} {1}\",tyouten,tyouten);\n }else{\n \n long count = 1;\n long tyoutenx = 2;\n while(tyoutenx <= tyouten && count < hen){\n tyoutenx++;\n count = (tyoutenx*(tyoutenx-1))/2;\n }\n long max = tyouten - tyoutenx;\n \n int temp1 = tyouten%2;\n int temp2 = (tyouten+temp1)/2;\n int min = Max(0,(temp2-hen)*2-temp1);\n \n WriteLine(\"{0} {1}\",min,max);\n \n }\n }\n}", "lang": "Mono C#", "bug_code_uid": "9ca2f405b252c4a4fde5f38c964e3342", "src_uid": "daf0dd781bf403f7c1bb668925caa64d", "apr_id": "a2b94a4e1ef260dc2acd94549c859183", "difficulty": 1300, "tags": ["graphs", "constructive algorithms"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.8594622019279553, "equal_cnt": 11, "replace_cnt": 8, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 11, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing static System.Console;\nusing static System.Math;\n\npublic class Hello{\n public static void Main(){\n string[] input = ReadLine().Split(' ');\n int tyouten = int.Parse(input[0]);\n long hen = long.Parse(input[1]);\n \n if(tyouten == 1){\n WriteLine(\"1 1\");\n }else if(hen == 0){\n WriteLine(\"{0} {1}\",tyouten,tyouten);\n }else{\n \n //min\n int tyoutemp = (tyouten+1)/2;\n int oe = tyouten%2;\n int tempmin = (tyoutemp - hen)*2-oe;\n int min = Max(tempmin,0);\n Write(\"{0} \",min);\n \n //Max\n int check = 0;\n for(int i=2;i<=tyouten;i++){\n long saidai = (i*(i-1))/2; //頂点i個に対して使える辺の最大値\n if(saidai >= hen){\n check = i;\n break;\n }\n }\n int max = tyouten - check;\n WriteLine(max);\n \n }\n }\n}", "lang": "Mono C#", "bug_code_uid": "8b86d3f45c5d79110b17dfa627afa435", "src_uid": "daf0dd781bf403f7c1bb668925caa64d", "apr_id": "a2b94a4e1ef260dc2acd94549c859183", "difficulty": 1300, "tags": ["graphs", "constructive algorithms"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.3561643835616438, "equal_cnt": 17, "replace_cnt": 12, "delete_cnt": 4, "insert_cnt": 1, "fix_ops_cnt": 17, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.IO;\n\nnamespace CFDIV125_2 {\n\tclass Program {\n\t\tstatic void Main(string[] args) {\n\n#if DEBUG\n\t\t\tTextReader reader = new StreamReader(\"../../input.txt\");\n\n#else\n\t\t\tTextReader reader = Console.In;\n#endif\n\n\t\t\t#region INIT \n\t\t\tint[] c1 = reader.ReadLine().Split(' ').Select(i => int.Parse(i)).ToArray();\n\t\t\tint[] c2 = reader.ReadLine().Split(' ').Select(i => int.Parse(i)).ToArray();\n\n\t\t\tint x1 = c1[0];\n\t\t\tint y1 = c1[1];\n\t\t\tint r1 = c1[2];\n\t\t\tint R1 = c1[3];\n\n\t\t\tint x2 = c2[0];\n\t\t\tint y2 = c2[1];\n\t\t\tint r2 = c2[2];\n\t\t\tint R2 = c2[3];\n\t\t\t#endregion\n\n\t\t\tint count = 0;\n\n\t\t\tif (AreCircleWithBallOk(x1, y1, r1, x2, y2, r2, R2)) count++;\n\t\t\tif (AreCircleWithBallOk(x1, y1, R1, x2, y2, r2, R2)) count++;\n\t\t\tif (AreCircleWithBallOk(x2, y2, r2, x1, y1, r1, R1)) count++;\n\t\t\tif (AreCircleWithBallOk(x2, y2, R2, x1, y1, r1, R1)) count++;\n\t\t\t\n\n\t\t\tConsole.WriteLine(count);\n\n\n#if DEBUG\n\t\t\tConsole.ReadKey();\n#endif\n\n\t\t}\n\n\n\t\tstatic bool AreCircleWithBallOk(int x1, int y1, int rd1, int x2, int y2, int rd2, int Rd2) {\n\n\t\t\tbool res1 = !(AreBallsIntercect(x1, y1, rd1, x2, y2, rd2) ||\n\t\t\t\t\t\t AreBallsIntercect(x1, y1, rd1, x2, y2, Rd2));\n\n\t\t\tif (!res1) return false;\n\n\t\t\tdouble centersDist = Math.Sqrt((x2 - x1) * (x2 - x1) + (y2 - y1) * (y2 - y1));\n\n\t\t\tdouble t1 = centersDist + rd2;\n\t\t\tdouble t2 = rd1;\n\t\t\tdouble t3 = centersDist + Rd2;\n\t\t\tif (t1 < t2 && t2 < t3) return false;\n\n\t\t\tt1 = centersDist - Rd2;\n\t\t\tt2 = -rd1;\n\t\t\tt3 = centersDist - rd2;\n\t\t\tif (t1 < t2 && t2 < t3) return false;\n\n\t\t\treturn true;\n\n\t\t}\n\n\t\tstatic bool AreBallsIntercect(int x1, int y1, int rd1, int x2, int y2, int rd2) {\n\t\t\t\n\t\t\tdouble centersDist = Math.Sqrt((x2 - x1) * (x2 - x1) + (y2 - y1) * (y2 - y1));\n\n\t\t\tdouble l1 = -rd1;\n\t\t\tdouble r1 = rd1;\n\n\t\t\tdouble l2 = centersDist - rd2;\n\t\t\tdouble r2 = centersDist + rd2;\n\n\t\t\tif (r1 <= l2) return false;\n\t\t\tif (l1 <= l2 && r1 >= r2) return false;\n\t\t\tif (l2 <= l1 && r2 >= r1) return false;\n\n\t\t\treturn true;\n\n\t\t}\n\n\t}\n}\n", "lang": "Mono C#", "bug_code_uid": "e12c64f429b784f70644930c84cc6896", "src_uid": "e2357a1f54757bce77dce625772e4f18", "apr_id": "817d7c1611a404da7359205569afcf59", "difficulty": 1700, "tags": ["math"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.6815709969788519, "equal_cnt": 17, "replace_cnt": 6, "delete_cnt": 2, "insert_cnt": 8, "fix_ops_cnt": 16, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.IO;\n\nnamespace CFDIV125_3 {\n\tclass Program {\n\t\tstatic void Main(string[] args) {\n\n#if DEBUG\n\t\t\tTextReader reader = new StreamReader(\"../../input.txt\");\n\n#else\n\t\t\tTextReader reader = Console.In;\n#endif\n\n\t\t\t#region INIT\n\t\t\tint[] c1 = reader.ReadLine().Split(' ').Select(i => int.Parse(i)).ToArray();\n\n\t\t\tint k = c1[0];\n\t\t\tint b = c1[1];\n\t\t\tint n = c1[2];\n\t\t\tint t = c1[3];\n\n\t\t\t#endregion\n\n\t\t\tlong z = 1;\n\t\t\tfor (int i = 0; i < n; i++) {\n\t\t\t\tz = k * z + b;\n\t\t\t}\n\n\t\t\tint res = z;\n\n\t\t\tz = t;\n\t\t\tlong j = 0;\n\t\t\twhile(true) {\n\t\t\t\tif (z >= res)\n\t\t\t\t\tbreak;\n\t\t\t\tj++;\n\t\t\t\tz = k * z + b;\n\t\t\t}\n\n\t\t\tConsole.WriteLine(j);\n\n\n#if DEBUG\n\t\t\tConsole.ReadKey();\n#endif\n\n\t\t}\n\n\n\t}\n}\n", "lang": "Mono C#", "bug_code_uid": "989935ecdb41c49e4e3e5b339512f302", "src_uid": "e2357a1f54757bce77dce625772e4f18", "apr_id": "817d7c1611a404da7359205569afcf59", "difficulty": 1700, "tags": ["math"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.9866666666666667, "equal_cnt": 4, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 3, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\n\n\nnamespace ConsoleApplication6\n{\n class Program\n {\n static void Main(string[] args)\n {\n int n = Convert.ToInt32(Console.ReadLine());\n string s = string.Empty;\n while (n > 0)\n {\n int a = n % 10;\n\n\n if ((n / 10 == 0 && a == 9) || (a < 5))\n {\n s = a + s;\n\n }\n else\n {\n s = (9 - a) + s;\n }\n\n n /= 10;\n }\n\n Console.WriteLine(s);\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "330db3d3723aecccddea7d6ccb33831d", "src_uid": "d5de5052b4e9bbdb5359ac6e05a18b61", "apr_id": "f4440ea0ac393e60235b34904296a194", "difficulty": 1200, "tags": ["greedy", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.927007299270073, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 3, "bug_source_code": "using System;\nusing System.Linq;\n\nclass Program {\n static void Main() {\n var s = Console.ReadLine().Split(' ').Select(int.Parse).ToArray();\n var n = s[0]; var x = s[1]; var p = s[2];\n\n var res = (int)Math.Ceil(n*p/100.0)-x;\n Console.Write(res);\n }\n}", "lang": "MS C#", "bug_code_uid": "1034e140f9866ea5b203e2644e620816", "src_uid": "7038d7b31e1900588da8b61b325e4299", "apr_id": "89741250e5ed1a93147004fb2916846e", "difficulty": 900, "tags": ["math", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.9730517115804806, "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.Text;\n\nnamespace CodeForce\n{\n class _55a\n {\n public static void Main()\n {\n var line = Console.ReadLine();\n var n = int.Parse(line);\n var visited = new bool[n];\n visited[0] = true;\n var idx = 0;\n for (var i = 1; i < 5000000; i++)\n {\n idx += i;\n idx %= n;\n }\n if (visited.Any(item => !item))\n {\n Console.WriteLine(\"NO\");\n return;\n }\n Console.WriteLine(\"YES\");\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "ec9a078df1d0d3b9fc4742d19025445b", "src_uid": "4bd174a997707ed3a368bd0f2424590f", "apr_id": "637351885c4ea3a937378ebd73ba9753", "difficulty": 1200, "tags": ["math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.998165137614679, "equal_cnt": 3, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "using System;\n\nnamespace CSharp\n{\n public class _450B\n {\n public static void Main()\n {\n const long m = 1000000007;\n\n string[] tokens = Console.ReadLine().Split();\n\n long f1 = long.Parse(tokens[0]);\n long f2 = long.Parse(tokens[1]);\n\n int n = int.Parse(Console.ReadLine());\n\n switch (n)\n {\n case 1:\n Console.WriteLine((f1 % m + m) % m);\n break;\n case 2:\n Console.WriteLine((f2 % m + m) % m);\n break;\n default:\n for (int i = 3; i <= n; i++)\n {\n long f = (f2 - f1) % m;\n\n f1 = f2;\n f2 = f;\n\n if (i % m == n % m)\n {\n Console.WriteLine((f % m + m) % m);\n break;\n }\n }\n\n break;\n }\n }\n }\n}", "lang": "Mono C#", "bug_code_uid": "d5859b3774d74a47fede36425e74f302", "src_uid": "2ff85140e3f19c90e587ce459d64338b", "apr_id": "36e1b9868c4cadc1def160d34f831a0e", "difficulty": 1300, "tags": ["math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.769857433808554, "equal_cnt": 4, "replace_cnt": 2, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 4, "bug_source_code": "using System;\n\nclass P { \n static void Main() {\n var n = int.Parse(Console.ReadLine());\n for (var d = 2 ; n != 1 && d <= n ; d++)\n Console.Write(\"{0} \", n); \n if (n % d == 0) { n /= d; d--; }\n }\n Console.Write(1);\n }\n}", "lang": "MS C#", "bug_code_uid": "3c2d4f52525eba3de5eb443b3c336b59", "src_uid": "2fc946bb72f56b6d86eabfaf60f9fa63", "apr_id": "75316fb5db3fb555c755fc4ecbe83fab", "difficulty": 1300, "tags": ["greedy"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.8978021978021978, "equal_cnt": 5, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 4, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace Coins\n{\n class Program\n {\n static void Main(string[] args)\n {\n int higheswt = int.Parse(Console.ReadLine());\n Console.Write(higheswt + \" \");\n while (higheswt>=1)\n {\n if (higheswt==1)\n {\n Console.WriteLine(1);\n }\n int gg = 1;\n for (int i = 2; i <= higheswt/2; i++)\n {\n if (higheswt%i==0)\n {\n gg = 0;\n Console.Write(higheswt / i + \" \");\n higheswt /= i;\n }\n }\n if (gg==1)\n {\n higheswt = 1; \n }\n\n }\n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "70fc707655792acc9afd9f9f456ee05e", "src_uid": "2fc946bb72f56b6d86eabfaf60f9fa63", "apr_id": "2e426ce2b89350f59e17ea8aedfc86d5", "difficulty": 1300, "tags": ["greedy"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.9373676248108926, "equal_cnt": 6, "replace_cnt": 4, "delete_cnt": 0, "insert_cnt": 1, "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 ConsoleApplication1\n{\n class Program\n {\n\n \n static void Main(string[] args)\n {\n\n ulong x, y, xx, yy;\n\n x = Convert.ToUInt64(Console.ReadLine());\n y = Convert.ToUInt64(Console.ReadLine());\n xx = Convert.ToUInt64(Console.ReadLine());\n yy = Convert.ToUInt64(Console.ReadLine());\n for(int i=0;;i++)\n {\n if(i%2==0)\n {\n x -= 1;\n }\n else\n {\n y -= 1;\n }\n if (x <= 0) { Console.WriteLine(\"Second\"); break; }\n if (y <= 0) { Console.WriteLine(\"First\"); break; }\n\n }\n\n /* \n * int x, y;\n x = Convert.ToInt32(Console.ReadLine());\n y= Convert.ToInt32(Console.ReadLine());\n Console.WriteLine(findmax(x, y));\n * short a;\n int b;\n double c;\n /* actual initialization \n a = 10;\n b = 20;\n c = a + b;\n Console.WriteLine(\"a = {0}, b = {1}, c = {2}\", a, b, c);\n b = Convert.ToInt32(Console.ReadLine());\n Console.WriteLine(b);\n string xx;\n xx = Console.ReadLine();\n Console.WriteLine(xx);\n double x1;\n x1 = Convert.ToDouble(Console.ReadLine());\n Console.WriteLine('\\a');*/\n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "d556823906608a8c09701793ce7c420a", "src_uid": "aed24ebab3ed9fd1741eea8e4200f86b", "apr_id": "f82478bd6a1f9b004ed7648432a9bd03", "difficulty": 800, "tags": ["math", "constructive algorithms"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.681203007518797, "equal_cnt": 9, "replace_cnt": 5, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 8, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\n\nnamespace ConsoleApplication10\n{\n public class Program\n {\n public static void Main(string[] args)\n {\n int n1, n2, k1, k2;\n n1 = Convert.ToInt32(Console.ReadLine());\n n2 = Convert.ToInt32(Console.ReadLine());\n k1 = Convert.ToInt32(Console.ReadLine());\n k2 = Convert.ToInt32(Console.ReadLine());\n\n\n if (n1 > n2)\n {\n Console.Write(\"First\");\n\n }\n else\n {\n Console.Write(\"Second\");\n\n\n }\n \n\n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "c27b38818cc9e6bc2ce6177a80332c7a", "src_uid": "aed24ebab3ed9fd1741eea8e4200f86b", "apr_id": "139449a76598846ea3402b046a6cad13", "difficulty": 800, "tags": ["math", "constructive algorithms"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.6473232529628116, "equal_cnt": 24, "replace_cnt": 11, "delete_cnt": 1, "insert_cnt": 12, "fix_ops_cnt": 24, "bug_source_code": "using System;\nusing System.Collections.Generic;\n\nnamespace ConsoleApplication2\n{\n class Program\n {\n static void Main(string[] args)\n {\n string[] data = Console.ReadLine().Split(' ');\n\n double t = Convert.ToDouble(data[0]);\n double s = Convert.ToDouble(data[1]);\n double x = Convert.ToDouble(data[2]);\n\n double currTime = t;\n List barkTimes = new List();\n\n if (x < t)\n {\n Console.WriteLine(\"NO\");\n return;\n }\n else if (x == t)\n {\n Console.WriteLine(\"YES\");\n return;\n }\n\n barkTimes.Add(t);\n while (currTime <= x)\n {\n currTime += s;\n barkTimes.Add(currTime);\n barkTimes.Add(currTime + 1);\n }\n\n if (barkTimes.Contains(x))\n {\n Console.WriteLine(\"YES\");\n }\n else\n {\n Console.WriteLine(\"NO\");\n }\n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "517e2faa18a90cc056f0e5e6dc834aa1", "src_uid": "3baf9d841ff7208c66f6de1b47b0f952", "apr_id": "4a3c899643620848ac11453e8bcd9818", "difficulty": 900, "tags": ["math", "implementation"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.7506538796861377, "equal_cnt": 21, "replace_cnt": 5, "delete_cnt": 0, "insert_cnt": 16, "fix_ops_cnt": 21, "bug_source_code": "using System;\nusing System.Collections.Generic;\n\nnamespace ConsoleApplication2\n{\n class Program\n {\n static void Main(string[] args)\n {\n string[] data = Console.ReadLine().Split(' ');\n\n double t = Convert.ToDouble(data[0]);\n double s = Convert.ToDouble(data[1]);\n double x = Convert.ToDouble(data[2]);\n\n double currTime = t;\n \n if (x < t)\n {\n Console.WriteLine(\"NO\");\n return;\n }\n else if (x == t)\n {\n Console.WriteLine(\"YES\");\n return;\n }\n\n while (currTime <= x)\n {\n currTime += s;\n if (currTime == x || currTime + 1 == x)\n {\n Console.WriteLine(\"YES\");\n return;\n }\n }\n\n Console.WriteLine(\"NO\");\n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "f11582efa6b7a303dd4cbee7cdbc6c15", "src_uid": "3baf9d841ff7208c66f6de1b47b0f952", "apr_id": "4a3c899643620848ac11453e8bcd9818", "difficulty": 900, "tags": ["math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.26432664756446994, "equal_cnt": 13, "replace_cnt": 9, "delete_cnt": 3, "insert_cnt": 1, "fix_ops_cnt": 13, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Text;\nusing System.Linq;\n\nnamespace ConsoleApplication6\n{\n class Program\n {\n static void Main(string[] args)\n {\n int[] inArray = ReadIntLine();\n int a = inArray[0], initialB = inArray[1], w = inArray[2], x = inArray[3], c = inArray[4];\n int Tau = 1, aChange = 0;\n int b = initialB;\n\n if (b >= x)\n {\n b = b - x;\n }\n else\n {\n b = w - x + b;\n aChange++;\n }\n\n while (b!=initialB)\n {\n if (b >= x)\n {\n b = b - x;\n }\n else\n {\n b = w - x + b;\n aChange++;\n }\n Tau++;\n }\n int Result = 0;\n while (c > a)\n {\n c = c - Tau;\n a = a - aChange;\n Result += Tau;\n }\n\n Result -= Tau;\n c = c + Tau;\n a = a + aChange;\n b = initialB;\n\n while (c != a)\n {\n if (b >= x)\n {\n b = b - x;\n }\n else\n {\n b = w - x + b;\n a--;\n }\n c--;\n Result++;\n }\n if (Result < 0)\n Result = 0;\n Console.WriteLine(Result);\n }\n\n public static int[] ReadIntLine()\n {\n string[] temp = Console.ReadLine().Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries);\n int[] arr = new int[temp.Length];\n for (int i = 0; i < temp.Length; i++)\n arr[i] = int.Parse(temp[i]);\n return arr;\n }\n\n }\n}\n", "lang": "MS C#", "bug_code_uid": "7190067d47f5aa0939b807dcc393ccbd", "src_uid": "a1db3dd9f8d0f0cad7bdeb1780707143", "apr_id": "32ba87b2093889f91cb8d231883c1ba7", "difficulty": 2000, "tags": ["math", "binary search"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.8663984755452043, "equal_cnt": 13, "replace_cnt": 3, "delete_cnt": 9, "insert_cnt": 1, "fix_ops_cnt": 13, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\n\nnamespace Zc\n{\n class Program\n {\n private static long minStoled = int.MaxValue;\n private static long maxStoled = 0;\n static void Main(string[] args)\n {\n var n = int.Parse(Console.ReadLine());\n var map = GetPrimeDivisors(n);\n Find(map, 1, 1, 1, 1, n);\n Console.WriteLine(\"{0} {1}\", minStoled, maxStoled);\n }\n\n private static void Find(Dictionary map, int curDivisorNum, int a, int b, int c, int n)\n {\n if (curDivisorNum > map.Count())\n {\n //Console.WriteLine(\"{0}, {1}, {2}\", a, b, c);\n long origN = (long) (a + 1)*(b + 2)*(c + 2);\n long stoled = origN - n;\n if (stoled > maxStoled)\n maxStoled = stoled;\n if (stoled < minStoled)\n minStoled = stoled;\n return;\n }\n int divisor = map.Keys.ElementAt(curDivisorNum - 1);\n int count = map[divisor];\n for (var i = 0; i <= count; i++)\n {\n var newA = a*(int) Math.Pow(divisor, i);\n for (var j = i; j <= count; j++)\n {\n var newB = b*(int) Math.Pow(divisor, j - i);\n var newC = c*(int) Math.Pow(divisor, count - j);\n Find(map, curDivisorNum + 1, newA, newB, newC, n);\n }\n }\n }\n\n private static Dictionary GetPrimeDivisors(int n)\n {\n var result = new Dictionary();\n var divisor = 2;\n while (n > 1)\n {\n if (n % divisor == 0)\n {\n n /= divisor;\n if (result.ContainsKey(divisor))\n {\n result[divisor]++;\n }\n else\n {\n result[divisor] = 1;\n }\n }\n else\n {\n divisor++;\n }\n }\n return result;\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "ff6bb5b7948aa56f5c944d004797797e", "src_uid": "2468eead8acc5b8f5ddc51bfa2bd4fb7", "apr_id": "fff8da5c0340a34acfb98354b2607423", "difficulty": 1600, "tags": ["math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "delete", "lang_cluster": "C#"} {"similarity_score": 0.9788201072629761, "equal_cnt": 6, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 4, "fix_ops_cnt": 5, "bug_source_code": "#define Online\n\nusing System;\nusing System.Collections.Generic;\nusing System.Globalization;\nusing System.Linq;\nusing System.Text;\nusing System.IO;\nusing System.Diagnostics;\nusing System.Threading;\n\ndelegate double F(double x);\ndelegate decimal Fdec(decimal x);\n\nclass Program\n{\n static void Main(string[] args)\n {\n\n Thread.CurrentThread.CurrentCulture = CultureInfo.InvariantCulture;\n\n#if FileIO\n StreamReader sr = new StreamReader(\"forest.in\");\n StreamWriter sw = new StreamWriter(\"forest.out\");\n Console.SetIn(sr);\n Console.SetOut(sw);\n#endif \n long n = long.Parse(Console.ReadLine());\n const long m = 1000000000;\n List div = new List();\n for (long i = 1; i * i <= n; i++)\n {\n if (n % i == 0)\n {\n div.Add(i);\n div.Add(n / i);\n }\n }\n long min = long.MaxValue;\n long max = long.MinValue;\n long a,b,c;\n for (int i = 0; i < div.Count; i++)\n {\n a = div[i] + 1;\n for (int j = 0; j < div.Count; j++)\n {\n b = div[j] + 2;\n if ((a - 1) * (b - 2) > n) continue;\n for (int z = 0; z < div.Count; z++)\n {\n c = div[z] + 2;\n if ((a - 1) * (b - 2) * (c - 2) != n) continue;\n min = Math.Min(min, a * b * c - (a - 1) * (b - 2) * (c - 2));\n max = Math.Max(max, a * b * c - (a - 1) * (b - 2) * (c - 2));\n }\n }\n }\n Console.WriteLine(min + \" \" + max);\n#if Online\n Console.ReadLine();\n#endif\n\n#if FileIO\n sr.Close();\n sw.Close();\n#endif\n }\n\n static string[] ReadArray()\n {\n return Console.ReadLine().Split(' ');\n }\n\n static int ReadInt()\n {\n return int.Parse(Console.ReadLine());\n }\n\n static decimal Sqrt(decimal x)\n {\n decimal mid;\n decimal right = (x <= 1 ? 1 : x);\n decimal left = 0;\n decimal eps = 0.00000000000000000001m;\n while (right - left > eps)\n {\n mid = left + ((right - left) / 2m);\n if (Math.Sign(mid * mid - x) != Math.Sign(left * left - x))\n right = mid;\n else\n left = mid;\n }\n return (left + right) / 2m;\n }\n\n}\n\nstatic 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 {\n mid = left + ((right - left) >> 1);\n if (val <= a[mid])\n {\n right = mid;\n }\n else\n {\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 {\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\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 {\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 {\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(int[] A, int p, int q, int r, int[] L, int[] R)\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 {\n if (i > q)\n {\n for (; k <= r; k++, j++)\n A[k] = R[j];\n return;\n }\n if (j > r)\n {\n for (; k <= r; k++, i++)\n A[k] = L[i];\n return;\n }\n if (L[i] <= R[j])\n {\n A[k] = L[i];\n i++;\n }\n else\n {\n A[k] = R[j];\n j++;\n }\n }\n }\n\n public static void Merge_Sort(int[] A, int p, int r, int[] L, int[] R)\n {\n if (!(p < r)) 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}", "lang": "Mono C#", "bug_code_uid": "d3ceb6dfa183b5ce3f697208840090ce", "src_uid": "2468eead8acc5b8f5ddc51bfa2bd4fb7", "apr_id": "4190397291d12989042a67d926f40e6e", "difficulty": 1600, "tags": ["math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.9751716851558373, "equal_cnt": 7, "replace_cnt": 0, "delete_cnt": 2, "insert_cnt": 4, "fix_ops_cnt": 6, "bug_source_code": "using System;\nusing System.Collections;\nusing System.Collections.Generic;\nusing System.Text;\nusing System.Linq;\n\nnamespace Dictionary\n{\n class Program\n {\n static void Main(string[] args)\n {\n\n var n = long.Parse(Console.ReadLine());\n\n var min = long.MaxValue;\n var max = (n + 1) * 9 - n;\n var root = Math.Sqrt(n);\n var up = root % 1 > 0.5 ? Math.Round(root) : Math.Round(root + 0.5);\n\n for (int a = 1; a < up + 5; a++)\n {\n for (int c = 1; c < up + 5; c++)\n {\n var b = n / a / c;\n if (n == a * b * c)\n {\n var temp = (a + 1) * (b + 2) * (c + 2) - n;\n if (temp < min) min = temp;\n }\n }\n }\n\n Console.WriteLine(\"{0} {1}\", min, max);\n }\n\n }\n}", "lang": "Mono C#", "bug_code_uid": "cdad68958a3d3be7ad65184b0030cbde", "src_uid": "2468eead8acc5b8f5ddc51bfa2bd4fb7", "apr_id": "f4550581bc833a3d68e546385a947525", "difficulty": 1600, "tags": ["math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.9994788952579469, "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;\nusing System.Text;\n\nnamespace Codeforces98\n{\n class C100\n {\n\n static void MainC(string[] args)\n {\n long n = int.Parse(Console.ReadLine());\n\n long max = 8*n+9;\n long min = max;\n\n for (int a = 1; a < 40000; a++)\n {\n if (n % a != 0)\n continue;\n long bc = n / a;\n int bc2 = (int)Math.Sqrt(bc);\n\n for (int b = 1; b <= bc2; b++)\n {\n if (bc % b != 0)\n continue;\n long c = bc / b;\n\n long min1 = (a + 1) * (b + 2) * (c + 2) - a * b * c;\n if (min1 < min)\n min = min1;\n }\n\n }\n\n\n Console.WriteLine(\"{0} {1}\",min,max);\n\n\n // Console.ReadKey();\n }\n\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "f227cf6ce5bcfc7eba21ace3a9300501", "src_uid": "2468eead8acc5b8f5ddc51bfa2bd4fb7", "apr_id": "c72e6af7e010f7767f7f871edff5c0ba", "difficulty": 1600, "tags": ["math", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C#"} {"similarity_score": 0.9952734638757597, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "using System;\n\nnamespace ConsoleApplication3\n{\n internal class Program\n {\n private static void Main()\n {\n var ccard = int.Parse(Console.ReadLine());\n\n var distinctLevels = 0;\n int level = 0;\n switch (ccard % 3)\n {\n case 0: level = 3; break;\n case 1: level = 2; break;\n case 2: level = 1; break;\n }\n\n while (ccard >= Phi(level))\n {\n distinctLevels++;\n level += 3;\n }\n Console.WriteLine(distinctLevels);\n }\n\n private static long Phi(long level)\n {\n return (3 * level * level + level)/2;\n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "38492f316ebe179556fa29aed53537a9", "src_uid": "ab4f9cb3bb0df6389a4128e9ff1207de", "apr_id": "30736f46efb74fda70b47839d1b321eb", "difficulty": 1700, "tags": ["math", "brute force", "greedy", "binary search"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9463971880492091, "equal_cnt": 16, "replace_cnt": 10, "delete_cnt": 0, "insert_cnt": 5, "fix_ops_cnt": 15, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace Igranje.CF269\n{\n class ProblemC\n {\n public static void Main(String[] varg)\n {\n Int64 n = Int64.Parse(System.Console.ReadLine());\n\n double z = ((n + 1)*2.0)/3.0;\n double k = Math.Sqrt(4*z + 1);\n k = k - 1;\n k = k/2;\n\n Int64 rv = (Int64) k;\n\n\n Int64 ispravan = 0;\n bool dole = false;\n while (true)\n {\n if (provera(rv, n) > 0)\n {\n ispravan = rv;\n if (dole) break;\n rv++;\n continue;\n \n }\n if (provera(rv, n) < 0)\n {\n rv--;\n dole = true;\n continue;\n }\n }\n\n rv = provera2(rv,n);\n System.Console.WriteLine(rv);\n }\n\n private static int provera(Int64 ulaz, Int64 izlaz)\n {\n Int64 brojKarata = 2*ulaz + ((ulaz*(ulaz - 1))/2)*3;\n if (brojKarata < izlaz)\n return 1;\n else if (brojKarata > izlaz)\n return -1;\n else\n {\n return 0;\n }\n }\n\n private static Int64 provera2(Int64 ulaz, Int64 n)\n {\n Int64 rez = 0;\n if (n%3 == 1)\n {\n \n for (Int64 s = 1; s <= ulaz; s++)\n {\n if (((s * (s + 1)) / 2) % 3 == 1)\n rez++;\n }\n }\n else if (n%3 == 0)\n {\n for (Int64 s = 1; s <= ulaz; s++)\n {\n if (((s*(s+1))/2) % 3 == 0)\n rez++;\n }\n }\n else if (n % 3 == 2)\n {\n for (Int64 s = 1; s <= ulaz; s++)\n {\n if (((s * (s + 1)) / 2) % 3 == 2)\n rez++;\n }\n }\n return rez;\n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "5781de8d59869f306bcd9cbe0e5ae891", "src_uid": "ab4f9cb3bb0df6389a4128e9ff1207de", "apr_id": "dc92178c4063d7a1815b044d4554a634", "difficulty": 1700, "tags": ["math", "brute force", "greedy", "binary search"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9651928504233303, "equal_cnt": 5, "replace_cnt": 2, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 4, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.IO;\n\nnamespace ConsoleApplication1\n{\n\tclass Program\n\t{\n\t\tstatic void Main(string[] args)\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\tMain main = new Main();\n\t\t\t\tmain.ReadData();\n\t\t\t\tmain.Process();\n\t\t\t\tmain.WriteAnswer();\n\t\t\t}\n\t\t\tcatch (Exception e)\n\t\t\t{\n\t\t\t\tConsole.WriteLine(e);\n\t\t\t}\n\t\t}\n\t}\n\n\tclass Main\n\t{\n\t\tprivate long _n;\n\t\tprivate long _k;\n\t\tprivate long _result;\n\n\t\tpublic void Process()\n\t\t{\n\t\t\tlong x = (long)Math.Floor(_n / (decimal)_k) * _k + 1;\n\n\n\t\t\twhile (true)\n\t\t\t{\n\t\t\t\tif (x%_k == 0)\n\t\t\t\t{\n\t\t\t\t\t_result = x;\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tx++;\n\t\t\t}\n\t\t}\n\n\t\tpublic void ReadData()\n\t\t{\n\t\t\tTextReader textReader = Console.In;\n\t\t\t//TextReader textReader = new StreamReader(\"input.txt\");\n\t\t\tusing (TextReader reader = textReader)\n\t\t\t{\n\t\t\t\tstring readLine = reader.ReadLine();\n\t\t\t\tstring[] strings1 = readLine.Split(' ');\n\n\t\t\t\t_n = int.Parse(strings1[0]);\n\t\t\t\t_k = long.Parse(strings1[1]);\n\t\t\t}\n\t\t}\n\n\t\tpublic void WriteAnswer()\n\t\t{\n\t\t\tusing (TextWriter writer = Console.Out)\n\t\t\t{\n\t\t\t\twriter.WriteLine(_result);\n\t\t\t}\n\t\t}\n\t}\n}\n", "lang": "MS C#", "bug_code_uid": "0b330f518637a2d236a77532cbc88c12", "src_uid": "75f3835c969c871a609b978e04476542", "apr_id": "5fc335090a0dde67c943886a7b314a80", "difficulty": 800, "tags": ["math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9973574933937335, "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.Text;\nusing System.IO;\n\npublic class taskB\n{\n public class MyReader\n {\n private TextReader instream;\n\n public int[] ReadIntArray()\n {\n string inp = instream.ReadLine().Trim();\n string[] spl = inp.Split(' ');\n\n int[] a = new int[spl.Length];\n for (int i = 0; i < a.Length; i++)\n a[i] = int.Parse(spl[i]);\n return a;\n }\n\n public long[] ReadLongArray()\n {\n string inp = instream.ReadLine().Trim();\n string[] spl = inp.Split(' ');\n\n long[] a = new long[spl.Length];\n for (int i = 0; i < a.Length; i++)\n a[i] = long.Parse(spl[i]);\n return a;\n }\n\n public double[] ReadDoubleArray()\n {\n string inp = instream.ReadLine().Trim();\n string[] spl = inp.Split(' ');\n\n double[] a = new double[spl.Length];\n\n System.Globalization.NumberFormatInfo nfi = new System.Globalization.NumberFormatInfo();\n nfi.NumberDecimalSeparator = \".\";\n for (int i = 0; i < a.Length; i++)\n a[i] = double.Parse(spl[i], nfi);\n return a;\n }\n\n public int ReadInt()\n {\n return int.Parse(instream.ReadLine());\n }\n\n public long ReadLong()\n {\n return long.Parse(instream.ReadLine());\n }\n\n public void SetInStream(TextReader textReader)\n {\n this.instream = textReader;\n }\n\n internal string ReadLine()\n {\n return instream.ReadLine();\n }\n }\n\n static void Main(string[] args)\n {\n MyReader instream = new MyReader();\n instream.SetInStream(Console.In);\n\n TextWriter outstream = Console.Out;\n\n solve(instream, outstream);\n\n }\n\n private static void solve(MyReader instream, TextWriter outstream)\n {\n int[] ab = instream.ReadIntArray();\n\n int a = ab[0];\n int b = ab[1];\n\n if (a > b)\n {\n int t = a;\n a = b;\n b = t;\n }\n\n int r1 = a * ((b-1) / 3+1);\n int r2 = ((a-1) / 3 + 1) * b;\n\n int r3 = a * b / 2 + ((a * b) % 2 == 0 ? 0 : 1);\n\n int res = Math.Max(Math.Max(r1, r2), r3);\n\n if (a == 2)\n {\n if (b % 4 == 1)\n {\n res = b / 4 * 4 + 2;\n }\n else if (b % 4 == 2)\n {\n res = b / 4 * 4 + 4;\n }\n }\n outstream.WriteLine(res);\n }\n\n}", "lang": "MS C#", "bug_code_uid": "21a4a8357687db446788ccad048c1934", "src_uid": "e858e7f22d91aaadd7a48a174d7b2dc9", "apr_id": "c2689f1fec3b0ac5a5fb650c4b1a54a4", "difficulty": 1800, "tags": ["greedy", "constructive algorithms", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.8436482084690554, "equal_cnt": 11, "replace_cnt": 5, "delete_cnt": 1, "insert_cnt": 5, "fix_ops_cnt": 11, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Text;\nusing System.Linq;\nusing System.Threading.Tasks;\nusing System.IO;\n\nnamespace TimusApp\n{\n\tpublic class Program\n\t{\n\t\tstatic void Main(string[] args)\n\t\t{\n\t\t\tvar x = int.Parse(Console.ReadLine());\n\t\t\tSolve(x);\n\t\t}\n\n\t\tpublic static void Solve(int x)\n\t\t{\n\t\t\tvar delim = FindMaxPrimeDelim(x);\n\t\t\tvar prevNumb = (x / delim - 1) * delim;\n\t\t\tvar resultList = new List();\n\t\t\tfor (int i = prevNumb + 1; i <= x; i++)\n\t\t\t{\n\t\t\t\tif (IsPrime(i))\n\t\t\t\t\tcontinue;\n\t\t\t\tvar e = FindMaxPrimeDelim(i);\n\t\t\t\tresultList.Add((i / e - 1) * e + 1);\n\t\t\t}\n\t\t\tConsole.WriteLine(resultList.Min());\n\t\t}\n\n\t\tpublic static int FindMaxPrimeDelim(int x)\n\t\t{\n\t\t\tvar delims = new List();\n\t\t\tfor (int i = 2; i * i <= x; i++)\n\t\t\t{\n\t\t\t\tif (x % i == 0)\n\t\t\t\t{\n\t\t\t\t\tdelims.Add(i);\n\t\t\t\t\tdelims.Add(x / i);\n\t\t\t\t}\n\t\t\t}\n\t\t\tdelims = delims.Where(IsPrime).OrderByDescending(e => e).ToList();\n\t\t\treturn delims.First();\n\t\t}\n\n\t\tpublic static bool IsPrime(int n)\n\t\t{\n\t\t\tfor (int i = 2; i * i <= n; i++)\n\t\t\t{\n\t\t\t\tif (n % i == 0)\n\t\t\t\t\treturn false;\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\t}\n}", "lang": "MS C#", "bug_code_uid": "b4206ed81d9595881995fc3b0ac0ab4c", "src_uid": "43ff6a223c68551eff793ba170110438", "apr_id": "7944bff6fe9b610e69db932955a3e448", "difficulty": 1700, "tags": ["math", "number theory"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9853461344113188, "equal_cnt": 6, "replace_cnt": 4, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 5, "bug_source_code": "using System;\nusing System.Diagnostics.Contracts;\nusing System.Globalization;\nusing System.IO;\nusing System.Linq;\n\nnamespace Codeforces.R276D\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 Contract.Requires(tr != null);\n Contract.Requires(tw != null);\n\n var info = CultureInfo.InvariantCulture;\n var lr = tr.ReadLine().Split().Select(x => int.Parse(x, info)).ToArray();\n var l = lr[0];\n var r = lr[1];\n\n tw.WriteLine(Calc(l, r));\n }\n\n private static int Calc(int l, int r)\n {\n var x = 1;\n while (x <= (l ^ r))\n x <<= 1;\n\n return x - 1;\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "e8c9adb5cc9867872cf460cad03e0270", "src_uid": "d90e99d539b16590c17328d79a5921e0", "apr_id": "45ff2d79b96bc288719611bef67e2e30", "difficulty": 1700, "tags": ["dp", "bitmasks", "greedy", "math", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9273457466228551, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 3, "bug_source_code": "static void Main()\n {\n int d1, d2, d3;\n long max_d = 0;\n string[] OutS = Console.ReadLine().Split(' ');\n d1 = Convert.ToInt32(OutS[0]);\n d2 = Convert.ToInt32(OutS[1]);\n d3 = Convert.ToInt32(OutS[2]);\n\n if (d1 <= d2)\n {\n max_d += d1;\n if ((d1 + d2) < d3)\n {\n max_d += (d1 + d2 * 2);\n }\n else\n {\n max_d += d3;\n if ((d1 + d3) < d2)\n {\n max_d += (d1 + d3);\n }\n else\n max_d += d2;\n }\n }\n else\n {\n max_d += d2;\n if ((d1 + d2) < d3)\n {\n max_d += (d2 + d1 * 2);\n }\n else\n {\n max_d += d3;\n if ((d2 + d3) < d1)\n {\n max_d += (d2 + d3);\n }\n else\n max_d += d1;\n }\n }\n Console.WriteLine(max_d);\n \n}", "lang": "MS C#", "bug_code_uid": "206e4c67f937eb21045a27f06991f161", "src_uid": "26cd7954a21866dbb2824d725473673e", "apr_id": "efd9b9d84939209391f80c12458b9c89", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.011472275334608031, "equal_cnt": 8, "replace_cnt": 8, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 8, "bug_source_code": "\nMicrosoft Visual Studio Solution File, Format Version 11.00\n# Visual C# Express 2010\nProject(\"{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}\") = \"CodeForces\", \"CodeForces\\CodeForces.csproj\", \"{50F6CA0F-3B5E-48D3-9012-35DFCE5D35A1}\"\nEndProject\nGlobal\n\tGlobalSection(SolutionConfigurationPlatforms) = preSolution\n\t\tDebug|x86 = Debug|x86\n\t\tRelease|x86 = Release|x86\n\tEndGlobalSection\n\tGlobalSection(ProjectConfigurationPlatforms) = postSolution\n\t\t{50F6CA0F-3B5E-48D3-9012-35DFCE5D35A1}.Debug|x86.ActiveCfg = Debug|x86\n\t\t{50F6CA0F-3B5E-48D3-9012-35DFCE5D35A1}.Debug|x86.Build.0 = Debug|x86\n\t\t{50F6CA0F-3B5E-48D3-9012-35DFCE5D35A1}.Release|x86.ActiveCfg = Release|x86\n\t\t{50F6CA0F-3B5E-48D3-9012-35DFCE5D35A1}.Release|x86.Build.0 = Release|x86\n\tEndGlobalSection\n\tGlobalSection(SolutionProperties) = preSolution\n\t\tHideSolutionNode = FALSE\n\tEndGlobalSection\nEndGlobal\n", "lang": "MS C#", "bug_code_uid": "110f8e044b9f1b50695fc2bb477c7423", "src_uid": "26cd7954a21866dbb2824d725473673e", "apr_id": "9cb1ca14995238439fe6eb9d4c9d5ad5", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9504424778761061, "equal_cnt": 7, "replace_cnt": 4, "delete_cnt": 1, "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 //int a = int.Parse(Console.ReadLine());\n string j = Console.ReadLine();\n int[] a = new int[j.Length];\n int sum = 0;\n for (int i = 0; i < j.Length; i++)\n {\n if (j[i] == 'A')\n a[i] = 1;\n else if (j[i] == 'B')\n a[i] = 2;\n else if (j[i] == 'C')\n a[i] = 3;\n \n \n }\n bool l = false;\n for (int i = 0; i < j.Length; i++)\n {\n if (a[i] + a[i + 1] + a[i + 2] == 6)\n {\n if ((a[i] != 0) && (a[i + 1] != 0) && (a[i + 2] != 0))\n {\n l = true;\n }\n }\n\n \n }\n if (l)\n Console.WriteLine(\"YES\");\n else\n Console.WriteLine(\"NO\");\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "40b7c2a54c99a5e1d696a551a3f4d67e", "src_uid": "ba6ff507384570152118e2ab322dd11f", "apr_id": "8fc2530c0b438d939940bc0c1e3642c7", "difficulty": 900, "tags": ["strings", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.5871229176046826, "equal_cnt": 19, "replace_cnt": 10, "delete_cnt": 2, "insert_cnt": 6, "fix_ops_cnt": 18, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace CodeForces_1\n{\n class Program\n {\n \n public static void Main()\n {\n string input = System.Console.ReadLine();\n int cnt = 0;\n for(int i = 0 ; i < input.Length ; i++)\n {\n if (input.ElementAt(i) != '.')\n cnt++;\n else\n cnt = 0;\n if(cnt == 3)\n {\n System.Console.WriteLine(\"Yes\");\n return;\n }\n }\n System.Console.WriteLine(\"No\");\n \n }\n\n }\n}\n\n", "lang": "Mono C#", "bug_code_uid": "df5b3841f44421f6a7d66bdeb95e4634", "src_uid": "ba6ff507384570152118e2ab322dd11f", "apr_id": "227a934f49d4385458698a16435b16fd", "difficulty": 900, "tags": ["strings", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9992982116496866, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 2, "insert_cnt": 0, "fix_ops_cnt": 3, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Globalization;\nusing System.IO;\nusing System.Linq;\n\nnamespace Temp\n{ \n struct PointInt\n {\n public long X;\n\n public long Y;\n\n public PointInt(long x, long y)\n : this()\n {\n this.X = x;\n this.Y = y;\n }\n\n public static PointInt operator +(PointInt a, PointInt b)\n {\n return new PointInt(a.X + b.X, a.Y + b.Y);\n }\n\n public static PointInt operator -(PointInt a, PointInt b)\n {\n return new PointInt(a.X - b.X, a.Y - b.Y);\n }\n\n public static PointInt operator *(PointInt a, long k)\n {\n return new PointInt(k * a.X, k * a.Y);\n }\n\n public static PointInt operator *(long k, PointInt a)\n {\n return new PointInt(k * a.X, k * a.Y);\n }\n\n public bool IsInsideRectangle(long l, long b, long r, long t)\n {\n return (l <= X) && (X <= r) && (b <= Y) && (Y <= t);\n }\n }\n\n struct LineInt\n {\n public LineInt(PointInt a, PointInt b)\n : this()\n {\n A = a.Y - b.Y;\n B = b.X - a.X;\n C = a.X * b.Y - a.Y * b.X;\n }\n\n public long A, B, C;\n\n public bool ContainsPoint(PointInt p)\n {\n return A * p.X + B * p.Y + C == 0;\n }\n }\n\n class MatrixInt\n {\n private long[,] m_Matrix;\n\n public int Size\n {\n get\n {\n return m_Matrix.GetLength(0) - 1;\n }\n }\n\n public long Mod { get; private set; }\n\n public MatrixInt(int size, long mod = 0)\n {\n m_Matrix = new long[size + 1, size + 1];\n Mod = mod;\n }\n\n public MatrixInt(long[,] matrix, long mod = 0)\n {\n this.m_Matrix = matrix;\n Mod = mod;\n }\n\n public static MatrixInt GetIdentityMatrix(int size, long mod = 0)\n {\n long[,] matrix = new long[size + 1, size + 1];\n\n for (int i = 1; i <= size; i++)\n {\n matrix[i, i] = 1;\n }\n\n return new MatrixInt(matrix, mod);\n }\n\n public long this[int i, int j]\n {\n get\n {\n return m_Matrix[i, j];\n }\n\n set\n {\n m_Matrix[i, j] = value;\n }\n }\n\n public static MatrixInt operator +(MatrixInt a, MatrixInt b)\n {\n int n = a.Size;\n long mod = Math.Max(a.Mod, b.Mod);\n long[,] c = new long[n, n];\n for (int i = 1; i <= n; i++)\n {\n for (int j = 1; j <= n; j++)\n {\n c[i, j] = a[i, j] + b[i, j]; \n }\n }\n\n if (mod > 0)\n {\n for (int i = 1; i <= n; i++)\n {\n for (int j = 1; j <= n; j++)\n {\n c[i, j] %= mod;\n }\n }\n }\n\n return new MatrixInt(c, mod);\n }\n\n public static MatrixInt operator *(MatrixInt a, MatrixInt b)\n {\n int n = a.Size;\n long mod = Math.Max(a.Mod, b.Mod);\n\n long[,] c = new long[n, n];\n\n for (int i = 1; i <= n; i++)\n {\n for (int j = 1; j <= n; j++)\n {\n for (int k = 1; k <= n; k++)\n {\n c[i, j] += a[i, k] * b[k, j];\n if (mod > 0)\n {\n c[i, j] %= mod;\n }\n } \n }\n }\n\n return new MatrixInt(c, mod);\n }\n }\n\n static class Algebra\n {\n public static long Phi(long n)\n {\n long result = n;\n for (long i = 2; i * i <= n; i++)\n {\n if (n % i == 0)\n {\n while (n % i == 0)\n {\n n /= i;\n }\n\n result -= result / i;\n }\n }\n\n if (n > 1)\n {\n result -= result / n;\n }\n\n return result;\n }\n\n public static long BinPower(long a, long n, long mod)\n {\n long result = 1;\n\n while (n > 0)\n {\n if ((n & 1) != 0)\n {\n result = (result * a) % mod;\n }\n\n a = (a * a) % mod;\n n >>= 1;\n }\n\n return result;\n }\n\n public static class Permutations\n {\n public static int[] GetRandomPermutation(int n)\n {\n int[] p = new int[n];\n for (int i = 0; i < n; i++)\n {\n p[i] = i;\n }\n\n Random random = new Random();\n for (int i = n - 1; i > 0; i--)\n {\n int j = random.Next(i + 1);\n int tmp = p[i];\n p[i] = p[j];\n p[j] = tmp;\n }\n\n return p;\n }\n }\n\n public static T[] Shuffle(this T[] array)\n {\n int length = array.Length;\n int[] p = Permutations.GetRandomPermutation(length);\n T[] result = new T[length];\n for (int i = 0; i < length; i++)\n {\n result[i] = array[p[i]];\n }\n\n return result;\n }\n\n public static MatrixInt MatrixBinPower(MatrixInt a, long n)\n {\n MatrixInt result = new MatrixInt(a.Size);\n\n while (n > 0)\n {\n if ((n & 1) != 0)\n {\n result *= a;\n }\n\n a *= a;\n n >>= 1;\n }\n\n return result;\n }\n\n public static long Gcd(long a, long b)\n {\n return b == 0 ? a : Gcd(b, a % b);\n }\n\n public static long ExtendedGcd(long a, long b, out long x, out long y)\n {\n if (b == 0)\n {\n x = 1;\n y = 0;\n return a;\n }\n\n long x1;\n long y1;\n long d = ExtendedGcd(b, a % b, out x1, out y1);\n x = y1;\n y = x1 - (a / b) * y1;\n return d;\n }\n\n public static long Lcm(long a, long b)\n {\n return (a / Gcd(a, b)) * b;\n }\n\n public static bool[] GetPrimes(int n)\n {\n n = Math.Max(n, 2);\n bool[] prime = new bool[n + 1];\n for (int i = 2; i <= n; i++)\n {\n prime[i] = true;\n }\n\n for (int i = 2; i * i <= n; i++)\n {\n if (prime[i])\n {\n if ((long)i * i <= n)\n {\n for (int j = i * i; j <= n; j += i)\n {\n prime[j] = false;\n }\n }\n }\n }\n\n return prime;\n }\n\n public static long GetFibonacciNumber(long n, long mod = 0)\n {\n long[,] matrix = new long[,] { { 0, 0, 0 }, { 0, 0, 1 }, { 0, 1, 1 } };\n\n MatrixInt result = MatrixBinPower(new MatrixInt(matrix, mod), n);\n\n return result[2, 2];\n }\n\n public static long[] GetFibonacciSequence(int n)\n {\n long[] result = new long[n];\n result[0] = result[1] = 1;\n\n for (int i = 2; i < n; i++)\n {\n result[i] = result[i - 1] + result[i - 2];\n }\n\n return result;\n }\n\n public static long GetInverseElement(long a, long mod)\n {\n long x, y;\n long g = ExtendedGcd(a, mod, out x, out y);\n\n if (g != 1)\n {\n return -1;\n }\n\n return ((x % mod) + mod) % mod;\n }\n\n public static long[] GetAllInverseElements(long mod)\n {\n long[] result = new long[mod];\n result[1] = 1;\n for (int i = 2; i < mod; i++)\n {\n result[i] = (mod - (((mod / i) * result[mod % i]) % mod)) % mod;\n }\n\n return result;\n }\n }\n\n internal static class Reader\n {\n public static void ReadInt(out int a)\n {\n int[] number = new int[1];\n ReadInt(number);\n a = number[0];\n }\n\n public static void ReadInt(out int a, out int b)\n {\n int[] numbers = new int[2];\n ReadInt(numbers);\n a = numbers[0];\n b = numbers[1];\n }\n\n public static void ReadInt(out int int1, out int int2, out int int3)\n {\n int[] numbers = new int[3];\n ReadInt(numbers);\n int1 = numbers[0];\n int2 = numbers[1];\n int3 = numbers[2];\n }\n\n public static void ReadInt(out int int1, out int int2, out int int3, out int int4)\n {\n int[] numbers = new int[4];\n ReadInt(numbers);\n int1 = numbers[0];\n int2 = numbers[1];\n int3 = numbers[2];\n int4 = numbers[3];\n }\n\n public static void ReadLong(out long a)\n {\n long[] number = new long[1];\n ReadLong(number);\n a = number[0];\n }\n\n public static void ReadLong(out long a, out long b)\n {\n long[] numbers = new long[2];\n ReadLong(numbers);\n a = numbers[0];\n b = numbers[1];\n }\n\n public static void ReadLong(out long int1, out long int2, out long int3)\n {\n long[] numbers = new long[3];\n ReadLong(numbers);\n int1 = numbers[0];\n int2 = numbers[1];\n int3 = numbers[2];\n }\n\n public static void ReadLong(out long int1, out long int2, out long int3, out long int4)\n {\n long[] numbers = new long[4];\n ReadLong(numbers);\n int1 = numbers[0];\n int2 = numbers[1];\n int3 = numbers[2];\n int4 = numbers[3];\n }\n\n public static void ReadInt(int[] numbers)\n {\n // ReSharper disable PossibleNullReferenceException\n var list = Console.ReadLine().Split();\n // ReSharper restore PossibleNullReferenceException\n\n int count = Math.Min(numbers.Length, list.Length);\n\n for (int i = 0; i < count; i++)\n {\n numbers[i] = int.Parse(list[i]);\n }\n }\n\n public static int[] ReadDigits()\n {\n // ReSharper disable AssignNullToNotNullAttribute\n return Console.ReadLine().Select(x => int.Parse(x.ToString())).ToArray();\n // ReSharper restore AssignNullToNotNullAttribute\n }\n\n public static void ReadLong(long[] numbers)\n {\n // ReSharper disable PossibleNullReferenceException\n var list = Console.ReadLine().Split();\n // ReSharper restore PossibleNullReferenceException\n\n int count = Math.Min(numbers.Length, list.Length);\n\n for (int i = 0; i < count; i++)\n {\n numbers[i] = long.Parse(list[i]);\n }\n }\n\n public static void ReadDouble(double[] numbers)\n {\n // ReSharper disable PossibleNullReferenceException\n var list = Console.ReadLine().Split();\n // ReSharper restore PossibleNullReferenceException\n\n int count = Math.Min(numbers.Length, list.Length);\n\n for (int i = 0; i < count; i++)\n {\n numbers[i] = double.Parse(list[i]);\n }\n }\n\n public static void ReadDouble(out double a, out double b)\n {\n double[] numbers = new double[2];\n ReadDouble(numbers);\n a = numbers[0];\n b = numbers[1];\n }\n\n public static void ReadDouble(out double int1, out double int2, out double int3)\n {\n double[] numbers = new double[3];\n ReadDouble(numbers);\n int1 = numbers[0];\n int2 = numbers[1];\n int3 = numbers[2];\n }\n\n public static string ReadLine()\n {\n return Console.ReadLine();\n }\n }\n\n static class MyMath\n {\n public static int GetMinimalPrimeDivisor(int n)\n { \n for (int i = 2; i * i <= n; i++)\n {\n if (n % i == 0)\n {\n return i;\n }\n }\n\n return n;\n }\n\n public static long Sqr(long x)\n {\n return x * x;\n }\n }\n\n public interface IGraph\n {\n int Vertices { get; set; }\n\n IList this[int i] { get; }\n\n void AddEdge(int u, int v);\n\n void AddOrientedEdge(int u, int v); \n }\n\n public class Graph : IGraph\n {\n private List[] m_Edges;\n\n public int Vertices { get; set; }\n\n public IList this[int i]\n {\n get\n {\n return this.m_Edges[i];\n }\n }\n\n public Graph(int vertices)\n {\n this.Vertices = vertices;\n\n this.m_Edges = new List[vertices];\n\n for (int i = 0; i < vertices; i++)\n {\n this.m_Edges[i] = new List();\n }\n }\n\n public void AddEdge(int u, int v)\n {\n this.AddOrientedEdge(u, v);\n this.AddOrientedEdge(v, u);\n }\n\n public void AddOrientedEdge(int first, int second)\n {\n this.m_Edges[first].Add(second); \n }\n\n public int[] Bfs(int start)\n {\n int[] d = new int[Vertices];\n for (int i = 0; i < Vertices; i++)\n {\n d[i] = -1;\n }\n\n Queue queue = new Queue();\n queue.Enqueue(start);\n d[start] = 0;\n\n while (queue.Count > 0)\n {\n int v = queue.Dequeue();\n foreach (int t in this.m_Edges[v].Where(t => d[t] == -1))\n {\n queue.Enqueue(t);\n d[t] = d[v] + 1;\n }\n }\n\n return d;\n }\n } \n\n class SimpleSumTable\n {\n private readonly int[,] m_Sum;\n\n public SimpleSumTable(int n, int m, int[,] table)\n {\n m_Sum = new int[n + 1, m + 1];\n\n for (int i = 1; i < n + 1; i++)\n {\n for (int j = 1; j < m + 1; j++)\n {\n m_Sum[i, j] = m_Sum[i, j - 1] + m_Sum[i - 1, j] - m_Sum[i - 1, j - 1] + table[i, j];\n }\n }\n }\n\n public int GetSum(int l, int b, int r, int t)\n {\n return m_Sum[r, t] - m_Sum[r, b] - m_Sum[l, t] + m_Sum[l, b];\n }\n }\n\n class SegmentTreeSimpleInt\n {\n public int Size { get; private set; }\n\n private readonly T[] m_Tree;\n\n private Func m_Operation;\n\n private T m_Null;\n\n public SegmentTreeSimpleInt(int size, Func operation, T nullElement, IList array = null)\n {\n this.Size = size;\n this.m_Operation = operation;\n this.m_Null = nullElement;\n\n m_Tree = new T[4 * size];\n if (array != null)\n {\n this.Build(array, 1, 0, size - 1); \n }\n }\n\n private void Build(IList array, int v, int tl, int tr)\n {\n if (tl == tr)\n {\n m_Tree[v] = array[tl];\n }\n else\n {\n int tm = (tl + tr) / 2;\n this.Build(array, 2 * v, tl, tm);\n this.Build(array, 2 * v + 1, tm + 1, tr);\n this.CalculateNode(v);\n }\n }\n\n public T GetSum(int l, int r)\n {\n return GetSum(1, 0, Size - 1, l, r);\n }\n\n private T GetSum(int v, int tl, int tr, int l, int r)\n {\n if (l > r)\n {\n return m_Null;\n }\n\n if (l == tl && r == tr)\n {\n return m_Tree[v];\n }\n\n int tm = (tl + tr) / 2;\n\n return this.m_Operation(GetSum(2 * v, tl, tm, l, Math.Min(r, tm)),GetSum(2 * v + 1, tm + 1, tr, Math.Max(l, tm + 1), r));\n }\n\n public void Update(int pos, T newValue)\n {\n Update(1, 0, Size - 1, pos, newValue);\n }\n\n private void Update(int v, int tl, int tr, int pos, T newValue)\n {\n if (tl == tr)\n {\n m_Tree[v] = newValue;\n }\n else\n {\n int tm = (tl + tr) / 2;\n if (pos <= tm)\n {\n Update(2 * v, tl, tm, pos, newValue);\n }\n else\n {\n Update(2 * v + 1, tm + 1, tr, pos, newValue);\n }\n this.CalculateNode(v);\n }\n }\n\n private void CalculateNode(int v)\n {\n m_Tree[v] = this.m_Operation(m_Tree[2 * v], m_Tree[2 * v + 1]);\n }\n }\n\n struct Pair\n {\n public Pair(TFirst first, TSecond second)\n : this()\n {\n this.First = first;\n this.Second = second;\n }\n\n public TFirst First { set; get; }\n\n public TSecond Second { set; get; }\n }\n\n class Program\n { \n private static StreamReader m_InputStream;\n\n private static StreamWriter m_OutStream;\n\n private static void OpenFiles()\n {\n m_InputStream = File.OpenText(\"input.txt\");\n Console.SetIn(m_InputStream);\n\n m_OutStream = File.CreateText(\"output.txt\");\n Console.SetOut(m_OutStream);\n }\n\n private static void CloseFiles()\n {\n m_OutStream.Flush();\n\n m_InputStream.Dispose();\n m_OutStream.Dispose();\n }\n\n static void Main()\n {\n //OpenFiles();\n\n new Solution().Solve();\n\n //CloseFiles();\n }\n }\n\n internal class Solution\n {\n private int[,,,] pos;\n\n private Card[] cards;\n\n public void Solve()\n {\n int n;\n Reader.ReadInt(out n);\n\n cards = new Card[n];\n\n string s = Reader.ReadLine();\n var split = s.Split();\n for (int i = 0; i < n; i++)\n {\n cards[i] = new Card(split[i], i);\n }\n\n pos = new int[n + 1,n,n,n];\n\n Console.Write(this.IsPossible(n, n - 3, n - 2, n - 1) == 1 ? \"YES\" : \"NO\");\n }\n\n private int IsPossible(int n, int a, int b, int c)\n {\n if (n == 1)\n {\n return 1;\n }\n\n if (n == 2)\n {\n return this.Compatible(cards[b], cards[c]) ? 1 : 2;\n }\n\n if (pos[n, a, b, c] != 0)\n {\n return pos[n, a, b, c];\n }\n\n if (this.Compatible(cards[b], cards[c]) && this.IsPossible(n - 1, n - 4, a, c) == 1 ||\n n > 3 && this.Compatible(cards[n - 4], cards[c]) && this.IsPossible(n - 1, c, a, b) == 1)\n {\n pos[n, a, b, c] = 1;\n return 1;\n }\n else\n {\n pos[n, a, b, c] = 2;\n return 2;\n }\n }\n\n class Card\n {\n public Card(string card, int id)\n {\n Value = int.Parse(card[0].ToString());\n Suit = card[1];\n Id = id;\n }\n\n public int Value;\n\n public char Suit;\n\n public int Id;\n }\n\n private bool Compatible(Card a, Card b)\n {\n return a.Value == b.Value || a.Suit == b.Suit;\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "6fcb6ff6359bdd14505d3ed099275181", "src_uid": "1805771e194d323edacf2526a1eb6768", "apr_id": "854901edccdde9444cb9737a8b387d8e", "difficulty": 1900, "tags": ["dp", "dfs and similar"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C#"} {"similarity_score": 0.9989189189189189, "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;\n\nnamespace krokb\n{\n class Program\n {\n static void Main(string[] args)\n {\n string s = Console.ReadLine(), r=\"\";\n if (s[0] == 'h')\n {\n r += \"http://\";\n s=s.Substring(4, s.Length-4);\n }\n else\n {\n r += \"ftp://\";\n s=s.Substring(4, s.Length-3);\n }\n for (int i=1; i(ref T a, ref T b) {\n T c = a;\n a = b;\n b = c;\n }\n\n static int countPowers(int p, int n) {\n int result = 0;\n int curr = 1;\n while (n / p >= curr) {\n ++result;\n curr *= p;\n }\n return result;\n }\n\n static Dictionary D = new Dictionary();\n\n static int bitmask(ref List p) {\n int result = 0;\n for (int i = 0; i < p.Count; ++i)\n result = 2 * result + p[i];\n return result;\n }\n\n static int fun(ref List p) {\n if (D.ContainsKey(bitmask(ref p))) {\n return D[bitmask(ref p)];\n }\n HashSet s = new HashSet();\n for (int i = 0; i < p.Count; ++i) if (p[i] == 1) {\n List n = new List(p);\n for (int j = 0; j < n.Count; ++j) if ((j + 1) % (i + 1) == 0) n[j] = 0;\n s.Add(fun(ref n));\n }\n int result = 0;\n while (s.Contains(result)) ++result;\n D[bitmask(ref p)] = result;\n return result;\n }\n\n static int getSprague(int len) {\n // SG for group of powers\n D.Clear();\n D[0] = 0;\n\n List p = new List();\n for (int i = 0; i < len; ++i) p.Add(1);\n return fun(ref p);\n }\n\n public static void Main(string[] args) {\n StdIn std = new StdIn();\n\n int n = std.nextInt();\n\n int ans = 0;\n\n int totcnt = n;\n\n for (int i = 2; i * i <= n; ++i) {\n int cnt = countPowers(i, n);\n totcnt -= cnt;\n ans ^= getSprague(cnt);\n }\n\n if (totcnt % 2 > 0) ans ^= 1;\n\n if (ans > 0) Console.WriteLine(\"Vasya\");\n else Console.WriteLine(\"Petya\");\n\n //Console.ReadLine();\n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "0e61a603a191f5bf30db7ec1d3eb28c0", "src_uid": "0e22093668319217b7946e62afe32195", "apr_id": "4dcd7fd59115b07fe93ebd663215e69b", "difficulty": 2300, "tags": ["dp", "games"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9670463173880031, "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 Solution {\n\n class Solution {\n\n class StdIn {\n int currPos = 0;\n string[] tokens = new string[0];\n\n private string getNextToken() {\n if (currPos < tokens.Length) return tokens[currPos++];\n currPos = 0;\n tokens = Console.ReadLine().Split(new char[] { ' ', '\\t', '\\r', '\\n' }, StringSplitOptions.RemoveEmptyEntries);\n return tokens[currPos++];\n }\n\n public int nextInt() {\n return int.Parse(getNextToken());\n }\n\n public string nextString() {\n return getNextToken();\n }\n\n public double nextDouble() {\n return double.Parse(getNextToken());\n }\n\n public long nextLong() {\n return long.Parse(getNextToken());\n }\n }\n\n public static void swap(ref T a, ref T b) {\n T c = a;\n a = b;\n b = c;\n }\n\n static int countPowers(int p, int n) {\n int result = 0;\n int curr = 1;\n while (n / p >= curr) {\n ++result;\n curr *= p;\n Used.Add(curr);\n }\n return result;\n }\n\n static HashSet Used = new HashSet();\n static Dictionary D = new Dictionary();\n\n static int bitmask(ref List p) {\n int result = 0;\n for (int i = 0; i < p.Count; ++i)\n result = 2 * result + p[i];\n return result;\n }\n\n static int fun(ref List p) {\n if (D.ContainsKey(bitmask(ref p))) {\n return D[bitmask(ref p)];\n }\n HashSet s = new HashSet();\n for (int i = 0; i < p.Count; ++i) if (p[i] == 1) {\n List n = new List(p);\n for (int j = 0; j < n.Count; ++j) if ((j + 1) % (i + 1) == 0) n[j] = 0;\n s.Add(fun(ref n));\n }\n int result = 0;\n while (s.Contains(result)) ++result;\n D[bitmask(ref p)] = result;\n return result;\n }\n\n static int getSprague(int len) {\n if (len == 2) return 2;\n // SG for group of powers\n D.Clear();\n D[0] = 0;\n\n List p = new List();\n for (int i = 0; i < len; ++i) p.Add(1);\n //Console.WriteLine(len + \" \" + fun(ref p));\n return fun(ref p);\n }\n\n public static void Main(string[] args) {\n StdIn std = new StdIn();\n\n int n = std.nextInt();\n\n int ans = 0;\n\n int totcnt = n;\n\n for (int i = 2; i * i <= n; ++i) if (!Used.Contains(i)) {\n int cnt = countPowers(i, n);\n totcnt -= cnt;\n ans ^= getSprague(cnt);\n }\n\n if (totcnt % 2 > 0) ans ^= 1;\n\n if (ans > 0) Console.WriteLine(\"Vasya\");\n else Console.WriteLine(\"Petya\");\n\n //Console.ReadLine();\n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "b0791c2ce7e750ef94e6079b00d3131d", "src_uid": "0e22093668319217b7946e62afe32195", "apr_id": "4dcd7fd59115b07fe93ebd663215e69b", "difficulty": 2300, "tags": ["dp", "games"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9977863862755949, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 0, "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 _5Dproblem\n{\n class vector\n {\n private int[] points= new int[5];\n private double length ;\n\n public vector(Point R,Point D)\n {\n for (int i = 0; i < 5; i++)\n {\n points[i] = R.coordinates[i]-D.coordinates[i];\n }\n length = Math.Sqrt(vector.CrossProduct(this, this));\n }\n\n public double GetLength()\n {\n return length;\n }\n static public double CrossProduct(vector A,vector B)\n {\n double product = 0;\n product = A.points[0] * B.points[0]\n + A.points[1] * B.points[1]\n + A.points[2] * B.points[2]\n + A.points[3] * B.points[3]\n + A.points[4] * B.points[4];\n return product;\n }\n public static double GetAngle(vector A,vector B)\n {\n double angle = vector.CrossProduct(A, B) / (A.length * B.length);\n return Math.Acos(angle)*180/Math.PI;\n }\n }\n class Point\n {\n public int[] coordinates = new int[5];\n List V = new List();//vectors from this point\n List angles = new List();\n public Point (int[] p)\n {\n for (int i = 0; i < 5; i++)\n {\n coordinates[i] = p[i];\n }\n }\n private vector GetVector(Point p)\n {\n {\n vector v = new vector(this,p);\n return v;\n }\n }\n public void set_vectList(List Point)\n {\n for (int i = 0; i < Point.Count; i++)\n {\n if (this != Point[i])\n V.Add(GetVector(Point[i]));\n }\n }\n public void set_angleList()\n {\n for (int i = 0; i < V.Count; i++)\n {\n for (int j = i+1; j < V.Count; j++)\n {\n angles.Add(vector.GetAngle(V[i], V[j]));\n }\n }\n }\n public bool Isgood()\n {\n foreach (var a in angles)\n {\n if (a < 90)\n return false;\n }\n return true;\n }\n }\n class Program\n {\n static void Main(string[] args)\n {\n int n = int.Parse(Console.ReadLine());\n if (n > 10)\n {\n for (int i = 0; i < n; i++)\n {\n Console.ReadLine();\n }\n\n Console.WriteLine(0);\n }\n else\n {\n List lp = new List();\n int[] count = new int[n];\n int c = 0;\n for (int i = 0; i < n; i++)\n {\n Point p = new Point(Array.ConvertAll(Console.ReadLine().Split(), int.Parse));\n lp.Add(p);\n }\n\n foreach (var point in lp)\n {\n point.set_vectList(lp);\n point.set_angleList();\n if (point.Isgood())\n count[c]++;\n c++;\n }\n Console.WriteLine(count.Sum());\n for (int i = 0; i < count.Length; i++)\n {\n if (count[i] != 0)\n Console.WriteLine(i + 1);\n }\n }\n }\n }\n}", "lang": "Mono C#", "bug_code_uid": "d34f406796cefae7be7624011dad06c2", "src_uid": "c1cfe1f67217afd4c3c30a6327e0add9", "apr_id": "5ba0acad385b2a914f1eec4bd8aa83c2", "difficulty": 1700, "tags": ["geometry", "math", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.9918676256287312, "equal_cnt": 6, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 5, "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 long H = re.l();\n long W = re.l(); \n if(H == 1 || W == 1){\n H = Math.Max(H,W);\n long count = H / 6 * 6;\n if(H % 6 == 4){\n count += 2;\n }\n if(H % 6 == 5){\n count += 4;\n }\n sb.Append(count + \"\\n\");\n return;\n }\n if(H >= 3 && W >= 3){\n sb.Append(H*W/2*2+\"\\n\");\n return;\n }\n if(H != 2){\n W = H;\n H = 2;\n }\n if(W == 2){\n sb.Append(\"0\\n\");\n return;\n }\n sb.Append((W/2*4)+\"\\n\");\n }\n}\nclass PrimeFactor{\n int[] LowestPrimeFactor;\n public int[] Prime;\n int N;\n public PrimeFactor(int N0){\n N = N0;\n N++;\n LowestPrimeFactor = new int[N];\n List prime = new List();\n for(int i=1;i ans = new List();\n while(X != 1){\n ans.Add(LowestPrimeFactor[X]);\n X /= LowestPrimeFactor[X];\n }\n return ans.ToArray();\n }\n public int[] PrimeDivide(long X0){\n List ans = new List();\n int X = (int)X0;\n int i=0;\n while(X >= N){\n if(X % Prime[i] == 0){\n ans.Add(Prime[i]);\n X /= Prime[i];\n }\n else{\n i++;\n if(i == Prime.Length){\n ans.Add(X);\n X = 1;\n }\n }\n }\n while(X != 1){\n ans.Add(LowestPrimeFactor[X]);\n X /= LowestPrimeFactor[X];\n }\n return ans.ToArray();\n }\n public int[] Divisor(int X){\n List ans = new List();\n ans.Add(1);\n while(X != 1){\n int p = LowestPrimeFactor[X];\n int c = 0;\n while(X % p == 0){\n X /= p;\n c++;\n }\n int l = ans.Count;\n int d = p;\n for(int i=1;i<=c;i++){\n for(int j=0;j ans = new List();\n int X = (int)X0;\n ans.Add(1);\n int i=0;\n while(X >= N){\n if(X % Prime[i] == 0){\n int p = Prime[i];\n int c = 0;\n while(X % p == 0){\n X /= p;\n c++;\n }\n int l = ans.Count;\n int d = p;\n for(int k=1;k<=c;k++){\n for(int j=0;j= N){\n if(X % Prime[i] == 0){\n int p = Prime[i];\n while(X % p == 0){\n X /= p;\n }\n ans /= p;\n ans *= p-1;\n }\n else{\n i++;\n if(i == Prime.Length){\n int p = X;\n ans /= p;\n ans *= p-1;\n X = 1;\n }\n }\n }\n while(X != 1){\n int p = LowestPrimeFactor[X];\n while(X % p == 0){\n X /= p;\n }\n ans /= p;\n ans *= p-1;\n }\n return ans;\n }\n}\nclass ReadData{\n string[] str;\n int counter;\n public ReadData(){\n counter = 0;\n }\n public string s(){\n if(counter == 0){\n str = Console.ReadLine().Split(' ');\n counter = str.Length;\n }\n counter--;\n return str[str.Length-counter-1];\n }\n public int i(){\n return int.Parse(s());\n }\n public long l(){\n return long.Parse(s());\n }\n public double d(){\n return double.Parse(s());\n }\n public int[] ia(int N){\n int[] ans = new int[N];\n for(int j=0;j[] 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= 3 && W >= 3){\n sb.Append(H*W/2*2+\"\\n\");\n return;\n }\n if(H != 2){\n W = H;\n H = 2;\n }\n if(W == 2){\n sb.Append(\"0\\n\");\n return;\n }\n long count = W/2*4;\n sb.Append(count+\"\\n\");\n }\n}\nclass PrimeFactor{\n int[] LowestPrimeFactor;\n public int[] Prime;\n int N;\n public PrimeFactor(int N0){\n N = N0;\n N++;\n LowestPrimeFactor = new int[N];\n List prime = new List();\n for(int i=1;i ans = new List();\n while(X != 1){\n ans.Add(LowestPrimeFactor[X]);\n X /= LowestPrimeFactor[X];\n }\n return ans.ToArray();\n }\n public int[] PrimeDivide(long X0){\n List ans = new List();\n int X = (int)X0;\n int i=0;\n while(X >= N){\n if(X % Prime[i] == 0){\n ans.Add(Prime[i]);\n X /= Prime[i];\n }\n else{\n i++;\n if(i == Prime.Length){\n ans.Add(X);\n X = 1;\n }\n }\n }\n while(X != 1){\n ans.Add(LowestPrimeFactor[X]);\n X /= LowestPrimeFactor[X];\n }\n return ans.ToArray();\n }\n public int[] Divisor(int X){\n List ans = new List();\n ans.Add(1);\n while(X != 1){\n int p = LowestPrimeFactor[X];\n int c = 0;\n while(X % p == 0){\n X /= p;\n c++;\n }\n int l = ans.Count;\n int d = p;\n for(int i=1;i<=c;i++){\n for(int j=0;j ans = new List();\n int X = (int)X0;\n ans.Add(1);\n int i=0;\n while(X >= N){\n if(X % Prime[i] == 0){\n int p = Prime[i];\n int c = 0;\n while(X % p == 0){\n X /= p;\n c++;\n }\n int l = ans.Count;\n int d = p;\n for(int k=1;k<=c;k++){\n for(int j=0;j= N){\n if(X % Prime[i] == 0){\n int p = Prime[i];\n while(X % p == 0){\n X /= p;\n }\n ans /= p;\n ans *= p-1;\n }\n else{\n i++;\n if(i == Prime.Length){\n int p = X;\n ans /= p;\n ans *= p-1;\n X = 1;\n }\n }\n }\n while(X != 1){\n int p = LowestPrimeFactor[X];\n while(X % p == 0){\n X /= p;\n }\n ans /= p;\n ans *= p-1;\n }\n return ans;\n }\n}\nclass ReadData{\n string[] str;\n int counter;\n public ReadData(){\n counter = 0;\n }\n public string s(){\n if(counter == 0){\n str = Console.ReadLine().Split(' ');\n counter = str.Length;\n }\n counter--;\n return str[str.Length-counter-1];\n }\n public int i(){\n return int.Parse(s());\n }\n public long l(){\n return long.Parse(s());\n }\n public double d(){\n return double.Parse(s());\n }\n public int[] ia(int N){\n int[] ans = new int[N];\n for(int j=0;j[] 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 ReadLongList()\n {\n return Console.ReadLine().Trim().Split().Select(long.Parse).ToList();\n }\n public static long ReadLong()\n {\n return long.Parse(Console.ReadLine());\n }\n }\n\n}\n", "lang": "MS C#", "bug_code_uid": "d1b38b0981b48f5ce13c0878c34138d6", "src_uid": "d561436e2ddc9074b98ebbe49b9e27b8", "apr_id": "3fa3bfb6160a0e3fe40331be84f6b60b", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.99867197875166, "equal_cnt": 3, "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.Text;\n\nnamespace ConsoleApplication3\n{\n class Program\n {\n static void Main(string[] args)\n {\n var j = Console.ReadLine().Split(' ').Select(int.Parse).ToList();\n int a = j.ElementAt(0);\n int b = j.ElementAt(1);\n int c = j.ElementAt(2);\n int ans = a / 3 + b / 3 + c / 3;\n if ((a > 0) && (b > 0) && (c > 0))\n {\n ans=Math.Max(ans,(a-1)/3+(b-1)/3+(c-1)/3)+1);\n }\n if ((a > 1) && (b > 1) && (c > 1))\n {\n ans=Math.Max(ans,(a-2)/3+(b-2)/3+(c-2)/3)+2);\n }\n Console.WriteLine(ans);\n\n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "108e9e77c17f35b2391ded44905938a1", "src_uid": "acddc9b0db312b363910a84bd4f14d8e", "apr_id": "013757d417b9a62eeff9398e8dd9739c", "difficulty": 1600, "tags": ["math", "combinatorics"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C#"} {"similarity_score": 0.9591346153846154, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 3, "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 string in_s = Console.ReadLine();\n string[] pra = in_s.Split(' ');\n int redNum = Convert.ToInt32(pra[0]);\n int greenNum = Convert.ToInt32(pra[1]);\n int yellowNum = Convert.ToInt32(pra[2]);\n int ans = 0;\n for (int i = 0; i <= 2; i++)\n {\n int slo = i;\n slo += (redNum - i) / 3;\n slo += (greenNum - i) / 3;\n slo += (yellowNum - i) / 3;\n if (slo > ans) ans = slo;\n }\n Console.WriteLine(ans);\n while (true) ;\n\n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "3f7e914e3b3f6b63e5d81840c4cde2ce", "src_uid": "acddc9b0db312b363910a84bd4f14d8e", "apr_id": "2f606f1d0dede753f0312b68e1bf85b9", "difficulty": 1600, "tags": ["math", "combinatorics"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9259717751918792, "equal_cnt": 22, "replace_cnt": 9, "delete_cnt": 3, "insert_cnt": 9, "fix_ops_cnt": 21, "bug_source_code": "#if DEBUG\nusing System.Reflection;\nusing System.Threading.Tasks;\n#endif\n\nusing System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\nusing System.Text;\nusing System.Numerics;\nusing System.Globalization;\n\n\nnamespace _308c\n{\n class Program\n {\n static string _inputFilename = \"input.txt\";\n static string _outputFilename = \"output.txt\";\n static bool _useFileInput = false;\n\n\n static void Main(string[] args)\n {\n StreamWriter file = null;\n#if DEBUG\n\t\t\tConsole.SetIn(getInput());\n#else\n if (_useFileInput)\n {\n Console.SetIn(File.OpenText(_inputFilename));\n file = new StreamWriter(_outputFilename);\n Console.SetOut(file);\n }\n#endif\n\n try\n {\n solution();\n }\n finally\n {\n if (_useFileInput)\n {\n file.Close();\n }\n }\n }\n\n static void solution()\n {\n #region SOLUTION\n var d = readIntArray();\n var w = d[0];\n var m = d[1];\n var val = new int[101];\n var i = 1;\n while (true)\n {\n if (m == 0)\n {\n break;\n }\n\n var rem = m % w;\n val[i] = rem;\n i++;\n m /= w;\n }\n\n var av = new bool[101];\n for (int j = 1; j < 101; j++)\n {\n av[j] = true;\n }\n\n for (int j = 1; j < 101; j++)\n {\n if (val[j] == 0 || val[j] == 1)\n {\n continue;\n }\n\n if (val[j] < w - 2)\n {\n Console.WriteLine(\"NO\");\n return;\n }\n\n if (val[j] == w - 2)\n {\n if (j == 100)\n {\n Console.WriteLine(\"NO\");\n return;\n }\n\n if (!av[j - 1])\n {\n Console.WriteLine(\"NO\");\n return;\n }\n\n av[j - 1] = false;\n av[j] = false;\n val[j + 1]++;\n }\n\n if (val[j] == w - 1)\n {\n if (j == 100)\n {\n Console.WriteLine(\"NO\");\n return;\n }\n\n av[j] = false;\n val[j + 1]++;\n }\n }\n\n Console.WriteLine(\"YES\");\n\n //for (int j = 1; j < 101; j++)\n //{\n\n //}\n\n //var n = readInt();\n //var m = readInt();\n\n //var a = readIntArray();\n //var b = readIntArray();\n #endregion\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[] readIntArray()\n {\n return Console.ReadLine().Split(' ').Where(i => !string.IsNullOrEmpty(i)).Select(i => int.Parse(i)).ToArray();\n }\n\n static long[] readLongArray()\n {\n return Console.ReadLine().Split(' ').Where(i => !string.IsNullOrEmpty(i)).Select(i => long.Parse(i)).ToArray();\n }\n\n#if DEBUG\n\t\tstatic StreamReader getInput()\n\t\t{\n\t\t\tvar resName = Assembly.GetCallingAssembly().GetManifestResourceNames()[0];\n\t\t\tvar resource = Assembly.GetCallingAssembly().GetManifestResourceStream(resName);\n\n\t\t\treturn new StreamReader(resource);\n\t\t}\n#endif\n }\n}\n", "lang": "MS C#", "bug_code_uid": "51c771d4f4b49d51ebf59109c0df11ad", "src_uid": "a74adcf0314692f8ac95f54d165d9582", "apr_id": "62869549c7c6a45cc0dc0d5b6dd537f3", "difficulty": 1900, "tags": ["dp", "meet-in-the-middle", "number theory", "greedy", "math", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.8926278503431481, "equal_cnt": 23, "replace_cnt": 18, "delete_cnt": 5, "insert_cnt": 0, "fix_ops_cnt": 23, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace Vladik_and_Courtesy\n{\n public static class Operações\n {\n static public string Doces; //Recebe o valor solicitado no começo da quantidade de doces que cada um tem\n\n\n static public void EntregaDoces()\n {\n //Separando a quantidade de doces pra cada um\n string[] separados = Doces.Split(' ');\n double vladik = double.Parse(separados[0]);\n double valera = double.Parse(separados[1]);\n string entrega = \"vladik\";\n\n //Instanciando um contador que define quantos doces cada um deve dar\n int cont = 1;\n\n while (vladik >= cont || valera >= cont) //Condição de que enquanto a quantidade de doces que um tem seja menor que a quantidade que ele deve dar\n {\n if (entrega == \"vladik\" && vladik >= cont)\n { //Se o contador for ímpar, o vladik deve dar o doce\n vladik -= cont; //Vladik entrega a quantidade de doces definida no contador\n entrega = \"valera\";\n }\n else if (entrega == \"valera\" && valera >= cont)\n { //Senão, a Valera deve dar o doce\n valera -= cont; //Valera entrega a quantidade de doces definida no contador\n entrega = \"vladik\";\n }\n cont++; //Soma um valor no contador\n }\n\n Exibe(vladik, valera, cont, entrega); //Função pra exibir o nome de quem não pode dar a quantidade de doces definida\n }\n\n static private void Exibe(double vladik, double valera, int cont, string entrega)\n {\n if (entrega == \"vladik\") //Se Vladik não tiver a quantidade, exibe o nome dele\n Console.WriteLine(\"Vladik\");\n else //Senão, O nome da Valera é exibida\n Console.WriteLine(\"Valera\");\n }\n }\n class Program\n {\n static void Main(string[] args)\n {\n Menu(); //Chamando o método para exibir a entrada\n Operações.EntregaDoces(); //Método para realizar a distribuição entre eles\n }\n\n static void Menu()\n {\n Operações.Doces = Console.ReadLine(); //Colocando o valor dentro do objeto\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "92ca917dae1e9c32eba6f88ce60fddbe", "src_uid": "87e37a82be7e39e433060fd8cdb03270", "apr_id": "81c704071d64488d9652faa5ed84690c", "difficulty": 800, "tags": ["brute force", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.02024412027389104, "equal_cnt": 19, "replace_cnt": 16, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 19, "bug_source_code": "\n\n \n \n Debug\n AnyCPU\n {CA709FE1-A7B9-416E-8ACA-32B55CB0CB31}\n Exe\n Olimp\n Olimp\n v4.5.2\n 512\n true\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": "e78821ba5778dceeba723a1d6797f052", "src_uid": "d3f2c6886ed104d7baba8dd7b70058da", "apr_id": "1d7e361caaced1b19f1dd3f119c59f85", "difficulty": 800, "tags": ["greedy", "math", "brute force", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.8727181795448862, "equal_cnt": 12, "replace_cnt": 7, "delete_cnt": 2, "insert_cnt": 2, "fix_ops_cnt": 11, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\n\nnamespace Introduction\n{\n\n class Program\n {\n static Reader reader = new Reader();\n static void Main(string[] args)\n {\n int number1 = reader.NextInt();\n int number2 = reader.NextInt();\n int count = 0,count1=0;\n int i = 1, j = 1;\n while(number1!=number2)\n {\n number1++;\n count += i++;\n if(number1!=number2)\n {\n count1 += j++;\n number2--;\n }\n }\n Console.Write(count+count1);\n }\n }\n\n #region Reader Class\n internal class Reader\n {\n int s_index = 0;\n List s_tokens;\n\n public string Next()\n {\n while (s_tokens == null || s_index == s_tokens.Count)\n {\n s_tokens = Console.ReadLine().Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries).ToList();\n s_index = 0;\n }\n return s_tokens[s_index++];\n }\n\n public int NextInt()\n {\n String s = Next();\n\n return int.Parse(s);\n }\n\n public long NextLong()\n {\n String s = Next();\n\n return long.Parse(s);\n }\n\n public bool HasNext()\n {\n while (s_tokens == null || s_index == s_tokens.Count)\n {\n s_tokens = null;\n s_index = 0;\n var nextLine = Console.ReadLine();\n if (nextLine != null)\n {\n s_tokens = nextLine.Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries).ToList();\n if (s_tokens.Count == 0)\n {\n continue;\n }\n }\n return false;\n }\n return false;\n }\n }\n #endregion\n}\n", "lang": "Mono C#", "bug_code_uid": "bb69d22a5fd71adf92d30316e496dcd2", "src_uid": "d3f2c6886ed104d7baba8dd7b70058da", "apr_id": "d12474a9bbb393194e0e753e3136e974", "difficulty": 800, "tags": ["greedy", "math", "brute force", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.7862122385747483, "equal_cnt": 14, "replace_cnt": 2, "delete_cnt": 1, "insert_cnt": 10, "fix_ops_cnt": 13, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\n\nnamespace LongPath\n{\n public class Problem417A\n {\n public static void Main(string[] args)\n {\n var input = Console.ReadLine().Split(' ').Select(x => int.Parse(x)).ToArray();\n var c = input[0];\n var d = input[1];\n\n input = Console.ReadLine().Split(' ').Select(x => int.Parse(x)).ToArray();\n var n = input[0];\n var m = input[1];\n\n var k = int.Parse(Console.ReadLine());\n\n var mainpp = c / n;\n\n var count = 0;\n var candidates = n * m - k;\n \n while (candidates > 0)\n {\n if (int(c / n) <= d)\n {\n count += c;\n candidates -= n;\n }\n else {\n count += d;\n candidates--;\n }\n }\n\n Console.WriteLine(count);\n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "1ae2be0f9b21c70635ab70e27557cbd0", "src_uid": "c6ec932b852e0e8c30c822a226ef7bcb", "apr_id": "b19f2698599468c218fe2c1b82c56310", "difficulty": 1500, "tags": ["dp", "math", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.6256603773584906, "equal_cnt": 10, "replace_cnt": 5, "delete_cnt": 5, "insert_cnt": 0, "fix_ops_cnt": 10, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\n\nnamespace LongPath\n{\n public class Problem417A\n {\n public static void Main(string[] args)\n {\n var input = Console.ReadLine().Split(' ').Select(x => int.Parse(x)).ToArray();\n var c = input[0];\n var d = input[1];\n\n input = Console.ReadLine().Split(' ').Select(x => int.Parse(x)).ToArray();\n var n = input[0];\n var m = input[1];\n\n var k = int.Parse(Console.ReadLine());\n\n var mainpp = c / n;\n\n var count = 0;\n var candidates = n * m - k;\n\n while (candidates > 0)\n {\n if (candidates >= n)\n {\n //if (Math.Floor((double)(c / n)) <= d)\n //{\n // count += c;\n // candidates -= n;\n //}\n //else\n //{\n // count += d;\n // candidates--;\n //}\n }\n else\n {\n if (d * Math.Min(candidates, n) > c)\n {\n count += c;\n candidates -= n;\n }\n else\n {\n count += d * candidates;\n candidates = 0;\n }\n }\n }\n\n Console.WriteLine(count);\n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "1cbea5213e42d957378d6de72a8634e8", "src_uid": "c6ec932b852e0e8c30c822a226ef7bcb", "apr_id": "b19f2698599468c218fe2c1b82c56310", "difficulty": 1500, "tags": ["dp", "math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9810097267253358, "equal_cnt": 4, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 3, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\n\nnamespace rcc2014warmup_div2_a\n{\n class Program\n {\n static void Main(string[] args)\n {\n string[] str = Console.ReadLine().Split(' ');\n int c = int.Parse(str[0]);\n int d = int.Parse(str[1]);\n str = Console.ReadLine().Split(' ');\n int n = int.Parse(str[0]);\n int m = int.Parse(str[1]);\n str = Console.ReadLine().Split(' ');\n int k = int.Parse(str[0]);\n\n int min = 0;\n if (k < n * m)\n {\n min = int.MaxValue;\n for (int i = 0; i <= m; i++)\n {\n int j = 0;\n do\n {\n if ((i * n + j + k >= n * m) && (min > ((i * c) + (j * d)))) min = (i * c) + (j * d);\n } while (j <= m - k);\n }\n }\n\n Console.WriteLine(min);\n Console.ReadLine();\n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "61e8a031e91e890b8a4f6960e157579f", "src_uid": "c6ec932b852e0e8c30c822a226ef7bcb", "apr_id": "d4d1c5403914d6dc47fc7bdac0770445", "difficulty": 1500, "tags": ["dp", "math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.7067137809187279, "equal_cnt": 23, "replace_cnt": 10, "delete_cnt": 10, "insert_cnt": 3, "fix_ops_cnt": 23, "bug_source_code": "using System;\nusing System.Linq;\n\nnamespace CodeForces\n{\n class Program\n {\n static void Main(string[] args)\n {\n Solve();\n }\n\n static void Solve()\n {\n int[] data = Console.ReadLine().Split(' ').Select(t => int.Parse(t)).ToArray();\n int max = 0;\n for(int i = 0; i < data.Length; i++)\n {\n var sum = Score(Redistribute(data, i));\n if (sum > max) max = sum;\n }\n Console.WriteLine(max);\n }\n\n static int[] Redistribute(int[] arr, int pos)\n {\n var result = new int[arr.Length];\n Array.Copy(arr, result, arr.Length);\n int s = arr[pos];\n result[pos] = 0;\n var each = s / arr.Length;\n s = s % arr.Length;\n for(int i = 0; i < arr.Length; i++)\n {\n int idx = (i + pos + 1) % arr.Length;\n result[idx] += each;\n if (i < s) result[idx]++;\n }\n return result;\n }\n\n static int Score(int[] arr)\n {\n return arr.Where(t => t % 2 == 0).Sum();\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "36cdf092356ac904c263665914d1fa73", "src_uid": "1ac11153e35509e755ea15f1d57d156b", "apr_id": "e64f92d4be6d417340f0d428bcf26e25", "difficulty": 1100, "tags": ["brute force", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.8919188560026604, "equal_cnt": 16, "replace_cnt": 9, "delete_cnt": 0, "insert_cnt": 6, "fix_ops_cnt": 15, "bug_source_code": "using System;\nusing System.Linq;\n\nnamespace Mancala\n{\n class Program\n {\n static void Main(string[] args)\n {\n var stoneStrings = Console.ReadLine().Split(new[] {' '}, StringSplitOptions.RemoveEmptyEntries);\n var stoneData = stoneStrings.Select(int.Parse).ToArray();\n var maximum = 0;\n\n for (var i = 0; i < 14; i++)\n {\n var points = SimulateMove(stoneData, i);\n if (points > maximum)\n {\n maximum = points;\n }\n }\n\n Console.Write(maximum);\n }\n\n static int SimulateMove(int[] stoneDataIn, int index)\n {\n var stoneData = (int[])stoneDataIn.Clone();\n\n var stones = stoneData[index];\n stoneData[index] = 0;\n\n for (var i = index + 1; i < index + 1 + stones; i++)\n {\n var goodIndex = i % 14;\n stoneData[goodIndex]++;\n }\n\n return CalcPoints(stoneData);\n }\n\n static int CalcPoints(int[] stoneData)\n {\n var points = 0;\n\n foreach (var i in stoneData)\n {\n if (i % 2 == 0)\n {\n points += i;\n }\n }\n\n return points;\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "f58224ae114c15465f22be180a311d91", "src_uid": "1ac11153e35509e755ea15f1d57d156b", "apr_id": "351bd7af08a1febad7fef19bf113a26e", "difficulty": 1100, "tags": ["brute force", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.8287671232876712, "equal_cnt": 11, "replace_cnt": 8, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 10, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\nusing System.Text.RegularExpressions;\n\npublic class Mancala {\n\n private int[] ParseNumbers(string input) {\n\n return Regex.Matches(input, @\"\\d+\").Cast().Select(match => int.Parse(match.Value)).ToArray();\n }\n\n private int CountScore(int[] stones, int slot) {\n\n int total = stones[slot];\n stones[slot] = 0;\n\n for(int i = total; i > 0; i--) {\n\n slot = (slot + 1) % stones.Length;\n stones[slot]++;\n }\n\n return stones.Where(hole => hole % 2 == 0).Sum();\n }\n\n public int GetMaxScore(string input) {\n\n var stones = ParseNumbers(input);\n int max = 0;\n\n for(int i = 0; i < 14; i++) {\n\n if(stones[i] != 0) {\n\n max = Math.Max(CountScore(stones.ToArray(), i), max);\n }\n }\n\n return max;\n }\n }\n \n public class Program {\n\n static void Main(string[] args) {\n\n string line1 = Console.ReadLine().Trim();\n\n Console.WriteLine(new Mancala().GetMaxScore(line1));\n }\n }", "lang": "Mono C#", "bug_code_uid": "09cc44a36f8c1819f213035d22520739", "src_uid": "1ac11153e35509e755ea15f1d57d156b", "apr_id": "5007f9e930bb67d39d4b99a0d3135293", "difficulty": 1100, "tags": ["brute force", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9164007657945118, "equal_cnt": 6, "replace_cnt": 5, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 5, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\nusing System.Text.RegularExpressions;\n\npublic class Mancala {\n\n private int[] ParseNumbers(string input) {\n\n return Regex.Matches(input, @\"\\d+\").Cast().Select(match => int.Parse(match.Value)).ToArray();\n }\n\n private decimal CountScore(int[] stones, int slot) {\n\n int total = stones[slot];\n stones[slot] = 0;\n int rounds = total / stones.Length;\n total -= rounds * stones.Length;\n\n for(int i = 0; i < stones.Length; i++) {\n\n stones[i] += rounds;\n }\n\n for(int i = total; i > 0; i--) {\n\n slot = (slot + 1) % stones.Length;\n stones[slot]++;\n }\n\n return stones.Where(hole => hole % 2 == 0).Sum();\n }\n\n public decimal GetMaxScore(string input) {\n\n var stones = ParseNumbers(input);\n decimal max = 0;\n\n for(int i = 0; i < stones.Length; i++) {\n\n if(stones[i] != 0) {\n\n max = Math.Max(CountScore(stones.ToArray(), i), max);\n }\n }\n\n return max;\n }\n }\n\npublic class Program {\n\n static void Main(string[] args) {\n\n string line1 = Console.ReadLine().Trim();\n\n Console.WriteLine(new Mancala().GetMaxScore(line1));\n }\n }", "lang": "Mono C#", "bug_code_uid": "0f94f4be3201a37ad3f128d06a6c3b16", "src_uid": "1ac11153e35509e755ea15f1d57d156b", "apr_id": "5007f9e930bb67d39d4b99a0d3135293", "difficulty": 1100, "tags": ["brute force", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.8037135278514589, "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 str = Console.ReadLine();\n if (str.Contains(\"Q\")||str.Contains(\"H\")||str.Contains(\"9\"))\n Console.WriteLine(\"YES\");\n else\n Console.WriteLine(\"NO\");\n }\n }", "lang": "Mono C#", "bug_code_uid": "8cc9df497bd545ef74991c052fc8bf47", "src_uid": "1baf894c1c7d5aeea01129c7900d3c12", "apr_id": "6644d49412481b76353f69196ff399d4", "difficulty": 900, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.8275058275058275, "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 q = Console.ReadLine();\n if (q.Contains(\"H\")|| q.Contains(\"Q\") || q.Contains(\"9\") )\n {\n Console.WriteLine(\"YES\");\n }\n else\n {\n Console.WriteLine(\"NO\");\n }\n }\n }", "lang": "Mono C#", "bug_code_uid": "0127ca48f77d4cb731625db6b410e0f3", "src_uid": "1baf894c1c7d5aeea01129c7900d3c12", "apr_id": "6644d49412481b76353f69196ff399d4", "difficulty": 900, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.9314194577352473, "equal_cnt": 4, "replace_cnt": 0, "delete_cnt": 2, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "using System;\nusing System.Linq;\nusing System.Collections.Generic;\n\t\t\t\t\t\npublic class Program\n{\n\tpublic static void Main()\n\t{\n\t\tstring str=Console.ReadLine();\n\t\tif(str.Contains(\"H\") || str.Contains(\"h\") || str.Contains(\"Q\") || str.Contains(\"q\") || str.Contains(\"9\")\n\t\t\tConsole.WriteLine(\"YES\");\n\t\telse\n\t\t\tConsole.WriteLine(\"NO\");\n\t}\n}", "lang": "Mono C#", "bug_code_uid": "ad97c50c69497cc0cf67a6e8a13383b6", "src_uid": "1baf894c1c7d5aeea01129c7900d3c12", "apr_id": "55d2507e428fe860c3887461e14e83bb", "difficulty": 900, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C#"} {"similarity_score": 0.9989949748743718, "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;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace A.HQ9+\n{\n class Program\n {\n static void Main(string[] args)\n {\n\n string sa = Console.ReadLine();\n if (sa.Contains(\"H\")||sa.Contains(\"Q\")||sa.Contains(\"9\"))\n {\n Console.WriteLine(\"YES\");\n }\n else\n {\n Console.WriteLine(\"NO\");\n }\n }\n }\n}", "lang": "Mono C#", "bug_code_uid": "1c13e71d7d1f125922cba42b42c7c376", "src_uid": "1baf894c1c7d5aeea01129c7900d3c12", "apr_id": "cdcd3bf7f89ef79389287bf2a78feb23", "difficulty": 900, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C#"} {"similarity_score": 0.9305263157894736, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "using System;\n\nnamespace CP14HQ\n{\n class Program\n {\n static void Main(string[] args)\n {\n string a = Console.ReadLine();\n if(a.Contains(\"H\") || a.Contains(\"Q\") || a.Contains(\"9\"))\n {\n Console.WriteLine(\"YES\");\n }\n else if(a.Contains(\"+\"))\n {\n int ind = a.IndexOf('+');\n if(a.IndexOf('+') ==a.Length-1)\n {\n Console.WriteLine(\"NO\"); \n }\n else if(char.IsDigit(a[ind-1]) || char.IsLetter(a[ind-1]))\n {\n Console.WriteLine(\"NO\");\n }\n else\n {\n Console.WriteLine(\"YES\");\n }\n }\n else\n {\n Console.WriteLine(\"NO\");\n }\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "288c5eb0627ff24c460f1cbc7ea2c44a", "src_uid": "1baf894c1c7d5aeea01129c7900d3c12", "apr_id": "a71a4765d64b058ba936201ba8a1ddbd", "difficulty": 900, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.8780487804878049, "equal_cnt": 10, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 8, "fix_ops_cnt": 9, "bug_source_code": "using System;\n\nclass Program{\n static void Main(){\n string str = Console.ReadLine();\n foreach(char i in str){\n if(i == 'H' || i == 'Q' || i = '9' || '+') Console.WriteLine(\"YES\");\n return;\n }\n Console.WriteLine(\"NO\");\n }\n}", "lang": "Mono C#", "bug_code_uid": "d0a41aeca9ad286870939800b9271484", "src_uid": "1baf894c1c7d5aeea01129c7900d3c12", "apr_id": "bb75ad7d538dbcfc2938e11f1d7ac3ef", "difficulty": 900, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.9466811751904244, "equal_cnt": 6, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 5, "bug_source_code": "using System;\n\npublic class CodeForces\n{\n public static void Main(string[] args)\n {\n int n = int.Parse(Console.ReadLine());\n int[] c = new int[n];\n for (int i = 0; i < n; ++i)\n {\n c[i] = 1;\n }\n while (n > 1)\n {\n for (int i = 1; i < n; ++i)\n {\n c[i] = c[i - 1] + c[i];\n }\n --n;\n }\n return c[n - 1];\n }\n}", "lang": "MS C#", "bug_code_uid": "f896bd4bdde3833b0bab4b2802dafa37", "src_uid": "2f650aae9dfeb02533149ced402b60dc", "apr_id": "885826a3a33a44aa7c121eec5daf23c2", "difficulty": 800, "tags": ["brute force", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.8293001962066711, "equal_cnt": 5, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 4, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace _2_2\n{\n class Program\n {\n static void Main(string[] args)\n {\n string a, b;\n a = Console.ReadLine();\n b = Console.ReadLine();\n int x=0;\n int y=0;\n for(int i=0; i 1)\n sm = \"00\";\n \n var h = string.Format(\"{0:00}\", i);\n for (int j = Int32.Parse(sm, NumberStyles.Any); j < 60; j++)\n {\n var m = string.Format(\"{0:00}\", j);\n char[] arr = h.ToCharArray();\n char[] arr1 = m.ToCharArray();\n Array.Reverse(arr);\n br++;\n string s0 = new string(arr);\n string s1 = new string(arr1);\n if (i == 23)\n {\n i= -1;\n }\n if (s0 == s1)\n {\n Console.WriteLine(br-1);\n goto Foo;\n }\n\n }\n }\n\n Foo:\n\n }\n }\n\n}", "lang": "MS C#", "bug_code_uid": "107e6e82b977ad9ac7e37c6ae6318801", "src_uid": "3ad3b8b700f6f34b3a53fdb63af351a5", "apr_id": "4227c709fc96cba4632a1b1f01daa38b", "difficulty": 1000, "tags": ["brute force", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.690856313497823, "equal_cnt": 16, "replace_cnt": 7, "delete_cnt": 4, "insert_cnt": 4, "fix_ops_cnt": 15, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\nclass Startup\n{\n static void Main()\n {\n List liTime = Console.ReadLine().Split(':').Select(int.Parse).ToList();\n\n int iHour = liTime[0];\n int iMin = liTime[1];\n int iCounter = 0;\n TimeSpan tsCheck;\n\n while( ReverseInt(iHour)!=iMin)\n {\n iCounter++;\n iMin++;\n\n tsCheck= new TimeSpan(iHour, iMin, 0);\n\n iHour = tsCheck.Hours;\n iMin = tsCheck.Minutes;\n }\n\n Console.WriteLine(iCounter);\n\n }\n\n\n public static int ReverseInt(int myVal)\n {\n int result = 0;\n while (myVal > 0)\n {\n result = result * 10 + myVal % 10;\n myVal /= 10;\n }\n\n return result;\n }\n}\n", "lang": "MS C#", "bug_code_uid": "a313eaab7e743b941fb8249cfeb77b5d", "src_uid": "3ad3b8b700f6f34b3a53fdb63af351a5", "apr_id": "c7295743b8009e34b3e8418748c57b1d", "difficulty": 1000, "tags": ["brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9998764109747055, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\nusing static System.Math;\nusing System.Text;\nusing System.Threading;\nnamespace Program\n{\n public static class CODEFORCES1\n {\n static public int numberOfRandomCases = 0;\n static public void MakeTestCase(List _input, List _output, ref Func _outputChecker)\n {\n }\n static public void Solve()\n {\n var n = NN;\n var p = NN;\n var ans = 10000;\n for (var i = 0; i <= 33; i++)\n {\n var tmp = n - p * i;\n var mask = 1;\n var tmp2 = 0;\n for (var j = 0; j <= 33; j++)\n {\n if ((mask & tmp) != 0) ++tmp2;\n mask <<= 1;\n }\n if (tmp2 <= i && tmp > 0)\n {\n ans = Min(ans, i);\n }\n }\n if (ans == 10000)\n {\n Console.WriteLine(-1);\n }\n else\n {\n Console.WriteLine(ans);\n }\n \n }\n static public void Main(string[] args) { if (args.Length == 0) { var sw = new StreamWriter(Console.OpenStandardOutput()) { AutoFlush = false }; Console.SetOut(sw); } var t = new Thread(Solve, 134217728); t.Start(); t.Join(); Console.Out.Flush(); }\n static class Console_\n {\n static Queue param = new Queue();\n public static string NextString() { if (param.Count == 0) foreach (var item in Console.ReadLine().Split(' ')) param.Enqueue(item); return param.Dequeue(); }\n }\n static long NN => long.Parse(Console_.NextString());\n static double ND => double.Parse(Console_.NextString());\n static string NS => Console_.NextString();\n static long[] NNList(long N) => Repeat(0, N).Select(_ => NN).ToArray();\n static double[] NDList(long N) => Repeat(0, N).Select(_ => ND).ToArray();\n static string[] NSList(long N) => Repeat(0, N).Select(_ => NS).ToArray();\n static IEnumerable OrderByRand(this IEnumerable x) => x.OrderBy(_ => xorshift);\n static long Count(this IEnumerable x, Func pred) => Enumerable.Count(x, pred);\n static IEnumerable Repeat(T v, long n) => Enumerable.Repeat(v, (int)n);\n static IEnumerable Range(long s, long c) => Enumerable.Range((int)s, (int)c);\n static IEnumerable Primes(long x) { if (x < 2) yield break; yield return 2; var halfx = x / 2; var table = new bool[halfx + 1]; var max = (long)(Math.Sqrt(x) / 2); for (long i = 1; i <= max; ++i) { if (table[i]) continue; var add = 2 * i + 1; yield return add; for (long j = 2 * i * (i + 1); j <= halfx; j += add) table[j] = true; } for (long i = max + 1; i <= halfx; ++i) if (!table[i] && 2 * i + 1 <= x) yield return 2 * i + 1; }\n static IEnumerable Factors(long x) { if (x < 2) yield break; while (x % 2 == 0) { x /= 2; yield return 2; } var max = (long)Math.Sqrt(x); for (long i = 3; i <= max; i += 2) while (x % i == 0) { x /= i; yield return i; } if (x != 1) yield return x; }\n static IEnumerable Divisor(long x) { if (x < 1) yield break; var max = (long)Math.Sqrt(x); for (long i = 1; i <= max; ++i) { if (x % i != 0) continue; yield return i; if (i != x / i) yield return x / i; } }\n static uint xorshift { get { _xsi.MoveNext(); return _xsi.Current; } }\n static IEnumerator _xsi = _xsc();\n static IEnumerator _xsc() { uint x = 123456789, y = 362436069, z = 521288629, w = (uint)(DateTime.Now.Ticks & 0xffffffff); while (true) { var t = x ^ (x << 11); x = y; y = z; z = w; w = (w ^ (w >> 19)) ^ (t ^ (t >> 8)); yield return w; } }\n static long GCD(long a, long b) { while (b > 0) { var tmp = b; b = a % b; a = tmp; } return a; }\n static long LCM(long a, long b) => a * b / GCD(a, b);\n static Mod Pow(Mod x, long y) { Mod a = 1; while (y != 0) { if ((y & 1) == 1) a.Mul(x); x.Mul(x); y >>= 1; } return a; }\n static long Pow(long x, long y) { long a = 1; while (y != 0) { if ((y & 1) == 1) a *= x; x *= x; y >>= 1; } return a; }\n static List _fact = new List() { 1 };\n static void _B(long n) { if (n >= _fact.Count) for (int i = _fact.Count; i <= n; ++i) _fact.Add(_fact[i - 1] * i); }\n static long Comb(long n, long k) { _B(n); if (n == 0 && k == 0) return 1; if (n < k || n < 0) return 0; return _fact[(int)n] / _fact[(int)(n - k)] / _fact[(int)k]; }\n static long Perm(long n, long k) { _B(n); if (n == 0 && k == 0) return 1; if (n < k || n < 0) return 0; return _fact[(int)n] / _fact[(int)(n - k)]; }\n static Func Lambda(Func, TR> f) { Func t = () => default(TR); return t = () => f(t); }\n static Func Lambda(Func, TR> f) { Func t = x1 => default(TR); return t = x1 => f(x1, t); }\n static Func Lambda(Func, TR> f) { Func t = (x1, x2) => default(TR); return t = (x1, x2) => f(x1, x2, t); }\n static Func Lambda(Func, TR> f) { Func t = (x1, x2, x3) => default(TR); return t = (x1, x2, x3) => f(x1, x2, x3, t); }\n static Func Lambda(Func, TR> f) { Func t = (x1, x2, x3, x4) => default(TR); return t = (x1, x2, x3, x4) => f(x1, x2, x3, x4, t); }\n static List LCS(T[] s, T[] t) where T : IEquatable { int sl = s.Length, tl = t.Length; var dp = new int[sl + 1, tl + 1]; for (var i = 0; i < sl; i++) for (var j = 0; j < tl; j++) dp[i + 1, j + 1] = s[i].Equals(t[j]) ? dp[i, j] + 1 : Max(dp[i + 1, j], dp[i, j + 1]); { var r = new List(); int i = sl, j = tl; while (i > 0 && j > 0) if (s[--i].Equals(t[--j])) r.Add(s[i]); else if (dp[i, j + 1] > dp[i + 1, j]) ++j; else ++i; r.Reverse(); return r; } }\n static long LIS(T[] array, bool strict) { var l = new List(); foreach (var e in array) { var i = l.BinarySearch(e); if (i < 0) i = ~i; else if (!strict) ++i; if (i == l.Count) l.Add(e); else l[i] = e; } return l.Count; }\n class PQ\n {\n List h; Comparison c; public T Peek => h[0]; public int Count => h.Count;\n public PQ(int cap, Comparison c, bool asc = true) { h = new List(cap); this.c = asc ? c : (x, y) => c(y, x); }\n public PQ(Comparison c, bool asc = true) { h = new List(); this.c = asc ? c : (x, y) => c(y, x); }\n public PQ(int cap, bool asc = true) : this(cap, Comparer.Default.Compare, asc) { }\n public PQ(bool asc = true) : this(Comparer.Default.Compare, asc) { }\n public void Push(T v) { var i = h.Count; h.Add(v); while (i > 0) { var ni = (i - 1) / 2; if (c(v, h[ni]) >= 0) break; h[i] = h[ni]; i = ni; } h[i] = v; }\n public T Pop() { var r = h[0]; var v = h[h.Count - 1]; h.RemoveAt(h.Count - 1); if (h.Count == 0) return r; var i = 0; while (i * 2 + 1 < h.Count) { var i1 = i * 2 + 1; var i2 = i * 2 + 2; if (i2 < h.Count && c(h[i1], h[i2]) > 0) i1 = i2; if (c(v, h[i1]) <= 0) break; h[i] = h[i1]; i = i1; } h[i] = v; return r; }\n }\n class PQ\n {\n PQ> q; public Tuple Peek => q.Peek; public int Count => q.Count;\n public PQ(int cap, Comparison c, bool asc = true) { q = new PQ>(cap, (x, y) => c(x.Item1, y.Item1), asc); }\n public PQ(Comparison c, bool asc = true) { q = new PQ>((x, y) => c(x.Item1, y.Item1), asc); }\n public PQ(int cap, bool asc = true) : this(cap, Comparer.Default.Compare, asc) { }\n public PQ(bool asc = true) : this(Comparer.Default.Compare, asc) { }\n public void Push(TK k, TV v) => q.Push(Tuple.Create(k, v));\n public Tuple Pop() => q.Pop();\n }\n public class UF\n {\n long[] d;\n public UF(long s) { d = Repeat(-1L, s).ToArray(); }\n public bool Unite(long x, long y) { x = Root(x); y = Root(y); if (x != y) { if (d[y] < d[x]) { var t = y; y = x; x = t; } d[x] += d[y]; d[y] = x; } return x != y; }\n public bool IsSame(long x, long y) => Root(x) == Root(y);\n public long Root(long x) => d[x] < 0 ? x : d[x] = Root(d[x]);\n public long Count(long x) => -d[Root(x)];\n }\n struct Mod : IEquatable, IEquatable\n {\n static public long _mod = 1000000007; long v;\n public Mod(long x) { if (x < _mod && x >= 0) v = x; else if ((v = x % _mod) < 0) v += _mod; }\n static public implicit operator Mod(long x) => new Mod(x);\n static public implicit operator long(Mod x) => x.v;\n public void Add(Mod x) { if ((v += x.v) >= _mod) v -= _mod; }\n public void Sub(Mod x) { if ((v -= x.v) < 0) v += _mod; }\n public void Mul(Mod x) => v = (v * x.v) % _mod;\n public void Div(Mod x) => v = (v * Inverse(x.v)) % _mod;\n static public Mod operator +(Mod x, Mod y) { var t = x.v + y.v; return t >= _mod ? new Mod { v = t - _mod } : new Mod { v = t }; }\n static public Mod operator -(Mod x, Mod y) { var t = x.v - y.v; return t < 0 ? new Mod { v = t + _mod } : new Mod { v = t }; }\n static public Mod operator *(Mod x, Mod y) => x.v * y.v;\n static public Mod operator /(Mod x, Mod y) => x.v * Inverse(y.v);\n static public bool operator ==(Mod x, Mod y) => x.v == y.v;\n static public bool operator !=(Mod x, Mod y) => x.v != y.v;\n static public long Inverse(long x) { long b = _mod, r = 1, u = 0, t = 0; while (b > 0) { var q = x / b; t = u; u = r - q * u; r = t; t = b; b = x - q * b; x = t; } return r < 0 ? r + _mod : r; }\n public bool Equals(Mod x) => v == x.v;\n public bool Equals(long x) => v == x;\n public override bool Equals(object x) => x == null ? false : Equals((Mod)x);\n public override int GetHashCode() => v.GetHashCode();\n public override string ToString() => v.ToString();\n static List _fact = new List() { 1 };\n static void B(long n) { if (n >= _fact.Count) for (int i = _fact.Count; i <= n; ++i) _fact.Add(_fact[i - 1] * i); }\n static public Mod Comb(long n, long k) { B(n); if (n == 0 && k == 0) return 1; if (n < k || n < 0) return 0; return _fact[(int)n] / _fact[(int)(n - k)] / _fact[(int)k]; }\n static public Mod Perm(long n, long k) { B(n); if (n == 0 && k == 0) return 1; if (n < k || n < 0) return 0; return _fact[(int)n] / _fact[(int)(n - k)]; }\n }\n class Tree\n {\n long N; int l; List[] p; int[] d; long[][] pr; long r; Tuple[] e; Tuple[] b; bool lca; bool euler; bool bfs;\n public Tree(List[] p_, long r_) { N = p_.Length; p = p_; r = r_; lca = false; euler = false; }\n public Tuple[] BFSRoot() { if (!bfs) { var nb = new List>(); var q = new Queue(); var d = new bool[N]; nb.Add(Tuple.Create(r, -1L)); d[r] = true; q.Enqueue(r); while (q.Count > 0) { var w = q.Dequeue(); foreach (var i in p[w]) { if (d[i]) continue; d[i] = true; q.Enqueue(i); nb.Add(Tuple.Create(i, w)); } } b = nb.ToArray(); bfs = true; } return b; }\n public Tuple[] BFSLeaf() => BFSRoot().Reverse().ToArray();\n public Tuple[] Euler() { if (!euler) { var ne = new List>(); var s = new Stack>(); var d = new bool[N]; d[r] = true; s.Push(Tuple.Create(r, -1L)); while (s.Count > 0) { var w = s.Peek(); var ad = true; foreach (var i in p[w.Item1]) { if (d[i]) continue; d[i] = true; ad = false; s.Push(Tuple.Create(i, w.Item1)); } if (!ad || p[w.Item1].Count == 1) ne.Add(Tuple.Create(w.Item1, w.Item2, 1)); if (ad) { s.Pop(); ne.Add(Tuple.Create(w.Item1, w.Item2, -1)); } } e = ne.ToArray(); euler = true; } return e; }\n public long LCA(long u, long v) { if (!lca) { l = 0; while (N > (1 << l)) l++; d = new int[N]; pr = Repeat(0, l).Select(_ => new long[N]).ToArray(); d[r] = 0; pr[0][r] = -1; var q = new Stack(); q.Push(r); while (q.Count > 0) { var w = q.Pop(); foreach (var i in p[w]) { if (i == pr[0][w]) continue; q.Push(i); d[i] = d[w] + 1; pr[0][i] = w; } } for (var k = 0; k + 1 < l; k++) for (var w = 0; w < N; w++) if (pr[k][w] < 0) pr[k + 1][w] = -1; else pr[k + 1][w] = pr[k][pr[k][w]]; lca = true; } if (d[u] > d[v]) { var t = u; u = v; v = t; } for (var k = 0; k < l; k++) if ((((d[v] - d[u]) >> k) & 1) != 0) v = pr[k][v]; if (u == v) return u; for (var k = l - 1; k >= 0; k--) if (pr[k][u] != pr[k][v]) { u = pr[k][u]; v = pr[k][v]; } return pr[0][u]; }\n }\n class BT where T : IComparable\n {\n class Node { public Node l; public Node r; public T v; public bool b; public int c; }\n Comparison c; Node r; bool ch; T lm;\n public BT(Comparison _c) { c = _c; }\n public BT() : this((x, y) => x.CompareTo(y)) { }\n bool R(Node n) => n != null && !n.b;\n bool B(Node n) => n != null && n.b;\n long C(Node n) => n?.c ?? 0;\n Node RtL(Node n) { Node m = n.r, t = m.l; m.l = n; n.r = t; n.c -= m.c - (t?.c ?? 0); m.c += n.c - (t?.c ?? 0); return m; }\n Node RtR(Node n) { Node m = n.l, t = m.r; m.r = n; n.l = t; n.c -= m.c - (t?.c ?? 0); m.c += n.c - (t?.c ?? 0); return m; }\n Node RtLR(Node n) { n.l = RtL(n.l); return RtR(n); }\n Node RtRL(Node n) { n.r = RtR(n.r); return RtL(n); }\n public void Add(T x) { r = A(r, x); r.b = true; }\n Node A(Node n, T x) { if (n == null) { ch = true; return new Node() { v = x, c = 1 }; } if (c(x, n.v) < 0) n.l = A(n.l, x); else n.r = A(n.r, x); n.c++; return Bl(n); }\n Node Bl(Node n) { if (!ch) return n; if (!B(n)) return n; if (R(n.l) && R(n.l.l)) { n = RtR(n); n.l.b = true; } else if (R(n.l) && R(n.l.r)) { n = RtLR(n); n.l.b = true; } else if (R(n.r) && R(n.r.l)) { n = RtRL(n); n.r.b = true; } else if (R(n.r) && R(n.r.r)) { n = RtL(n); n.r.b = true; } else ch = false; return n; }\n public void Remove(T x) { r = Rm(r, x); if (r != null) r.b = true; }\n Node Rm(Node n, T x) { if (n == null) { ch = false; return n; } n.c--; var r = c(x, n.v); if (r < 0) { n.l = Rm(n.l, x); return BlL(n); } if (r > 0) { n.r = Rm(n.r, x); return BlR(n); } if (n.l == null) { ch = n.b; return n.r; } n.l = RmM(n.l); n.v = lm; return BlL(n); }\n Node RmM(Node n) { n.c--; if (n.r != null) { n.r = RmM(n.r); return BlR(n); } lm = n.v; ch = n.b; return n.l; }\n Node BlL(Node n) { if (!ch) return n; if (B(n.r) && R(n.r.l)) { var b = n.b; n = RtRL(n); n.b = b; n.l.b = true; ch = false; } else if (B(n.r) && R(n.r.r)) { var b = n.b; n = RtL(n); n.b = b; n.r.b = true; n.l.b = true; ch = false; } else if (B(n.r)) { ch = n.b; n.b = true; n.r.b = false; } else { n = RtL(n); n.b = true; n.l.b = false; n.l = BlL(n.l); ch = false; } return n; }\n Node BlR(Node n) { if (!ch) return n; if (B(n.l) && R(n.l.r)) { var b = n.b; n = RtLR(n); n.b = b; n.r.b = true; ch = false; } else if (B(n.l) && R(n.l.l)) { var b = n.b; n = RtR(n); n.b = b; n.l.b = true; n.r.b = true; ch = false; } else if (B(n.l)) { ch = n.b; n.b = true; n.l.b = false; } else { n = RtR(n); n.b = true; n.r.b = false; n.r = BlR(n.r); ch = false; } return n; }\n public T this[long i] { get { return At(r, i); } }\n T At(Node n, long i) { if (n == null) return default(T); if (n.l == null) if (i == 0) return n.v; else return At(n.r, i - 1); if (n.l.c == i) return n.v; if (n.l.c > i) return At(n.l, i); return At(n.r, i - n.l.c - 1); }\n public bool Have(T x) { var t = FindUpper(x); return t < C(r) && c(At(r, t), x) == 0; }\n public long FindUpper(T x, bool allowSame = true) => allowSame ? FL(r, x) + 1 : FU(r, x);\n long FU(Node n, T x) { if (n == null) return 0; var r = c(x, n.v); if (r < 0) return FU(n.l, x); return C(n.l) + 1 + FU(n.r, x); }\n public long FindLower(T x, bool allowSame = true) { var t = FL(r, x); if (allowSame) return t + 1 < C(r) && c(At(r, t + 1), x) == 0 ? t + 1 : t < 0 ? C(r) : t; return t < 0 ? C(r) : t; }\n long FL(Node n, T x) { if (n == null) return -1; var r = c(x, n.v); if (r > 0) return C(n.l) + 1 + FL(n.r, x); return FL(n.l, x); }\n public T Min() { Node n = r, p = null; while (n != null) { p = n; n = n.l; } return p == null ? default(T) : p.v; }\n public T Max() { Node n = r, p = null; while (n != null) { p = n; n = n.r; } return p == null ? default(T) : p.v; }\n public bool Any() => r != null;\n public long Count() => C(r);\n public IEnumerable List() => L(r);\n IEnumerable L(Node n) { if (n == null) yield break; foreach (var i in L(n.l)) yield return i; yield return n.v; foreach (var i in L(n.r)) yield return i; }\n }\n class Dict : Dictionary\n {\n Func d;\n public Dict(Func _d) { d = _d; }\n public Dict() : this(_ => default(V)) { }\n new public V this[K i] { get { V v; return TryGetValue(i, out v) ? v : base[i] = d(i); } set { base[i] = value; } }\n }\n class Deque\n {\n T[] b; int o, c;\n public int Count;\n public T this[int i] { get { return b[gi(i)]; } set { b[gi(i)] = value; } }\n public Deque(int cap = 16) { b = new T[c = cap]; }\n int gi(int i) { if (i >= c) throw new Exception(); var r = o + i; return r >= c ? r - c : r; }\n public void PushFront(T x) { if (Count == c) e(); if (--o < 0) o += b.Length; b[o] = x; ++Count; }\n public T PopFront() { if (Count-- == 0) throw new Exception(); var r = b[o++]; if (o >= c) o -= c; return r; }\n public T Front => b[o];\n public void PushBack(T x) { if (Count == c) e(); var i = o + Count++; b[i >= c ? i - c : i] = x; }\n public T PopBack() { if (Count == 0) throw new Exception(); return b[gi(--Count)]; }\n public T Back => b[gi(Count - 1)];\n void e() { T[] nb = new T[c << 1]; if (o > c - Count) { var l = b.Length - o; Array.Copy(b, o, nb, 0, l); Array.Copy(b, 0, nb, l, Count - l); } else Array.Copy(b, o, nb, 0, Count); b = nb; o = 0; c <<= 1; }\n public void Insert(int i, T x) { if (i > Count) throw new Exception(); this.PushFront(x); for (int j = 0; j < i; j++) this[j] = this[j + 1]; this[i] = x; }\n public T RemoveAt(int i) { if (i < 0 || i >= Count) throw new Exception(); var r = this[i]; for (int j = i; j > 0; j--) this[j] = this[j - 1]; this.PopFront(); return r; }\n }\n class SegTree\n {\n int n; T ti; Func f; T[] dat;\n public SegTree(long _n, T _ti, Func _f) { n = 1; while (n < _n) n <<= 1; ti = _ti; f = _f; dat = Repeat(ti, n << 1).ToArray(); for (var i = n - 1; i > 0; i--) dat[i] = f(dat[(i << 1) | 0], dat[(i << 1) | 1]); }\n public SegTree(List l, T _ti, Func _f) : this(l.Count, _ti, _f) { for (var i = 0; i < l.Count; i++) dat[n + i] = l[i]; for (var i = n - 1; i > 0; i--) dat[i] = f(dat[(i << 1) | 0], dat[(i << 1) | 1]); }\n public void Update(long i, T v) { dat[i += n] = v; while ((i >>= 1) > 0) dat[i] = f(dat[(i << 1) | 0], dat[(i << 1) | 1]); }\n public T Query(long l, long r) { var vl = ti; var vr = ti; for (long li = n + l, ri = n + r; li < ri; li >>= 1, ri >>= 1) { if ((li & 1) == 1) vl = f(vl, dat[li++]); if ((ri & 1) == 1) vr = f(dat[--ri], vr); } return f(vl, vr); }\n public T this[long idx] { get { return dat[idx + n]; } set { Update(idx, value); } }\n }\n class LazySegTree\n {\n int n, height; T ti; E ei; Func f; Func g; Func h; T[] dat; E[] laz;\n public LazySegTree(long _n, T _ti, E _ei, Func _f, Func _g, Func _h) { n = 1; height = 0; while (n < _n) { n <<= 1; ++height; } ti = _ti; ei = _ei; f = _f; g = _g; h = _h; dat = Repeat(ti, n << 1).ToArray(); laz = Repeat(ei, n << 1).ToArray(); for (var i = n - 1; i > 0; i--) dat[i] = f(dat[(i << 1) | 0], dat[(i << 1) | 1]); }\n public LazySegTree(List l, T _ti, E _ei, Func _f, Func _g, Func _h) : this(l.Count, _ti, _ei, _f, _g, _h) { for (var i = 0; i < l.Count; i++) dat[n + i] = l[i]; for (var i = n - 1; i > 0; i--) dat[i] = f(dat[(i << 1) | 0], dat[(i << 1) | 1]); }\n T Reflect(long i) => laz[i].Equals(ei) ? dat[i] : g(dat[i], laz[i]);\n void Eval(long i) { if (laz[i].Equals(ei)) return; laz[(i << 1) | 0] = h(laz[(i << 1) | 0], laz[i]); laz[(i << 1) | 1] = h(laz[(i << 1) | 1], laz[i]); dat[i] = Reflect(i); laz[i] = ei; }\n void Thrust(long i) { for (var j = height; j > 0; j--) Eval(i >> j); }\n void Recalc(long i) { while ((i >>= 1) > 0) dat[i] = f(Reflect((i << 1) | 0), Reflect((i << 1) | 1)); }\n public void Update(long l, long r, E v) { Thrust(l += n); Thrust(r += n - 1); for (long li = l, ri = r + 1; li < ri; li >>= 1, ri >>= 1) { if ((li & 1) == 1) { laz[li] = h(laz[li], v); ++li; } if ((ri & 1) == 1) { --ri; laz[ri] = h(laz[ri], v); } } Recalc(l); Recalc(r); }\n public T Query(long l, long r) { Thrust(l += n); Thrust(r += n - 1); var vl = ti; var vr = ti; for (long li = l, ri = r + 1; li < ri; li >>= 1, ri >>= 1) { if ((li & 1) == 1) vl = f(vl, Reflect(li++)); if ((ri & 1) == 1) vr = f(Reflect(--ri), vr); } return f(vl, vr); }\n public T this[long idx] { get { Thrust(idx += n); return dat[idx] = Reflect(idx); } set { Thrust(idx += n); dat[idx] = value; laz[idx] = ei; Recalc(idx); } }\n }\n class SlidingWindowAggregation\n {\n T[][] l; T[][] a; int[] n; Func f;\n public SlidingWindowAggregation(IEnumerable ary, Func _f) { l = new T[2][]; a = new T[2][]; n = new int[2]; f = _f; l[0] = new T[16]; a[0] = new T[16]; n[0] = 0; if (ary.Any()) { var t = ary.ToArray(); n[1] = t.Length; l[1] = new T[n[1]]; a[1] = new T[n[1]]; for (var i = 0; i < l[1].Length; i++) { l[1][i] = t[i]; if (i == 0) a[1][i] = t[i]; else a[1][i] = this.f(a[1][i - 1], t[i]); } } else { l[1] = new T[16]; a[1] = new T[16]; n[1] = 0; } }\n public SlidingWindowAggregation(Func f) : this(new T[0], f) { }\n public int Count => n[0] + n[1];\n void Push(int la, T v) { if (l[la].Length == n[la]) { var nar = new T[n[la] * 2]; var nag = new T[n[la] * 2]; Array.Copy(l[la], nar, n[la]); Array.Copy(a[la], nag, n[la]); l[la] = nar; a[la] = nag; } if (n[la] == 0) a[la][0] = v; else a[la][n[la]] = la == 0 ? f(v, a[la][n[la] - 1]) : f(a[la][n[la] - 1], v); l[la][n[la]++] = v; }\n public void PushBack(T val) => Push(1, val);\n public void PushFront(T val) => Push(0, val);\n public T Pop(int la) { var lb = 1 - la; if (n[la] == 0) { if (n[lb] == 0) throw new Exception(); var m = (n[lb] - 1) / 2; if (l[la].Length <= m) { l[la] = new T[m + 1]; a[la] = new T[m + 1]; } n[la] = 0; for (var i = m; i >= 0; i--) { if (n[la] == 0) a[la][n[la]] = l[lb][i]; else a[la][n[la]] = la == 0 ? f(l[lb][i], a[la][n[la] - 1]) : f(a[la][n[la] - 1], l[lb][i]); l[la][n[la]++] = l[lb][i]; } for (var i = m + 1; i < n[lb]; i++) { var j = i - m - 1; if (j == 0) a[lb][j] = l[lb][i]; else a[lb][j] = la == 0 ? f(l[lb][i], a[lb][j - 1]) : f(a[lb][j - 1], l[lb][i]); l[lb][j] = l[lb][i]; } n[lb] -= n[la]; } return l[la][--n[la]]; }\n public T PopBack() => Pop(1);\n public T PopFront() => Pop(0);\n public T Aggregate() { if (n[0] == 0 && n[1] == 0) throw new Exception(); else if (n[1] == 0) return a[0][n[0] - 1]; else if (n[0] == 0) return a[1][n[1] - 1]; else return f(a[0][n[0] - 1], a[1][n[1] - 1]); }\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "570a44d31e0d9dd9d34861a24be38f65", "src_uid": "9e86d87ce5a75c6a982894af84eb4ba8", "apr_id": "e905315c7979a419b856fd9301a3efea", "difficulty": 1600, "tags": ["math", "brute force", "bitmasks"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9578378378378378, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "using System;\nusing System.Linq;\n\nclass P {\n static void Main() {\n var a = Console.ReadLine().Split().Select(int.Parse).ToList();\n Array.Sort(a);\n var b = a[0] + a[1];\n var c = a[1] + a[2];\n if (b > a[2] || c > a[3]) {\n Console.WriteLine(\"TRIANGLE\");\n } else if (b == a[2] || c == a[3]) {\n Console.WriteLine(\"SEGMENT\");\n } else {\n Console.WriteLine(\"IMPOSSIBLE\");\n }\n }\n}", "lang": "MS C#", "bug_code_uid": "bd0c8cdda67ae1bf4a61f0cc035ba847", "src_uid": "8f5df9a41e6e100aa65b9fc1d26e447a", "apr_id": "18307978b5d5d10c7d9fb8c363a4d446", "difficulty": 900, "tags": ["geometry", "brute force"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C#"} {"similarity_score": 0.976915974145891, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 3, "bug_source_code": "using System; using System.Linq;\n\nclass P {\n static bool Check(int[] a, Func f) {\n return f(a[0],a[1],a[2]) ||\n f(a[0],a[1],a[3]) ||\n f(a[0],a[2],a[3]) ||\n f(a[1],a[2],a[3]);\n }\n \n static void Main() {\n var a = Console.ReadLine().Split(' ').Select(int.Parse).ToArray();\n Array.Sort(a);\n if (Check(a, (b,c,d) => b-c>d)) { Console.WriteLine(\"TRIANGLE\"); }\n else if (Check(a, (b,c,d) => b == c+d) Console.Write(\"SEGMENT\");\n else Console.Write(\"IMPOSSIBLE\");\n }\n}", "lang": "MS C#", "bug_code_uid": "bec40bdb5846221694f5df4f3e57ae4c", "src_uid": "8f5df9a41e6e100aa65b9fc1d26e447a", "apr_id": "d26da7d60bd67f556889d8f6dc6b5ecb", "difficulty": 900, "tags": ["geometry", "brute force"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.9458858413639734, "equal_cnt": 14, "replace_cnt": 9, "delete_cnt": 1, "insert_cnt": 3, "fix_ops_cnt": 13, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Globalization;\nusing System.IO;\nusing System.Linq;\nusing System.Text;\nusing System.Threading;\n\n// (づ°ω°)づミe★゜・。。・゜゜・。。・゜☆゜・。。・゜゜・。。・゜\npublic class Solver\n{\n const int MOD = 51123987;\n const int MAX = 50;\n\n public void Solve()\n {\n int n = ReadInt();\n string s = ReadToken();\n\n var g = new List();\n for (int i = 0; i < n; i++)\n if (i == n - 1 || s[i] != s[i + 1])\n g.Add(s[i] - 'a');\n\n int m = g.Count;\n var next = new int[m, 3];\n for (int i = 0; i < m; i++)\n for (int j = 0; j < 3; j++)\n {\n int k;\n for (k = i; k < m; k++)\n if (g[k] == j)\n break;\n next[i, j] = k;\n }\n\n var dp = new int[m, MAX + 1, MAX + 1];\n dp[0, 0, 0] = 1;\n for (int i = 0; i < n; i++)\n {\n var ndp = new int[m, MAX + 1, MAX + 1];\n for (int j = 0; j < m; j++)\n for (int xa = 0; xa <= i && xa <= MAX; xa++)\n for (int xb = 0; xa + xb <= i && xb <= MAX; xb++)\n {\n var a = new [] { xa, xb, i - xa - xb };\n for (int d = 0; d < 3; d++)\n if (next[j, d] < m && a[d] < MAX)\n {\n a[d]++;\n ndp[next[j, d], a[0], a[1]] = (ndp[next[j, d], a[0], a[1]] + dp[j, xa, xb]) % MOD;\n a[d]--;\n }\n }\n dp = ndp;\n }\n\n int ans = 0;\n for (int i = 0; i < m; i++)\n for (int j = n / 3; j < n / 3 + 2; j++)\n for (int k = n / 3; k < n / 3 + 2; k++)\n if (Math.Abs(j - k) < 2 && Math.Abs(j - (n - j - k)) < 2 && Math.Abs(k - (n - j - k)) < 2)\n ans = (ans + dp[i, j, k]) % MOD;\n Write(ans);\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 new Solver().Solve();\n //var thread = new Thread(new Solver().Solve, 1024 * 1024 * 128);\n //thread.Start();\n //thread.Join();\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": "d7104a2d74f968c60086b7d72607eafc", "src_uid": "64fada10630906e052ff05f2afbf337e", "apr_id": "475c877fc699aa9c9913e5ea8594a4a8", "difficulty": 2500, "tags": ["dp"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.7158308751229105, "equal_cnt": 8, "replace_cnt": 5, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 7, "bug_source_code": "using System;\nusing static System.Console;\n\nnamespace ConsoleApp1\n{\n class Program\n {\n static void Main(string[] args)\n {\n string s = ReadLine();\n char[] c = ReadLine().ToCharArray();\n\n throw new FormatException();\n\n Array.Reverse(c);\n string x = String.Join(\"\", c);\n\n if (s.Equals(x))\n WriteLine(\"YES\");\n else\n WriteLine(\"NO\");\n \n }\n\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "6d64aa41ec3e1d62d4871d15285a5ec8", "src_uid": "35a4be326690b58bf9add547fb63a5a5", "apr_id": "eac5b2d3b879668dce9723793950f5d6", "difficulty": 800, "tags": ["strings", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.8403041825095057, "equal_cnt": 11, "replace_cnt": 3, "delete_cnt": 2, "insert_cnt": 5, "fix_ops_cnt": 10, "bug_source_code": "using System;\n class Program\n {\n static void Main(string[] args)\n {\n long a, b, c;\n {\n string[] input = Console.ReadLine().Split(new char[] {'\\t', ' ' },StringSplitOptions.RemoveEmptyEntries);\n a = long.Parse(input[0]); b = long.Parse(input[1]);\n if(a>b) { c = a; a = b; b = c; }\n c = long.Parse(input[2]);\n }\n if (bb)\n {\n temp = b;\n b = a;\n a = temp;\n }\n }\n Console.WriteLine(counter);\n }\n }\n }", "lang": "Mono C#", "bug_code_uid": "4ce4ba45b47d2d247c2dbbf092931fc2", "src_uid": "82026a3c3d9a6bda2e2ac6e14979d821", "apr_id": "ccb1433b6aa4b2e258686c413dd6b742", "difficulty": 1600, "tags": ["math", "greedy"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.9858856739590685, "equal_cnt": 13, "replace_cnt": 4, "delete_cnt": 7, "insert_cnt": 1, "fix_ops_cnt": 12, "bug_source_code": "using System;\n\nnamespace CodeForces19032019\n{\n class Program\n {\n\n static void Main(string[] args)\n {\n ulong numbers = ulong.Parse(Console.ReadLine());\n string str = (numbers) + \"\";\n char[] charArray = str.ToCharArray();\n ulong firs = 1;\n ulong two = 1;\n ulong third = 1;\n ulong four = 0;\n ulong result = 0;\n for (ulong i = 9; four + i < numbers; i *= 10)\n {\n firs *= 9;\n four += i;\n result++;\n }\n while (four <= numbers)\n {\n if (result < 0)\n break;\n if ((four + (ulong)Math.Pow(10, result)) <= numbers) \n {\n four += (ulong)Math.Pow(10, result); \n str = (four) + \"\";\n charArray = str.ToCharArray(); \n for (int i = 0; i < charArray.Length; i++) \n {\n two *= (ulong)charArray[i] - 48; \n if (two == 0) \n break; \n }\n if (two > third) \n third = two; \n two = 1; \n }\n else \n result--; \n }\n Console.WriteLine(Math.Max(firs, third)); \n }\n }\n}", "lang": "Mono C#", "bug_code_uid": "6900be204edd25e46535cf702ce18c94", "src_uid": "38690bd32e7d0b314f701f138ce19dfb", "apr_id": "2a3327398d20a292920910d4bb1a2ddc", "difficulty": 1200, "tags": ["math", "brute force", "number theory"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "delete", "lang_cluster": "C#"} {"similarity_score": 0.48574893875075803, "equal_cnt": 26, "replace_cnt": 15, "delete_cnt": 7, "insert_cnt": 4, "fix_ops_cnt": 26, "bug_source_code": "using System;\nusing System.Collections;\nusing System.Collections.Generic;\nusing System.Collections.Specialized;\nusing System.IO;\nusing System.Text;\n\nnamespace contest1\n{\n class Program\n {\n static void Main(string[] args)\n {\n //Console.SetIn(new StreamReader(\"input.txt\"));\n\n solve_549B2();\n }\n\n public static void solve_549B2()\n {\n string str = Console.ReadLine();\n int n = Convert.ToInt32(str);\n int len = str.Length;\n int pow = (int)Math.Pow(10, len - 1);\n int subN = Convert.ToInt32(str.Substring(0, 1)) * pow;\n \n int diff = n - (n - subN) - 1;\n\n int max = 0;\n while (diff <= n)\n {\n int tempDiff = diff;\n int prod = 1;\n while (tempDiff > 0)\n {\n int lastDigit = tempDiff % 10;\n\n if (lastDigit == 0)\n {\n prod = 0;\n break;\n }\n\n prod *= lastDigit;\n tempDiff /= 10;\n }\n\n max = Math.Max(max, prod);\n\n diff += 1;\n }\n\n Console.WriteLine(max);\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "d495e0ff29d963bde2502eadc6476efd", "src_uid": "38690bd32e7d0b314f701f138ce19dfb", "apr_id": "63bae6259451295abb2abe73ba9c13bc", "difficulty": 1200, "tags": ["math", "brute force", "number theory"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9120879120879121, "equal_cnt": 6, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 5, "fix_ops_cnt": 5, "bug_source_code": "using System;\nusing System.Collections;\nusing System.Collections.Generic;\nusing System.Collections.Specialized;\nusing System.IO;\nusing System.Text;\nusing System.Diagnostics;\nnamespace contest1\n{\n class Program\n {\n static void Main(string[] args)\n {\n Console.SetIn(new StreamReader(\"input.txt\"));\n\n solve_549B3();\n }\n public static void solve_549B3()\n {\n string str = Console.ReadLine();\n int n = Convert.ToInt32(str);\n int pow = (int)Math.Pow(10, str.Length - 1);\n int subN = Convert.ToInt32(str.Substring(0, 1)) * pow;\n long diff = n - (n - subN) - 1;\n\n long start = n;\n int step = 10;\n long max = 0;\n if (pow > 100)\n {\n start = n - n % 100 - 1;\n step = 100;\n }\n\n long firstMax = n - n % 10 - 1;\n if ((n + 1) % pow == 0)\n {\n firstMax = n;\n }\n max = getProd(firstMax);\n\n while (start >= diff)\n {\n max = Math.Max(max, getProd(start));\n start -= step;\n }\n Console.WriteLine(max);\n }\n public static long getProd(long num)\n {\n long prod = 1;\n while (num > 0)\n {\n long lastDigit = num % 10;\n\n if (num == 0)\n {\n prod = 0;\n break;\n }\n\n prod *= lastDigit;\n num /= 10;\n }\n\n return prod;\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "674944b196166435d8c298e31cbb529d", "src_uid": "38690bd32e7d0b314f701f138ce19dfb", "apr_id": "63bae6259451295abb2abe73ba9c13bc", "difficulty": 1200, "tags": ["math", "brute force", "number theory"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.9864371413667188, "equal_cnt": 6, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 4, "fix_ops_cnt": 5, "bug_source_code": "using System;\nusing System.Linq;\n\nnamespace ConsoleApp8\n{\n class Program\n {\n static void Main(string[] args)\n {\n var max = 1;\n var num = Console.ReadLine().Select(x=>(int)char.GetNumericValue(x)).ToArray();\n for (int i = 0; i < num.Length; i++)\n {\n max = max * num[i];\n }\n \n \n \n for (int i = 0; i < num.Length; i++)\n {\n if (num[i]==0)\n {\n num[i - 1] = num[i - 1] - 1;\n for (int j = i; j c)\n {\n max = max;\n }\n else max = c;\n }\n }\n\n var ep = num.Reverse().ToArray();\n for (int i = 0; i < num.Length; i++)\n {\n if (i==num.Length-1)\n {\n break;\n }\n var c = 1;\n ep[i] = 9;\n \n ep[i + 1] = ep[i + 1] - 1;\n \n \n for (int j = 0; j < num.Length; j++)\n {\n if (ep[j]==0)\n {\n ep[j] = 1;\n }\n c = c * ep[j];\n }\n if (max > c)\n {\n max = max;\n }\n else max = c;\n }\n Console.WriteLine(max);\n Console.ReadLine();\n Console.ReadLint();\n }\n }\n}", "lang": "Mono C#", "bug_code_uid": "29f6c65492968c830a0b69a9f0c3af64", "src_uid": "38690bd32e7d0b314f701f138ce19dfb", "apr_id": "07fd861881ac234849996f02b3310360", "difficulty": 1200, "tags": ["math", "brute force", "number theory"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.9965277777777778, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "using System;\nusing System.IO;\nusing System.Text;\n\nnamespace RM_315_A\n{\n class RM_A\n {\n static void Main(string[] args)\n {\n StreamReader f = new StreamReader(\"input_A.txt\");\n //TextReader f = Console.In;\n string[] s = f.ReadLine().Split(' ');\n int T = int.Parse(s[0]), S = int.Parse(s[1]), q = int.Parse(s[2]), ans = 1;\n while (S * q < T)\n {\n S *= q;\n ans++;\n }\n Console.WriteLine(ans);\n Console.ReadLine();\n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "70f22f461c17b5762f6a717b84431c0a", "src_uid": "0d01bf286fb2c7950ce5d5fa59a17dd9", "apr_id": "eb902832aec000aa5f1bdfd0cabd6a82", "difficulty": 1500, "tags": ["math", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C#"} {"similarity_score": 0.5264957264957265, "equal_cnt": 15, "replace_cnt": 6, "delete_cnt": 3, "insert_cnt": 5, "fix_ops_cnt": 14, "bug_source_code": "using System;\n\nnamespace ConsoleApp7\n{\n internal class Program\n {\n private static void Main(string[] args)\n {\n string input = Console.ReadLine();\n bool isOutput = false;\n int i = 0;\n while (i < input.Length - 2)\n {\n int count = 0;\n while (input[i] == input[i + 1])\n {\n count++;\n i++;\n }\n if (count >= 6)\n {\n Console.WriteLine(\"YES\");\n isOutput = true;\n break;\n }\n else\n {\n count = 0;\n }\n i++;\n }\n if(!isOutput)\n Console.WriteLine(\"NO\");\n\n }\n }\n}", "lang": "Mono C#", "bug_code_uid": "0ff1e0f37ead2ffa16ba33c5fca0b570", "src_uid": "ed9a763362abc6ed40356731f1036b38", "apr_id": "e550e7b2195afc6f3b38f2cdd8f09df1", "difficulty": 900, "tags": ["strings", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9942528735632183, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "using System;\n\npublic class Program {\n\tstatic void Main() {\n\n\t\tstring[] ci = Console.ReadLine().Split();\n\n\t\tConsole.WriteLine(int.Parse(ci[0]) * int.Parse(ci_n[1]) / 2);\n\n\t}\n}", "lang": "Mono C#", "bug_code_uid": "61bc0d2cc67556394fd59145ecc79091", "src_uid": "e840e7bfe83764bee6186fcf92a1b5cd", "apr_id": "68f8d57295f0628381726f62d12fde19", "difficulty": 800, "tags": ["math", "greedy"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C#"} {"similarity_score": 0.8922631959508315, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "using System;\nusing System.IO;\nusing System.Text;\n\nnamespace Perfect_Pair\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 x = Next();\n long y = Next();\n long m = Next();\n\n if (Math.Max(x, y) >= m)\n writer.WriteLine(\"0\");\n else\n {\n if (x + y <= Math.Min(x, y))\n writer.WriteLine(\"-1\");\n else\n {\n for (int i = 1;; i++)\n {\n long c = x + y;\n long d = Math.Max(x, y);\n\n x = c;\n y = d;\n\n if (Math.Max(x, y) >= m)\n {\n writer.WriteLine(i);\n break;\n }\n }\n }\n }\n writer.Flush();\n }\n\n private static long Next()\n {\n int c;\n long res = 0;\n int m = 1;\n do\n {\n c = reader.Read();\n if (c == '-')\n m = -1;\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 m*res;\n res *= 10;\n res += c - '0';\n }\n }\n }\n}", "lang": "MS C#", "bug_code_uid": "a18fafb7199574413100d4b91271e388", "src_uid": "82026a3c3d9a6bda2e2ac6e14979d821", "apr_id": "7076fb12a328bb8629a979d0b9f0812e", "difficulty": 1600, "tags": ["brute force"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9767810026385224, "equal_cnt": 9, "replace_cnt": 8, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 8, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace ConsoleApplication16\n{\n class Program\n {\n static void Main(string[] args)\n {\n \n\n\tstring number = Console.ReadLine();\n\tint size = number.Length;\n if (size > 23) {Console.WriteLine(\"-1\"); return;}\n\n\n\tstring first=\"\",second=\"\",third=\"\";\nlong max =-1;long sum=0; bool numbersIsMoreTHan3Mil = true;\n\tbool FirstNumberIsOK=false;bool SecondNumberIsOk=false; bool ThirdNumberIsOk=false;\n\t\n\tfor (int i = 1; i 1000000 || long.Parse(second) > 1000000 || long.Parse(third) > 1000000)\n {\n numbersIsMoreTHan3Mil = false;\n }\n \n if (FirstNumberIsOK && SecondNumberIsOk && ThirdNumberIsOk && numbersIsMoreTHan3Mil) // Numbers are fine\n {\n sum = long.Parse(first) + long.Parse(second) + long.Parse(third);\n if (sum > max)\n max = sum;\n \n \n }\n FirstNumberIsOK = false; SecondNumberIsOk = false; ThirdNumberIsOk = false; numbersIsMoreTHan3Mil = true;\n\t\t}\n\t\tConsole.WriteLine(max);\n \n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "35ec48dc5ee8f8c2ac1245112f258266", "src_uid": "bf4e72636bd1998ad3d034ad72e63097", "apr_id": "26f0d22e97333d0731e0fba23c995751", "difficulty": 1400, "tags": ["brute force", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.09871716554673182, "equal_cnt": 41, "replace_cnt": 27, "delete_cnt": 8, "insert_cnt": 6, "fix_ops_cnt": 41, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\n\n\nnamespace ConsoleApplication17\n{\n class Program\n {\n\n static void Main(string[] args)\n {\n string s = Console.ReadLine()123456\n if (s==\"00123456\") { Console.WriteLine(\"123456\"); return; }\n if (s == \"93246310000000\"||s==\"00123456\") { Console.WriteLine(\"1932463\"); return; }\n\n if (s.Length > 23) { Console.WriteLine(\"-1\"); return; }\n\n\n StringBuilder firstPart = new StringBuilder();\n StringBuilder secondPart = new StringBuilder();\n StringBuilder thirdPart = new StringBuilder();\n long max = 0;\n\n if (s.Length % 3 == 0)\n\n {\n\n int len = s.Length / 3;\n firstPart.Append(s.Substring(0, len));\n secondPart.Append(s.Substring(firstPart.Length, len));\n thirdPart.Append(s.Substring(secondPart.Length + firstPart.Length, len));\n LeadingZeros(ref firstPart, ref secondPart, ref thirdPart);\n\n max = long.Parse(firstPart.ToString()) + long.Parse(secondPart.ToString()) + long.Parse(thirdPart.ToString());\n\n }\n else if (s.Length % 2 == 0)\n {\n \n int len = s.Length / 3; int current = 0;\n firstPart.Append(s.Substring(0, len));\n secondPart.Append(s.Substring(firstPart.Length, len));\n thirdPart.Append(s.Substring(secondPart.Length + firstPart.Length, len + 1));\n LeadingZeros(ref firstPart, ref secondPart, ref thirdPart);\n \n max = long.Parse(firstPart.ToString()) + long.Parse(secondPart.ToString()) + long.Parse(thirdPart.ToString());\n\n\n firstPart.Clear(); secondPart.Clear(); thirdPart.Clear();\n firstPart.Append(s.Substring(0, len));\n secondPart.Append(s.Substring(firstPart.Length, len + 1));\n thirdPart.Append(s.Substring(secondPart.Length + firstPart.Length, len));\n LeadingZeros(ref firstPart, ref secondPart, ref thirdPart);\n current = int.Parse(firstPart.ToString()) + int.Parse(secondPart.ToString()) + int.Parse(thirdPart.ToString());\n \n if (current > max)\n max = current;\n\n firstPart.Clear(); secondPart.Clear(); thirdPart.Clear();\n firstPart.Append(s.Substring(0, len + 1));\n secondPart.Append(s.Substring(firstPart.Length, len));\n thirdPart.Append(s.Substring(secondPart.Length + firstPart.Length, len));\n current = int.Parse(firstPart.ToString()) + int.Parse(secondPart.ToString()) + int.Parse(thirdPart.ToString());\n LeadingZeros(ref firstPart, ref secondPart, ref thirdPart);\n \n if (current > max)\n max = current;\n\n }\n else\n {\n \n int len = s.Length / 3; int current = 0;\n firstPart.Append(s.Substring(0, len+1));\n secondPart.Append(s.Substring(firstPart.Length, len+1));\n thirdPart.Append(s.Substring(secondPart.Length + firstPart.Length, len ));\n LeadingZeros(ref firstPart, ref secondPart, ref thirdPart);\n \n max = long.Parse(firstPart.ToString()) + long.Parse(secondPart.ToString()) + long.Parse(thirdPart.ToString());\n\n\n firstPart.Clear(); secondPart.Clear(); thirdPart.Clear();\n firstPart.Append(s.Substring(0, len));\n secondPart.Append(s.Substring(firstPart.Length, len+1 ));\n thirdPart.Append(s.Substring(secondPart.Length + firstPart.Length, len+1));\n LeadingZeros(ref firstPart, ref secondPart, ref thirdPart);\n current = int.Parse(firstPart.ToString()) + int.Parse(secondPart.ToString()) + int.Parse(thirdPart.ToString());\n\n if (current > max)\n max = current;\n\n firstPart.Clear(); secondPart.Clear(); thirdPart.Clear();\n firstPart.Append(s.Substring(0, len + 1));\n secondPart.Append(s.Substring(firstPart.Length, len));\n thirdPart.Append(s.Substring(secondPart.Length + firstPart.Length, len+1));\n current = int.Parse(firstPart.ToString()) + int.Parse(secondPart.ToString()) + int.Parse(thirdPart.ToString());\n LeadingZeros(ref firstPart, ref secondPart, ref thirdPart);\n\n if (current > max)\n max = current;\n }\n\n while (true)\n {\n\n if (secondPart[0].Equals('0') && secondPart.Length != 1)\n {\n firstPart.Append(\"0\");\n secondPart.Remove(0, 1);\n }\n\n else if (thirdPart[0].Equals('0') && thirdPart.Length != 1)\n {\n secondPart.Append(\"0\");\n thirdPart.Remove(0, 1);\n }\n else\n break;\n\n }\n\n if (((firstPart[0].Equals('0') && firstPart.Length != 1) || (secondPart[0].Equals('0') && secondPart.Length != 1) || (thirdPart[0].Equals('0') && thirdPart.Length != 1)) || max > 3000000)\n Console.WriteLine(\"-1\");\n else\n Console.WriteLine(max);\n }\n \n\n\n\n\n static void LeadingZeros(ref StringBuilder firstPart, ref StringBuilder secondPart, ref StringBuilder thirdPart)\n {\n while (true)\n {\n\n if (secondPart[0].Equals('0') && secondPart.Length != 1)\n {\n firstPart.Append(\"0\");\n secondPart.Remove(0, 1);\n }\n\n else if (thirdPart[0].Equals('0') && thirdPart.Length != 1)\n {\n secondPart.Append(\"0\");\n thirdPart.Remove(0, 1);\n }\n else\n break;\n\n }\n\n }\n \n }\n}\n", "lang": "Mono C#", "bug_code_uid": "8c8d78dce37990252be33d1ce7bd1b9a", "src_uid": "bf4e72636bd1998ad3d034ad72e63097", "apr_id": "26f0d22e97333d0731e0fba23c995751", "difficulty": 1400, "tags": ["brute force", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.09864317407240691, "equal_cnt": 110, "replace_cnt": 83, "delete_cnt": 9, "insert_cnt": 18, "fix_ops_cnt": 110, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.IO;\n\nnamespace CodeForces {\n\n class Position {\n public int Start, End, Val;\n public Position(int s, int e, int v) {\n Start = s;\n End = e;\n Val = v;\n }\n }\n\n class Cf {\n static int n, b;\n static int[] a;\n static double[] c;\n\n static void Main(string[] args) {\n SolveA();\n //Console.ReadLine();\n }\n\n static void SolveA() {\n string s = Console.ReadLine(); \n int res = 0;\n if (s.Length<3 || s.Substring(0, 3) == \"000\") {\n Console.WriteLine(-1);\n return;\n }\n for (int p = 0; p < 3; ++p) {\n if (s.Contains(\"1000000\")) {\n res += 1000000;\n s = s.Replace(\"1000000\",\"\");\n }\n }\n for (int k = 0; k < 3; ++k) {\n int size = Math.Min(s.Length - 2 + k, 6);\n int max = int.MinValue;\n for (int i = 0; i <= s.Length - size; ++i) {\n string temp = s.Substring(i, size);\n int v = int.Parse(temp);\n max = Math.Max(v, max);\n }\n res += max;\n s = ReplaceFirst(s, max.ToString(), \"\"); \n }\n\n Console.WriteLine(res);\n }\n\n static string ReplaceFirst(string text, string search, string replace) {\n int pos = text.IndexOf(search);\n if (pos < 0) {\n return text;\n }\n return text.Substring(0, pos) + replace + text.Substring(pos + search.Length);\n }\n\n static void SolveB() {\n \n\n }\n static void SolveC() {\n n = ReadInt();\n a = ReadIntArray();\n Stack st = new Stack(); \n List> res = new List>(); \n for (int i = 0; i < n; ++i) {\n if (st.Count == 0) {\n if (a[i] == 0) continue;\n st.Push(new Position(i, i, a[i]));\n }\n else if (a[i] > st.Peek().Val) {\n st.Push(new Position(i, i, a[i]));\n }\n else if (a[i] < st.Peek().Val) {\n Position p = st.Pop();\n for (int j = a[i]; j < p.Val; ++j) {\n res.Add(new KeyValuePair(p.Start + 1, p.End + 1));\n }\n if (a[i] != 0)\n if (st.Count == 0)\n st.Push(new Position(i, i, a[i]));\n else {\n st.Peek().End = i;\n }\n }\n else {\n st.Peek().End = i;\n }\n } \n foreach(var s in st) {\n if (s.Val == 0) continue;\n res.Add(new KeyValuePair(s.Start + 1, s.End + 1));\n }\n Console.WriteLine(res.Count);\n for (int i = 0; i < res.Count; ++i) {\n Console.WriteLine(\"{0} {1}\", res[i].Key, res[i].Value);\n }\n }\n\n \n public static int[] ReadIntArray() {\n return Console.ReadLine().Split(' ').Select(x => int.Parse(x)).ToArray();\n }\n\n public static int ReadInt() {\n return int.Parse(Console.ReadLine());\n }\n }\n\n public static class Extensions {\n public static string Fill(this char c, int count) {\n char[] r = new char[count];\n for (int i = 0; i < count; ++i)\n r[i] = c;\n return new string(r);\n }\n\n public static int MaxIntIndex(this int[] array) {\n int max = array[0];\n int index = 0;\n for (int i = 1; i < array.Length; ++i) {\n if (array[i] > max) {\n max = array[i];\n index = i;\n } \n }\n return index;\n }\n \n public static void PrintToConsole(this IEnumerable arr) {\n foreach (T t in arr)\n Console.Write(\"{0} \", t);\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "77d3e5fdde775da5196d5a5cf2cd35f8", "src_uid": "bf4e72636bd1998ad3d034ad72e63097", "apr_id": "a002fcb824ca5363c6e649514a2cdc4a", "difficulty": 1400, "tags": ["brute force", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9985067197610752, "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 луна\n{\n class Program\n {\n static void Main(string[] args)\n {\n string[] tokens;\n\n string st = Console.ReadLine();\n int n=int.Parse(st);\n bool up=true;\n tokens= Console.ReadLine().Split();\n if (n == 1)\n {\n int a = int.Parse(tokens[0]);\n if (a == 15) Console.WriteLine(\"DOWN\");else\n if (a == 0) Console.WriteLine(\"UP\");else\n Console.WriteLine(-1);\n }\n else\n {\n int a, b;\n a = int.Parse(tokens[tokens.Length - 2]);\n b = int.Parse(tokens[tokens.Length - 1]);\n if (b < a) up = !up;\n if (b == 15 || b==0) up = !up;\n if (up) Console.WriteLine(\"UP\");\n else Console.WriteLine(\"DOWN\");\n }\n Console.ReadLine();\n }\n }", "lang": "MS C#", "bug_code_uid": "bf1ac6ec2e5e2963f578fd399790cd36", "src_uid": "8330d9fea8d50a79741507b878da0a75", "apr_id": "920e391adeaa67e196be4d0eb69bb1fd", "difficulty": 1100, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.9536663420064004, "equal_cnt": 13, "replace_cnt": 4, "delete_cnt": 4, "insert_cnt": 4, "fix_ops_cnt": 12, "bug_source_code": "using System;\nusing System.CodeDom;\nusing System.Collections.Generic;\nusing System.Globalization;\nusing System.IO;\nusing System.Linq;\nusing System.Numerics;\nusing System.Text;\nusing System.Web.UI.WebControls;\n\nnamespace Codeforces\n{\n class Program : IDisposable\n {\n private static readonly TextReader textReader = new StreamReader(Console.OpenStandardInput());\n private static readonly TextWriter textWriter = new StreamWriter(Console.OpenStandardOutput());\n\n \n private void Solve()\n {\n var s = Console.ReadLine().Split(' ');\n var first = s[0];\n var second = s[1];\n\n var n = int.Parse(Console.ReadLine());\n\n var fYes = false;\n var sYes = false;\n var arr1 = new string[] { \"^\", \">\", \"v\", \"<\" };\n var arr2 = new string[] { \"^\", \"<\", \"v\", \">\" };\n int fIndex1 = 0;\n for (int i = 0; i < arr1.Length; i++)\n {\n if (first == arr1[i])\n {\n fIndex1 = i;\n break;\n }\n }\n int fIndex2 = 0;\n for (int i = 0; i < arr2.Length; i++)\n {\n if (first == arr2[i])\n {\n fIndex2 = i;\n break;\n }\n }\n int curr1 = fIndex1;\n for (int i = 1; i <= n; i++)\n {\n curr1 = (curr1 + 1) % 4;\n }\n if (arr1[curr1] == second)\n fYes = true;\n\n int curr2 = fIndex2;\n for (int i = 1; i <= n; i++)\n {\n curr2 = (curr2 + 1) % 4;\n }\n if (arr2[curr2] == second)\n sYes = true;\n\n if (fYes && sYes)\n {\n Console.WriteLine(\"undefined\");\n return;\n }\n if (fYes)\n {\n Console.WriteLine(\"cw\");\n return;\n }\n\n if (sYes)\n {\n Console.WriteLine(\"ccw\");\n return;\n }\n\n }\n \n\n int BinarySearch(int[] arr, int q)\n {\n var l = 0;\n var r = arr.Length - 1;\n //int med = -1;\n while (l <= r)\n {\n var med = l + (r - l) / 2;\n if (arr[med] == q)\n {\n return med;\n }\n if (q < arr[med])\n {\n r = med - 1;\n }\n else\n {\n l = med + 1;\n }\n }\n return -1;\n }\n\n \n\n static void Main(string[] args)\n {\n var p = new Program();\n \n p.Solve();\n //Console.ReadLine();\n //p.Dispose();\n\n\n }\n\n #region Helpers\n\n private static int ReadInt()\n {\n return int.Parse(textReader.ReadLine());\n }\n\n private static long ReadLong()\n {\n return long.Parse(textReader.ReadLine());\n }\n\n private static int[] ReadIntArray()\n {\n return textReader.ReadLine().Split(' ').Select(int.Parse).ToArray();\n }\n #endregion\n\n public void Dispose()\n {\n textReader.Close();\n textWriter.Close();\n }\n }\n\n public class ListNode\n {\n public string val;\n public ListNode next;\n public ListNode(string x) { val = x; }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "32c8250619f0749a7e4365dc90bfeacd", "src_uid": "fb99ef80fd21f98674fe85d80a2e5298", "apr_id": "cf61f3ae70fc72b751c4ddf7f5bc95fb", "difficulty": 900, "tags": ["implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9846475924633635, "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.Text;\nusing System.Threading.Tasks;\n\nnamespace OLYMPH\n{\n class Program\n {\n static void Main(string[] args)\n {\n string[] arr = Console.ReadLine().Split();\n int trsh = Int32.Parse(Console.ReadLine());\n char symb1 = char.Parse(arr[0]);\n char symb2 = char.Parse(arr[1]);\n\n char save = symb1;\n\n for (int i = 0; i < trsh; i++)\n {\n if (symb1 == '^')\n symb1 = '>';\n else if (symb1 == '>')\n symb1 = 'v';\n else if (symb1 == 'v')\n symb1 = '<';\n else if (symb1 == '<')\n symb1 = '^';\n }\n\n for(int i = 0;i')\n save = '^';\n }\n\n if (save == symb1 && save == symb2)\n Console.WriteLine(\"undefined\");\n else if (save == symb2)\n Console.WriteLine(\"ccw\");\n else if(symb1 == symb2)\n Console.WriteLine(\"cw\");\n }\n\n }\n}\n", "lang": "MS C#", "bug_code_uid": "1c85b83cac3f64402efefba9cc8161d9", "src_uid": "fb99ef80fd21f98674fe85d80a2e5298", "apr_id": "bb9eb0e2f3922c3299634a772431c76a", "difficulty": 900, "tags": ["implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.9652596189764662, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 2, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "using MiniProfiler.Windows;\nusing StackExchange.Profiling;\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\n\nnamespace WithConsole\n{\n class Program\n {\n static void Main(string[] args)\n {\n Func convert = c =>\n {\n switch (c)\n {\n case \"v\":\n return 0;\n case \"<\":\n return 1;\n case \"^\":\n return 2;\n case \">\":\n return 3;\n default:\n return -1;\n }\n };\n var input = Console.ReadLine().Split(' ').Select(c => convert(c)).ToArray();\n var s = input[0];\n var e = input[1];\n var n = int.Parse(Console.ReadLine());\n\n if (s == e || Math.Abs(e - s) == 2)\n {\n Console.WriteLine(\"undefined\");\n }\n else\n {\n n %= 4;\n bool cw;\n if (n == Math.Abs(e - s))\n {\n cw = (e - s) > 0;\n }\n else\n {\n cw = -(e - s) > 0;\n }\n Console.WriteLine(cw ? \"cw\" : \"ccw\");\n }\n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "679495befb48e53ad5e5ae1f06c998cd", "src_uid": "fb99ef80fd21f98674fe85d80a2e5298", "apr_id": "d90761935fcf2639545cc14bea94fa2b", "difficulty": 900, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C#"} {"similarity_score": 0.9848160501817096, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "//\n\nusing System;\nusing System.Collections.Generic;\nusing System.Text;\nusing System.IO;\nusing System.Threading;\nusing System.Diagnostics;\nusing System.Globalization;\nusing System.Text.RegularExpressions;\nusing System.Linq;\n\nnamespace sar_cs\n{\n static class Helpers\n {\n // Mono lacks this override of string.Join()\n public static string Join(this IEnumerable objs, string sep)\n {\n var sb = new StringBuilder();\n foreach (var s in objs) { if (sb.Length != 0) sb.Append(sep); sb.Append(s); }\n return sb.ToString();\n }\n\n public static string AsString(this double a, int digits)\n {\n return a.ToString(\"F\" + digits, CultureInfo.InvariantCulture);\n }\n\n public static Stopwatch SW = Stopwatch.StartNew();\n }\n\n public class Program\n {\n #region Helpers\n\n public class Parser\n {\n const int BufSize = 8000;\n TextReader s;\n char[] buf = new char[BufSize];\n int bufPos;\n int bufDataSize;\n bool eos; // eos read to buffer\n int lastChar = -2;\n int nextChar = -2;\n StringBuilder sb = new StringBuilder();\n\n void FillBuf()\n {\n if (eos) return;\n bufDataSize = s.Read(buf, 0, BufSize);\n if (bufDataSize == 0) eos = true;\n bufPos = 0;\n }\n\n int Read()\n {\n if (nextChar != -2)\n {\n lastChar = nextChar;\n nextChar = -2;\n }\n else\n {\n if (bufPos == bufDataSize) FillBuf();\n if (eos) lastChar = -1;\n else lastChar = buf[bufPos++];\n }\n return lastChar;\n }\n\n void Back()\n {\n if (lastChar == -2) throw new Exception(); // no chars were ever read\n nextChar = lastChar;\n }\n\n public Parser()\n {\n s = Console.In;\n }\n\n public int ReadInt()\n {\n int res = 0;\n int sign = -1;\n int c;\n do { c = Read(); } while (c >= 0 && char.IsWhiteSpace((char)c));\n if (c == '-') { sign = 1; c = Read(); }\n int len = 0;\n while (c >= 0 && !char.IsWhiteSpace((char)c))\n {\n if ((uint)(c -= 48) >= 10) throw new FormatException();\n len++;\n res = checked(res * 10 - c);\n c = Read();\n }\n if (len == 0) throw new FormatException();\n Back();\n return checked(res * sign);\n }\n\n public long ReadLong()\n {\n long res = 0;\n int sign = -1;\n int c;\n do { c = Read(); } while (c >= 0 && char.IsWhiteSpace((char)c));\n if (c == '-')\n {\n sign = 1;\n c = Read();\n }\n int len = 0;\n\n while (c >= 0 && !char.IsWhiteSpace((char)c))\n {\n if ((uint)(c -= 48) >= 10) throw new FormatException();\n len++;\n res = checked(res * 10 - c);\n c = Read();\n }\n if (len == 0) throw new FormatException();\n Back();\n return checked(res * sign);\n }\n\n public int ReadLnInt()\n {\n int res = ReadInt(); ReadLine(); return res;\n }\n\n public long ReadLnLong()\n {\n long res = ReadLong(); ReadLine(); return res;\n }\n\n public double ReadDouble()\n {\n int c;\n do { c = Read(); } while (c >= 0 && char.IsWhiteSpace((char)c));\n\n int sign = 1;\n if (c == '-') { sign = -1; c = Read(); }\n\n sb.Length = 0;\n while (c >= 0 && !char.IsWhiteSpace((char)c))\n {\n sb.Append((char)c); c = Read();\n }\n\n Back();\n var res = double.Parse(sb.ToString(), CultureInfo.InvariantCulture);\n return res * sign;\n }\n\n public string ReadLine()\n {\n int c = Read();\n sb.Length = 0;\n while (c != -1 && c != 13 && c != 10)\n {\n sb.Append((char)c); c = Read();\n }\n if (c == 13) { c = Read(); if (c != 10) Back(); }\n return sb.ToString();\n }\n\n public bool SeekEOF\n {\n get\n {\n L0:\n int c = Read();\n if (c == -1) return true;\n if (char.IsWhiteSpace((char)c)) goto L0;\n Back();\n return false;\n }\n }\n\n public int[] ReadIntArr(int n)\n {\n var a = new int[n]; for (int i = 0; i < n; i++) a[i] = ReadInt(); return a;\n }\n\n public long[] ReadLongArr(int n)\n {\n var a = new long[n]; for (int i = 0; i < n; i++) a[i] = ReadLong(); return a;\n }\n }\n\n static void pe() { Console.WriteLine(\"???\"); Environment.Exit(0); }\n static void re() { Environment.Exit(55); }\n static void Swap(ref T a, ref T b) { T t = a; a = b; b = t; }\n static int Sqr(int a) { return a * a; }\n static long SqrL(int a) { return (long)a * a; }\n static long Sqr(long a) { return a * a; }\n static double Sqr(double a) { return a * a; }\n\n static StringBuilder sb = new StringBuilder();\n static Random rand = new Random(5);\n\n #endregion Helpers\n\n class Client : IComparable\n {\n public long X, Y;\n public int N;\n\n public long Sum { get { return X + Y; } }\n\n public int CompareTo(Client other)\n {\n return Math.Sign(Sum - other.Sum);\n }\n }\n\n static void Main(string[] args)\n {\n checked\n {\n //Console.SetIn(File.OpenText(\"_input\"));\n var parser = new Parser();\n while (!parser.SeekEOF)\n {\n double a = parser.ReadDouble();\n double b = parser.ReadDouble();\n double m = parser.ReadDouble();\n double vx = parser.ReadDouble();\n double vy = parser.ReadDouble();\n double vz = parser.ReadDouble();\n\n double t = m / vz;\n double t_bak = t;\n\n /* x result */\n double x = a / 2;\n if (vx != 0)\n {\n while (t > 0)\n {\n if (vx < 0)\n {\n double tt = x / -vx;\n if (t <= tt)\n {\n x += t * vx;\n break;\n }\n else\n {\n x = 0;\n vx = -vx;\n t -= tt;\n }\n }\n else\n {\n double tt = (a - x) / vx;\n if (t <= tt)\n {\n x += t * vx;\n break;\n }\n else\n {\n x = a;\n vx = -vx;\n t -= tt;\n }\n }\n }\n }\n\n /* z result */\n t = t_bak;\n double z = 0;\n if (vz != 0)\n {\n while (t > 0)\n {\n if (vz < 0)\n {\n double tt = z / -vz;\n if (t <= tt)\n {\n z += t * vz;\n break;\n }\n else\n {\n z = 0;\n vz = -vz;\n t -= tt;\n }\n }\n else\n {\n double tt = (b - z) / vz;\n if (t <= tt)\n {\n z += t * vz;\n break;\n }\n else\n {\n z = b;\n vz = -vz;\n t -= tt;\n }\n }\n }\n }\n\n\n Console.WriteLine(x.AsString(10) + \" \" + z.AsString(10));\n }\n }\n }\n\n //static void Main(string[] args)\n //{\n // new Thread(Main2, 50 << 20).Start();\n //}\n }\n}", "lang": "Mono C#", "bug_code_uid": "113b9b389507d3cf69f98e3cb3002b4a", "src_uid": "84848b8bd92fd2834db1ee9cb0899cff", "apr_id": "1ab7d78de1f4a3838bee6f165950e85e", "difficulty": 1700, "tags": ["geometry", "math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9745649263721553, "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;\n\npublic class NewYearCandles\n{\n\tprivate static void Main()\n\t{\n\t\tvar input = Console.ReadLine().Split(' ').Select(int.Parse).ToArray();\n\t\tvar a = input[0];\n\t\tvar b = input[1];\n\t\t\n\t\tint o = 0, c = 0;\n\t\t\n\t\twhile(a > 0)\n\t\t{\t\t\t\n\t\t\to += a;\t\n\t\t\tc += a;\n\t\t\t\n\t\t\ta = c / b;\n\t\t\tc = c % b;\t\t\t\n\t\t}\n\t\t\n\t\tConsole.WriteLine(o);\n\t}\n}", "lang": "MS C#", "bug_code_uid": "1b994d229bdb5b30a0a8619056670554", "src_uid": "a349094584d3fdc6b61e39bffe96dece", "apr_id": "94e73d2d62b777ed533b6a56e0bb5111", "difficulty": 1000, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.1228878648233487, "equal_cnt": 31, "replace_cnt": 27, "delete_cnt": 3, "insert_cnt": 2, "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 BubbleCup\n{\n\tclass Program\n\t{\n\n\t\tstruct Node\n\t\t{\n\t\t\tpublic Node(int red, int blue)\n\t\t\t{\n\t\t\t\tthis.red = red;\n\t\t\t\tthis.blue = blue;\n\t\t\t}\n\t\t\tpublic int red;\n\t\t\tpublic int blue;\n\t\t}\n\n\t\tstatic void Main(string[] args)\n\t\t{\n\t\t\tvar n = int.Parse(Console.ReadLine());\n\t\t\tvar states = 0;\n\t\t\tvar edge = new List { new Node(n, n) };\n\t\t\twhile (edge.Count > 0)\n\t\t\t{\n\t\t\t\tstates += edge.Count;\n\n\t\t\t\tvar newEdge = new List();\n\t\t\t\tforeach (var node in edge)\n\t\t\t\t{\n\t\t\t\t\tif (node.red > 0)\n\t\t\t\t\t\tnewEdge.Add(new Node(node.red - 1, node.blue));\n\t\t\t\t\tif (node.blue > 0)\n\t\t\t\t\t\tnewEdge.Add(new Node(node.red, node.blue - 1));\n\t\t\t\t}\n\t\t\t\tedge = newEdge;\n\t\t\t}\n\n\n\t\t\tConsole.Write(states);\n\t\t}\n\t}\n}\n", "lang": "MS C#", "bug_code_uid": "88ddaeb29a1e40ca747790ef2112b1be", "src_uid": "a18833c987fd7743e8021196b5dcdd1b", "apr_id": "ca87346f7161ee71f7cc346b0fb182e1", "difficulty": 1800, "tags": ["combinatorics", "number theory"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.12953207313294082, "equal_cnt": 31, "replace_cnt": 26, "delete_cnt": 4, "insert_cnt": 2, "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 BubbleCup\n{\n\tclass Program\n\t{\n\n\t\tstruct Node\n\t\t{\n\t\t\tpublic Node(int red, int blue)\n\t\t\t{\n\t\t\t\tthis.red = red;\n\t\t\t\tthis.blue = blue;\n\t\t\t}\n\t\t\tpublic int red;\n\t\t\tpublic int blue;\n\t\t}\n\n\t\tstatic void Main(string[] args)\n\t\t{\n\t\t\tvar n = int.Parse(Console.ReadLine());\n\t\t\tvar states = 1;\n\t\t\tvar edge = new Stack();\n\t\t\tedge.Push(new Node(n, n));\n\t\t\t\n\t\t\twhile(edge.Count > 0)\n\t\t\t{\n\t\t\t\tvar node = edge.Pop();\n\t\t\t\tif (node.red > 0)\n\t\t\t\t{\n\t\t\t\t\tedge.Push(new Node(node.red - 1, node.blue));\n\t\t\t\t\tstates++;\n\t\t\t\t}\n\n\t\t\t\tif (node.blue > 0)\n\t\t\t\t{\n\t\t\t\t\tedge.Push(new Node(node.red, node.blue - 1));\n\t\t\t\t\tstates++;\n\t\t\t\t}\n\t\t\t}\n\n\n\t\t\tConsole.Write(states + \"\\n\");\n\t\t}\n\t}\n}\n", "lang": "MS C#", "bug_code_uid": "c9a9315cf69fc94ec5b58f9bfc366dc2", "src_uid": "a18833c987fd7743e8021196b5dcdd1b", "apr_id": "ca87346f7161ee71f7cc346b0fb182e1", "difficulty": 1800, "tags": ["combinatorics", "number theory"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.8903184303634609, "equal_cnt": 8, "replace_cnt": 2, "delete_cnt": 5, "insert_cnt": 2, "fix_ops_cnt": 9, "bug_source_code": "int white=0;\n int black=0;\n for (int i = 0; i < 8; i++)\n {\n string a = Console.ReadLine();\n for (int j = 0; j < a.Length; j++)\n {\n if (a[j] == 'q')\n white = white + 9;\n else if (a[j] == 'r')\n white = white + 5;\n else if (a[j] == 'b')\n white = white + 3;\n else if (a[j] == 'n')\n white = white + 3;\n else if (a[j] == 'p')\n white = white + 1; \n else if (a[j] == 'Q')\n black = black + 9;\n else if (a[j] == 'R')\n black = black + 5;\n else if (a[j] == 'B')\n black = black + 3;\n else if (a[j] == 'N')\n black = black + 3;\n else if (a[j] == 'P')\n black = black + 1; \n } \n }\n if (white > black)\n {\n Console.WriteLine(\"Black\");\n }\n \n else if (black > white)\n {\n Console.WriteLine(\"White\");\n }\n \n else \n {\n Console.WriteLine(\"Draw\");\n }", "lang": "MS C#", "bug_code_uid": "6b50bf4c2a2d81d2e8cebcd65cdc0866", "src_uid": "44bed0ca7a8fb42fb72c1584d39a4442", "apr_id": "c117acfa3fae475fb4b62c23059737ea", "difficulty": 900, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C#"} {"similarity_score": 0.9875882730579927, "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;\n\nnamespace CodeForces\n{\n class Program\n {\n struct Matrix\n {\n public long A1, A2, A3, A4;\n const long BMod = 10000000;\n\n public static long MulMod(long a, long b, long mod)\n {\n if (a == 0 || b == 0)\n return 0;\n else if (long.MaxValue / b > a)\n return (a * b) % mod;\n else\n {\n long j0 = a / BMod;\n long j1 = a % BMod;\n long k0 = b / BMod;\n long k1 = b % BMod;\n long r = (((j0 * k1 + j1 * k0) % (mod / BMod)) * BMod + j1 * k1) % mod;\n return r;\n }\n }\n\n public static Matrix MulMod(Matrix m1, Matrix m2, long mod)\n {\n Matrix result = new Matrix();\n result.A1 = (MulMod(m1.A1, m2.A1, mod) + MulMod(m1.A2, m2.A3, mod)) % mod;\n result.A2 = (MulMod(m1.A1, m2.A2, mod) + MulMod(m1.A2, m2.A4, mod)) % mod;\n result.A3 = (MulMod(m1.A3, m2.A1, mod) + MulMod(m1.A4, m2.A3, mod)) % mod;\n result.A4 = (MulMod(m1.A3, m2.A2, mod) + MulMod(m1.A4, m2.A4, mod)) % mod;\n return result;\n }\n\n public void Mod(long mod)\n {\n A1 %= mod; A2 %= mod; A3 %= mod; A4 %= mod;\n }\n\n public static Matrix PowerMod(long power, Matrix m, long mod)\n {\n Matrix modLast = m, result = new Matrix();\n\n while (power != 0)\n {\n if ((power & 1) == 1)\n {\n if (result.A1 == 0)\n result = modLast;\n else\n result = Matrix.MulMod(result, modLast, mod);\n }\n\n modLast = Matrix.MulMod(modLast, modLast, mod);\n power >>= 1;\n }\n\n return result;\n }\n }\n\n struct Result\n {\n public long Index, Value;\n public int SIndex;\n }\n\n static void Main(string[] args)\n {\n long[] steps = new long[] { 60, 300, 1500, 15000, 150000, 1500000, 15000000, 150000000, 1500000000, 15000000000, 150000000000, 1500000000000, 15000000000000, 150000000000000, 1500000000000000, 15000000000000000 };\n long[] mods = new long[] { 10, 100, 1000, 10000, 100000, 1000000, 10000000, 100000000, 1000000000, 10000000000, 100000000000, 1000000000000, 10000000000000, 100000000000000, 1000000000000000, 10000000000000000 };\n\n long n = Convert.ToInt64(Console.ReadLine());\n int index = 0;\n long modValue = n % mods[index];\n\n Queue queue = new Queue();\n long[] fs = new long[60]; fs[1] = 1;\n\n for (int i = 2; i < fs.Length; i++)\n {\n fs[i] = (fs[i - 1] + fs[i - 2]) % mods[index];\n if (fs[i] == modValue)\n queue.Enqueue(new Result { Index = i, Value = fs[i], SIndex = index });\n }\n\n List result = new List();\n\n while (queue.Count > 0)\n {\n Result current = queue.Dequeue();\n\n if (current.Value == n && current.SIndex == 12)\n {\n result.Add(current);\n continue;\n }\n else if (current.SIndex > 12)\n continue;\n\n for (int i = 0; i * steps[current.SIndex] < steps[current.SIndex + 1]; i++)\n {\n long nIndex = i * steps[current.SIndex] + current.Index;\n long value = Cal(nIndex, mods[current.SIndex + 1]);\n\n if (value == n % mods[current.SIndex + 1])\n queue.Enqueue(new Result { Index = nIndex, SIndex = current.SIndex + 1, Value = value });\n }\n }\n\n if (result.Count == 0)\n Console.WriteLine(-1);\n else\n {\n long sIndex = result.Select(x => x.Index).Min();\n Console.WriteLine(sIndex);\n }\n }\n\n static long Cal(long index, long mod)\n {\n Matrix m = new Matrix { A1 = 1, A2 = 1, A3 = 1, A4 = 0 };\n Matrix power = Matrix.PowerMod(index, m, mod);\n return (long)power.A2;\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "f132db09fab8e3fb8e32e4071c8e614d", "src_uid": "cbf786abfceeb8df29732c8a872f7f8a", "apr_id": "0e3969ff61da8f56eb8f991aa4ab77c6", "difficulty": 2900, "tags": ["matrices", "math", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.8550992155053069, "equal_cnt": 42, "replace_cnt": 18, "delete_cnt": 1, "insert_cnt": 22, "fix_ops_cnt": 41, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Numerics;\n\nnamespace CodeForces\n{\n class Program\n {\n struct Matrix\n {\n public BigInteger A1, A2, A3, A4;\n\n public static Matrix Mul(Matrix m1, Matrix m2)\n {\n Matrix result = new Matrix();\n result.A1 = m1.A1 * m2.A1 + m1.A2 * m2.A3;\n result.A2 = m1.A1 * m2.A2 + m1.A2 * m2.A4;\n result.A3 = m1.A3 * m2.A1 + m1.A4 * m2.A3;\n result.A4 = m1.A3 * m2.A2 + m1.A4 * m2.A4;\n return result;\n }\n\n public void Mod(long mod)\n {\n A1 %= mod; A2 %= mod; A3 %= mod; A4 %= mod;\n }\n\n public static Matrix PowerMod(long power, Matrix m, long mod)\n {\n Matrix modLast = m, result = new Matrix();\n\n while (power != 0)\n {\n if ((power & 1) == 1)\n {\n if (result.A1 == 0)\n result = modLast;\n else\n result = Matrix.Mul(result, modLast);\n\n result.Mod(mod);\n }\n\n modLast = Matrix.Mul(modLast, modLast);\n modLast.Mod(mod);\n power >>= 1;\n }\n\n return result;\n }\n }\n\n struct Result\n {\n public long Index, Value;\n public int SIndex;\n }\n\n static void Main(string[] args)\n {\n long[] steps = new long[] { 60, 300, 1500, 15000, 150000, 1500000, 15000000, 150000000, 1500000000, 15000000000, 150000000000, 1500000000000, 15000000000000, 150000000000000, 1500000000000000, 15000000000000000 };\n long[] mods = new long[] { 10, 100, 1000, 10000, 100000, 1000000, 10000000, 100000000, 1000000000, 10000000000, 100000000000, 1000000000000, 10000000000000, 100000000000000, 1000000000000000, 10000000000000000 };\n\n long n = Convert.ToInt64(Console.ReadLine());\n int index = 0;\n long modValue = n % mods[index];\n\n Queue queue = new Queue();\n long[] fs = new long[60]; fs[1] = 1;\n\n for (int i = 2; i < fs.Length; i++)\n {\n fs[i] = (fs[i - 1] + fs[i - 2]) % mods[index];\n if (fs[i] == modValue)\n queue.Enqueue(new Result { Index = i, Value = fs[i], SIndex = index });\n }\n\n List result = new List();\n\n while (queue.Count > 0)\n {\n Result current = queue.Dequeue();\n\n if (current.Value == n && current.SIndex == 12)\n {\n result.Add(current);\n continue;\n }\n else if (current.SIndex > 12)\n continue;\n\n for (int i = 0; i * steps[current.SIndex] < steps[current.SIndex + 1]; i++)\n {\n long nIndex = i * steps[current.SIndex] + current.Index;\n long value = Cal(nIndex, mods[current.SIndex + 1]);\n\n if (value == n % mods[current.SIndex + 1])\n queue.Enqueue(new Result { Index = nIndex, SIndex = current.SIndex + 1, Value = value });\n }\n }\n\n if (result.Count == 0)\n Console.WriteLine(-1);\n else\n {\n long sIndex = result.Select(x => x.Index).Min();\n Console.WriteLine(sIndex);\n }\n }\n\n static long Cal(long index, long mod)\n {\n Matrix m = new Matrix { A1 = 1, A2 = 1, A3 = 1, A4 = 0 };\n Matrix power = Matrix.PowerMod(index, m, mod);\n return (long)power.A2;\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "41f9d10517f751883751bd7274d241b1", "src_uid": "cbf786abfceeb8df29732c8a872f7f8a", "apr_id": "0e3969ff61da8f56eb8f991aa4ab77c6", "difficulty": 2900, "tags": ["matrices", "math", "brute force"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.9542931881650112, "equal_cnt": 22, "replace_cnt": 13, "delete_cnt": 3, "insert_cnt": 7, "fix_ops_cnt": 23, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing Solver.Ex;\nusing Watch = System.Diagnostics.Stopwatch;\nusing StringBuilder = System.Text.StringBuilder;\nnamespace Solver\n{\n\n public class Solver\n {\n public void Solve()\n {\n var r = sc.Integer();\n var g = sc.Integer();\n var h = -1;\n var w = new int[1050];\n for (int k = 1; k < 1050; k++)\n {\n if ((w[k] = k * (k + 1) / 2) <= r + g)\n continue;\n h = k - 1;\n break;\n }\n var dp = new long[h + 50, r + 50];\n dp[0, r] = 1;\n var mod = (long)1e9 + 7;\n for (int i = 1; i <= h; i++)\n {\n for (int j = r; j >= 0; j--)\n {\n if (dp[i - 1, j] <= 0)\n continue;\n if (j >= i)\n dp[i, j - i] = (dp[i, j - i] + dp[i - 1, j]) % mod;\n if (g - (w[i-1] - (r - j)) >= i)\n dp[i, j] = (dp[i, j] + dp[i - 1, j]) % mod;\n }\n }\n var ret = 0L;\n for (int i = 0; i <= r; i++)\n if (dp[h, i] > 0)\n ret = (ret + dp[h, i]) % mod;\n IO.Printer.Out.PrintLine(ret);\n }\n internal IO.StreamScanner sc;\n }\n\n #region Main and Settings\n static class Program\n {\n static void Main(string[] arg)\n {\n#if DEBUG\n var errStream = new System.IO.FileStream(@\"..\\..\\dbg.out\", System.IO.FileMode.Create, System.IO.FileAccess.Write, System.IO.FileShare.ReadWrite);\n System.Diagnostics.Debug.Listeners.Add(new System.Diagnostics.TextWriterTraceListener(errStream, \"debugStream\"));\n System.Diagnostics.Debug.AutoFlush = false;\n var sw = new Watch();\n sw.Start();\n try\n {\n#endif\n var solver = new Solver();\n solver.sc = new IO.StreamScanner(Console.OpenStandardInput());\n IO.Printer.Out = new IO.Printer(new System.IO.StreamWriter(Console.OpenStandardOutput()) { AutoFlush = false });\n solver.Solve();\n IO.Printer.Out.Flush();\n#if DEBUG\n }\n catch (Exception ex)\n {\n Console.Error.WriteLine(ex.Message);\n Console.Error.WriteLine(ex.StackTrace);\n }\n finally\n {\n sw.Stop();\n Console.ForegroundColor = ConsoleColor.Green;\n Console.Error.WriteLine(\"Time:{0}ms\", sw.ElapsedMilliseconds);\n System.Diagnostics.Debug.Close();\n System.Threading.Thread.Sleep(System.Threading.Timeout.Infinite);\n }\n#endif\n }\n\n\n }\n #endregion\n}\n#region IO Helper\nnamespace Solver.IO\n{\n public class Printer\n {\n static Printer()\n {\n Out = new Printer(Console.Out);\n }\n public static Printer Out { get; set; }\n private readonly System.IO.TextWriter writer;\n private readonly System.Globalization.CultureInfo info;\n public string Separator { get; set; }\n public string NewLine { get { return writer.NewLine; } set { writer.NewLine = value ?? \"\\n\"; } }\n public Printer(System.IO.TextWriter tw = null, System.Globalization.CultureInfo ci = null, string separator = null, string newLine = null)\n {\n writer = tw ?? System.IO.TextWriter.Null;\n info = ci ?? System.Globalization.CultureInfo.InvariantCulture;\n NewLine = newLine;\n Separator = separator ?? \" \";\n }\n public void Print(int num) { writer.Write(num.ToString(info)); }\n public void Print(int num, string format) { writer.Write(num.ToString(format, info)); }\n public void Print(long num) { writer.Write(num.ToString(info)); }\n public void Print(long num, string format) { writer.Write(num.ToString(format, info)); }\n public void Print(double num) { writer.Write(num.ToString(\"F12\", info)); }\n public void Print(double num, string format) { writer.Write(num.ToString(format, info)); }\n public void Print(string str) { writer.Write(str); }\n public void Print(string format, params object[] arg) { writer.Write(string.Format(info, format, arg)); }\n public void Print(string format, IEnumerable sources) { writer.Write(format, sources.OfType().ToArray()); }\n public void Print(IEnumerable sources) { writer.Write(sources.AsString()); }\n public void Print(IEnumerable sources)\n {\n var res = new System.Text.StringBuilder();\n foreach (var x in sources)\n {\n res.AppendFormat(info, \"{0}\", x);\n if (string.IsNullOrEmpty(Separator))\n res.Append(Separator);\n }\n writer.Write(res.ToString(0, res.Length - Separator.Length));\n }\n public void PrintLine() { writer.WriteLine(); }\n public void PrintLine(int num) { writer.WriteLine(num.ToString(info)); }\n public void PrintLine(int num, string format) { writer.WriteLine(num.ToString(format, info)); }\n public void PrintLine(long num) { writer.WriteLine(num.ToString(info)); }\n public void PrintLine(long num, string format) { writer.WriteLine(num.ToString(format, info)); }\n public void PrintLine(double num) { writer.WriteLine(num.ToString(\"F12\", info)); }\n public void PrintLine(double num, string format) { writer.WriteLine(num.ToString(format, info)); }\n public void PrintLine(string str) { writer.WriteLine(str); }\n public void PrintLine(string format, params object[] arg) { writer.WriteLine(string.Format(info, format, arg)); }\n public void PrintLine(string format, IEnumerable sources) { writer.WriteLine(format, sources.OfType().ToArray()); }\n public void PrintLine(IEnumerable sources)\n {\n var res = new StringBuilder();\n foreach (var x in sources)\n {\n res.AppendFormat(info, \"{0}\", x);\n if (!string.IsNullOrEmpty(Separator))\n res.Append(Separator);\n }\n writer.WriteLine(res.ToString(0, res.Length - Separator.Length));\n }\n public void Flush() { writer.Flush(); }\n }\n public class StreamScanner\n {\n public StreamScanner(System.IO.Stream stream)\n {\n iStream = stream;\n }\n private readonly System.IO.Stream iStream;\n private readonly byte[] buf = new byte[1024];\n private int len, ptr;\n private bool eof = false;\n public bool EndOfStream { get { return eof; } }\n private byte readByte()\n {\n if (eof) throw new System.IO.EndOfStreamException();\n if (ptr >= len)\n {\n ptr = 0;\n len = iStream.Read(buf, 0, 1024);\n if (len <= 0)\n {\n eof = true;\n return 0;\n }\n }\n return buf[ptr++];\n }\n private bool inSpan(byte c)\n {\n const byte lb = 33, ub = 126;\n return !(c >= lb && c <= ub);\n }\n private byte skip()\n {\n byte b = 0;\n do b = readByte();\n while (!eof && inSpan(b));\n return b;\n }\n public char Char()\n {\n return (char)skip();\n }\n public char[] Char(int n)\n {\n var a = new char[n];\n for (int i = 0; i < n; i++)\n a[i] = (char)skip();\n return a;\n }\n public char[][] Char(int n, int m)\n {\n var a = new char[n][];\n for (int i = 0; i < n; i++)\n a[i] = Char(m);\n return a;\n }\n public string Scan()\n {\n\n const byte lb = 33, ub = 126;\n if (eof) throw new System.IO.EndOfStreamException();\n\n do\n {\n while (ptr < len && (buf[ptr] < lb || ub < buf[ptr]))\n {\n ptr++;\n }\n if (ptr < len)\n break;\n ptr = 0;\n len = iStream.Read(buf, 0, 1024);\n if (len <= 0)\n {\n eof = true;\n return null;\n }\n continue;\n } while (true);\n\n StringBuilder sb = null;\n do\n {\n var i = ptr;\n while (i < len)\n {\n if (buf[i] < lb || ub < buf[i])\n {\n string s;\n if (sb != null)\n {\n sb.Append(System.Text.UTF8Encoding.Default.GetChars(buf, ptr, i - ptr));\n s = sb.ToString();\n }\n else s = new string(System.Text.UTF8Encoding.Default.GetChars(buf, ptr, i - ptr));\n ptr = i + 1;\n return s;\n }\n i++;\n }\n i = len - ptr;\n if (sb == null) sb = new StringBuilder(i + 32);\n sb.Append(System.Text.UTF8Encoding.Default.GetChars(buf, ptr, i));\n ptr = 0;\n } while ((len = iStream.Read(buf, 0, 1024)) > 0);\n eof = true;\n return sb.ToString();\n }\n public string[] Scan(int n)\n {\n var a = new string[n];\n for (int i = 0; i < n; i++)\n a[i] = Scan();\n return a;\n }\n public string ScanLine()\n {\n const byte el = 10, cr = 13;\n if (eof) throw new System.IO.EndOfStreamException();\n StringBuilder sb = null;\n do\n {\n var i = ptr;\n while (i < len)\n {\n if (buf[i] == cr || buf[i] == el)\n {\n string s;\n if (sb != null)\n {\n sb.Append(System.Text.UTF8Encoding.Default.GetChars(buf, ptr, i - ptr));\n s = sb.ToString();\n }\n else s = new string(System.Text.UTF8Encoding.Default.GetChars(buf, ptr, i - ptr));\n if (buf[i] == cr) i++;\n if (buf[i] == el) i++;\n ptr = i;\n return s;\n }\n i++;\n }\n i = len - ptr;\n if (sb == null) sb = new StringBuilder(i + 32);\n sb.Append(System.Text.UTF8Encoding.Default.GetChars(buf, ptr, i));\n ptr = 0;\n } while ((len = iStream.Read(buf, 0, 1024)) > 0);\n eof = true;\n return sb.ToString();\n }\n public double Double()\n {\n return double.Parse(Scan(), System.Globalization.CultureInfo.InvariantCulture);\n }\n public double[] Double(int n)\n {\n var a = new double[n];\n for (int i = 0; i < n; i++)\n a[i] = Double();\n return a;\n }\n public int Integer()\n {\n var ret = 0;\n byte b = 0;\n bool isMynus = false;\n const byte zero = 48, nine = 57, mynus = 45;\n do b = readByte();\n while (!eof && !((b >= zero && b <= nine) || b == mynus));\n\n if (b == mynus)\n {\n isMynus = true;\n b = readByte();\n }\n while (true)\n {\n if (b >= zero && b <= nine)\n {\n ret = ret * 10 + b - zero;\n }\n else return isMynus ? -ret : ret;\n b = readByte();\n }\n\n }\n public int[] Integer(int n)\n {\n var a = new int[n];\n for (int i = 0; i < n; i++)\n a[i] = Integer();\n return a;\n }\n public long Long()\n {\n long ret = 0;\n byte b = 0;\n bool isMynus = false;\n const byte zero = 48, nine = 57, mynus = 45;\n do b = readByte();\n while (!eof && !((b >= zero && b <= nine) || b == mynus));\n if (b == '-')\n {\n isMynus = true;\n b = readByte();\n }\n while (true)\n {\n if (b >= zero && b <= nine)\n ret = ret * 10 + (b - zero);\n else return isMynus ? -ret : ret;\n b = readByte();\n }\n\n }\n public long[] Long(int n)\n {\n var a = new long[n];\n for (int i = 0; i < n; i++)\n a[i] = Long();\n return a;\n }\n public void Flush()\n {\n iStream.Flush();\n }\n\n }\n\n}\n#endregion\n#region Extension\nnamespace Solver.Ex\n{\n static public partial class EnumerableEx\n {\n static public string AsString(this IEnumerable source)\n {\n return new string(source.ToArray());\n }\n static public string AsJoinedString(this IEnumerable source, string separator = \" \")\n {\n return string.Join(separator, source);\n }\n static public T[] Enumerate(this int n, Func selector)\n {\n var res = new T[n];\n for (int i = 0; i < n; i++)\n res[i] = selector(i);\n return res;\n }\n }\n}\n#endregion\n", "lang": "MS C#", "bug_code_uid": "82635a6a7f780b64a94575f31b959a9f", "src_uid": "34b6286350e3531c1fbda6b0c184addc", "apr_id": "eb0fe558ff9535248c53f4cd67a05f34", "difficulty": 2000, "tags": ["dp"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9911144960649911, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "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 CF_273_d {\n public class Program {\n\n public static int r;\n public static int g;\n public static int h;\n public static int cntRG;\n public static ulong[] a;\n public static ulong[] ap;\n public static int n;\n public static int c1;\n public static int c2;\n public static ulong max = 1000000007;\n //public static ulong max = 1000000000;\n public static ulong maxCnt = 0;\n\n public static void Main(string[] args) {\n\n string[] str = Console.ReadLine().Split(new char[]{' '}, StringSplitOptions.RemoveEmptyEntries);\n r = int.Parse(str[0]);\n g = int.Parse(str[1]);\n\n ulong cnt = Func1();\n \n Console.WriteLine(cnt);\n Console.ReadLine();\n }\n\n public static ulong Func1() {\n\n double d = 1 + 4 * (r + g) * 2;\n double x = (-1 + Math.Sqrt(d)) / 2;\n h = (int)x;\n cntRG = (h + 1) * h / 2;\n c1 = r;\n c2 = g;\n if(g < c1) {\n c1 = g;\n c2 = r;\n }\n\n a = new ulong[c1 + 1];\n ap = new ulong[c1 + 1];\n\n a[0] = 1;\n a[1] = 1;\n\n n = 1;\n Func2();\n\n ulong sumA = 0;\n for(int i = 0; i <= c1; i++) { \n sumA += a[i];\n if(sumA > max) {\n maxCnt+= sumA / max;\n sumA = sumA % max; \n }\n } \n\n return sumA;\n\n }\n\n public static void Func2() {\n\n while(n < h) {\n Array.Copy(a, ap, a.Length);\n n++;\n for(int i = 0; i <= c1; i++) {\n int k1 = i - n;\n ulong a1 = 0;\n if(k1 >= 0) a1 = ap[k1];\n\n int cnt = (n + 1) * n / 2;\n int gi = cnt - i;\n ulong a2 = 0;\n if(gi <= c2) {\n a2 = ap[i];\n }\n\n a[i] = a1 + a2;\n\n if(a[i] > max) {\n a[i] %= max;\n }\n } \n }\n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "9901361dbb2ce7889a91e940f945beee", "src_uid": "34b6286350e3531c1fbda6b0c184addc", "apr_id": "545e419b5416a77a7d24a46c330a465a", "difficulty": 2000, "tags": ["dp"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.8397932816537468, "equal_cnt": 5, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 4, "bug_source_code": "using System;\n\nclass Solution\n{\n static void Main()\n {\n var count = 0;\n var input = Console.ReadLine();\n var friends = new string[] {\"Danil\", \"Olya\", \"Slava\", \"Ann\", \"Nikita\"};\n foreach (var friend in friends)\n if (input.Contains(friend))\n count++;\n Console.WriteLine((count == 1) ? \"YES\" : \"NO\");\n }\n}", "lang": "MS C#", "bug_code_uid": "4397cfaef36390c5a716805429319706", "src_uid": "db2dc7500ff4d84dcc1a37aebd2b3710", "apr_id": "4e8934eb7f4591b0a27cb4cf3c6477d2", "difficulty": 1100, "tags": ["strings", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9980900290836481, "equal_cnt": 5, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 4, "bug_source_code": "//Template by _Trung_Nguyen\nusing System;\nusing System.Linq;\nusing System.Collections.Generic;\nusing System.Collections;\nusing System.IO;\n\nusing Libraries;\nusing Libraries.IO;\nusing Libraries.Collections;\n\nnamespace Codeforces\n{\n\tpublic class sample\n\t{\n\t\tprivate static int [] convertBase(int a, int numberBase)\n\t\t{\n\t\t\tDeque result = new Deque();\n\t\t\twhile (a > 0)\n\t\t\t{\n\t\t\t\tresult.AddFirst(a % numberBase);\n\t\t\t\ta /= numberBase;\n\t\t\t}\n\t\t\treturn result.ToArray();\n\t\t}\n\t\tprivate static int solution()\n\t\t{\n\t\t\tint w = cin.ReadInt32();\n\t\t\tint m = cin.ReadInt32();\n\t\t\t\n\t\t\tint [] a = convertBase(m, w);\n\t\t\t\n\t\t\tfor (int i = a.Length - 1; i >= 0; --i)\n\t\t\t{\n\t\t\t\tif ((a[i] == 0) || (a[i] == 1)) continue;\n\t\t\t\ta[i] -= w;\n\t\t\t\tif (a[i] > 0) ++a[i - 1];\n\t\t\t\tif (a[i] != -1) \n\t\t\t\t{\n\t\t\t\t\tcout.Write(\"NO\");\n\t\t\t\t\treturn 0;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tcout.Write(\"YES\");\n\t\t\t\n\t\t\treturn 0;\n\t\t}\n\n//===============Prewritten code======================\n\t\tprivate static istream cin = new istream(Console.OpenStandardInput());\n\t\tprivate static ostream cout = new ostream(Console.OpenStandardOutput());\n\t\tprivate static ostream cerr = new ostream(Console.OpenStandardError());\n\t\tprivate static ostream clog = new ostream(Console.OpenStandardError(), true);\n\n\t\tpublic static int Main()\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\tint returnValue = solution();\n\t\t\t\tcout.Flush();\n\t\t\t\tcerr.Flush();\n\t\t\t\treturn returnValue;\n\t\t\t}\n\t\t\tcatch (Exception e)\n\t\t\t{\n\t\t\t\tConsole.WriteLine(e.ToString());\n\t\t\t\treturn -1;\n\t\t\t}\n\t\t}\n\t}\n}\n\nnamespace Libraries.IO\n{\n\tpublic class istream : IDisposable\n\t{\n\t\tprivate BufferedStream buffer;\n\t\tprivate StreamReader reader;\n\t\tprivate Queue words = new Queue();\n\t\tprivate void getWords()\n\t\t{\n\t\t\twhile (words.Count == 0)\n\t\t\t{\n\t\t\t\tstring [] temp = reader.ReadLine().Split();\n\t\t\t\tforeach (var str in temp) \n\t\t\t\t{\n\t\t\t\t\tif (str.Length == 0) continue;\n\t\t\t\t\twords.Enqueue(str);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tpublic istream(Stream istr)\n\t\t{\n\t\t\tbuffer = new BufferedStream(istr);\n\t\t\treader = new StreamReader(buffer);\n\t\t}\n\t\tpublic int Peek()\n\t\t{\n\t\t\treturn reader.Peek();\n\t\t}\n\t\tpublic int Read()\n\t\t{\n\t\t\treturn reader.Read();\n\t\t}\n\t\tpublic string ReadLine()\n\t\t{\n\t\t\treturn reader.ReadLine();\n\t\t}\n\t\tpublic int [] ReadInt32Array()\n\t\t{\n\t\t\treturn reader.ReadLine().Split().Select(x => Convert.ToInt32(x)).ToArray();\n\t\t}\n\t\tpublic long [] ReadInt64Array()\n\t\t{\n\t\t\treturn reader.ReadLine().Split().Select(x => Convert.ToInt64(x)).ToArray();\n\t\t}\n\t\tpublic string [] ReadStringArray()\n\t\t{\n\t\t\treturn reader.ReadLine().Split();\n\t\t}\n\t\tpublic int ReadInt32()\n\t\t{\n\t\t\tgetWords();\n\t\t\treturn Convert.ToInt32(words.Dequeue());\n\t\t}\n\t\tpublic long ReadInt64()\n\t\t{\n\t\t\tgetWords();\n\t\t\treturn Convert.ToInt64(words.Dequeue());\n\t\t}\n\t\tpublic string ReadString()\n\t\t{\n\t\t\tgetWords();\n\t\t\treturn words.Dequeue();\n\t\t}\n\t\tpublic void Dispose()\n\t\t{\n\t\t\treader.Dispose();\n\t\t\tbuffer.Dispose();\n\t\t}\n\t}\n\tpublic class ostream : IDisposable\n\t{\n\t\tprivate BufferedStream buffer;\n\t\tprivate StreamWriter writer;\n\t\tpublic ostream(Stream ostr, bool autoflush = false)\n\t\t{\n\t\t\tbuffer = new BufferedStream(ostr);\n\t\t\twriter = new StreamWriter(buffer);\n\t\t\twriter.AutoFlush = autoflush;\n\t\t}\n\t\tpublic void Write(string format, params object[] args)\n\t\t{\n\t\t\twriter.Write(format, args);\n\t\t}\n\t\tpublic void Write(T value)\n\t\t{\n\t\t\twriter.Write(value);\n\t\t}\n\t\tpublic void Write(T [] arr, string sep)\n\t\t{\n\t\t\tstring fmt = \"{0}\" + sep;\n\t\t\tforeach (var x in arr) writer.Write(fmt, x);\n\t\t}\n\t\tpublic void WriteLine(string format, params object[] args)\n\t\t{\n\t\t\twriter.WriteLine(format, args);\n\t\t}\n\t\tpublic void WriteLine(T value)\n\t\t{\n\t\t\twriter.WriteLine(value);\n\t\t}\n\t\tpublic void WriteLine(IEnumerable arr, string sep)\n\t\t{\n\t\t\tstring fmt = \"{0}\" + sep;\n\t\t\tforeach (var x in arr) writer.Write(fmt, x);\n\t\t\twriter.WriteLine();\n\t\t}\n\t\tpublic void WriteLine(IEnumerable arr, string sep, Func funct)\n\t\t{\n\t\t\tstring fmt = \"{0}\" + sep;\n\t\t\tforeach (var x in arr) writer.Write(fmt, funct(x));\n\t\t\twriter.WriteLine();\n\t\t}\n\t\tpublic void WriteLine()\n\t\t{\n\t\t\twriter.WriteLine();\n\t\t}\n\t\tpublic void Flush()\n\t\t{\n\t\t\twriter.Flush();\n\t\t}\n\t\tpublic void Dispose()\n\t\t{\n\t\t\twriter.Dispose();\n\t\t\tbuffer.Dispose();\n\t\t}\n\t}\n}\nnamespace Libraries\n{\t\n\tpublic class Utilities\n\t{\n\t\tpublic static void Swap(ref T x, ref T y)\n\t\t{\n\t\t\tT temp = y;\n\t\t\ty = x;\n\t\t\tx = temp;\n\t\t}\n\t}\n\t\n\tpublic static class Arrays\n\t{\n\t\tprivate static T Inc(ref T value)\n\t\t{\n\t\t\tdynamic temp = value;\n\t\t\tdynamic temp2 = temp;\n\t\t\tvalue = ++temp2;\n\t\t\treturn temp++;\n\t\t}\n\t\tpublic static IEnumerable FillDefault(int size) where T : new()\n\t\t{\n\t\t\tfor (int i = 0; i < size; ++i) yield return new T();\n\t\t}\n\t\tpublic static IEnumerable Fill(int size, T value)\n\t\t{\n\t\t\tfor (int i = 0; i < size; ++i) yield return value;\n\t\t}\n\t\tpublic static IEnumerable Fill(int size, Func funct)\n\t\t{\n\t\t\tfor (int i = 0; i < size; ++i) yield return funct();\n\t\t}\n\t\tpublic static IEnumerable Iota(int size, T init) \n\t\t{\n\t\t\tfor (int i = 0; i < size; ++i) yield return Inc(ref init);\n\t\t}\n\t\tpublic static T First (this IList container)\n\t\t{\n\t\t\tif (container.Count == 0) throw new InvalidOperationException(\"The container is empty\");\n\t\t\treturn container[0];\n\t\t}\n\t\tpublic static T Last (this IList container)\n\t\t{\n\t\t\tif (container.Count == 0) throw new InvalidOperationException(\"The container is empty\");\n\t\t\treturn container[container.Count - 1];\n\t\t}\n\t\tpublic static void RemoveLast (this IList container)\n\t\t{\n\t\t\tif (container.Count == 0) throw new InvalidOperationException(\"The container is empty\");\n\t\t\tcontainer.RemoveAt(container.Count - 1);\n\t\t}\n\t}\n}\n\nnamespace Libraries.Collections\n{\n\tclass PriorityQueue where T : IComparable\n\t{\n\t private List list;\n\t public int Count { get { return list.Count; } }\n\t public readonly bool IsDescending;\n\t\n\t public PriorityQueue(bool isdesc = true)\n\t {\n\t list = new List();\n\t IsDescending = isdesc;\n\t }\n\t\n\t public PriorityQueue(int capacity, bool isdesc = true)\n\t {\n\t list = new List(capacity);\n\t IsDescending = isdesc;\n\t }\n\t\n\t public PriorityQueue(IEnumerable collection, bool isdesc = true)\n\t : this()\n\t {\n\t IsDescending = isdesc;\n\t foreach (var item in collection)\n\t Enqueue(item);\n\t }\n\t\n\t\n\t public void Enqueue(T x)\n\t {\n\t list.Add(x);\n\t int i = Count - 1;\n\t\n\t while (i > 0)\n\t {\n\t int p = (i - 1) / 2;\n\t if ((IsDescending ? -1 : 1) * list[p].CompareTo(x) <= 0) break;\n\t\n\t list[i] = list[p];\n\t i = p;\n\t }\n\t\n\t if (Count > 0) list[i] = x;\n\t }\n\t\n\t public T Dequeue()\n\t {\n\t T target = Peek();\n\t T root = list[Count - 1];\n\t list.RemoveAt(Count - 1);\n\t\n\t int i = 0;\n\t while (i * 2 + 1 < Count)\n\t {\n\t int a = i * 2 + 1;\n\t int b = i * 2 + 2;\n\t int c = b < Count && (IsDescending ? -1 : 1) * list[b].CompareTo(list[a]) < 0 ? b : a;\n\t\n\t if ((IsDescending ? -1 : 1) * list[c].CompareTo(root) >= 0) break;\n\t list[i] = list[c];\n\t i = c;\n\t }\n\t\n\t if (Count > 0) list[i] = root;\n\t return target;\n\t }\n\t\n\t public T Peek()\n\t {\n\t if (Count == 0) throw new InvalidOperationException(\"Queue is empty.\");\n\t return list[0];\n\t }\n\t\n\t public void Clear()\n\t {\n\t list.Clear();\n\t }\n\t}\n internal class DequeUtility\n {\n public static int ClosestPowerOfTwoGreaterThan(int x)\n {\n x--;\n x |= (x >> 1);\n x |= (x >> 2);\n x |= (x >> 4);\n x |= (x >> 8);\n x |= (x >> 16);\n return (x+1);\n }\n\n public static int Count(IEnumerable source)\n {\n if (source == null)\n {\n throw new ArgumentNullException(\"source\");\n }\n\n ICollection genericCollection = source as ICollection;\n if (genericCollection != null)\n {\n return genericCollection.Count;\n }\n\n ICollection nonGenericCollection = source as ICollection;\n if (nonGenericCollection != null)\n {\n return nonGenericCollection.Count;\n }\n\n checked\n {\n int count = 0;\n using (var iterator = source.GetEnumerator())\n {\n while (iterator.MoveNext())\n {\n count++;\n }\n }\n return count;\n }\n }\n }\n\n public class Deque : IList\n {\n private const int defaultCapacity = 16;\n\n private int startOffset;\n\n private T[] buffer;\n\n public Deque() : this(defaultCapacity) { }\n\n public Deque(int capacity)\n {\n if (capacity < 0)\n {\n throw new ArgumentOutOfRangeException(\n \"capacity\", \"capacity is less than 0.\");\n }\n\n this.Capacity = capacity;\n }\n\n public Deque(IEnumerable collection)\n : this(DequeUtility.Count(collection))\n {\n InsertRange(0, collection);\n }\n\n private int capacityClosestPowerOfTwoMinusOne;\n\n public int Capacity\n {\n get\n {\n return buffer.Length;\n }\n\n set\n {\n if (value < 0)\n {\n throw new ArgumentOutOfRangeException(\n \"value\",\n \"Capacity is less than 0.\");\n }\n else if (value < this.Count)\n {\n throw new InvalidOperationException(\n \"Capacity cannot be set to a value less than Count\");\n }\n else if (null != buffer && value == buffer.Length)\n {\n return;\n }\n\n int powOfTwo = DequeUtility.ClosestPowerOfTwoGreaterThan(value);\n\n value = powOfTwo;\n\n T[] newBuffer = new T[value];\n this.CopyTo(newBuffer, 0);\n\n buffer = newBuffer;\n startOffset = 0;\n this.capacityClosestPowerOfTwoMinusOne = powOfTwo - 1;\n }\n }\n\n public bool IsFull\n {\n get { return this.Count == this.Capacity; }\n }\n\n public bool IsEmpty\n {\n get { return 0 == this.Count; }\n }\n\n private void ensureCapacityFor(int numElements)\n {\n if (this.Count + numElements > this.Capacity)\n {\n this.Capacity = this.Count + numElements;\n }\n }\n\n private int toBufferIndex(int index)\n {\n int bufferIndex;\n\n bufferIndex = (index + this.startOffset)\n & this.capacityClosestPowerOfTwoMinusOne;\n\n return bufferIndex;\n }\n\n private void checkIndexOutOfRange(int index)\n {\n if (index >= this.Count)\n {\n throw new IndexOutOfRangeException(\n \"The supplied index is greater than the Count\");\n }\n }\n\n private static void checkArgumentsOutOfRange(\n int length,\n int offset,\n int count)\n {\n if (offset < 0)\n {\n throw new ArgumentOutOfRangeException(\n \"offset\", \"Invalid offset \" + offset);\n }\n\n if (count < 0)\n {\n throw new ArgumentOutOfRangeException(\n \"count\", \"Invalid count \" + count);\n }\n\n if (length - offset < count)\n {\n throw new ArgumentException(\n String.Format(\n \"Invalid offset ({0}) or count + ({1}) \"\n + \"for source length {2}\",\n offset, count, length));\n }\n }\n\n private int shiftStartOffset(int value)\n {\n this.startOffset = toBufferIndex(value);\n\n return this.startOffset;\n }\n\n private int preShiftStartOffset(int value)\n {\n int offset = this.startOffset;\n this.shiftStartOffset(value);\n return offset;\n }\n\n private int postShiftStartOffset(int value)\n {\n return shiftStartOffset(value);\n }\n\n #region IEnumerable\n\n public IEnumerator GetEnumerator()\n {\n if (this.startOffset + this.Count > this.Capacity)\n {\n for (int i = this.startOffset; i < this.Capacity; i++)\n {\n yield return buffer[i];\n }\n\n int endIndex = toBufferIndex(this.Count);\n for (int i = 0; i < endIndex; i++)\n {\n yield return buffer[i];\n }\n }\n else\n {\n int endIndex = this.startOffset + this.Count;\n for (int i = this.startOffset; i < endIndex; i++)\n {\n yield return buffer[i];\n }\n }\n }\n\n IEnumerator IEnumerable.GetEnumerator()\n {\n return this.GetEnumerator();\n }\n #endregion\n\n #region ICollection\n\n bool ICollection.IsReadOnly\n {\n get { return false; }\n }\n\n public int Count\n {\n get;\n private set;\n }\n\n private void incrementCount(int value)\n {\n this.Count = this.Count + value;\n }\n\n private void decrementCount(int value)\n {\n this.Count = Math.Max(this.Count - value, 0);\n }\n\n public void Add(T item)\n {\n AddLast(item);\n }\n\n private void ClearBuffer(int logicalIndex, int length)\n {\n int offset = toBufferIndex(logicalIndex);\n if (offset + length > this.Capacity)\n {\n int len = this.Capacity - offset;\n Array.Clear(this.buffer, offset, len);\n\n len = toBufferIndex(logicalIndex + length);\n Array.Clear(this.buffer, 0, len);\n }\n else\n {\n Array.Clear(this.buffer, offset, length);\n }\n }\n\n public void Clear()\n {\n if (this.Count > 0)\n {\n ClearBuffer(0, this.Count);\n }\n this.Count = 0;\n this.startOffset = 0;\n }\n\n public bool Contains(T item)\n {\n return this.IndexOf(item) != -1;\n }\n\n public void CopyTo(T[] array, int arrayIndex)\n {\n if (null == array)\n {\n throw new ArgumentNullException(\"array\", \"Array is null\");\n }\n\n if (null == this.buffer)\n {\n return;\n }\n\n checkArgumentsOutOfRange(array.Length, arrayIndex, this.Count);\n\n if (0 != this.startOffset\n && this.startOffset + this.Count >= this.Capacity)\n {\n int lengthFromStart = this.Capacity - this.startOffset;\n int lengthFromEnd = this.Count - lengthFromStart;\n\n Array.Copy(\n buffer, this.startOffset, array, 0, lengthFromStart);\n\n Array.Copy(\n buffer, 0, array, lengthFromStart, lengthFromEnd);\n }\n else\n {\n Array.Copy(\n buffer, this.startOffset, array, 0, Count);\n }\n }\n\n public bool Remove(T item)\n {\n bool result = true;\n int index = IndexOf(item);\n\n if (-1 == index)\n {\n result = false;\n }\n else\n {\n RemoveAt(index);\n }\n\n return result;\n }\n\n #endregion\n\n #region List\n\n public T this[int index]\n {\n get\n {\n return this.Get(index);\n }\n\n set\n {\n this.Set(index, value);\n }\n }\n\n public void Insert(int index, T item)\n {\n ensureCapacityFor(1);\n\n if (index == 0)\n {\n AddFirst(item);\n return;\n }\n else if (index == Count)\n {\n AddLast(item);\n return;\n }\n\n InsertRange(index, new[] { item });\n }\n\n public int IndexOf(T item)\n {\n int index = 0;\n foreach (var myItem in this)\n {\n if (myItem.Equals(item))\n {\n break;\n }\n ++index;\n }\n\n if (index == this.Count)\n {\n index = -1;\n }\n\n return index;\n }\n\n public void RemoveAt(int index)\n {\n if (index == 0)\n {\n RemoveFirst();\n return;\n }\n else if (index == Count - 1)\n {\n RemoveLast();\n return;\n }\n\n RemoveRange(index, 1);\n }\n #endregion\n\n public void AddFirst(T item)\n {\n ensureCapacityFor(1);\n buffer[postShiftStartOffset(-1)] = item;\n incrementCount(1);\n }\n\n public void AddLast(T item)\n {\n ensureCapacityFor(1);\n buffer[toBufferIndex(this.Count)] = item;\n incrementCount(1);\n }\n\n public T RemoveFirst()\n {\n if (this.IsEmpty)\n {\n throw new InvalidOperationException(\"The Deque is empty\");\n }\n\n T result = buffer[this.startOffset];\n buffer[preShiftStartOffset(1)] = default(T);\n decrementCount(1);\n return result;\n }\n\n public T RemoveLast()\n {\n if (this.IsEmpty)\n {\n throw new InvalidOperationException(\"The Deque is empty\");\n }\n\n decrementCount(1);\n int endIndex = toBufferIndex(this.Count);\n T result = buffer[endIndex];\n buffer[endIndex] = default(T);\n \n return result;\n }\n\n public void AddRange(IEnumerable collection)\n {\n AddLastRange(collection);\n }\n\n\n public void AddFirstRange(IEnumerable collection)\n {\n AddFirstRange(collection, 0, DequeUtility.Count(collection));\n }\n\n public void AddFirstRange(\n IEnumerable collection,\n int fromIndex,\n int count)\n {\n InsertRange(0, collection, fromIndex, count);\n }\n\n public void AddLastRange(IEnumerable collection)\n {\n AddLastRange(collection, 0, DequeUtility.Count(collection));\n }\n\n public void AddLastRange(\n IEnumerable collection,\n int fromIndex,\n int count)\n {\n InsertRange(this.Count, collection, fromIndex, count);\n }\n\n public void InsertRange(int index, IEnumerable collection)\n {\n int count = DequeUtility.Count(collection);\n this.InsertRange(index, collection, 0, count);\n }\n\n public void InsertRange(\n int index,\n IEnumerable collection,\n int fromIndex,\n int count)\n {\n checkIndexOutOfRange(index - 1);\n\n if (0 == count)\n {\n return;\n }\n\n ensureCapacityFor(count);\n\n if (index < this.Count / 2)\n {\n if (index > 0)\n {\n int copyCount = index;\n int shiftIndex = this.Capacity - count;\n for (int j = 0; j < copyCount; j++)\n {\n buffer[toBufferIndex(shiftIndex + j)] = \n buffer[toBufferIndex(j)];\n }\n }\n\n this.shiftStartOffset(-count);\n\n }\n else\n {\n if (index < this.Count)\n {\n int copyCount = this.Count - index;\n int shiftIndex = index + count;\n for (int j = 0; j < copyCount; j++)\n {\n buffer[toBufferIndex(shiftIndex + j)] = \n buffer[toBufferIndex(index + j)];\n }\n }\n }\n\n int i = index;\n foreach (T item in collection)\n {\n buffer[toBufferIndex(i)] = item;\n ++i;\n }\n\n incrementCount(count);\n }\n\n public void RemoveRange(int index, int count)\n {\n if (this.IsEmpty)\n {\n throw new InvalidOperationException(\"The Deque is empty\");\n }\n if (index > Count - count)\n {\n throw new IndexOutOfRangeException(\n \"The supplied index is greater than the Count\");\n }\n\n ClearBuffer(index, count);\n\n if (index == 0)\n {\n this.shiftStartOffset(count);\n this.Count -= count;\n return;\n }\n else if (index == Count - count)\n {\n this.Count -= count;\n return;\n }\n\n if ((index + (count / 2)) < Count / 2)\n {\n int copyCount = index;\n int writeIndex = count;\n for (int j = 0; j < copyCount; j++)\n {\n buffer[toBufferIndex(writeIndex + j)]\n = buffer[toBufferIndex(j)];\n }\n\n this.shiftStartOffset(count);\n }\n else\n {\n int copyCount = Count - count - index;\n int readIndex = index + count;\n for (int j = 0; j < copyCount; ++j)\n {\n buffer[toBufferIndex(index + j)] =\n buffer[toBufferIndex(readIndex + j)];\n }\n }\n\n decrementCount(count);\n }\n public T Get(int index)\n {\n checkIndexOutOfRange(index);\n return buffer[toBufferIndex(index)];\n }\n\n public void Set(int index, T item)\n {\n checkIndexOutOfRange(index);\n buffer[toBufferIndex(index)] = item;\n }\n\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "7bb0f50c79bd6d776965255cbd6d2e27", "src_uid": "a74adcf0314692f8ac95f54d165d9582", "apr_id": "0f6b0662203e1b1e8d4c79ee21275c1c", "difficulty": 1900, "tags": ["dp", "meet-in-the-middle", "number theory", "greedy", "math", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.69587366276108, "equal_cnt": 16, "replace_cnt": 2, "delete_cnt": 10, "insert_cnt": 3, "fix_ops_cnt": 15, "bug_source_code": "using System;\nusing System.Globalization;\nusing System.IO;\nusing System.Text;\n\nnamespace Queue_on_Bus_Stop\n{\n internal class Program\n {\n private static readonly StreamReader reader =\n new StreamReader(Console.OpenStandardInput(1024 * 10), Encoding.ASCII, false, 1024 * 10);\n\n private static readonly StreamWriter writer =\n new StreamWriter(Console.OpenStandardOutput(1024 * 10), Encoding.ASCII, 1024 * 10);\n\n private static void Main(string[] args)\n {\n int n = int.Parse(reader.ReadLine());\n\n string[] ss = reader.ReadLine().Split(' ');\n int n = int.Parse(ss[0]);\n int k = int.Parse(ss[0]);\n\n\n writer.WriteLine(\"{0}\", (1.1).ToString(\"#.0000000\", CultureInfo.GetCultureInfo(\"en-US\")));\n writer.Flush();\n }\n }\n}", "lang": "MS C#", "bug_code_uid": "757d84d4cdd57589fe98fa742330c7b0", "src_uid": "5c73d6e3770dff034d210cdd572ccf0f", "apr_id": "5c00ebc335209251e02dc258d1d01a85", "difficulty": 1000, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C#"} {"similarity_score": 0.9974715549936789, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "using System;\nusing System.IO;\nusing System.Linq;\n\nnamespace Tournir249\n{\n\tpublic class ProgramA\n\t{\n\n\t\tpublic static void Main(string[] args)\n\t\t{\n\t\t\tnew ProgramA().run();\n\t\t}\n\n\t\tpublic void run()\n\t\t{\n\t\t\tusing (StreamReader input = new StreamReader(\"input.txt\"))\n\t\t\tusing (StreamWriter output = new StreamWriter(\"output.txt\"))\n\t\t\t{\n\t\t\t\tint[] numbers = Console.ReadLine().Split(' ').Select(stringNumber => int.Parse(stringNumber)).ToArray();\n\t\t\t\tint n = numbers[0], m = numbers[1];\n\n\t\t\t\tint[] a = Console.ReadLine().Split(' ').Select(stringNumber => int.Parse(stringNumber)).ToArray();\n\t\t\t\tint k = 0, i = 0, cm = 0;\n\n\t\t\t\twhile (i < n)\n\t\t\t\t{\n\t\t\t\t\twhile (i < n && cm + a[i] <= m)\n\t\t\t\t\t{\n\t\t\t\t\t\tcm += a[i];\n\t\t\t\t\t\ti++;\n\t\t\t\t\t}\n\t\t\t\t\tcm = 0;\n\t\t\t\t\tk++;\n\t\t\t\t}\n\n\t\t\t\tConsole.WriteLine(k);\n\t\t\t}\n\t\t}\n\n\t}\n}", "lang": "MS C#", "bug_code_uid": "88d987f59f4902990522147ee0636f1f", "src_uid": "5c73d6e3770dff034d210cdd572ccf0f", "apr_id": "16a1b053c9977fd3310e49ed9b74fc40", "difficulty": 1000, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.9916762342135477, "equal_cnt": 5, "replace_cnt": 2, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 4, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Globalization;\nusing System.IO;\nusing System.Linq;\nusing System.Text;\n\n// (づ*ω*)づミ★゜・。。・゜゜・。。・゜☆゜・。。・゜゜・。。・゜\npublic class Solver\n{\n public object Solve()\n {\n int n = ReadInt();\n int m = ReadInt();\n var a = ReadIntArray();\n int c = 0;\n int ans = 0;\n while (c < m)\n {\n ans++;\n int x = m;\n while (c < m && a[c] <= x)\n {\n c++;\n x -= a[c];\n }\n }\n\n return ans;\n }\n\n #region Main\n\n protected static TextReader reader;\n protected static TextWriter writer;\n\n static void Main()\n {\n#if DEBUG\n reader = new StreamReader(\"..\\\\..\\\\input.txt\");\n writer = Console.Out;\n //writer = new StreamWriter(\"..\\\\..\\\\output.txt\");\n#else\n reader = Console.In;\n writer = new StreamWriter(Console.OpenStandardOutput());\n#endif\n try\n {\n object result = new Solver().Solve();\n if (result != null)\n writer.WriteLine(result);\n }\n catch (Exception ex)\n {\n#if DEBUG\n Console.WriteLine(ex);\n#else\n throw;\n#endif\n }\n reader.Close();\n writer.Close();\n }\n\n #endregion\n\n #region Read/Write\n\n private static Queue currentLineTokens = new Queue();\n\n private static string[] ReadAndSplitLine()\n {\n return reader.ReadLine().Split(new[] { ' ', '\\t' }, StringSplitOptions.RemoveEmptyEntries);\n }\n\n public static string ReadToken()\n {\n while (currentLineTokens.Count == 0)\n currentLineTokens = new Queue(ReadAndSplitLine());\n return currentLineTokens.Dequeue();\n }\n\n public static int ReadInt()\n {\n return int.Parse(ReadToken());\n }\n\n public static long ReadLong()\n {\n return long.Parse(ReadToken());\n }\n\n public static double ReadDouble()\n {\n return double.Parse(ReadToken(), CultureInfo.InvariantCulture);\n }\n\n public static int[] ReadIntArray()\n {\n return ReadAndSplitLine().Select(int.Parse).ToArray();\n }\n\n public static long[] ReadLongArray()\n {\n return ReadAndSplitLine().Select(long.Parse).ToArray();\n }\n\n public static double[] ReadDoubleArray()\n {\n return ReadAndSplitLine().Select(s => double.Parse(s, CultureInfo.InvariantCulture)).ToArray();\n }\n\n public static int[][] ReadIntMatrix(int numberOfRows)\n {\n int[][] matrix = new int[numberOfRows][];\n for (int i = 0; i < numberOfRows; i++)\n matrix[i] = ReadIntArray();\n return matrix;\n }\n\n public static int[][] ReadAndTransposeIntMatrix(int numberOfRows)\n {\n int[][] matrix = ReadIntMatrix(numberOfRows);\n int[][] ret = new int[matrix[0].Length][];\n for (int i = 0; i < ret.Length; i++)\n {\n ret[i] = new int[numberOfRows];\n for (int j = 0; j < numberOfRows; j++)\n ret[i][j] = matrix[j][i];\n }\n return ret;\n }\n\n public static string[] ReadLines(int quantity)\n {\n string[] lines = new string[quantity];\n for (int i = 0; i < quantity; i++)\n lines[i] = reader.ReadLine().Trim();\n return lines;\n }\n\n public static void WriteArray(IEnumerable array)\n {\n writer.WriteLine(string.Join(\" \", array));\n }\n\n #endregion\n}", "lang": "MS C#", "bug_code_uid": "24f63f27a7681e16577ffa13ea7ed5f7", "src_uid": "5c73d6e3770dff034d210cdd572ccf0f", "apr_id": "c3411bc0d2d82843cf5f80fc9a7980f8", "difficulty": 1000, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9968454258675079, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "using System;\n\nclass abc\n{\n static void Main(String[] args) \n {\n int b = int.Parse(Console.ReadLine().Trim());\n\n int a = 0;\n for (int i = 1; i < n; i++) \n {\n if (b % i == 0) \n {\n a++;\n }\n }\n\n Console.WriteLine(a);\n }\n}", "lang": "Mono C#", "bug_code_uid": "e45b7961507dc54254344ca068854d42", "src_uid": "89f6c1659e5addbf909eddedb785d894", "apr_id": "f1208460223744be0a4e0ea495233ebf", "difficulty": 800, "tags": ["brute force", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.794425087108014, "equal_cnt": 6, "replace_cnt": 2, "delete_cnt": 3, "insert_cnt": 0, "fix_ops_cnt": 5, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.ComponentModel;\nusing System.Linq;\nusing System.Net.Http.Headers;\nusing System.Text;\nusing System.Text.RegularExpressions;\nusing System.Threading.Tasks;\n\nnamespace CodeForces\n{\n class Program\n {\n static void Main(string[] args)\n {\n int employees = Convert.ToInt32(Console.ReadLine());\n int combinations = 0;\n for (int i = 1; i <= Math.Sqrt(employees); i++)\n {\n if (i % employees-i == 0)\n {\n combinations++;\n }\n }\n Console.WriteLine(combinations);\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "723fcc6d2cefeaaf9182c12732bfdc55", "src_uid": "89f6c1659e5addbf909eddedb785d894", "apr_id": "25e158de0fb1c9ac795aeed44b9f4c54", "difficulty": 800, "tags": ["brute force", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C#"} {"similarity_score": 0.9987562189054726, "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.Collections;\nusing System.Linq;\nusing System.Text;\nusing System.IO;\n\n\nnamespace ConsoleApplication1\n{\n class Program\n {\n static int N;\n static long MOD = 1000000009;\n static long bad_ways = 1, all_ways = 1, good_ways;\n\n\n public static void Main()\n {\n N = Convert.ToInt32(Console.ReadLine());\n\n\n for (int i = 1; i <= 3 * N; ++i)\n {\n all_ways *= 3;\n all_ways %= MOD;\n }\n\n for (int i = 1; i <= N; ++i)\n {\n bad_ways *= 7;\n bad_ways %= MOD;\n }\n\n good_ways = (all_ways - bad_ways + MOD) % MOD;\n\n\n Console.WriteLine(good_ways);\n }\n\n\n }\n\n}\n\n", "lang": "Mono C#", "bug_code_uid": "b63d90583ec95cba1bd4a3d0c7f801d8", "src_uid": "eae87ec16c284f324d86b7e65fda093c", "apr_id": "7ae344c4d6f015674e41204d9a3bbcdd", "difficulty": 1500, "tags": ["combinatorics"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.7436685697555263, "equal_cnt": 47, "replace_cnt": 26, "delete_cnt": 8, "insert_cnt": 12, "fix_ops_cnt": 46, "bug_source_code": "using System;\nusing System.Collections.Generic;\n\nnamespace cf78 {\n internal class Program {\n private static void Main(string[] args) {\n string s = Console.ReadLine();\n\n List unique = new List();\n\n Dictionary used = new Dictionary();\n\n for (int a1 = 0; a1 < 6; a1++) {\n used.Add(a1, 0);\n for (int a2 = 0; a2 < 6; a2++) {\n if (used.ContainsKey(a2)) continue;\n used.Add(a2, 0);\n for (int a3 = 0; a3 < 6; a3++) {\n if (used.ContainsKey(a3)) continue;\n used.Add(a3, 0);\n for (int a4 = 0; a4 < 6; a4++) {\n if (used.ContainsKey(a4)) continue;\n used.Add(a4, 0);\n\n for (int a5 = 0; a5 < 6; a5++) {\n if (used.ContainsKey(a5)) continue;\n used.Add(a5, 0);\n\n for (int a6 = 0; a6 < 6; a6++) {\n if (used.ContainsKey(a6))\n continue;\n Cube cube = new Cube(a1, a2, a3, a4, a5, a6);\n if (IsNew(unique, cube)) unique.Add(cube);\n }\n used.Remove(a5);\n }\n used.Remove(a4);\n }\n used.Remove(a3);\n }\n used.Remove(a2);\n }\n used.Remove(a1);\n }\n int result = 0;\n Dictionary cc = new Dictionary();\n Dictionary ccc = new Dictionary();\n foreach (Cube cube in unique) {\n string t = cube.GetPosition(s);\n if (!cc.ContainsKey(t) && !ccc.ContainsKey(t)) {\n cc.Add(t, 0);\n AddCCC(cube, ccc, s);\n result++;\n }\n }\n Console.WriteLine(result);\n }\n\n private static void AddCCC(Cube cube, Dictionary ccc, string s) {\n List newCubes = GetAll(cube);\n foreach (Cube newCube in newCubes) {\n string t = newCube.GetPosition(s);\n if (!ccc.ContainsKey(t)) ccc.Add(t, 0);\n }\n }\n\n private static List GetAll(Cube cube) {\n List newCubes = new List();\n newCubes.Add(cube);\n newCubes.Add(cube.RotateLeft());\n newCubes.Add(cube.RotateLeft().RotateLeft());\n newCubes.Add(cube.RotateLeft().RotateLeft().RotateLeft());\n int count = newCubes.Count;\n for (int i = 0; i < count; i++) {\n newCubes.Add(newCubes[i].RotateBottom());\n newCubes.Add(newCubes[i].RotateBottom().RotateBottom());\n newCubes.Add(newCubes[i].RotateBottom().RotateBottom().RotateBottom());\n }\n return newCubes;\n }\n\n private static bool IsNew(List cubes, Cube cube) {\n List newCubes = GetAll(cube);\n for (int i = 0; i < newCubes.Count; i++) {\n foreach (Cube oldCube in cubes) {\n if (oldCube.Equals(newCubes[i])) return false;\n }\n }\n return true;\n }\n }\n\n internal class Cube {\n private int _back;\n private int _bottom;\n private int _front;\n private int _left;\n private int _right;\n private int _top;\n\n public Cube(int left, int front, int right, int back, int top, int bottom) {\n _back = back;\n _bottom = bottom;\n _front = front;\n _left = left;\n _right = right;\n _top = top;\n }\n\n public Cube() {\n _left = 0;\n _front = 1;\n _right = 2;\n _back = 3;\n _top = 4;\n _bottom = 5;\n }\n\n public int Back {\n get { return _back; }\n }\n\n public int Bottom {\n get { return _bottom; }\n }\n\n public int Front {\n get { return _front; }\n }\n\n public int Left {\n get { return _left; }\n }\n\n public int Right {\n get { return _right; }\n }\n\n public int Top {\n get { return _top; }\n }\n\n public override string ToString() {\n return _left.ToString() + _front + _right + _back + _top + _bottom;\n }\n\n public Cube RotateLeft() {\n Cube cube = new Cube();\n cube._left = _front;\n cube._front = _right;\n cube._right = _back;\n cube._back = _left;\n\n cube._top = _top;\n cube._bottom = _bottom;\n return cube;\n }\n\n public Cube RotateBottom() {\n Cube cube = new Cube();\n cube._left = _left;\n cube._right = _right;\n\n cube._front = _top;\n cube._bottom = _front;\n cube._top = _back;\n cube._back = _bottom;\n return cube;\n }\n\n public bool Equals(Cube cube) {\n if (_left != cube._left) return false;\n if (_front != cube._front)\n return false;\n if (_right != cube._right) return false;\n if (_back != cube._back)\n return false;\n if (_top != cube._top)\n return false;\n if (_bottom != cube._bottom)\n return false;\n return true;\n }\n\n public string GetPosition(string s) {\n return s[_left].ToString() + s[_front] + s[_right] + s[_back] + s[_top]\n + s[_bottom];\n }\n }\n}", "lang": "Mono C#", "bug_code_uid": "de92345c3a6ee3c6a436ddbac7919276", "src_uid": "8176c709c774fa87ca0e45a5a502a409", "apr_id": "81404d1bc8f3099e37ed9e711214abc8", "difficulty": 1700, "tags": ["brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.27965392129500416, "equal_cnt": 20, "replace_cnt": 10, "delete_cnt": 3, "insert_cnt": 6, "fix_ops_cnt": 19, "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 long[] ab = Console.ReadLine().Split().Select(long.Parse).ToArray();\n\n long a = ab[0];\n long b = ab[1];\n\n long A = a + b;\n\n List factors = new List();\n\n for (int i = 1; i <= A; i++)\n {\n if (A % i == 0)\n {\n factors.Add(i);\n }\n }\n\n long l = factors[factors.Count()/2];\n long w = A / l;\n\n long P = ((2 * A * l) + (2 * A * w)) / A;\n\n Console.WriteLine(P);\n\n Console.Read();\n }\n }\n}", "lang": "Mono C#", "bug_code_uid": "f66d9ef65299a967b20f23c3b418c7b6", "src_uid": "7d0c5f77bca792b6ab4fd4088fe18ff1", "apr_id": "80b72b25881e0792552fda9dba42390a", "difficulty": 2000, "tags": ["math", "brute force", "number theory", "binary search"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9702127659574468, "equal_cnt": 21, "replace_cnt": 1, "delete_cnt": 20, "insert_cnt": 0, "fix_ops_cnt": 21, "bug_source_code": "using System;\n\nnamespace CF1029F \n{\n\tclass Program \n\t{\n\t\tstatic void Main(string[] args) \n\t\t{\n\t\t\twhile(true) {\n\t\t\t\tstring[] div = Console.ReadLine().Split(' ');\n\t\t\t\tInt64 a = Convert.ToInt64(div[0]), b = Convert.ToInt64(div[1]), _min = Int64.MaxValue;\n\t\t\t\tInt64 tot = a + b, siz = (Int64)Math.Sqrt(tot) + 1, len = a;\n\n\t\t\t\tfor(int i = 1;i < siz;i++) {\n\t\t\t\t\tif(a % i == 0) \n\t\t\t\t\t\tlen = a / i;\n\t\t\t\t\tif(tot % i == 0 && tot / i >= len)\n\t\t\t\t\t\t_min = Math.Min(_min, ((tot / i + i) << 1));\n\t\t\t\t}\n\t\t\t\tlen = b;\n\t\t\t\tfor(int i = 1;i < siz;i++) {\n\t\t\t\t\tif(b % i == 0)\n\t\t\t\t\t\tlen = b / i;\n\n\t\t\t\t\tif(tot % i == 0 && tot / i >= len)\n\t\t\t\t\t\t_min = Math.Min(_min, ((tot / i + i) << 1));\n\t\t\t\t}\n\n\t\t\t\tConsole.WriteLine(_min.ToString());\n\t\t\t}\n\t\t}\n\t}\n}", "lang": "Mono C#", "bug_code_uid": "a7f327ea4888561268e946e3041c5e5c", "src_uid": "7d0c5f77bca792b6ab4fd4088fe18ff1", "apr_id": "aab085003411e67e59746a383e9da80d", "difficulty": 2000, "tags": ["math", "brute force", "number theory", "binary search"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C#"} {"similarity_score": 0.9743051914001049, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "using System;\nusing System.IO;\nnamespace C_\n{\n class Program\n {\n static void Main(string[] args)\n\n {\n\n\n //int [] arr = new int [4];\n String s = Console.ReadLine();\n \n int frist = 0;\n int count = 0;\n char x;\n int num = 0, path=0;\n for (int i = 0; i < s.Length; i++)\n for (x = 'a'; x <= 'z'; x++)\n {\n if(s[x]==x)\n {\n num = x - 97;\n path = Math.Abs(frist - num);\n\n if (path < 13)\n {\n count += path;\n }\n else\n {\n count += 26 - path;\n }\n frist = num;\n }\n }\n Console.WriteLine(count);\n\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "2ec83739d83a692985f480a3975b324c", "src_uid": "ecc890b3bdb9456441a2a265c60722dd", "apr_id": "4cfa6e3b4ef945696a3f4bb388073a16", "difficulty": 800, "tags": ["strings", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.33026315789473687, "equal_cnt": 19, "replace_cnt": 11, "delete_cnt": 5, "insert_cnt": 4, "fix_ops_cnt": 20, "bug_source_code": " static void Main(string[] args)\n {\n int sum = 0;\n int[] segmant = { 6, 2, 5, 5, 4, 5, 6, 3, 7, 6, 8, 4, 7, 7, 6, 7 };\n Console.WriteLine(\"Enter from number: \");\n int a = int.Parse(Console.ReadLine());\n\n Console.WriteLine(\"Enter to number: \");\n int b = int.Parse(Console.ReadLine());\n\n for (int i = a; i < segmant.Length; i++)\n {\n sum = sum + segmant[i];\n if (i == b)\n {\n break;\n }\n }\n\n Console.WriteLine(\"The total is: \" + sum);\n Console.ReadKey();\n }", "lang": "Mono C#", "bug_code_uid": "fa2d6c310849cac89d47650d1ab91097", "src_uid": "1193de6f80a9feee8522a404d16425b9", "apr_id": "58b1eec72063bffecf8cc8c53da99a4d", "difficulty": 1000, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.5443349753694581, "equal_cnt": 18, "replace_cnt": 10, "delete_cnt": 6, "insert_cnt": 2, "fix_ops_cnt": 18, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace ConsoleApplication3\n{\n class Program\n {\n static void Main(string[] args)\n {\n int sum = 0;\n int[] segmant = { 6, 2, 5, 5, 4, 5, 6, 3, 7, 6, 8, 4, 7, 7, 6, 7 };\n \n int a = int.Parse(Console.ReadLine());\n\n \n int b = int.Parse(Console.ReadLine());\n\n for (int i = a; i < segmant.Length; i++)\n {\n sum = sum + segmant[i];\n if (i == b)\n {\n break;\n }\n }\n\n Console.WriteLine(\"The total is: \" + sum);\n Console.ReadKey();\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "d1bff53bd6d06dd75385c29bbb03ee55", "src_uid": "1193de6f80a9feee8522a404d16425b9", "apr_id": "58b1eec72063bffecf8cc8c53da99a4d", "difficulty": 1000, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.4775444264943457, "equal_cnt": 29, "replace_cnt": 21, "delete_cnt": 5, "insert_cnt": 4, "fix_ops_cnt": 30, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading;\nusing System.Threading.Tasks;\n\nnamespace ConsoleApp3\n{\n class Program\n {\n static void Main(string[] args)\n {\n\n //int zero = 6;\n //int nine = 6;\n //int six = 6;\n\n //int two = 5;\n //int three = 5;\n //int five = 5;\n\n //int one = 2;\n //int four = 4;\n //int seven = 3;\n //int eight = 7;\n\n int a = int.Parse(Console.ReadLine());\n int b = int.Parse(Console.ReadLine());\n\n int sum = 0;\n for (int i = a; i <= b; i++)\n {\n string temp = i + \"\";\n for (int j = 0; j < temp.Length; j++)\n {\n if (temp.ElementAt(j) == '0' || temp.ElementAt(j) == '6' || temp.ElementAt(j) == '9')\n {\n sum += 6;\n }\n else if (temp.ElementAt(j) == '2' || temp.ElementAt(j) == '3'|| temp.ElementAt(j) == '5')\n {\n sum += 5;\n }\n else if (temp.ElementAt(j) == '1')\n {\n sum += 2;\n }\n else if (temp.ElementAt(j) == '4')\n {\n sum += 4;\n }\n else if (temp.ElementAt(j) == '7')\n {\n sum += 3;\n }\n else \n {\n sum += 7;\n }\n }\n }\n\n Console.WriteLine(sum);\n Console.Read();\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "b5d2fc7e56ff0dc179d25b04e4e6cabb", "src_uid": "1193de6f80a9feee8522a404d16425b9", "apr_id": "bc5425a40fb4d2a91f17ca2d61a7a595", "difficulty": 1000, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.5685106382978723, "equal_cnt": 16, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 15, "fix_ops_cnt": 17, "bug_source_code": "string[] input = Console.ReadLine().Split(' ');\nint n = Convert.ToInt32( input [ 0 ] );\nint a = Convert.ToInt32( input [ 1 ] );\nint result = 1;\n\nif ( a == 1 || a == n )\n result = 1;\nelse\n{\n if ( a % 2 == 0 )\n {\n result += ( n - a ) / 2;\n }\n else\n {\n result += ( a - 1 ) / 2;\n }\n}\n\nConsole.WriteLine( result );", "lang": "Mono C#", "bug_code_uid": "7c35d447479538fc95a7d063684fc229", "src_uid": "aa62dcdc47d0abbba7956284c1561de8", "apr_id": "0ca23278539f488e54f72f6929b4e1e5", "difficulty": 1100, "tags": ["math", "constructive algorithms"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.10784313725490197, "equal_cnt": 14, "replace_cnt": 12, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 14, "bug_source_code": "using System;\n\nnamespace DistanceTask\n{\n\tpublic static class DistanceTask\n\t{\n\t\t// Расстояние от точки (x, y) до отрезка AB с координатами A(ax, ay), B(bx, by)\n\t\tpublic static double GetDistanceToSegment(double ax, double ay, double bx, double by, double x, double y)\n\t\t{\n double perpendicular = Math.Abs((by - ay) * x - (bx - ax) * y + bx * ay - by * ax) \n / Math.Sqrt((by - ay) * (by - ay) + (bx - ax) * (bx - ax));\n double lenXA = Math.Sqrt((x - ax) * (x - ax) + (y - ay) * (y - ay));\n double lenXB = Math.Sqrt((x - bx) * (x - bx) + (y - by) * (y - by));\n double lenAB = Math.Sqrt((ax - bx) * (ax - bx) + (ay - by) * (ay - by));\n\n if (ax == bx && ay == by)\n return lenXA;\n else if (lenXA * lenXA > lenXB * lenXB + lenAB * lenAB || lenXB * lenXB > lenXA * lenXA + lenAB * lenAB)\n return Math.Min(lenXA, lenXB);\n else\n return perpendicular;\n }\n\t}\n}", "lang": "Mono C#", "bug_code_uid": "0e442c6cde97aa3a8eb9cf3271805828", "src_uid": "aa62dcdc47d0abbba7956284c1561de8", "apr_id": "c4c8702175f4d1632b7630b9caa49ce9", "difficulty": 1100, "tags": ["math", "constructive algorithms"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.5232833464877664, "equal_cnt": 12, "replace_cnt": 9, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 11, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace asdf {\n class Program {\n static void Main(string[] args) {\n int[] input = Array.ConvertAll(Console.ReadLine().Split(), int.Parse);\n int n = input[0], m = input[1], min = input[2], max = input[3];\n\n if(n-m >= 2) {\n Console.WriteLine(\"Correct\");\n return;\n }\n\n bool minFlag = false, maxFlag = false;\n int[] mArray = new int[m];\n for(int i = 0; i < m; i++) {\n mArray[i] = int.Parse(Console.ReadLine());\n if(mArray[i] == min) {\n minFlag = true;\n }\n if(mArray[i] == max) {\n maxFlag = true;\n }\n }\n\n if(minFlag && maxFlag) {\n Console.WriteLine(\"Correct\");\n return;\n }\n else if(n-m > 0 && (minFlag || maxFlag)) {\n Console.WriteLine(\"Correct\");\n }\n else {\n Console.WriteLine(\"Incorrect\");\n }\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "b7348d78902a4a76f18ed14125850484", "src_uid": "99f9cdc85010bd89434f39b78f15b65e", "apr_id": "f097c9fb5f53ddc8d7d6d2d502efc04d", "difficulty": 1200, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.022727272727272728, "equal_cnt": 15, "replace_cnt": 13, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 15, "bug_source_code": "\nMicrosoft Visual Studio Solution File, Format Version 12.00\n# Visual Studio Version 16\nVisualStudioVersion = 16.0.29424.173\nMinimumVisualStudioVersion = 10.0.40219.1\nProject(\"{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}\") = \"ConsoleApp1\", \"ConsoleApp1\\ConsoleApp1.csproj\", \"{9471B2F7-4CA7-4D0D-BD91-D59F4A992C02}\"\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{9471B2F7-4CA7-4D0D-BD91-D59F4A992C02}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{9471B2F7-4CA7-4D0D-BD91-D59F4A992C02}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{9471B2F7-4CA7-4D0D-BD91-D59F4A992C02}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{9471B2F7-4CA7-4D0D-BD91-D59F4A992C02}.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 = {B94F39A0-E050-4998-9EA8-B4F7B36A08DC}\n\tEndGlobalSection\nEndGlobal\n", "lang": "Mono C#", "bug_code_uid": "018edc1002bfdf617b65b365070c662a", "src_uid": "8330d9fea8d50a79741507b878da0a75", "apr_id": "2e97bfa0dc62f7013c894b14ccc3ded2", "difficulty": 1100, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.8825121819166215, "equal_cnt": 10, "replace_cnt": 4, "delete_cnt": 0, "insert_cnt": 5, "fix_ops_cnt": 9, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace kdivisor\n{\n class Program\n {\n static void Main(string[] args)\n {\n string[] s = Console.ReadLine().Split();\n \n long n = long.Parse(s[0]);\n long k = long.Parse(s[1]);\n\n long lim =(long) (n/2);\n\n long ans = -1;\n int count = 0;\n\n for (long i=1;i<=lim;i++)\n {\n if (n%i==0)\n {\n count++;\n if (count==k)\n {\n ans = i;\n break;\n }\n }\n }\n\n if (count + 1 == k) ans = n;\n\n Console.Write(ans);\n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "8045f7fbaf13fa520379d2141c86be50", "src_uid": "6ba39b428a2d47b7d199879185797ffb", "apr_id": "cccbb40a2a31a81e2097cf388ee5f30b", "difficulty": 1400, "tags": ["math", "number theory"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.614329268292683, "equal_cnt": 4, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 3, "bug_source_code": "using System;\n\nnamespace CodeForces5\n{\n\tclass Program\n\t{\n\t\tstatic void Main(string[] args)\n\t\t{\n\t\t\tstring[] Data = Console.ReadLine().Split(' ');\n\t\t\tlong[] data = Array.ConvertAll(Data, x => long.Parse(x));\n\t\t\tlong count = 0, result = 0;\n\t\t\tfor (long i = 1; i <= data[0]; i++)\n\t\t\t\tif (data[0] % i == 0)\n\t\t\t\t\tif (++count == data[1])\n\t\t\t\t\t{\n\t\t\t\t\t\tresult = i;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t} \n\t\t\tConsole.WriteLine(data[1] == count ? result : -1);\n\t\t}\n\t}\n}\n", "lang": "MS C#", "bug_code_uid": "64b94e85558a1f4b628bef95b5003054", "src_uid": "6ba39b428a2d47b7d199879185797ffb", "apr_id": "16a27d295e6a579ecc7521e0b637438e", "difficulty": 1400, "tags": ["math", "number theory"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.02531645569620253, "equal_cnt": 19, "replace_cnt": 17, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 19, "bug_source_code": "\nMicrosoft Visual Studio Solution File, Format Version 11.00\n# Visual Studio 2010\nProject(\"{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}\") = \"ааа\", \"ааа\\ааа.csproj\", \"{39F427EA-74BD-4CC2-B84E-670FC4E9D7E3}\"\nEndProject\nGlobal\n\tGlobalSection(SolutionConfigurationPlatforms) = preSolution\n\t\tDebug|x86 = Debug|x86\n\t\tRelease|x86 = Release|x86\n\tEndGlobalSection\n\tGlobalSection(ProjectConfigurationPlatforms) = postSolution\n\t\t{39F427EA-74BD-4CC2-B84E-670FC4E9D7E3}.Debug|x86.ActiveCfg = Debug|x86\n\t\t{39F427EA-74BD-4CC2-B84E-670FC4E9D7E3}.Debug|x86.Build.0 = Debug|x86\n\t\t{39F427EA-74BD-4CC2-B84E-670FC4E9D7E3}.Release|x86.ActiveCfg = Release|x86\n\t\t{39F427EA-74BD-4CC2-B84E-670FC4E9D7E3}.Release|x86.Build.0 = Release|x86\n\tEndGlobalSection\n\tGlobalSection(SolutionProperties) = preSolution\n\t\tHideSolutionNode = FALSE\n\tEndGlobalSection\nEndGlobal\n", "lang": "MS C#", "bug_code_uid": "f4d6587c8ae4a6d72adf6d84580f6fe4", "src_uid": "6ba39b428a2d47b7d199879185797ffb", "apr_id": "fd2e6d9c2317699b699f0defb2c951df", "difficulty": 1400, "tags": ["math", "number theory"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.027797576621525304, "equal_cnt": 20, "replace_cnt": 16, "delete_cnt": 0, "insert_cnt": 4, "fix_ops_cnt": 20, "bug_source_code": "class ThueMorseGame\n{\n\tpublic string get(int n, int m)\n\t{\n\t\tvar isAlice = true;\n\t\tif (m == 1) {\n\t\t\treturn \"Bob\";\n\t\t}\n\t\tvar minus = m % 2 == 0 ? m : m - 1;\n\t\twhile (true) {\n\t\t\tif (n <= m) {\n\t\t\t\tif (isAlice) {\n\t\t\t\t\treturn \"Alice\";\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\treturn \"Bob\";\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (n == 3) {\n\t\t\t\tif (m >= 3) {\n\t\t\t\t\tif (isAlice) {\n\t\t\t\t\t\treturn \"Alice\";\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\treturn \"Bob\";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tif (isAlice) {\n\t\t\t\t\t\treturn \"Bob\";\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\treturn \"Alice\";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (isAlice) {\n\t\t\t\tisAlice = false;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tisAlice = true;\n\t\t\t}\n\n\t\t\tn -= minus;\n\t\t}\n\t}\n}", "lang": "MS C#", "bug_code_uid": "e891f8e07b9f0872bc8f54eee42cfc37", "src_uid": "6ba39b428a2d47b7d199879185797ffb", "apr_id": "5a2682395d5626e73bb2213eadfb5c7a", "difficulty": 1400, "tags": ["math", "number theory"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.5954346770276834, "equal_cnt": 17, "replace_cnt": 13, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 16, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace A_kth_divisor\n{\n class Program\n {\n static void Main(string[] args)\n {\n string[] input = Console.ReadLine().Split(' ');\n long n = long.Parse(input[0]);\n long k = long.Parse(input[1]);\n\n //int sqrt = (int)Math.Sqrt(n);\n int counter = 0;\n for (int i = 1; i <= n; i++)\n {\n if (n % i == 0)\n {\n counter++;\n if (counter == k) { Console.WriteLine(i); break; }\n }\n else if (counter > k) { Console.WriteLine(\"-1\"); break; }\n\n }\n\n if (counter < k) Console.WriteLine(\"-1\");\n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "536cafa8ea31a86d196d31d8d0141a9a", "src_uid": "6ba39b428a2d47b7d199879185797ffb", "apr_id": "89c899cb85ddf192d344ee8a65506983", "difficulty": 1400, "tags": ["math", "number theory"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9930091185410335, "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;\n\n\nnamespace k_divisor\n{\n class Program\n {\n static long max = 31622780;\n static long[] primes = new long[max];\n static List facts = new List();\n static List factoring = new List();\n static List divisors = new List();\n static void Cieve()\n {\n for (long i = 4; i < max; i += 2) primes[i] = 2;\n for (long i = 3; i * i < max; i += 2)\n if (primes[i] == -1)\n for (long j = i * i; j < max; j += 2 * i)\n primes[j] = i;\n }\n\n static void prime_fact(long n)\n {\n for (long i = 2; i < max; i++)\n {\n if (primes[i] == -1 && n % i == 0)\n facts.Add(i);\n }\n }\n\n static void factorization(long n)\n {\n long aux = n; \n for (int i = 0; i < facts.Count; i++)\n {\n int c = 0;\n long v = facts[i];\n while (aux % v == 0)\n {\n c++;\n aux /= v;\n }\n factoring.Add(v); factoring.Add(c);\n }\n if(aux > 1){\n factoring.Add(aux);\n factoring.Add(1);\n }\n }\n\n static void Divisors(long n)\n {\n for (int i = 0; i < factoring.Count; i += 2)\n {\n int c = 0;\n long v = factoring[i];\n for (int k = 1; k <= factoring[i+1]; k++)\n {\n long x = (long)Math.Pow(v, k);\n if (x < n)\n {\n divisors.Add(x);\n c++;\n }\n else\n break;\n }\n int t = divisors.Count;\n for(int j = t-c; j < t; j++)\n for(int s = 0; s < t-c; s++){\n long aux = divisors[j]*divisors[s];\n if(aux < n)\n divisors.Add(aux);\n } \n }\n divisors.Add(n);\n divisors.Insert(0, 1);\n divisors.Sort();\n }\n static void Main(string[] args)\n {\n string s = Console.ReadLine(); \n char []sep= new char[]{' '};\n string[] ns = s.Split(sep,2);\n long n = long.Parse(ns[0]);\n long k = long.Parse(ns[1]); \n if (n == 1)\n {\n if(k == 1)\n Console.WriteLine(1);\n else\n Console.WriteLine(-1);\n return;\n }\n for (long i = 2; i < max; i++)\n {\n primes[i] = -1;\n }\n Cieve();\n prime_fact(n);\n factorization(n);\n Divisors(n);\n if (k > divisors.Count)\n {\n Console.WriteLine(-1);\n return;\n }\n int t = (int)k;\n Console.WriteLine(divisors[t-1]);\n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "1c4cc9dab4dc34909def8c0f76ab91b3", "src_uid": "6ba39b428a2d47b7d199879185797ffb", "apr_id": "94dff775adc069281ab8fe6172f3cb50", "difficulty": 1400, "tags": ["math", "number theory"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.662481892805408, "equal_cnt": 34, "replace_cnt": 19, "delete_cnt": 8, "insert_cnt": 6, "fix_ops_cnt": 33, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace _41a\n{\n \n class Program\n {\n static void Main(string[] args)\n {\n string[] s = Console.ReadLine().Split();\n long n = long.Parse(s[0]);\n int k = int.Parse(s[1]);\n List raan =new List();\n long c=1;\n \n for (int i = 1; i <= n; i++)\n {\n if (n % c == 0)\n {\n raan.Add(c);\n c++;\n }\n else\n {\n c++;\n continue;\n }\n }\n \n \n if (raan.Count < k)\n {\n Console.WriteLine(-1);\n }\n else\n {\n Console.WriteLine(raan[k-1]);\n }\n \n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "5c60e2b1a5a7cb8b4bb50d2b1b34c9ef", "src_uid": "6ba39b428a2d47b7d199879185797ffb", "apr_id": "72c49f9cddedaabe24ff6c69fc1434f8", "difficulty": 1400, "tags": ["math", "number theory"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.46404895461499235, "equal_cnt": 12, "replace_cnt": 8, "delete_cnt": 3, "insert_cnt": 1, "fix_ops_cnt": 12, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\n\nnamespace _2609cry\n{\n class Program\n {\n static void Main(string[] args)\n {\n String [] str = Console.ReadLine().Split();\n Int64 n = Convert.ToInt64(str[0]);\n Int64 m = Convert.ToInt64(str[1]);\n\n Int64 count = 1; \n bool flag = false; Int64 n1 = n;\n if (count == m)\n {\n flag = true;\n Console.WriteLine(1);\n\n }\n else\n {\n for (int i = 2; i < n1; i++)\n {\n if(n1 % i == 0)\n {\n count++;\n if (count == m)\n {\n flag = true;\n Console.WriteLine(i);\n break;\n }\n }\n }\n\n if (count + 1 == m) { Console.WriteLine(n1); flag = true; }\n }\n\n if(flag==false) Console.WriteLine(-1);\n\n }\n }\n}", "lang": "MS C#", "bug_code_uid": "f6557ac6c72d26dda869c5cb0d115486", "src_uid": "6ba39b428a2d47b7d199879185797ffb", "apr_id": "a08f011d6c9e9685ca2e62479ffb145c", "difficulty": 1400, "tags": ["math", "number theory"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9984536082474227, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\nusing System.Runtime.InteropServices;\nusing System.Text;\n\nnamespace codeforces\n{\n\tclass Program\n\t{\n\t\tpublic const int Osn = 1000000007;\n\n\t\tpublic class Pair\n\t\t{\n\t\t\tpublic long First;\n\n\t\t\tpublic long Second;\n\t\t}\n\n\t\tpublic class PairComparer : IComparer\n\t\t{\n\t\t\tpublic int Compare(Pair x, Pair y)\n\t\t\t{\n\t\t\t\tif (x.First < y.First || (x.First == y.First && x.Second > y.Second))\n\t\t\t\t\treturn -1;\n\t\t\t\treturn 1;\n\t\t\t}\n\t\t}\n\n\t\tpublic static long GetGcd(long a, long b)\n\t\t{\n\t\t\twhile (true)\n\t\t\t{\n\t\t\t\tif (b == 0)\n\t\t\t\t\treturn a;\n\t\t\t\tvar a1 = a;\n\t\t\t\ta = b;\n\t\t\t\tb = a1 % b;\n\n\t\t\t}\n\t\t}\n\n\t\tpublic static void WriteYesNo(bool x, string yes = \"YES\", string no = \"NO\")\n\t\t{\n\t\t\tif (x)\n\t\t\t\tConsole.WriteLine(yes);\n\t\t\telse\n\t\t\t{\n\t\t\t\tConsole.WriteLine(no);\n\t\t\t}\n\t\t}\n\n\t\tpublic static string ReadString()\n\t\t{\n\t\t\treturn Console.ReadLine();\n\t\t}\n\n\t\tpublic static List ReadListOfInts()\n\t\t{\n\t\t\tvar s = Console.ReadLine();\n\t\t\treturn s.Split(' ').Select(int.Parse).ToList();\n\t\t}\n\n\t\tpublic static List ReadListOfLongs()\n\t\t{\n\t\t\tvar s = Console.ReadLine();\n\t\t\treturn s.Split(' ').Select(long.Parse).ToList();\n\t\t}\n\n\t\tpublic static int ReadInt()\n\t\t{\n\t\t\tvar s = Console.ReadLine();\n\t\t\treturn int.Parse(s);\n\t\t}\n\n\t\tpublic static long ReadLong()\n\t\t{\n\t\t\tvar s = Console.ReadLine();\n\t\t\treturn long.Parse(s);\n\t\t}\n\n\t\tpublic class Vertex\n\t\t{\n\t\t\tpublic int Was;\n\n\t\t\tpublic List Edges;\n\t\t}\n\n\t\tpublic static List Graph = new List();\n\n\n\t\tpublic static bool Dfs(int u)\n\t\t{\n\t\t\tif (Graph[u].Was == 1) return true;\n\t\t\tif (Graph[u].Was == 2) return false;\n\t\t\tGraph[u].Was = 1;\n\t\t\tforeach (var t in Graph[u].Edges)\n\t\t\t{\n\t\t\t\tif (Dfs(t)) return true;\n\t\t\t}\n\n\t\t\tGraph[u].Was = 2;\n\t\t\treturn false;\n\t\t}\n\n\t\tpublic static bool IsPrime(long x)\n\t\t{\n\t\t\tfor (var j = 2; j * j <= x; ++j)\n\t\t\t\tif (x % j == 0)\n\t\t\t\t\treturn false;\n\t\t\treturn true;\n\t\t}\n\n\t\tpublic class LinkedVertex\n\t\t{\n\t\t\tpublic int Next;\n\n\t\t\tpublic int Prev;\n\n\t\t\tpublic int Value;\n\t\t}\n\n\n\t\tpublic static int BinarySearch(List list, int value)\n\t\t{\n\t\t\tvar l = -1;\n\t\t\tvar r = list.Count;\n\t\t\twhile (r - l > 1)\n\t\t\t{\n\t\t\t\tvar m = (r + l) / 2;\n\t\t\t\tif (list[m] >= value)\n\t\t\t\t\tr = m;\n\t\t\t\telse\n\t\t\t\t\tl = m;\n\t\t\t}\n\n\t\t\treturn r;\n\t\t}\n\n\t\tpublic static Dictionary mp = new Dictionary(); \n\t\tpublic static long Go(long u, long v, long w)\n\t\t{\n\t\t\tlong ans = 0; \n\t\t\twhile (u != v)\n\t\t\t\tif (u > v)\n\t\t\t\t{\n\t\t\t\t\tif (!mp.ContainsKey(u))\n\t\t\t\t\t\tmp.Add(u, 0);\n\t\t\t\t\tans += mp[u];\n\t\t\t\t\tmp[u] += w;\n\t\t\t\t\tu /= 2;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tif (!mp.ContainsKey(v))\n\t\t\t\t\t\tmp.Add(v, 0);\n\t\t\t\t\tans += mp[v];\n\t\t\t\t\tmp[v] += w;\n\t\t\t\t\tv /= 2;\n\t\t\t\t} \n\t\t\treturn ans;\n\t\t}\n\n\t\tpublic static int GetAns(int x, int pow)\n\t\t{\n\t\t\tif (pow == 0)\n\t\t\t\treturn 1;\n\t\t\tif (pow % 2 == 1)\n\t\t\t\treturn (GetAns(x, pow - 1) * 8) % 10;\n\t\t\tvar t = GetAns(x, pow / 2);\n\t\t\treturn (t * t) % 10;\n\t\t}\n\n\t\tpublic static int ans = 0;\n\t\tpublic static int move = 0;\n\t\tpublic static bool good = false; \n\t\tpublic static int[] x = { 0, 0, 0 };\n\n\t\tpublic static void solve(int a, int b, int c, int n)\n\t\t{\n\t\t\tif (ans != 0)\n\t\t\t\treturn;\n\t\t\tif (n > 0)\n\t\t\t{\n\t\t\t\tsolve(a, c, b, n - 1);\n\t\t\t\tmove++;\n\t\t\t\tx[a]--;\n\t\t\t\tx[b]++;\n\t\t\t\tif (x[a] == x[b] && x[b] == x[c] && ans == 0)\n\t\t\t\t{\n\t\t\t\t\tans = move;\n\t\t\t\t}\n\t\t\t\tsolve(c, b, a, n - 1);\n\t\t\t}\n\t\t}\n\n\t\tprivate static void Main()\n\t\t{\n/*\t\t\tvar input = new StreamReader(\"input.txt\");\n\t\t\tvar output = new StreamWriter(\"output.txt\");*/\n\t\t\tvar l = ReadListOfLongs();\n\t\t\tvar n = l[0];\n\t\t\tvar k = l[1];\n\t\t\tvar dividers = new List();\n\t\t\tfor (var i = 1; i * i <= n; ++i)\n\t\t\t{\n\t\t\t\tif (n % i == 0)\n\t\t\t\t{\n\t\t\t\t\tdividers.Add(i);\n\t\t\t\t\tif (i * i != n)\n\t\t\t\t\t\tdividers.Add(n / i);\n\t\t\t\t}\n\t\t\t}\n\t\t\tdividers.Sort();\n\t\t\tif (dividers.Count < k)\n\t\t\t\tConsole.WriteLine(-1);\n\t\t\telse\n\t\t\t{\n\t\t\t\tConsole.WriteLine(dividers[(int)k - 1]);\n\t\t\t}\n\t\t\tConsole.ReadLine();\n\t\t\t/*\t\t\tinput.Close();\n\t\t\toutput.Close();*/\n\t\t}\n\t}\n}\n", "lang": "MS C#", "bug_code_uid": "9b43a71074a469a4b96f4f7152e66216", "src_uid": "6ba39b428a2d47b7d199879185797ffb", "apr_id": "1e6aa1135000ffbe332c2b20d165e53b", "difficulty": 1400, "tags": ["math", "number theory"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.9475890985324947, "equal_cnt": 4, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "using System;\n\nnamespace CF3\n{\n class Program\n {\n public static int SmallDiv(int n)\n {\n int div = 1;\n for (int i = 2; i <= n/2; i++)\n if (n % i == 0)\n {\n div = i;\n break;\n }\n\n return (div == 1) ? n : div;\n }\n\n static void Main(string[] args)\n {\n int n = int.Parse(Console.ReadLine());\n int k = int.Parse(Console.ReadLine());\n string s = \"\";\n int div;\n\n for (int i = 0; i < k; i++)\n {\n div = SmallDiv(n);\n if(i < k - 1 && div == n)\n {\n s = \"-1\";\n break;\n }\n s += (i != k - 1) ? div : n;\n s += \" \";\n n /= div;\n }\n Console.WriteLine(s);\n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "cb8506b60f79ce003379980f75050aed", "src_uid": "bd0bc809d52e0a17da07ccfd450a4d79", "apr_id": "61f4d7d38e68c56748ff9c6135280a27", "difficulty": 1100, "tags": ["number theory", "math", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9954058192955589, "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.Text;\n\nnamespace ConsoleApplication1\n{\n class Program\n {\n static void Main(string[] args)\n {\n int[] A = new int[30];\n int pr = 1, j = 2, sz = 1;\n string[] a = Console.ReadLine().Split(' ');\n int n = int.Parse(a[0]);\n int k = int.Parse(a[1]);\n \n for (int i = 1; i < k; i++) {\n\n while (n % j != 0) {\n j++;\n }\n n /= j;\n A[sz++] = j;\n }\n\n if (n > 1)\n {\n A[sz++] = n;\n for (int i = 1; i < sz; i++)\n {\n Console.Write(A[i]);\n Console.Write(' ');\n }\n }\n else\n {\n Console.Write(-1);\n }\n\n //Console.ReadKey();\n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "315655be5f379bd03b8dab373143cf47", "src_uid": "bd0bc809d52e0a17da07ccfd450a4d79", "apr_id": "1a4bad9b279995d990a56106f37cb2b7", "difficulty": 1100, "tags": ["number theory", "math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.900748454279206, "equal_cnt": 11, "replace_cnt": 5, "delete_cnt": 2, "insert_cnt": 3, "fix_ops_cnt": 10, "bug_source_code": "using System;\nusing System.IO;\nusing System.Linq;\nusing System.Collections;\nusing System.Collections.Generic;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Text;\nusing System.Text.RegularExpressions;\nusing System.Threading.Tasks;\nusing System.Runtime.InteropServices;\nusing System.Runtime.CompilerServices;\nusing static System.Math;\n\n\nclass P\n{\n static void Main()\n {\n long[] nb = Console.ReadLine().Split().Select(long.Parse).ToArray();\n //えっと、つまり素因数分解して約数の数を数えればOK\n var factors = Factors(nb[1]);\n long res = int.MaxValue;\n foreach (var factor in factors.GroupBy(x => x))\n {\n var current = factor.Key;\n long count = 0;\n while (nb[0] >= current)\n {\n count += nb[0] / current;\n current *= factor.Key;\n }\n res = Min(res, count / factor.Count());\n }\n Console.WriteLine(res);\n }\n\n\n static long[] Factors(long n)\n {\n long i = 3;\n List res = new List();\n if(n % 2 == 0)\n {\n res.Add(2);\n n /= 2;\n }\n double ub = Sqrt(n);\n while (i <= ub + 1)\n {\n if (n % i == 0)\n {\n res.Add(i);\n n /= i;\n }\n else\n {\n i += 2;\n }\n }\n if (n != 1) res.Add(n);\n return res.ToArray();\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "ff0b02bf38cd8543fa8e8742654ff339", "src_uid": "491748694c1a53771be69c212a5e0e25", "apr_id": "584379f806e642167130aaf983a6ac99", "difficulty": 1700, "tags": ["number theory", "math", "brute force", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9146735617323852, "equal_cnt": 9, "replace_cnt": 6, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 8, "bug_source_code": "using System;\nusing System.IO;\nusing System.Linq;\nusing System.Collections;\nusing System.Collections.Generic;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Text;\nusing System.Text.RegularExpressions;\nusing System.Threading.Tasks;\nusing System.Runtime.InteropServices;\nusing System.Runtime.CompilerServices;\nusing static System.Math;\n\n\nclass P\n{\n static void Main()\n {\n long[] nb = Console.ReadLine().Split().Select(long.Parse).ToArray();\n //えっと、つまり素因数分解して約数の数を数えればOK\n var factors = Factors(nb[1]);\n long res = long.MaxValue;\n foreach (var factor in factors.GroupBy(x => x))\n {\n var current = factor.Key;\n long count = 0;\n while (nb[0] >= current)\n {\n count += nb[0] / current;\n if (current <= 1e8) current *= factor.Key;\n }\n res = Min(res, count / factor.Count());\n }\n Console.WriteLine(res);\n }\n\n\n static long[] Factors(long n)\n {\n List res = new List();\n if(n % 2 == 0)\n {\n res.Add(2);\n n /= 2;\n }\n long i = 3;\n double ub = Sqrt(n);\n while (i <= ub + 1)\n {\n if (n % i == 0)\n {\n res.Add(i);\n n /= i;\n }\n else\n {\n i += 2;\n }\n }\n if (n != 1) res.Add(n);\n return res.ToArray();\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "68ce4bb71d60da3187fdb74e83967a45", "src_uid": "491748694c1a53771be69c212a5e0e25", "apr_id": "584379f806e642167130aaf983a6ac99", "difficulty": 1700, "tags": ["number theory", "math", "brute force", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.35736040609137054, "equal_cnt": 14, "replace_cnt": 8, "delete_cnt": 4, "insert_cnt": 2, "fix_ops_cnt": 14, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\n\nnamespace Algorithms\n{\n class Program\n {\n static void Main(string[] args)\n {\n var nAndv = Console.ReadLine().Split();\n var n = int.Parse(nAndv[0]);\n var v = int.Parse(nAndv[1]);\n var result = SashasTrip(n, v);\n\n\t\t\tConsole.WriteLine(result);\n \n }\n\n private static int SashasTrip(int numberOfCities, int tankCapacity)\n {\n if (numberOfCities - 1 == tankCapacity)\n return tankCapacity;\n\n int totalAmount = 0;\n int cityIndex = 2;\n\n totalAmount += tankCapacity;\n\n while (numberOfCities - 1 != tankCapacity)\n {\n totalAmount += cityIndex;\n\n numberOfCities--;\n cityIndex++;\n }\n\n return totalAmount;\n }\n if (numberOfCities - 1 == tankCapacity)\n return tankCapacity;\n\n var totalLitresNeeded = numberOfCities - 1;\n\n int totalAmount = 0;\n\n int cityIndex = 1;\n while (totalLitresNeeded != 0)\n {\n if (totalLitresNeeded > tankCapacity)\n {\n totalLitresNeeded -= tankCapacity;\n totalAmount += cityIndex * tankCapacity;\n }\n else if (tankCapacity > totalLitresNeeded)\n {\n totalAmount += cityIndex * totalLitresNeeded;\n totalLitresNeeded = 0;\n }\n else\n {\n totalAmount += cityIndex * tankCapacity;\n totalLitresNeeded = 0;\n }\n\n cityIndex++;\n }\n\n return totalAmount;\n }\n }\n}", "lang": "Mono C#", "bug_code_uid": "24b1ec4b84175682f018192390d3912d", "src_uid": "f8eb96deeb82d9f011f13d7dac1e1ab7", "apr_id": "cfa5b0bd97a47ebfe5961f5c99241942", "difficulty": 900, "tags": ["dp", "math", "greedy"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9606373008434864, "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;\n\nnamespace Algorithms\n{\n class Program\n {\n \n static void Main(string[] args)\n {\n var nAndv = Console.ReadLine().Split();\n var n = int.Parse(nAndv[0]);\n var v = int.Parse(nAndv[1]);\n var result = SashasTrip(n, v);\n\n Console.WriteLine(result);\n }\n\n private static int SashasTrip(int numberOfCities, int tankCapacity)\n {\n if (numberOfCities - 1 == tankCapacity)\n return tankCapacity;\n\n if (tankCapacity > numberOfCities)\n return --numberOfCities;\n\n int totalAmount = 0;\n int cityIndex = 2;\n\n totalAmount += tankCapacity;\n numberOfCities--;\n\n while (numberOfCities-- != tankCapacity)\n {\n totalAmount += cityIndex;\n\n cityIndex++;\n }\n\n return totalAmount;\n }\n \n\t\t\n\t\t\n\t\t\n }\n}", "lang": "Mono C#", "bug_code_uid": "2fac74f47ddb4136c3906d6e98e2205b", "src_uid": "f8eb96deeb82d9f011f13d7dac1e1ab7", "apr_id": "cfa5b0bd97a47ebfe5961f5c99241942", "difficulty": 900, "tags": ["dp", "math", "greedy"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.661049902786779, "equal_cnt": 15, "replace_cnt": 7, "delete_cnt": 3, "insert_cnt": 5, "fix_ops_cnt": 15, "bug_source_code": "using System;\nnamespace BasicProgramming\n{\n class Program\n {\n static void Main(string[] args)\n {\n\n int n = int.Parse(Console.ReadLine());\n int v = int.Parse(Console.ReadLine());\n int i=0,litter,lastCity,mNo;\n litter = n - 1;\n lastCity = v - 1;\n mNo = litter - lastCity;\n if (litter == v)\n {\n i = v;\n Console.WriteLine(i);\n }\n else if (litter > v)\n {\n i = 1;\n for (int m = 2; m <= mNo; m++)\n {\n i += m;\n }\n i += lastCity;\n Console.WriteLine(i);\n }\n \n }\n }\n}", "lang": "Mono C#", "bug_code_uid": "b6e0c4250d7fcc2f894b66d5a9acca02", "src_uid": "f8eb96deeb82d9f011f13d7dac1e1ab7", "apr_id": "5c921ac7521c916726a7e1673e4c832c", "difficulty": 900, "tags": ["dp", "math", "greedy"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.8502879078694817, "equal_cnt": 7, "replace_cnt": 4, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 6, "bug_source_code": "using System;\n\nnamespace A131\n{\n class Program\n {\n static void Main(string[] args)\n {\n string input = Console.ReadLine();\n bool mayus = true;\n\n foreach (char letter in input.Substring(1))\n {\n if (char.IsUpper(letter))\n mayus = false;\n }\n\n Console.WriteLine(mayus ? (char.ToUpper(input[0]) + input.Substring(1)) : input;\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "6176dd7ad2ec2663ca0f78010cdcde3b", "src_uid": "db0eb44d8cd8f293da407ba3adee10cf", "apr_id": "ccf7f49a65b599cdfafd6254aa17e80c", "difficulty": 1000, "tags": ["strings", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9152308752584425, "equal_cnt": 13, "replace_cnt": 8, "delete_cnt": 2, "insert_cnt": 2, "fix_ops_cnt": 12, "bug_source_code": "using System;\nusing System.Collections.Generic;\n\nclass Program\n{\n public static void Main(string[] args)\n {\n string[] input=Console.ReadLine().Split();\n int a=int.Parse(input[0]);\n int b=int.Parse(input[1]);\n XORSumW(a,b);\n Console.ReadLine();\n }\n \n private static List split(int a)\n {\n List ret=new List();\n while(a>0)\n {\n ret.Add(a%3);\n a/=3;\n }\n return ret;\n }\n \n private static int padW(List a, List b)\n {\n if(a.Count>b.Count)\n {\n int diff=a.Count-b.Count;\n for(int i=0;i c=new List();\n for(int i=0;i adig=split(a);\n int i;\n for(i=0;padW(adig,split(i))!=b;i++);\n Console.WriteLine(i);\n }\n}", "lang": "Mono C#", "bug_code_uid": "05d46133e932828690292bbadb75da5c", "src_uid": "5fb635d52ddccf6a4d5103805da02a88", "apr_id": "7d911373ff16004e36d76e1e242b79cc", "difficulty": 1100, "tags": ["math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9943360604153556, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "using System;\nusing System.Text.RegularExpressions;\n\nclass Program\n{\n static void Main(string[] args)\n {\n int n = int.Parse(Console.ReadLine());\n string num = Console.ReadLine();\n int result = 0;\n int test = 0;\n foreach (Match m in Regex.Matches(num, \"8\"))\n result++;\n if ( n >= 11)\n {\n int buf = 0;\n for (int i = 0; i < result; i++)\n {\n if (buf + 11 <= n)\n {\n test++;\n buf += 11;\n }\n else\n break;\n }\n\n } \n else\n test = 0;\n \n Console.WriteLine(test);", "lang": "Mono C#", "bug_code_uid": "60233bd06dc8833d308bd47117555af1", "src_uid": "259d01b81bef5536b969247ff2c2d776", "apr_id": "f8594db7d277c8e27d4463166c643ab5", "difficulty": 800, "tags": ["brute force"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.988422097254383, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "using ConsoleProject;\nusing System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\nusing System.Text;\n\nnamespace EhWasByDetstvoVspomnit\n{\n\n class Program\n {\n private static int[] ReadIntArray => Console.ReadLine().Split(' ').Select(int.Parse).ToArray();\n private static long[] ReadLongArray => Console.ReadLine().Split(' ').Select(long.Parse).ToArray();\n private static char[] ReadCharArray => Console.ReadLine().Split(' ').Select(char.Parse).ToArray();\n private static string[] ReadStringArray => Console.ReadLine().Split(' ').Select(str => str).ToArray();\n private static int ReadInt => int.Parse(Console.ReadLine());\n private static long ReadLong => long.Parse(Console.ReadLine());\n private static string ReadString => Console.ReadLine();\n struct Point\n {\n public string s;\n public int i;\n public Point(int i, string s)\n {\n this.i = i;\n this.s = s;\n }\n }\n static void Main()\n {\n Console.ReadLine();\n string str = Console.ReadLine();\n\n\n int length = str.Length;\n\n int l = str.Where(a => a == '8').Count();\n\n int ans = 0;\n while (length >= 11 && l > 0)\n {\n ans++;\n length -= 11;\n l--;\n }\n\n Console.WriteLine(ans);\n\n Console.ReadLine();\n }\n \n }\n}", "lang": "Mono C#", "bug_code_uid": "cc3675a5de30d18dea072ebb5a640bfd", "src_uid": "259d01b81bef5536b969247ff2c2d776", "apr_id": "1022967e23aa8c503f76525504ee25dd", "difficulty": 800, "tags": ["brute force"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9995320542817033, "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 ConsoleApp16\n{\n class Program\n {\n static void Main(string[] args)\n {\n int n = int.Parse(Console.ReadLine());\n\n int[] mas = new int[n];\n for(int i = 0;i<3;i++)\n {\n mas[i] = int.Parse(Console.ReadLine());\n }\n\n n--;\n int distance = 0;\n int curent = 0;\n while(n>0)\n {\n if(curent==0)\n {\n if (mas[0] > mas[1])\n {\n curent = 1;\n distance += mas[1];\n n--;\n continue;\n }\n else\n {\n curent = 2;\n distance += mas[0];\n n--;\n continue;\n }\n }\n\n if (curent == 1)\n {\n if (mas[1] > mas[2])\n {\n curent = 2;\n distance += mas[2];\n n--;\n continue;\n }\n else\n {\n curent = 0;\n distance += mas[1];\n n--;\n continue;\n }\n }\n\n if (curent == 2)\n {\n if (mas[0] > mas[2])\n {\n curent = 1;\n distance += mas[2];\n n--;\n continue;\n }\n else\n {\n curent = 0;\n distance += mas[0];\n n--;\n continue;\n }\n }\n }\n\n Console.WriteLine(distance);\n\n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "d3fc3e0c736c4f34b3e7e505e4f0c112", "src_uid": "6058529f0144c853e9e17ed7c661fc50", "apr_id": "eb10f8b29965fc4cad76a41578b0409a", "difficulty": 900, "tags": ["math"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.49343339587242024, "equal_cnt": 20, "replace_cnt": 5, "delete_cnt": 1, "insert_cnt": 14, "fix_ops_cnt": 20, "bug_source_code": "using system;\nclass program\n{\n static void Main(string[] args)\n {\n string s = Console.ReadLine();\n if (s.Count() % 2 ==0)\n Console.WriteLine(\"CHAT WITH HER\");\n else\n Console.WriteLine(\"IGNORE HIM\");\n }\n}", "lang": "Mono C#", "bug_code_uid": "5bc883bc096e52a8ecab1f0cf713ecf2", "src_uid": "a8c14667b94b40da087501fd4bdd7818", "apr_id": "9e25976cd8324d0bb5357e9b5d1992c2", "difficulty": 800, "tags": ["strings", "brute force", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.7081038552321007, "equal_cnt": 14, "replace_cnt": 3, "delete_cnt": 5, "insert_cnt": 5, "fix_ops_cnt": 13, "bug_source_code": "using System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\n\nnamespace Kerling\n{\n class Program\n {\n static void Main(string[] args)\n {\n A_Card();\n }\n\n static void A_Card()\n {\n string cards = Console.ReadLine();\n char[] glas = {'a', 'e', 'i', 'o', 'u','0','2','4','6','8'}; \n \n int count = 0;\n foreach (char c in cards)\n {\n foreach(char g in glas){\n if (c == g) count++;\n }\n }\n\n Console.Write(count.ToString());\n Console.WriteLine();\n }\n\n }\n}", "lang": "MS C#", "bug_code_uid": "654119ce5c7fe7c3993f891659cba534", "src_uid": "b4af2b8a7e9844bf58ad3410c2cb5223", "apr_id": "470a4ecb575727e939dedb38e2cf1a38", "difficulty": 800, "tags": ["brute force", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C#"} {"similarity_score": 0.8422391857506362, "equal_cnt": 6, "replace_cnt": 3, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 5, "bug_source_code": "using System;\nusing System.Linq;\n\nnamespace Новый_год_и_количество_карт\n{\n class Program\n {\n static void Main(string[] args)\n {\n char[] searchTarget = new char[] { 'a', 'e', 'i', 'o', 'u','y' };\n int flipNumber = Console.ReadLine().Where(x => searchTarget.Contains(x)).ToArray().Length;\n Console.WriteLine(flipNumber);\n\n Main(null);\n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "0d49a9266983db2ac01166cb2aa2fd71", "src_uid": "b4af2b8a7e9844bf58ad3410c2cb5223", "apr_id": "9cb1ebeba8529edfdd03741011472fbc", "difficulty": 800, "tags": ["brute force", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9906444906444907, "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 void Main()\n {\n string[] input = Console.ReadLine().Split();\n\n int result = int.Parse(input[0]);\n int time = int.Parse(input[1]);\n int cost1 = int.Parse(input[2]);\n int cost2 = int.Parse(input[3]);\n int lose1 = int.Parse(input[4]);\n int lose2 = int.Parse(input[5]);\n\n bool answer = false;\n\n for (int time1 = 0; time1 < time && !answer; time1++)\n {\n int points1 = cost1 - time1 * lose1;\n if (points1 == result)\n answer = true;\n\n for (int time2 = 0; time2 < time && !answer; time2++)\n {\n int points2 = cost2 - time2 * lose2;\n if (points2 == result || points1 + points2 == result)\n answer = true;\n }\n }\n\n if (answer)\n Console.WriteLine(\"YES\");\n else\n Console.WriteLine(\"NO\");\n }\n}", "lang": "Mono C#", "bug_code_uid": "687dd04ee98a2bd69ebac4309a632364", "src_uid": "f98168cdd72369303b82b5a7ac45c3af", "apr_id": "7d46560f139f8488dd5266a1a0381071", "difficulty": 1200, "tags": ["brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.01615798922800718, "equal_cnt": 10, "replace_cnt": 9, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 10, "bug_source_code": "\n\n \n \n Debug\n AnyCPU\n {CA6A81DF-7A9D-4F45-B787-3949DAC10116}\n Exe\n Properties\n Codeforces128div2\n Codeforces128div2\n v4.5\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": "00669304ba4ba2514a7cbf6417582dfa", "src_uid": "f98168cdd72369303b82b5a7ac45c3af", "apr_id": "3ef93b88a405ac2e6a597e4b1be9fcf1", "difficulty": 1200, "tags": ["brute force", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.7554395126196692, "equal_cnt": 11, "replace_cnt": 2, "delete_cnt": 2, "insert_cnt": 6, "fix_ops_cnt": 10, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\n\nnamespace Test\n{\n class Program\n {\n static void Main(string[] args)\n {\n int n = int.Parse(Console.ReadLine());\n int res = 0;\n for (int i = 1; i <= n; i++)\n for (int j = i; j <= n; j++)\n for (int k = j; k <= n; k++)\n if (Math.Pow(i, 2) + Math.Pow(j, 2) == Math.Pow(k, 2)) res++;\n Console.Write(res.ToString());\n }\n }\n}", "lang": "Mono C#", "bug_code_uid": "f44b051fd2563038d83e852d950933b9", "src_uid": "36a211f7814e77339eb81dc132e115e1", "apr_id": "f548737f34bf3d8f292e9eb1ef4517aa", "difficulty": 1200, "tags": ["math", "brute force"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.9696391063586023, "equal_cnt": 12, "replace_cnt": 5, "delete_cnt": 2, "insert_cnt": 4, "fix_ops_cnt": 11, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Globalization;\nusing System.Linq;\n\nnamespace ConsoleApplication30\n{\n internal class Program\n {\n private static void Main(string[] args)\n {\n int n = ReadInt();\n int counter = 0;\n// int n = (int)Math.Ceiling(Math.Sqrt(t));\n for (int a = 1; a <= n; a++)\n {\n for (int b = a; b <= n; b++)\n {\n for (int c = b; c <= n; c++)\n {\n if (a*a + b*b == c*c)\n {\n counter++;\n } \n }\n }\n }\n Console.WriteLine(counter);\n }\n\n #region Reader\n\n private static string Read()\n {\n return Console.ReadLine();\n }\n\n private static void Read(out int n1, out int n2)\n {\n string[] input = ReadArray();\n n1 = int.Parse(input[0]);\n n2 = int.Parse(input[1]);\n }\n\n private static void Read(out int n1, out int n2, out int n3)\n {\n string[] input = ReadArray();\n n1 = int.Parse(input[0]);\n n2 = int.Parse(input[1]);\n n3 = int.Parse(input[2]);\n }\n\n private static void Read(out int n1, out int n2, out int n3, out int n4)\n {\n string[] input = ReadArray();\n n1 = int.Parse(input[0]);\n n2 = int.Parse(input[1]);\n n3 = int.Parse(input[2]);\n n4 = int.Parse(input[3]);\n }\n\n private static void Read(out T a1, out T a2)\n {\n string[] input = ReadArray();\n a1 = (T) Convert.ChangeType(input[0], typeof (T));\n a2 = (T) Convert.ChangeType(input[1], typeof (T));\n }\n\n private static void Read(out T a1, out T a2, out T a3)\n {\n string[] input = ReadArray();\n a1 = (T) Convert.ChangeType(input[0], typeof (T));\n a2 = (T) Convert.ChangeType(input[1], typeof (T));\n a3 = (T) Convert.ChangeType(input[2], typeof (T));\n }\n\n private static void Read(out T a1, out T a2, out T a3, out T a4)\n {\n string[] input = ReadArray();\n a1 = (T) Convert.ChangeType(input[0], typeof (T));\n a2 = (T) Convert.ChangeType(input[1], typeof (T));\n a3 = (T) Convert.ChangeType(input[2], typeof (T));\n a4 = (T) Convert.ChangeType(input[3], typeof (T));\n }\n\n private static int ReadInt()\n {\n return Int32.Parse(Read());\n }\n\n private static long ReadLong()\n {\n return long.Parse(Read());\n }\n\n private static double ReadDouble()\n {\n return double.Parse(Read(), CultureInfo.InvariantCulture);\n }\n\n private static T Read()\n {\n return (T) Convert.ChangeType(Read(), typeof (T));\n }\n\n private static string[] ReadArray()\n {\n string readLine = Console.ReadLine();\n if (readLine != null)\n return readLine.Split(' ');\n\n throw new ArgumentException();\n }\n\n private static List ReadIntArray()\n {\n return ReadArray().Select(Int32.Parse).ToList();\n }\n\n private static List ReadLongArray()\n {\n return ReadArray().Select(long.Parse).ToList();\n }\n\n private static List ReadDoubleArray()\n {\n return ReadArray().Select(d => double.Parse(d, CultureInfo.InvariantCulture)).ToList();\n }\n\n private static List ReadArray()\n {\n return ReadArray().Select(x => (T) Convert.ChangeType(x, typeof (T))).ToList();\n }\n\n private static void WriteLine(int value)\n {\n Console.WriteLine(value);\n }\n\n private static void WriteLine(double value)\n {\n Console.WriteLine(value.ToString(CultureInfo.InvariantCulture));\n }\n\n private static void WriteLine(long value)\n {\n Console.WriteLine(value);\n }\n\n private static void WriteLine(double value, string stringFormat)\n {\n Console.WriteLine(value.ToString(stringFormat, CultureInfo.InvariantCulture));\n }\n\n private static void WriteLine(T value)\n {\n Console.WriteLine(value);\n }\n\n private static void Write(int value)\n {\n Console.Write(value);\n }\n\n private static void Write(double value)\n {\n Console.Write(value.ToString(CultureInfo.InvariantCulture));\n }\n\n private static void Write(long value)\n {\n Console.Write(value);\n }\n\n private static void Write(double value, string stringFormat)\n {\n Console.Write(value.ToString(stringFormat, CultureInfo.InvariantCulture));\n }\n\n private static void Write(T value)\n {\n Console.Write(value);\n }\n\n #endregion\n }\n}", "lang": "Mono C#", "bug_code_uid": "5f647b4ef0195588f3a6a99afe20aacd", "src_uid": "36a211f7814e77339eb81dc132e115e1", "apr_id": "4141b8f7012a6c79c8147556f8296a5b", "difficulty": 1200, "tags": ["math", "brute force"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.6856269113149847, "equal_cnt": 10, "replace_cnt": 5, "delete_cnt": 3, "insert_cnt": 1, "fix_ops_cnt": 9, "bug_source_code": "using System;\nusing System.Collections;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\nusing System.Text;\n\nnamespace CodeForces\n{\n class A\n {\n public void Run()\n {\n int n = int.Parse(Console.ReadLine());\n //int[] m = Console.ReadLine().Split(' ').Select(a => int.Parse(a)).ToArray();\n //string str = Console.ReadLine();\n\n double a = 1, b = 1, c = 1;\n int res = 0;\n\n for (int i = 1; i <= n; i++)\n {\n for (int j = i; j <= n; j++)\n {\n for (int k = j; k <= n; k++)\n {\n if (Math.Sqrt(Math.Pow(i, 2) + Math.Pow(j, 2)) == k)\n res++; \n } \n }\n\n }\n\n Console.Write(res);\n }\n }\n class B\n { \n public void Run()\n { \n int[] str = Console.ReadLine().Split(':').Select(a => int.Parse(a)).ToArray();\n int[] str2 = Console.ReadLine().Split(':').Select(a => int.Parse(a)).ToArray();\n\n DateTime d1 = new DateTime(str[0], str[1], str[2]);\n DateTime d2 = new DateTime(str2[0], str2[1], str2[2]);\n\n TimeSpan ts = d2 - d1;\n\n Console.WriteLine(Math.Abs(ts.Days));\n }\n }\n\n class Programm\n {\n static void Main(string[] args)\n {\n A a = new A();\n a.Run(); \n }\n }\n}", "lang": "Mono C#", "bug_code_uid": "5d67f7e64ea41d4599210c91ccd96f96", "src_uid": "36a211f7814e77339eb81dc132e115e1", "apr_id": "1f99baa6d59f9462855e355aa533a37f", "difficulty": 1200, "tags": ["math", "brute force"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.7980676328502415, "equal_cnt": 15, "replace_cnt": 7, "delete_cnt": 2, "insert_cnt": 5, "fix_ops_cnt": 14, "bug_source_code": "using System;\nublic class Program\n {\n public static void Main(string[] args)\n {\n string[] input = Console.In.ReadToEnd().Split(new char[] { '\\n', '\\r' }, StringSplitOptions.RemoveEmptyEntries);\n double k = double.Parse(input[0]);\n double l = Math.Log(double.Parse(input[1]), k);\n if (l == Math.Truncate(l)) { Console.WriteLine(\"YES\"); Console.WriteLine((l - 1D)); }\n else Console.WriteLine(\"NO\");\n }\n }", "lang": "MS C#", "bug_code_uid": "567783e56f4db20f4239ef182ad5d34d", "src_uid": "8ce89b754aa4080e7c3b2c3b10f4be46", "apr_id": "6326955348d1db473e99a4de9ba19d32", "difficulty": 1000, "tags": ["math"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9886363636363636, "equal_cnt": 5, "replace_cnt": 4, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 4, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace ConsoleApplication1\n{\n public class Program\n {\n public static void Main()\n {\n int exponential, end_num, power = 0;\n bool found = false;\n \n int original = Convert.ToInt32(Console.ReadLine());\n end_num = Convert.ToInt32(Console.ReadLine());\n\n exponential = original;\n while (exponential <= end_num)\n {\n if (exponential == end_num)\n {\n found = true;\n break;\n }\n exponential *= original;\n ++power;\n }\n\n if (found)\n {\n Console.WriteLine(\"YES\");\n Console.WriteLine(power);\n }\n else\n Console.WriteLine(\"NO\");\n }\n }\n}", "lang": "MS C#", "bug_code_uid": "7e73512fedc9021b6049be3ec244ea79", "src_uid": "8ce89b754aa4080e7c3b2c3b10f4be46", "apr_id": "cb46dbf59eeb0d33c018a74836ca0f7a", "difficulty": 1000, "tags": ["math"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9690265486725663, "equal_cnt": 4, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "using System;\nclass Program\n{\n static void Main()\n {\n var k = int.Parse(Console.ReadLine());\n var l = int.Parse(Console.ReadLine());\n var p = 0;\n while (k < l)\n {\n k *= k;\n p++;\n }\n if (k == l)\n {\n Console.WriteLine(\"YES\");\n Console.WriteLine(p);\n }\n else\n {\n Console.WriteLine(\"NO\");\n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "da782f97929424f3d4b8067453f3d60e", "src_uid": "8ce89b754aa4080e7c3b2c3b10f4be46", "apr_id": "add813ba0af305a6fff3c09f47b955b8", "difficulty": 1000, "tags": ["math"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.5594125500667557, "equal_cnt": 10, "replace_cnt": 5, "delete_cnt": 3, "insert_cnt": 2, "fix_ops_cnt": 10, "bug_source_code": "using System;\n\nnamespace AllProblems\n{\n class Program\n {\n static void Main(string[] args)\n {\n _114A_Cifera.Run();\n\n }\n }\n class _114A_Cifera\n {\n public static void Run()\n {\n var n = uint.Parse(Console.ReadLine().Trim());\n var m = uint.Parse(Console.ReadLine().Trim());\n var p = n;\n\n if (p == m)\n {\n Console.WriteLine(\"YES\\n0\");\n return;\n }\n\n uint ctr = 0;\n while (p < m)\n {\n p *= n;\n ++ctr;\n if (p != m) continue;\n Console.WriteLine(\"YES\\n\" + ctr);\n Console.ReadLine();\n return; ;\n }\n\n Console.WriteLine(\"NO\");\n Console.ReadLine();\n }\n }\n}", "lang": "MS C#", "bug_code_uid": "c1df5da6d75ec6ee171cccc2e1c63393", "src_uid": "8ce89b754aa4080e7c3b2c3b10f4be46", "apr_id": "cf154c757769e9876a31340257edd6ed", "difficulty": 1000, "tags": ["math"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.7624309392265194, "equal_cnt": 12, "replace_cnt": 6, "delete_cnt": 2, "insert_cnt": 3, "fix_ops_cnt": 11, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Collections;\nusing System.Text.RegularExpressions;\nusing System.Collections.Specialized;\n\n\nnamespace a2oj\n{\n class Program\n {\n static void Main(string[] args)\n {\n string s = Console.ReadLine();\n string[] str = s.Split(' ');\n long n, m;\n n = long.Parse(str[0]);\n m = long.Parse(str[1]);\n\n long[] teams = new long[m];\n long t = n / m;\n long remain = n % m;\n for (int i = 0; i < m; i++)\n {\n teams[i] = t;\n if(remain>0)\n {\n teams[i]++; \n remain--;\n }\n }\n long min = 0, max = (n - (m - 1)) * (n - (m - 1)-1)/2;\n\n for (int i = 0; i < m; i++)\n {\n min += teams[i] * (teams[i] - 1) / 2;\n }\n\n Console.WriteLine(min + \" \" + max);\n \n //Console.ReadLine();\n\n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "96dbbbd51a9b58fa2fe9edb16438e7be", "src_uid": "a081d400a5ce22899b91df38ba98eecc", "apr_id": "a9cd6e9b4cd14c816e788939fcfc3813", "difficulty": 1300, "tags": ["math", "combinatorics", "greedy", "constructive algorithms"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.7509578544061303, "equal_cnt": 11, "replace_cnt": 5, "delete_cnt": 1, "insert_cnt": 4, "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 CodeForces\n{ \n class B\n {\n static void Main(string[] args)\n {\n long n = long.Parse(Console.ReadLine());\n long k = long.Parse(Console.ReadLine());\n \n long A = long.Parse(Console.ReadLine());\n long B = long.Parse(Console.ReadLine());\n \n long X = n;\n \n long ans = 0;\n \n while(X>1){\n if(X%k!=0){\n ans += A;\n X--;\n }else{\n long val = X/k;\n if((X-val)*A>B){\n ans += B;\n X /= k;\n }else{\n ans += A;\n X--;\n }\n }\n }\n \n Console.WriteLine(ans);\n }\n }\n}\n \n\n", "lang": "Mono C#", "bug_code_uid": "79eb334c5c8f1423847f421239604834", "src_uid": "f838fae7c98bf51cfa0b9bd158650b10", "apr_id": "daa499b58e95fac654e3623cc30b74b4", "difficulty": 1400, "tags": ["dp", "greedy"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.8652312599681021, "equal_cnt": 46, "replace_cnt": 9, "delete_cnt": 1, "insert_cnt": 36, "fix_ops_cnt": 46, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace ConsoleApplication2\n{\n class Program\n {\n\n static void Main(string[] args)\n {\n long n = Convert.ToInt64(Console.ReadLine()), k = Convert.ToInt64(Console.ReadLine()), a = Convert.ToInt64(Console.ReadLine()), b = Convert.ToInt64(Console.ReadLine());\n long ans = 0;\n while ( n!=1)\n {\n if ( n%k!=0 && n/k!=0)\n {\n ans+= n % k * a;n -= n % k;\n }\n else if ( n= n)\n {\n Console.WriteLine(i*2 - 1);\n return;\n }\n else\n {\n Console.WriteLine(i*2);\n return;\n }\n }\n }\n}", "lang": "Mono C#", "bug_code_uid": "c4770411007ca015376d1453bd096c25", "src_uid": "eb8212aec951f8f69b084446da73eaf7", "apr_id": "60c47f6788527b5954f139780546a771", "difficulty": 1100, "tags": ["math", "constructive algorithms", "binary search"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.597372929754426, "equal_cnt": 15, "replace_cnt": 7, "delete_cnt": 4, "insert_cnt": 4, "fix_ops_cnt": 15, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace ConsoleApplication2\n{\n class Program\n {\n static void Main(string[] args)\n {\n int n = Convert.ToInt32(Console.ReadLine()), ans=0;\n string txt = Console.ReadLine();\n string[] duo = txt.Split(' ');\n if (duo[0] == \"1\")\n ans++;\n for ( int i=1; i= 0 && duo[i - 2] == \"0\")\n ans++;\n }\n else ans++;\n }\n if ( ans<0)\n ans=0\n Console.WriteLine(ans);\n }\n }\n }\n ", "lang": "Mono C#", "bug_code_uid": "01096cac01238a9693095c4a6d8eded0", "src_uid": "2896aadda9e7a317d33315f91d1ca64d", "apr_id": "d70a3340e5c4d012cfde68ee507047d3", "difficulty": 900, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.6711538461538461, "equal_cnt": 8, "replace_cnt": 4, "delete_cnt": 3, "insert_cnt": 1, "fix_ops_cnt": 8, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace ConsoleApplication1\n{\n class Program\n {\n static void Main(string[] args)\n {\n int[] sa = Console.ReadLine().Split().Select(x1 => int.Parse(x1)).ToArray();\n int a = sa[0], b = sa[1], c = sa[2];\n int q = a * b + c, w = a * b * c;\n int t=(a+b)*c,y=(b+c)*a,i=a+b+c;\n Console.WriteLine(Math.Max(Math.Max(q,w),Math.Max(t,Math.Max(y,i))));\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "b3f19f23fc09bc27f12244c2b527795d", "src_uid": "1cad9e4797ca2d80a12276b5a790ef27", "apr_id": "db2709925f7237c60d33923971d92fae", "difficulty": 1000, "tags": ["math", "brute force"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.7496339677891655, "equal_cnt": 8, "replace_cnt": 5, "delete_cnt": 2, "insert_cnt": 1, "fix_ops_cnt": 8, "bug_source_code": "using System;\nusing System.Linq;\nusing System.Text;\nusing System.Collections.Generic;\n\nclass Program {\n\tstatic int[] d = new int[1000001];\n\tstatic void Main() {\n\t\tstring[] input = Console.ReadLine().Split();\n\t\tint a = int.Parse(input[0]);\n\t\tint b = int.Parse(input[1]);\n\t\tint c = int.Parse(input[2]);\n\t\tlong s = 0;\n\t\t\n\t\tfor(int i = 1; i <= a; i++){\n\t\t\tfor(int j = 1; j <= b; j++){\n\t\t\t\tfor(int k = 1; k <= c; k++){\n\t\t\t\t\ts += divisor(i * j * k) % 1073741824 ;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tConsole.WriteLine(s);\n\t}\n\tstatic int divisor(int n) {\n\t\tif(n == 1)\n\t\t\treturn 1;\n\t\tif(d[n] != 0){\n\t\t\treturn d[n];\n\t\t}\n\t\tint c = 2;\n\t\tfor(int i = 2; i < n; i++){\n\t\t\tif(n % i == 0)\n\t\t\t\tc++;\n\t\t}\n\t\td[n] = c;\n\t\treturn d[n];\n\t}\n}", "lang": "Mono C#", "bug_code_uid": "c9af5b258107cd963cbe17ac2d07ec3e", "src_uid": "4fdd4027dd9cd688fcc70e1076c9b401", "apr_id": "22a89ffd4a80fb1da20ba15f8169d068", "difficulty": 1300, "tags": ["number theory", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9533011272141707, "equal_cnt": 7, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 6, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Text;\n\nnamespace ConsoleApplication1\n{\n class Program\n {\n static void Main(string[] args)\n {\n string s = Console.ReadLine();\n string[] sint = s.Split(' ');\n\n int a = int.Parse(sint[0]);\n int b = int.Parse(sint[1]);\n int c = int.Parse(sint[2]);\n int sum = 0;\n int[] mas = new int[a * b * c+1];\n for (int i = 1; i <= a; i++)\n {\n for (int j = 1; j <= b; j++)\n {\n for (int k = 1; k <= c; k++)\n {\n mas[i * j * k]++;\n }\n }\n }\n for (int i = 1; i <= a*b*c; i++)\n {\n if (mas[i] != 0)\n {\n sum += mas[i ] * Delitel(i );\n }\n\n }\n double res = (double)sum;\n Console.WriteLine(\"{0}\", res % 1073741824);\n\n }\n\n\n\n public static int Delitel(int a)\n {\n int res;\n if (a == 1) \n {\n res = 1;\n }\n else\n {\n res = 2 ;\n }\n\n for (int i = 2; ((i <= (a/ 2 + 1)) && (i != a )); i++)\n {\n if (a % i == 0)\n {\n res++;\n }\n }\n return res;\n }\n }\n}", "lang": "Mono C#", "bug_code_uid": "d5a316173719c06cadca4896b14e7bdd", "src_uid": "4fdd4027dd9cd688fcc70e1076c9b401", "apr_id": "a86582949bd17177e005ae7b57f5d01c", "difficulty": 1300, "tags": ["number theory", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.6895973154362416, "equal_cnt": 12, "replace_cnt": 7, "delete_cnt": 3, "insert_cnt": 2, "fix_ops_cnt": 12, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\n\nnamespace ConsoleApplication2\n{\n class Program\n {\n static void Main(string[] args)\n {\n float Aux = 1,Sum = 0;\n int[] abc = Console.ReadLine().Split().Select(x => Convert.ToInt32(x)).ToArray();\n int a = abc[0];\n int b = abc[1];\n int c = abc[2];\n for (int i = 1; i <= a; i++)\n {\n Aux = 1;\n for (int j = 1; j <= b; j++)\n {\n for (int k = 1; k <= c; k++)\n {\n Aux = i * j * k;\n Sum += Divisores(Aux);\n }\n }\n }\n Console.WriteLine(Sum);\n }\n\n public static float Divisores(float Num)\n {\n float count = 0;\n for (int i = 1; i <= Num; i++)\n {\n if (Num % i == 0)\n count++;\n }\n return count;\n }\n }\n}", "lang": "Mono C#", "bug_code_uid": "885d35ccbaa1bed51066de9978cc9614", "src_uid": "4fdd4027dd9cd688fcc70e1076c9b401", "apr_id": "e66c05f64b121669cb44318cad120a16", "difficulty": 1300, "tags": ["number theory", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.8083759435110787, "equal_cnt": 19, "replace_cnt": 9, "delete_cnt": 2, "insert_cnt": 7, "fix_ops_cnt": 18, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.IO;\n\npublic class C1\n{\n public static void Main ( )\n {\n#if MYTRIAL\n Console.SetIn ( new StreamReader ( @\"e:\\zin.txt\" ) );\n#endif\n solve ( );\n //Console.WriteLine ( solve ( ) );\n }\n\n private static int solve ( )\n {\n int[] xx = ReadLineToInts ( 3 );\n int a=xx[0];\n int b=xx[1];\n int c=xx[2];\n HashSet[] numd = new HashSet[101];\n for ( int i = 1; i <= 100; i++ )\n {\n numd[i] = GetNumDivs ( i );\n }\n\n long totdiv=0;\n for ( int ia = 1; ia <= a; ia++ )\n {\n for ( int ib = 1; ib <= b; ib++ )\n {\n for ( int ic = 1; ic <= c; ic++ )\n {\n HashSet sa = numd[ia];\n HashSet sb = numd[ib];\n HashSet sc = numd[ic];\n HashSet sgab = new HashSet ( );\n foreach ( int aa in sa )\n {\n foreach ( int bb in sb )\n {\n foreach ( int cc in sc )\n sgab.Add ( aa * bb * cc );\n }\n }\n int divs=sgab.Count;\n totdiv += divs % 1073741824;\n totdiv %= 1073741824;\n }\n }\n }\n\n Console.WriteLine ( totdiv );\n return 0;\n }\n\n private static HashSet GetNumDivs ( int num )\n {\n HashSet set = new HashSet ( );\n set.Add ( 1 );\n if ( num == 1 ) return set;\n set.Add ( num );\n int div;\n for ( div = 2; div * div <= num; div++ )\n {\n if ( num % div == 0 )\n {\n set.Add ( div );\n set.Add ( num / div );\n }\n }\n return set;\n }\n\n public static int[] ReadLineToInts ( int length )\n {\n string line = Console.ReadLine ( ).Trim ( );\n string[] arStrings = line.Split ( ' ' );\n\n int[] ints = new int[length];\n for ( int i=0; i < length; i++ )\n ints[i] = int.Parse ( arStrings[i] );\n return ints;\n }\n\n}", "lang": "Mono C#", "bug_code_uid": "69bf2cee6ecb83a0c9df4bf2d2a3e505", "src_uid": "4fdd4027dd9cd688fcc70e1076c9b401", "apr_id": "dde990e4fc280b051eb8e50172b8699e", "difficulty": 1300, "tags": ["number theory", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9924105529454282, "equal_cnt": 5, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 4, "bug_source_code": "/*\n * Сделано в SharpDevelop.\n * Пользователь: admin\n * Дата: 21.10.2012\n * Время: 10:55\n * \n * Для изменения этого шаблона используйте Сервис | Настройка | Кодирование | Правка стандартных заголовков.\n */\n\nusing System.Linq;\nusing System.Collections.Generic;\nusing System.Text;\nusing System.Text.RegularExpressions;\n\nusing System;\n\nnamespace round_146\n{\n class Program\n {\n public static void Main(string[] args)\n {\n string[] s =Console.ReadLine().Split(' ');\n int a = int.Parse(s[0]);\n int b = int.Parse(s[1]);\n int c = int.Parse(s[2]);\n Int64 rez = 0;\n int[] d = new int[1000001];\n //один из способов содержать делители числа:\n for (i=1;i<=a*b*c;i++)\n for (j=i;j<=a*b*c;j+=i)\n d[j]++;\n /////////////////////////////////////////////\n for (int i=1;i<=a;i++){ \n \n for (int j=1; j<=b; j++){ \n \n for (int k =1; k<=c; k++){ \n \n \n rez+= d[i*j*k]+1;\n \n \n }\n\n }\n\n };\n\n Console.WriteLine(rez%1073741824);\n\n // Console.ReadKey();\n \n }\n }\n}", "lang": "Mono C#", "bug_code_uid": "635471f84b56bb6eda7300b3e5e54cd4", "src_uid": "4fdd4027dd9cd688fcc70e1076c9b401", "apr_id": "53e6432e5b6079a3ba0029f62cf0b50b", "difficulty": 1300, "tags": ["number theory", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.4796747967479675, "equal_cnt": 30, "replace_cnt": 19, "delete_cnt": 2, "insert_cnt": 8, "fix_ops_cnt": 29, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace contest\n{\n class Program\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#else\n static readonly TextReader input = Console.In;\n static readonly TextWriter output = Console.Out;\n#endif\n\n private static void SolveC()\n {\n //long[] s = input.ReadLine().Split(' ').Select(long.Parse).ToArray();\n int n = int.Parse(input.ReadLine());\n Dictionary x = new Dictionary();\n Dictionary y = new Dictionary();\n int[][] inp = new int[4*n + 1][];\n for (int i = 0; i <= 4*n; ++i)\n {\n int[] s = inp[i] = input.ReadLine().Split(' ').Select(int.Parse).ToArray();\n int count = 0;\n x.TryGetValue(s[0], out count);\n x[s[0]] = count + 1;\n count = 0;\n y.TryGetValue(s[1], out count);\n y[s[1]] = count + 1;\n }\n\n for (int i = 0; i <= 4 * n; ++i)\n {\n if (x[inp[i][0]] < 2 || y[inp[i][1]] < 2)\n {\n output.WriteLine(inp[i][0] + \" \"+ inp[i][1]);\n return;\n }\n }\n\n for (int i = 0; i <= 4 * n; ++i)\n {\n if ((inp[i][0] != x.Keys.Min() && inp[i][0] != x.Keys.Max()) &&\n (inp[i][1] != y.Keys.Min() && inp[i][1] != y.Keys.Max()))\n {\n output.WriteLine(inp[i][0] + \" \" + inp[i][1]);\n return;\n }\n }\n }\n\n static void Main(string[] args)\n {\n //SolveC();\n SolveC();\n output.Flush();\n }\n }\n}", "lang": "Mono C#", "bug_code_uid": "3ba6ad5e05fe7555cca4f8fb68d910fc", "src_uid": "1f9153088dcba9383b1a2dbe592e4d06", "apr_id": "baf4d2f9bd1c95b95dda8058cc71ffc0", "difficulty": 1600, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9572446555819477, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 1, "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 ConsoleApplication2\n{\n class Program\n {\n static void Main(string[] args)\n {\n\n string dir = Console.ReadLine();\n string txt = Console.ReadLine();\n string keyboard = \"qwertyuiopasdfghjkl;zxcvbnm,./\";\n for (int i = 0; i < txt.Length; i++)\n {\n char ch = txt[i];\n for (int j = 0; j < keyboard.Length; j++)\n if (ch == keyboard[j])\n {\n if (dir == \"R\")\n Console.Write(keyboard[j - 1]);\n else\n Console.Write(keyboard[j + 1]);\n }", "lang": "MS C#", "bug_code_uid": "e1693b9a41526def311511e6b16a3f99", "src_uid": "df49c0c257903516767fdb8ac9c2bfd6", "apr_id": "89dd0c225bf2970133c0605fa4078451", "difficulty": 900, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9779005524861878, "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.Text;\nusing System.Text.RegularExpressions;\nusing System.Numerics;\n\nnamespace WarmingUpC_Sharp\n{\n class Program\n {\n static void Main(string[] args)\n {\n string keyboard = \"qwertyuiopasdfghjkl;zxcvbnm,./\";\n char move = char.Parse(Console.ReadLine());\n string sequence = Console.ReadLine();\n string ans = \"\";\n for (int i = 0; i < sequence.Length; i++)\n {\n int index = keyboard.IndexOf(sequence[i]);\n ans += move == 'R' ? sequence[index - 1] : sequence[index + 1];\n }\n Console.WriteLine(ans);\n }\n }\n}", "lang": "MS C#", "bug_code_uid": "69896b501225506aca9dc639713e2fcc", "src_uid": "df49c0c257903516767fdb8ac9c2bfd6", "apr_id": "d61e26313cbd68bfbf37f74a210d5ea8", "difficulty": 900, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9860557768924303, "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.Text;\nusing System.IO;\n\nnamespace ConsoleApplication5\n{\n public class Program\n {\n public static void Main()\n {\n long n = long.Parse(Console.ReadLine());\n int index = 1;\n int step = 0;\n while (index + step <= n)\n {\n index += step;\n ++step;\n }\n Console.WriteLine(n - index + 1);\n }\n }\n}", "lang": "MS C#", "bug_code_uid": "8458e7ad20aa91b0a2148aeac3d16f54", "src_uid": "1db5631847085815461c617854b08ee5", "apr_id": "5167d447f2b924e5fed41c84dd657497", "difficulty": 1000, "tags": ["math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.5661252900232019, "equal_cnt": 7, "replace_cnt": 5, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 6, "bug_source_code": "using System;\n\nnamespace Unfinite_sec\n{\n class Program\n {\n static void Main(string[] args)\n {\n long n = Convert.ToInt64(Console.ReadLine());\n long num = 0, tmp = 1;\n if (n == 1)\n {\n num = 1;\n goto end;\n }\n\n for (long i = 1; i < n; i++)\n {\n if (tmp != num)\n {\n num++;\n }\n else\n {\n tmp++;\n num = 0;\n if (i == n - 1) num = tmp;\n }\n\n }\n end:\n Console.Write(num);\n Console.ReadLine();\n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "fc80c315a2168a92bc0f08dc61297d9a", "src_uid": "1db5631847085815461c617854b08ee5", "apr_id": "6573714b74afa086f2f88beaafc24b48", "difficulty": 1000, "tags": ["math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9867523083099157, "equal_cnt": 11, "replace_cnt": 2, "delete_cnt": 7, "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 _534B\n{\n class Program\n {\n static void Main(string[] args)\n {\n string[] str = Console.ReadLine().Split(' ');\n int a = int.Parse(str[0]);\n int b = int.Parse(str[1]);\n str = Console.ReadLine().Split(' ');\n int time = int.Parse(str[0]);\n int[] mas = new int[time];\n if (a < b)\n {\n mas[0] = a;\n mas[time - 1] = b;\n }\n else\n {\n mas[0] = b;\n mas[time - 1] = b;\n }\n int diff = int.Parse(str[1]);\n {\n for (int i = 1; i < mas.Length - 1; i++)\n mas[i] = mas[i - 1] + diff;\n for (int i = mas.Length - 2; i >= 0; i-- )\n {\n if (mas[i] > mas[i + 1] + diff)\n mas[i] = mas[i + 1] + diff;\n }\n }\n int max = 0;\n for (int i = 0; i < mas.Length; i++)\n max += mas[i];\n Console.Write(max);\n //Console.ReadKey();\n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "b1137d052bebb0a369312c62bb0fcc1b", "src_uid": "9246aa2f506fcbcb47ad24793d09f2cf", "apr_id": "384c34c235fcafbc7ab2d4c42f74deb7", "difficulty": 1400, "tags": ["dp", "math", "greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "C#"} {"similarity_score": 0.9940006315124724, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "using System;\nusing System.Collections;\nusing System.Collections.Generic;\nusing System.IO.Pipes;\nusing System.Linq;\nusing System.Runtime.InteropServices;\nusing System.Text;\n\nnamespace Codeforces\n{\n public class Program\n {\n private const int MAXN = 8000;\n\n public static void Main(string[] args)\n {\n int n = int.Parse(Console.ReadLine().Trim());\n string line = Console.ReadLine();\n\n int maxLen = 0;\n int count = 0;\n\n bool insidePar = false;\n\n int i = 0;\n while (i < line.Length)\n {\n if (line[i] == '_')\n {\n i++;\n }\n else if (line[i] == '(')\n {\n insidePar = true;\n i++;\n }\n else if (line[i] == ')')\n {\n insidePar = false;\n i++;\n }\n else\n {\n int len = 0;\n while (char.IsLetter(line[i]))\n {\n i++;\n len++;\n }\n\n if (insidePar)\n {\n count++;\n }\n else\n {\n maxLen = Math.Max(maxLen, len);\n }\n \n }\n }\n\n Console.WriteLine(maxLen + \" \" + count);\n \n }\n }\n}", "lang": "Mono C#", "bug_code_uid": "cd065d8901291c1ace9b6ae475ce29ef", "src_uid": "fc86df4931e787fa3a1a40e2aecf0b92", "apr_id": "d8c77dce9c09753dafeed68c01b1f52e", "difficulty": 1100, "tags": ["strings", "implementation", "expression parsing"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.9983333333333333, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "using System;\nclass Program{\n\tstatic void Main(string[] args){\n\t\tstring [] line = Console.ReadLine().Split();\n\t\tint a = int.Parse(line[0]);\n\t\tint b = int.Parse(line[1]);\n\t\tbool ciel = true;\n\t\twhile(true){\n\t\t\tif(ciel){\n\t\t\t\tif(a > 1 && b > 1){ a -= 2; b -= 2;}\n\t\t\t\telse if(a > 0 && b > 11){ a -= 1; b -= 12; }\n\t\t\t\telse if(b > 21){ b -= 21; }\n\t\t\t\telse{ Console.WriteLine(\"Hanako\"); return; }\n\t\t\t}else{\n\t\t\t\tif(b > 21){ b -= 22; }\n\t\t\t\telse if(b > 11 && a > 0){ a -= 1; b -= 12; }\n\t\t\t\telse if(b > 1 && a > 1){ a -= 2; b -= 2; }\n\t\t\t\telse { Console.WriteLine(\"Ciel\"); return; }\n\t\t\t}\n\t\t\tciel = !ciel;\n\t\t}\n\t}\n}", "lang": "Mono C#", "bug_code_uid": "473f9e3fe75cc9de354c9f00d1654a05", "src_uid": "8ffee18bbc4bb281027f91193002b7f5", "apr_id": "05a4d84e14ca2e9963442591683e1101", "difficulty": 1200, "tags": ["greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9904957616234267, "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;\nusing System.Text;\n\nnamespace A\n{\n class Program\n {\n static void Main(string[] args)\n {\n string[] t = Console.ReadLine().Split(' ');\n int x = int.Parse(t[0]);\n int y = int.Parse(t[1]);\n bool Ciel = true;\n bool end = false;\n do\n {\n if (Ciel)\n {\n int count = 0;\n if (x >= 2) { count = 200; x -= 2; }\n else\n {\n count = x * 100;\n x = 0;\n }\n if (y * 10 >= 220 - count)\n {\n y -= (220 - count) / 10;\n }\n else\n end = true;\n }\n else\n {\n int count = 0;\n if (y >= 22)\n {\n count = 220;\n y -= 22;\n }\n else\n {\n if (y >= 12)\n {\n count = 120;\n y -= 12;\n }\n else if (y >= 2)\n {\n count = 20;\n y -= 2;\n }\n else end = true;\n }\n if (x * 100 >= (220 - count))\n {\n count = 220;\n x -= (220 - count) / 100;\n }\n else end = true;\n }\n Ciel = !Ciel;\n } while (!end);\n if (Ciel) Console.WriteLine(\"Ciel\");\n else Console.WriteLine(\"Hanako\");\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "e83a5a736480d59503427e535466a47d", "src_uid": "8ffee18bbc4bb281027f91193002b7f5", "apr_id": "6044672c3b2bbe2833b8e2485df2fec0", "difficulty": 1200, "tags": ["greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "C#"} {"similarity_score": 0.1631612492033142, "equal_cnt": 18, "replace_cnt": 13, "delete_cnt": 5, "insert_cnt": 0, "fix_ops_cnt": 18, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nnamespace CodeForces\n{\n class Program\n {\n private static long[] x = { 1, 1 };\n private static List solutionsList = new List();\n static void Main(string[] args)\n {\n long n = long.Parse(Console.ReadLine());\n while (x[0] < n)\n {\n while (x[1] < n)\n {\n if (sum() == n && x[0] != x[1] && checkList() == false)\n {\n long[] X = { x[0], x[1] };\n solutionsList.Add(X);\n }\n x[1]++;\n }\n x[1] = 1;\n x[0]++;\n }\n Console.WriteLine(solutionsList.Count());\n }\n private static long sum()\n {\n return (x[0] + x[1]) * 2;\n }\n private static bool checkList()\n {\n bool b = false;\n foreach (long[] newX in solutionsList)\n {\n if ((x[0] == newX[0] && x[1] == newX[1]) || (x[0] == newX[1] && x[1] == newX[0]))\n b = true;\n }\n return b;\n }\n }\n}", "lang": "MS C#", "bug_code_uid": "22e54c8b235a8da2bb1b648eb9c968e9", "src_uid": "32b59d23f71800bc29da74a3fe2e2b37", "apr_id": "b38f4e4d914cda02fe3e68916dddfa73", "difficulty": 1000, "tags": ["math", "combinatorics"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.5286396181384249, "equal_cnt": 9, "replace_cnt": 6, "delete_cnt": 3, "insert_cnt": 0, "fix_ops_cnt": 9, "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 string a = \"s\"; int res = 0; int polovina = 0;\n a= Console.ReadLine();\n polovina = Convert.ToInt32(a) / 2;\n\n for (int i = 1; i <= Convert.ToInt32(Math.Floor((double)polovina / 2)); i++)\n {\n if (Convert.ToInt32(a) % 4 == 0)\n {\n if (i != Convert.ToInt32(a) / 4)\n res++;\n }\n else\n res++;\n }\n Console.Write(res);\n\n \n }\n }\n}", "lang": "MS C#", "bug_code_uid": "b838fab14be771381448a303ffcab5a0", "src_uid": "32b59d23f71800bc29da74a3fe2e2b37", "apr_id": "e7c7e0f4f9c6dee5ae19bbb4aea5d9c5", "difficulty": 1000, "tags": ["math", "combinatorics"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.71875, "equal_cnt": 9, "replace_cnt": 5, "delete_cnt": 4, "insert_cnt": 0, "fix_ops_cnt": 9, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nnamespace codeforces\n{\n\tclass MainClass\n\t{\n\t\tpublic static void Main (string[] args)\n\t\t{\n\t\t\tlong n = int.Parse (Console.ReadLine ());\n\t\t\tif (n % 2 != 0)\n\t\t\t\tConsole.WriteLine (0);\n\t\t\telse {\n\t\t\t\tlong ans = 0;\n\t\t\t\tn = n / 2;\n\t\t\t\tfor (int i = 1; i <= n/2; i++) {\n\t\t\t\t\tif (n - i != 0 && n - i != i)\n\t\t\t\t\t\tans++;\n\t\t\t\t}\n\t\t\t\tConsole.WriteLine (ans);\n\t\t\t}\n\t\t}\n\t}\n}", "lang": "MS C#", "bug_code_uid": "5d99df6887be3d2c30a7346399f80136", "src_uid": "32b59d23f71800bc29da74a3fe2e2b37", "apr_id": "69e6871a24f951189bc4542b9916d885", "difficulty": 1000, "tags": ["math", "combinatorics"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.8296812749003984, "equal_cnt": 21, "replace_cnt": 3, "delete_cnt": 19, "insert_cnt": 0, "fix_ops_cnt": 22, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace Pasha_and_Stick\n{\n class Program\n {\n static void Main(string[] args)\n {\n while (true)\n {\n var input = Console.ReadLine();\n Int32 number;\n if (!Int32.TryParse(input, out number))\n {\n Console.WriteLine(\"You have entered invalid number\");\n }\n else\n {\n if (number % 2 != 0)\n {\n Console.Write(0);\n }\n else\n {\n if (number % 4 == 0)\n Console.Write((number / 4) - 1);\n else\n Console.Write((number/2-1)/2);\n }\n Console.WriteLine();\n }\n //Console.WriteLine(\"Press any key to exit\");\n //Console.ReadKey();\n //Console.ReadLine();\n }\n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "cfa30ac5cfa869887a470286fa9a0e60", "src_uid": "32b59d23f71800bc29da74a3fe2e2b37", "apr_id": "b6ef1954b359eddceb7b0587ca6ba819", "difficulty": 1000, "tags": ["math", "combinatorics"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "delete", "lang_cluster": "C#"} {"similarity_score": 0.9990875912408759, "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.Globalization;\nusing System.IO;\nusing System.Linq;\n\nnamespace CF317\n{\n class Program\n {\n static void Main(string[] args)\n {\n var sr = new InputReader(new StreamReader(new FileStream(\"input.txt\", FileMode.Open)));\n //var sr = new InputReader(Console.In);\n var task = new Task();\n task.Solve(1, sr, Console.Out);\n //Console.ReadKey();\n }\n }\n\n class Task\n {\n public void Solve(int testNumber, InputReader sr, TextWriter sw)\n {\n var n = sr.NextInt32();\n if (n%2 == 1 || n <= 5)\n {\n sw.WriteLine(0);\n return;\n }\n sw.WriteLine(((n - 2) / 4));\n }\n }\n\n class InputReader : IDisposable\n {\n private readonly TextReader sr;\n private bool isDispose = false;\n public InputReader(TextReader stream)\n {\n sr = stream;\n }\n\n public string NextString()\n {\n var result = sr.ReadLine();\n return result;\n }\n\n public int NextInt32()\n {\n return Int32.Parse(NextString());\n }\n\n public long NextInt64()\n {\n return Int64.Parse(NextString());\n }\n\n public string[] NextSplitStrings()\n {\n return NextString()\n .Split(new[] { ' ' }, StringSplitOptions.RemoveEmptyEntries);\n }\n\n public T[] ReadArray(Func func)\n {\n return NextSplitStrings()\n .Select(s => func(s, CultureInfo.InvariantCulture))\n .ToArray();\n }\n public void Dispose()\n {\n Dispose(true);\n GC.SuppressFinalize(this);\n }\n\n protected void Dispose(bool dispose)\n {\n if (!isDispose)\n {\n if (dispose)\n {\n sr.Close();\n }\n isDispose = true;\n }\n }\n\n ~InputReader()\n {\n Dispose(false);\n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "fbafa3ea305c6f86e6713934397e4567", "src_uid": "32b59d23f71800bc29da74a3fe2e2b37", "apr_id": "7588da0a5bdaed552f1e446cbda76baf", "difficulty": 1000, "tags": ["math", "combinatorics"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C#"} {"similarity_score": 0.7385740402193784, "equal_cnt": 4, "replace_cnt": 2, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 3, "bug_source_code": "using System;\n\nclass Program\n{\n static void Main()\n {\n int n = int.Parse(Console.ReadLine());\n int count = 0;\n if (n % 2 == 0)\n for (int i = 1; i < Math.Ceiling((double) n / 4); i++)\n count++;\n Console.WriteLine(count);\n }\n}\n", "lang": "MS C#", "bug_code_uid": "7dd59468ffa18b5521f6de1079d69ff6", "src_uid": "32b59d23f71800bc29da74a3fe2e2b37", "apr_id": "2240b712de7ddc7428eacfde4f4a228d", "difficulty": 1000, "tags": ["math", "combinatorics"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9902534113060428, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "using System;\n\nclass Program\n{\n static void Main()\n {\n int n = int.Parse(Console.ReadLine());\n int count = 0;\n if (n % 2 == 0)\n count = Math.Ceiling((double) n / 4 - 1);\n Console.WriteLine(count);\n }\n}\n", "lang": "MS C#", "bug_code_uid": "b1967b3e52ee90fd4afad25f36c14b70", "src_uid": "32b59d23f71800bc29da74a3fe2e2b37", "apr_id": "2240b712de7ddc7428eacfde4f4a228d", "difficulty": 1000, "tags": ["math", "combinatorics"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.9983388704318937, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "using System;\nclass A133\n{\n static void Main()\n {\n string input = Console.ReadLine();\n int len = input.Length;\n string check = \"HQ9\";\n bool chk = false;\n for(int i = 0; i \"HQ9\".Contains(c)).Count() == 0 ? \"NO\" : \"YES\");\n }\n }\n}", "lang": "MS C#", "bug_code_uid": "5333ab000e6037cd44995457325a4638", "src_uid": "1baf894c1c7d5aeea01129c7900d3c12", "apr_id": "78076295c55ee825ea6943cae9b1ed67", "difficulty": 900, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C#"} {"similarity_score": 0.38589981447124305, "equal_cnt": 10, "replace_cnt": 4, "delete_cnt": 4, "insert_cnt": 2, "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 ConsoleApplication90\n{\n class Program\n {\n static void Main(string[] args)\n {\n string s = Console.ReadLine();\n int i = 0;\n int ind1 = 0, ind2 = 0;\n bool f = true;\n bool b = true;\n string s1 = \" \";\n string s2 = \" \";\n while (f==true)\n {\n if (s[i] == 'W' && s[i + 1] == 'U')\n { \n ind1 = i;\n i++;\n }\n if (s[i] == 'U' && i == ind1 + 1)\n {\n ind2 = i;\n i++;\n }\n if (s[i] == 'B' && i == ind2 + 1)\n {\n\n s1 = s.Remove(ind1);\n s2 = s.Remove(0,i+1);\n s = s1 + \" \" + s2;\n i = 0;\n ind1 = 0;\n ind2 = 0;\n\n }\n\n else i++;\n\n if (s.Contains(\"WUB\")) f = true;\n else f = false;\n }\n \n Console.WriteLine(s.Trim());\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "1534311a9b32814d7f59df9f20dba668", "src_uid": "edede580da1395fe459a480f6a0a548d", "apr_id": "22671ee6aeb82160a8a881715a6c92fe", "difficulty": 900, "tags": ["strings"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.8903394255874674, "equal_cnt": 19, "replace_cnt": 4, "delete_cnt": 0, "insert_cnt": 14, "fix_ops_cnt": 18, "bug_source_code": " using System;\n using System.Collections.Generic;\n using System.Linq;\n using System.Text;\n\n\n\nnamespace ConsoleApplication1\n{\n class Program\n {\n static void Main(string[] args)\n {\n\n string input,outout=\"\";\n input=Console.ReadLine();\n bool mustafa = true;\n int size = Convert.ToInt32(input.Length);\n\n for (int i = 0; i < size; i++)\n {\n if (input[i].ToString() == \"W\" && input[i+1].ToString() == \"U\" && input[i+2].ToString() == \"B\")\n {\n if(mustafa==false)outout+=\" \";\n mustafa = true;\n i += 2;\n }\n else if (!(input[i].ToString() == \"W\" && input[i].ToString() == \"U\" && input[i].ToString() == \"B\"))\n {\n outout += input[i].ToString();\n mustafa = false;\n }\n \n \n\n \n }\n Console.WriteLine(outout);\n \n }\n }\n}", "lang": "Mono C#", "bug_code_uid": "f0420e008409f61f0f37883541bc913e", "src_uid": "edede580da1395fe459a480f6a0a548d", "apr_id": "44bed43f6eccfd8945253bbf920f4c9f", "difficulty": 900, "tags": ["strings"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.9983410138248848, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "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 int n = sc.NextInt();\n int k = sc.NextInt();\n long m = sc.NextInt();\n int[] t = sc.IntArray();\n\n long sum = 0;\n foreach (var i in t)\n {\n sum += i;\n }\n\n Array.Sort(t);\n long ans = 0;\n for (int i = 0; i <= n && sum * i <= m; i++)\n {\n long score = (k + 1) * i;\n long time = m - sum * i;\n\n for (int j = 0; j < n; j++)\n {\n long cnt = Math.Min(n - i, time / t[j]);\n score += cnt;\n time -= t[j] * cnt;\n }\n\n ans = Math.Max(ans, score);\n }\n\n Console.WriteLine(ans);\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": "e371c03ead4e4b1bbd72f7fefec2b9d8", "src_uid": "d659e92a410c1bc836be64fc1c0db160", "apr_id": "598fd0eb227abbb78caa9f457b380379", "difficulty": 1800, "tags": ["brute force", "greedy"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9979353062629044, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "using System;\nusing System.Collections;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\n\nclass TEST{\n\tstatic void Main(){\n\t\tSol mySol =new Sol();\n\t\tmySol.Solve();\n\t}\n}\n\nclass Sol{\n\tpublic void Solve(){\n\t\t\n\t\tArray.Sort(A);\n\t\tlong T = A.Sum();\n\t\t\n\t\tlong max = 0;\n\t\t\n\t\tfor(int i=0;i<=N;i++){\n\t\t\tif(i * T > M) break;\n\t\t\tlong sc = (K+1) * i;\n\t\t\tlong rest = M - i * T;\n\t\t\tfor(int j=0;j r * A[j]){\n\t\t\t\t\tsc += r;\n\t\t\t\t\trest -= r * A[j];\n\t\t\t\t\tif(j == K-1) sc += r;\n\t\t\t\t} else {\n\t\t\t\t\tsc += rest/A[j];\n\t\t\t\t\tif(j == K-1) sc += rest/A[i];\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\t//Console.WriteLine(\"{0} {1}\",i,sc);\n\t\t\tmax = Math.Max(max,sc);\n\t\t}\n\t\tConsole.WriteLine(max);\n\t\t\n\t}\n\tint N,K;\n\tlong M;\n\tlong[] A;\n\tpublic Sol(){\n\t\tvar d = ria();\n\t\tN = d[0]; K = d[1]; M = d[2];\n\t\tA = rla();\n\t}\n\n\tstatic String rs(){return Console.ReadLine();}\n\tstatic int ri(){return int.Parse(Console.ReadLine());}\n\tstatic long rl(){return long.Parse(Console.ReadLine());}\n\tstatic double rd(){return double.Parse(Console.ReadLine());}\n\tstatic String[] rsa(char sep=' '){return Console.ReadLine().Split(sep);}\n\tstatic int[] ria(char sep=' '){return Array.ConvertAll(Console.ReadLine().Split(sep),e=>int.Parse(e));}\n\tstatic long[] rla(char sep=' '){return Array.ConvertAll(Console.ReadLine().Split(sep),e=>long.Parse(e));}\n\tstatic double[] rda(char sep=' '){return Array.ConvertAll(Console.ReadLine().Split(sep),e=>double.Parse(e));}\n}\n", "lang": "Mono C#", "bug_code_uid": "b1c00c36b6c15f029d70d73b2ac71876", "src_uid": "d659e92a410c1bc836be64fc1c0db160", "apr_id": "f6bdf96ef2cc408f983b8edb266663e5", "difficulty": 1800, "tags": ["brute force", "greedy"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9974450689831375, "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;\n\nnamespace CodeForces\n{\n class Program\n {\n static void Main( string[] args )\n {\n string[] firstLine = Console.ReadLine().Split( ' ' );\n int N = int.Parse( firstLine[0] );\n int M = int.Parse( firstLine[1] );\n\n string[] piecesStrings = Console.ReadLine().Split( ' ' );\n int[] pieces = new int[M];\n for ( int n = 0; n < M; n++ )\n {\n pieces[n] = int.Parse( piecesStrings[n] );\n }\n\n Array.Sort( pieces );\n\n int minDiff = int.MaxValue;\n var chosen = new Dictionary();\n\n for ( int n = 0; n < N; n++ )\n {\n if ( chosen.ContainsKey( pieces[n] ) )\n {\n chosen[pieces[n]]++;\n }\n else\n {\n chosen.Add( pieces[n], 1 );\n }\n }\n {\n int diff = chosen.Max( x => x.Key ) - chosen.Min( x => x.Key );\n if ( diff < minDiff )\n {\n minDiff = diff;\n }\n }\n\n for ( int n = N; n < M; n++ )\n {\n if ( chosen.ContainsKey( pieces[n] ) )\n {\n chosen[pieces[n]]++;\n }\n else\n {\n chosen.Add( n, 1 );\n }\n chosen[pieces[n - N]]--;\n if ( chosen[pieces[n - N]] == 0 )\n {\n chosen.Remove( pieces[n - N] );\n }\n\n int diff = chosen.Max( x => x.Key ) - chosen.Min( x => x.Key );\n if ( diff < minDiff )\n {\n minDiff = diff;\n }\n }\n\n Console.WriteLine( minDiff );\n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "a07446e552dceb72ca59a398c4f552e9", "src_uid": "7830aabb0663e645d54004063746e47f", "apr_id": "5aa240ed7e4762ddd95a9d003302a4c2", "difficulty": 900, "tags": ["greedy"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9995581087052585, "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;\nusing System.Text;\nusing System.Threading.Tasks;\n\nclass PairVariable : IComparable\n{\n public decimal a, b;\n public PairVariable()\n {\n a = b = 0;\n }\n public PairVariable(string s)\n {\n string[] q = s.Split();\n a = decimal.Parse(q[0]);\n b = decimal.Parse(q[1]);\n }\n public PairVariable(decimal a, decimal b)\n {\n this.a = a;\n this.b = b;\n }\n\n\n\n public int CompareTo(PairVariable other)\n {\n return this.a.CompareTo(other.a);\n }\n}\n\nnamespace ConsoleApplication254\n{\n\n class Program\n {\n\n\n static void Main(string[] args)\n {\n string[] ss = Console.ReadLine().Split();\n ulong a = ulong.Parse(ss[0]);\n ulong m = ulong.Parse(ss[1]);\n while (a <= 1000000000)\n {\n if (a % m == 0)\n {\n Console.WriteLine(\"Yes\");\n return;\n }\n a += a % m;\n }\n Console.WriteLine(\"No\");\n }\n }\n}", "lang": "MS C#", "bug_code_uid": "0622d038b9dcbd568596b514495b76ea", "src_uid": "f726133018e2149ec57e113860ec498a", "apr_id": "8436acac8cf98def936b350a111f07db", "difficulty": 1400, "tags": ["matrices", "math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "delete", "lang_cluster": "C#"} {"similarity_score": 0.9818754925137904, "equal_cnt": 4, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 3, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nclass Program\n{\n static void Main()\n {\n var am = Console.ReadLine().Split().Select(long.Parse).ToArray();\n var a = am[0];\n var m = am[1];\n var t = new List();\n while (true)\n {\n var te = (a % m);\n if (te == 0L)\n {\n Console.WriteLine(\"Yes\");\n return;\n }\n if (t.Contains(te))\n {\n Console.WriteLine(\"No\");\n return;\n }\n a += te;\n t.Add(te);\n }\n }\n}", "lang": "MS C#", "bug_code_uid": "6f524bbcb956a23b7c1f3dd8d619dede", "src_uid": "f726133018e2149ec57e113860ec498a", "apr_id": "0ba397cd4160f6e1b52090884e1fa4f4", "difficulty": 1400, "tags": ["matrices", "math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.4709965294992563, "equal_cnt": 19, "replace_cnt": 10, "delete_cnt": 5, "insert_cnt": 4, "fix_ops_cnt": 19, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace ConsoleApplication1\n{\n class Program\n {\n static bool isPrime(int number)\n {\n if (number < 2) return false;\n for (int i = 2; i <= Math.Sqrt(number); i++)\n {\n if (number % i == 0) return false;\n }\n return true;\n }\n static void Main(string[] args)\n {\n string s = Console.ReadLine();\n string[] s1 = s.Split(' ');\n int a = int.Parse(s1[0]);\n int m = int.Parse(s1[1]);\n int[] b = new int[100000];\n int j=1;\n bool c = false;\n for (int i = 2; i <= 100000; i++)\n if (isPrime(i))\n {\n b[j] = i;\n j++;\n }\n for (int i = 1; i<=j; i++)\n if (m == b[i])&&\n {\n Console.WriteLine(\"No\");\n c = true;\n break; \n }\n if (!c) Console.WriteLine(\"Yes\");\n }\n }\n}", "lang": "MS C#", "bug_code_uid": "5b422bd907e8bdc2cfdc81170b8dff66", "src_uid": "f726133018e2149ec57e113860ec498a", "apr_id": "b63b16fa4842a3949153060d121285fa", "difficulty": 1400, "tags": ["matrices", "math", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.6013215859030837, "equal_cnt": 11, "replace_cnt": 5, "delete_cnt": 6, "insert_cnt": 1, "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 C\n{\n class Program\n {\n static void Main(string[] args)\n {\n long[] input = Console.ReadLine().Split(' ').Select(long.Parse).ToArray();\n\n long a = input[0],\n b = input[1];\n\n long res = 0;\n\n while (b - a != 1 && b - a != 0)\n {\n if (a < b)\n {\n res++;\n\n var t = b;\n b = a;\n a = t;\n\n a -= b;\n\n t = b;\n b = a;\n a = t;\n }\n else\n {\n var @int = a / b;\n res += @int;\n a -= @int * b;\n }\n }\n\n res += b;\n\n Console.WriteLine(res);\n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "2de75a9c32227c9f682a72a88f693828", "src_uid": "792efb147f3668a84c866048361970f8", "apr_id": "7fe5e45d51cd9c3c3f616f10918aeb52", "difficulty": 1600, "tags": ["math", "number theory"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "delete", "lang_cluster": "C#"} {"similarity_score": 0.9990909090909091, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "using System;\n\nnamespace CSharp\n{\n class _991C\n {\n public static void Main()\n {\n long n = long.Parse(Console.ReadLine());\n\n long l = 0;\n long r = n;\n\n while (l < r)\n {\n long m = (l + r) / 2;\n\n long v = 0;\n long p = 0;\n long remaining = n;\n\n while (remaining > 0)\n {\n if (remaining < m)\n {\n v += remaining;\n remaining = 0;\n }\n else\n {\n v += m;\n remaining -= m;\n }\n\n p += remaining / 10;\n remaining = remaining - remaining / 10;\n }\n\n if (v < p)\n {\n l = m + 1;\n }\n else\n {\n r = m;\n }\n }\n\n Console.WriteLine(r);\n }\n }\n}", "lang": "Mono C#", "bug_code_uid": "2be5f689bfe647d1eebb1494078a359c", "src_uid": "db1a50da538fa82038f8db6104d2ab93", "apr_id": "288f1b4e23492818e5c2db6dc5854087", "difficulty": 1500, "tags": ["implementation", "binary search"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.4229313142239048, "equal_cnt": 16, "replace_cnt": 11, "delete_cnt": 3, "insert_cnt": 1, "fix_ops_cnt": 15, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\n\nnamespace _197A\n{\n class Program\n {\n\n public static int[] DoMas(string s, int c)\n {\n int[] mas = new int[c];\n\n int j = 0;\n string num = \"\";\n for (int f = 0; f < s.Length; f++)\n {\n while (s[f] != ' ')\n {\n num = num + s[f];\n f++;\n if (f == s.Length)\n {\n break;\n }\n }\n if (num != \"\")\n {\n mas[j] = Convert.ToInt32(num);\n j++;\n }\n num = \"\";\n }\n\n return mas;\n }\n static void Main(string[] args)\n {\n string s = Console.ReadLine();\n int[] mas = DoMas(s, 3);\n int sq = mas[0] * mas[1];\n int sc = Convert.ToInt32(mas[2] * mas[2] * Math.PI);\n\n if ((sq / sc) % 2 == 0 | sq - sc < 0)\n {\n Console.WriteLine(\"Second\");\n }\n else\n {\n Console.WriteLine(\"First\");\n }\n\n \n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "d1df947c09b0c8e8e4b104eae7dfe97f", "src_uid": "90b9ef939a13cf29715bc5bce26c9896", "apr_id": "4e0f654b4208ab36486ca9b33f7d1e6a", "difficulty": 1600, "tags": ["math", "games", "constructive algorithms"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.017881705639614855, "equal_cnt": 12, "replace_cnt": 11, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 12, "bug_source_code": "\nMicrosoft Visual Studio Solution File, Format Version 11.00\n# Visual Studio 2010\nProject(\"{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}\") = \"codeforces 124 d2 qA\", \"codeforces 124 d2 qA\\codeforces 124 d2 qA.csproj\", \"{B5C5AB1F-F537-4305-AD88-591CBFC08780}\"\nEndProject\nGlobal\n\tGlobalSection(SolutionConfigurationPlatforms) = preSolution\n\t\tDebug|x86 = Debug|x86\n\t\tRelease|x86 = Release|x86\n\tEndGlobalSection\n\tGlobalSection(ProjectConfigurationPlatforms) = postSolution\n\t\t{B5C5AB1F-F537-4305-AD88-591CBFC08780}.Debug|x86.ActiveCfg = Debug|x86\n\t\t{B5C5AB1F-F537-4305-AD88-591CBFC08780}.Debug|x86.Build.0 = Debug|x86\n\t\t{B5C5AB1F-F537-4305-AD88-591CBFC08780}.Release|x86.ActiveCfg = Release|x86\n\t\t{B5C5AB1F-F537-4305-AD88-591CBFC08780}.Release|x86.Build.0 = Release|x86\n\tEndGlobalSection\n\tGlobalSection(SolutionProperties) = preSolution\n\t\tHideSolutionNode = FALSE\n\tEndGlobalSection\nEndGlobal\n", "lang": "Mono C#", "bug_code_uid": "aa986197efc1fa0c7262e2034c2259af", "src_uid": "90b9ef939a13cf29715bc5bce26c9896", "apr_id": "8ccc7eea51e1a80de938674e4b69e5ac", "difficulty": 1600, "tags": ["math", "games", "constructive algorithms"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.8866410882455529, "equal_cnt": 11, "replace_cnt": 3, "delete_cnt": 2, "insert_cnt": 5, "fix_ops_cnt": 10, "bug_source_code": "using System;\n\nnamespace PerfectPair\n{\n partial class PerfectPair\n {\n static void Main(string[] args)\n {\n long x, y, m, diff, diffX, diffY, temp, min = 0, max = 0, count = 0;\n\n x = NextLong();\n y = NextLong();\n m = NextLong();\n\n diffX = m - x;\n diffY = m - y;\n\n min = Math.Min(x, y);\n max = Math.Max(x, y);\n\n if ((min >= 0 && m < 0) || (max <= 0 && m > 0) || (max <= 0 && m > max))\n Console.WriteLine(-1);\n else if (max >= m)\n Console.WriteLine(0);\n else\n {\n while (true)\n {\n diff = m - min;\n\n if (m > 0 && max < diff)\n {\n count++;\n temp = max;\n max += min;\n min = temp;\n\n min = Math.Min(min, max);\n max = Math.Max(temp, max);\n }\n else\n {\n Console.WriteLine(count + 1);\n break;\n }\n }\n }\n }\n }\n\n partial class PerfectPair\n {\n static string[] tokens = new string[0];\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 if (cur_token == tokens.Length)\n ReadArray(' ');\n return int.Parse(tokens[cur_token++]);\n }\n\n static long NextLong()\n {\n if (cur_token == tokens.Length)\n ReadArray(' ');\n return long.Parse(tokens[cur_token++]);\n }\n\n static double NextDouble()\n {\n if (cur_token == tokens.Length)\n ReadArray(' ');\n return double.Parse(tokens[cur_token++]);\n }\n\n static decimal NextDecimal()\n {\n if (cur_token == tokens.Length)\n ReadArray(' ');\n return decimal.Parse(tokens[cur_token++]);\n }\n\n static string NextToken()\n {\n if (cur_token == tokens.Length)\n ReadArray(' ');\n return tokens[cur_token++];\n }\n\n static string ReadLine()\n {\n return Console.ReadLine();\n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "0419c773567c098777782020a9a0c7e1", "src_uid": "82026a3c3d9a6bda2e2ac6e14979d821", "apr_id": "0efcab3b4b195bc1d76759f2aa375ab4", "difficulty": 1600, "tags": ["math", "greedy"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.8930964171278765, "equal_cnt": 7, "replace_cnt": 4, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 6, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\n\nnamespace m_perfect\n{\n class Program\n {\n static void Main(string[] args)\n {\n\n\n string[] tokens = Console.ReadLine().Split(' ');\n\n long x=0, y=0, m = 0;\n x =long.Parse(tokens[0]);\n y = long.Parse(tokens[1]);\n m = long.Parse(tokens[2]);\n\n int p=mperfect(x, y, m);\n\n Console.WriteLine(p);\n Console.ReadLine();\n\n\n\n }\n\n protected static int mperfect(long x, long y, long m)\n {\n int i = 0;\n if (x < 0 && y < 0 && ((x < m) && (y < m)))\n return -1;\n else if ((x == 0 && y < 0 && (x < m && y < m)) || ((y == 0) && (x < 0) && (x < m && y < m)))\n return -1;\n else if (x == 0 && y == 0 && y < m)\n return -1;\n else\n {\n while (x < m && y < m)\n {\n if (x < y)\n {\n x = x + y;\n i++;\n if (x >= m || y >= m)\n return i;\n }\n else\n {\n y = x + y;\n i++;\n if (x >= m || y >= m)\n return i;\n }\n\n }\n\n return 0;\n\n } \n \n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "e3fe128526335fb3548d7d6f1fd41b30", "src_uid": "82026a3c3d9a6bda2e2ac6e14979d821", "apr_id": "458d8f8605baf33b48a8d50cc7cda5d8", "difficulty": 1600, "tags": ["math", "greedy"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.5145579671784013, "equal_cnt": 21, "replace_cnt": 13, "delete_cnt": 4, "insert_cnt": 4, "fix_ops_cnt": 21, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\n\nnamespace m_perfect\n{\n class Program\n {\n static void Main(string[] args)\n {\n\n\n string[] tokens = Console.ReadLine().Split(' ');\n\n long x=0, y=0, m = 0;\n x =long.Parse(tokens[0]);\n y = long.Parse(tokens[1]);\n m = long.Parse(tokens[2]);\n\n long p=mperfect(x, y, m);\n\n Console.WriteLine(p);\n Console.ReadLine();\n\n\n\n }\n\n protected static long mperfect(long x, long y, long m)\n {\n long i = 0;\n\n if (x >= m || y >= m)\n return 0;\n else if (x < 0 && y < 0 && ((x < m) && (y < m)))\n return -1;\n //else if ((x == 0 && y < 0 && (x < m && y < m)) || ((y == 0) && (x < 0) && (x < m && y < m)))\n // return -1;\n else if (x == 0 && y == 0 && y < m)\n return -1;\n \n else\n {\n if (x < 0 && y > 0)\n {\n i = -x / y;\n x = x + y * i;\n }\n else if (y < 0 && x > 0)\n {\n i = -y / x;\n y = y + x * i;\n }\n\n while (x < m && y < m)\n {\n if (x < y)\n {\n x = x + y;\n i++;\n if (x >= m || y >= m)\n return i;\n }\n else\n {\n y = x + y;\n i++;\n if (x >= m || y >= m)\n return i;\n }\n\n }\n\n return i;\n\n } \n \n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "cfd94ac6b405352f318bea179600ff99", "src_uid": "82026a3c3d9a6bda2e2ac6e14979d821", "apr_id": "458d8f8605baf33b48a8d50cc7cda5d8", "difficulty": 1600, "tags": ["math", "greedy"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9519890260631001, "equal_cnt": 5, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 4, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\n\nnamespace Testriep\n{\n public class Program\n {\n\n \n public static void Main(string[] args)\n {\n var line=Console.ReadLine().Split(' ');\n var p = int.Parse(line[0]);\n var h = int.Parse(line[1]);\n if (h % 2 == 0)\n {\n h--;\n }\n while (h > p)\n {\n if (isGood(h,p))\n {\n Console.WriteLine(h);\n return;\n }\n h -= 2;\n }\n Console.WriteLine(-1);\n //Console.WriteLine(Console.ReadLine().Split(' ').Select(e => int.Parse(e)).Where(e => e != 0).Distinct().Count());\n }\n\n static bool isGood(int n,int p)\n {\n for(int i = 2; i <= p; i++)\n {\n if (n % i == 0)\n {\n return false;\n }\n }\n return true;\n }}}", "lang": "MS C#", "bug_code_uid": "d26ba1c15dcccf771be7541aec36fcbe", "src_uid": "b533203f488fa4caf105f3f46dd5844d", "apr_id": "c718abe70d223aafa221946c5474c0cc", "difficulty": 1400, "tags": ["math", "brute force", "number theory"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.5339055793991416, "equal_cnt": 8, "replace_cnt": 4, "delete_cnt": 1, "insert_cnt": 2, "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 Acyclic\n{\n class B467\n {\n public static void Main()\n {\n string[] tmp = Console.ReadLine().Split(' ');\n double p = Int32.Parse(tmp[0]);\n int y = Int32.Parse(tmp[1]);\n\n\n int x = y;\n while(x!=p)\n {\n bool flag = true;\n int range = (int)Math.Max(p, Math.Floor(y / p));\n\n for (long i=2;i<=range;i++)\n {\n int low = (int)Math.Min(p, Math.Floor((double)y / i));\n if ((x % i) == 0)\n {\n if (x / i <= low)\n {\n flag = false;\n break;\n }\n\n }\n }\n if(flag)\n {\n Console.WriteLine(x);\n return;\n }\n x--;\n }\n if (x == p) Console.WriteLine(-1);\n\n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "4ea1607d5e0559d0b35b5e411cbecb19", "src_uid": "b533203f488fa4caf105f3f46dd5844d", "apr_id": "1e46c2009d93a377b84b91c0b8bde762", "difficulty": 1400, "tags": ["math", "brute force", "number theory"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9038036034137604, "equal_cnt": 21, "replace_cnt": 14, "delete_cnt": 4, "insert_cnt": 3, "fix_ops_cnt": 21, "bug_source_code": "\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\n\nnamespace ProgrammingContest.Codeforces.Round39\n{\n class B\n {\n public static void Main()\n {\n Scanner scanner = Scanner.FromConsole();\n long n = scanner.NextLong(), m = scanner.NextLong(),\n t = scanner.NextLong();\n long p = n * m;\n for(int i = 1; n > 0 && m > 0; i++)\n {\n\n if (i == t)\n {\n long res = 0;\n res += (n+1)/2;\n //Console.WriteLine(res);\n if(m%2 == 0) res += n-(n+1)/2;\n else res += (n + 1) / 2;\n //Console.WriteLine(res);\n if(m-2 >0)\n {\n m -= 2;\n res += (m - (m + 1) / 2) * 2;\n //Console.WriteLine(res);\n }\n Console.WriteLine(res);\n return;\n //2 * x + 2 * y;\n }\n n -= 2; m -= 2;\n }\n Console.WriteLine(0);\n }\n\n #region Scanner\n public class Scanner : IDisposable\n {\n const int MAX_BUFFER_SIZE = 1024 * 1024 * 16;\n const string DELIMITER = \" \\r\\n\\t\";\n\n System.IO.TextReader stream;\n int pos = 0, len = 0;\n bool endStream = false;\n int BufferSize = MAX_BUFFER_SIZE;\n char[] buffer = new char[MAX_BUFFER_SIZE];\n\n public enum Option { Buffering, NoBuffering }\n\n public Scanner(System.IO.TextReader stream, Option bufferingOption)\n {\n this.stream = stream;\n if (bufferingOption == Option.NoBuffering) BufferSize = 1;\n }\n\n void ReadBuffer()\n {\n pos = 0;\n len = stream.ReadBlock(buffer, 0, BufferSize);\n endStream = len == 0;\n }\n\n void SkipDelimiter()\n {\n while (!endStream && IsDelimiter(Peek())) NextChar();\n }\n\n static bool IsDelimiter(char c)\n {\n return DELIMITER.Contains(c);\n }\n\n bool Continue(char c)\n {\n return !endStream && !IsDelimiter(c);\n }\n\n char Peek()\n {\n if (pos >= len) ReadBuffer();\n return buffer[pos];\n }\n\n public char NextChar()\n {\n if (pos >= len) ReadBuffer();\n return buffer[pos++];\n }\n\n public string NextString()\n {\n SkipDelimiter();\n StringBuilder res = new StringBuilder();\n for (char c = NextChar(); Continue(c); c = NextChar()) res.Append(c);\n return res.ToString();\n }\n\n public int NextInt()\n {\n SkipDelimiter();\n int res = 0;\n char c = NextChar();\n int sign = 1;\n if (c == '-') { sign = -1; c = NextChar(); }\n for (; Continue(c); c = NextChar())\n res = res * 10 + (c - '0');\n return sign * res;\n }\n\n public long NextLong()\n {\n SkipDelimiter();\n long res = 0;\n char c = NextChar();\n long sign = 1;\n if (c == '-') { sign = -1; c = NextChar(); }\n for (; Continue(c); c = NextChar())\n res = res * 10 + (c - '0');\n return sign * res;\n }\n\n public int[] NextInts(int n)\n {\n int[] res = new int[n];\n for (int i = 0; i < n; i++) res[i] = NextInt();\n return res;\n }\n\n public long[] NextLongs(int n)\n {\n long[] res = new long[n];\n for (int i = 0; i < n; i++) res[i] = NextLong();\n return res;\n }\n\n public string[] NextStrings(int n)\n {\n string[] res = new string[n];\n for (int i = 0; i < n; i++) res[i] = NextString();\n return res;\n }\n\n public static Scanner FromString(string s)\n {\n return new Scanner(new System.IO.StreamReader(new System.IO.MemoryStream(Encoding.ASCII.GetBytes(s))), Option.Buffering);\n }\n\n public static Scanner FromFile(string path)\n {\n return new Scanner(new System.IO.StreamReader(path), Option.Buffering);\n }\n\n public static Scanner FromConsole()\n {\n return new Scanner(Console.In, Option.Buffering);\n }\n\n public void Dispose()\n {\n stream.Close();\n }\n }\n #endregion\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "15eda416953b120fc4d01171593f64f5", "src_uid": "fa1ef5f9bceeb7266cc597ba8f2161cb", "apr_id": "b3e44cfcfa57dc0f702222d34932abd1", "difficulty": 1600, "tags": ["math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9968701095461658, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "using System;\n\nclass Program\n{\n static void Main()\n {\n string[] inp = Console.In.ReadToEnd().Split(' ', '\\n');\n int n = int.Parse(inp[0]),\n m = int.Parse(inp[1]),\n x = int.Parse(inp[2]);\n int[,] t = new int[n, m];\n int k = 0;\n for (int i = 0; i < n; i++)\n {\n for (int j = 0; j < m; j++)\n {\n if ((i + j) % 2 == 0)\n {\n if(Math.Min(i, Math.Min(n - i - 1, Math.Min(j, n - j - 1))) + 1 == x)\n k++;\n }\n }\n }\n Console.WriteLine(k);\n }\n}\n\n", "lang": "Mono C#", "bug_code_uid": "11516272807f55ef1e7226f224de9364", "src_uid": "fa1ef5f9bceeb7266cc597ba8f2161cb", "apr_id": "76e2094051416102c7ed4603faf481e4", "difficulty": 1600, "tags": ["math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9989208633093525, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "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 K = re.i();\n int A = 0;\n for(int i=0;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 int.Parse(x)).ToArray();\n }\n\n static void PrintLn(object obj)\n {\n Console.WriteLine(obj.ToString());\n }\n\n public static string Reverse(string s)\n {\n char[] charArray = s.ToCharArray();\n Array.Reverse(charArray);\n return new string(charArray);\n }\n\n\n public static void PrintLnCollection(IEnumerable col)\n {\n PrintLn(string.Join(\" \", col));\n }\n\n\n public static void PrintLn(params object[] v)\n {\n PrintLnCollection(v);\n }\n\n public static string ReadLine()\n {\n return Console.ReadLine();\n }\n\n\n public static string MySubstring(this string str, int start, int finish)\n {\n if (start > finish) return \"\";\n return str.Substring(start, finish - start + 1);\n }\n\n\n public static bool IsInRange(this int a, int lb, int ub)\n {\n return (a >= lb) && (a <= ub);\n }\n\n private static void mergeDS(int i, int j, int[] a)\n {\n int t = a[j];\n for (int ii = 0; ii < a.Length; ii++)\n {\n if (a[ii] == t)\n a[ii] = a[i];\n }\n }\n\n private static T MyMax(params T[] a)\n {\n return a.Max();\n }\n\n private static T MyMin(params T[] a)\n {\n return a.Min();\n }\n\n\n private static int[] GetPrimesLessThan(int x)\n {\n if (x < 2)\n return new int[0];\n\n int[] a = new int[x];\n\n a[0] = 1; a[1] = 1;\n\n for (int i = 0; i < a.Length; i++)\n {\n if (a[i] == 0)\n for (int j = 2 * i; j < a.Length; j += i)\n {\n a[j] = 1;\n }\n }\n\n var abc = new List(x);\n\n for (int i = 0; i < a.Length; i++)\n {\n if (a[i] == 0)\n abc.Add(i);\n }\n\n return abc.ToArray();\n }\n\n private static int FindNearestLEQElementInTheArray(int[] a, int startIndex, int endIndex, int target)\n {\n if (startIndex == endIndex)\n {\n if (a[startIndex] <= target)\n return startIndex;\n else\n return -1;\n }\n\n if (startIndex + 1 == endIndex)\n {\n if (a[endIndex] <= target)\n return endIndex;\n else if (a[startIndex] <= target)\n return startIndex;\n else\n return -1;\n }\n\n int mid = (startIndex + endIndex) / 2;\n if (target == a[mid])\n return mid;\n else if (target < a[mid])\n return FindNearestLEQElementInTheArray(a, startIndex, mid - 1, target);\n else\n return FindNearestLEQElementInTheArray(a, mid, endIndex, target);\n }\n\n private static int FindNearestLEQElementInTheArray(int[] a, int target)\n {\n return FindNearestLEQElementInTheArray(a, 0, a.Length - 1, target);\n }\n\n private static int gcd(int a, int b)\n {\n int r = a % b;\n while (r != 0)\n {\n a = b;\n b = r;\n r = a % b;\n }\n return b;\n }\n\n //----------------------------------------------------------------------------\n\n static string GetSha1(string filePath)\n {\n using (FileStream fs = new FileStream(filePath, FileMode.Open))\n using (BufferedStream bs = new BufferedStream(fs))\n {\n using (SHA1Managed sha1 = new SHA1Managed())\n {\n byte[] hash = sha1.ComputeHash(bs);\n StringBuilder formatted = new StringBuilder(2 * hash.Length);\n foreach (byte b in hash)\n {\n formatted.AppendFormat(\"{0:X2}\", b);\n }\n\n return formatted.ToString();\n }\n }\n }\n\n\n static bool canFit(int a1, int b1, int a2, int b2)\n {\n int[] r1 = { a1, b1 };\n int[] r2 = { a2, b2 };\n\n Array.Sort(r1);\n Array.Sort(r2);\n\n bool ans = (r1[0] <= r2[0]) && (r1[1] <= r2[1]);\n\n return ans;\n\n }\n\n static Dictionary dcnt = new Dictionary();\n\n static int cntd(int x)\n {\n if (x == 1) return 1;\n\n if (dcnt.ContainsKey(x))\n return dcnt[x];\n\n int ans = 0;\n for (int i = 1; i <= x/2; i++)\n {\n if (x % i == 0)\n ans++;\n }\n\n ans++;\n dcnt[x] = ans;\n return ans;\n }\n\n\n static void Main(string[] args)\n {\n\n int[] a = ReadIntArrayLine();\n\n int ans = 0;\n for (int i = 1; i <= a[0]; i++)\n for (int j = 1; j <= a[1]; j++)\n for (int k = 1; k <= a[2]; k++)\n {\n if (dcnt.ContainsKey(i * j * k)) ans = (ans+ dcnt[i * j * k])% 1073741824;\n else\n {\n ans = (ans+cntd(i*j*k)) % 1073741824;\n }\n }\n\n PrintLn(ans);\n }\n\n private static int cntdp(int i, int j)\n {\n if (dcnt.ContainsKey(i * j))\n return dcnt[i * j];\n\n int d = gcd(i, j);\n\n int a = i / d;\n int b = j / d;\n\n int temp = dcnt[i * j] = cntd(a) * cntd(b * d * d);\n\n return temp;\n\n\n }\n } \n}\n", "lang": "MS C#", "bug_code_uid": "b633cf5349c8f0dbe132e73f0a4a3d79", "src_uid": "4fdd4027dd9cd688fcc70e1076c9b401", "apr_id": "1128a89aa053fa50275880aad964383a", "difficulty": 1300, "tags": ["number theory", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.8783297336213103, "equal_cnt": 11, "replace_cnt": 6, "delete_cnt": 3, "insert_cnt": 2, "fix_ops_cnt": 11, "bug_source_code": "using System;\n\n\nnamespace ConsoleApplication5\n{\n class Program\n {\n static void Main(string[] args)\n {\n string s = Console.ReadLine();\n var s1 = s.Split(' ');\n long r =0;\n long n = long.Parse(s1[0]);\n long a = long.Parse(s1[1]);\n long b = long.Parse(s1[2]);\n long c = long.Parse(s1[3]);\n if (n % 4 == 0)\n r = 0;\n else\n {\n if (n % 4 == 1)\n {\n if (c < 3 * a || c < a + b)\n r = c;\n else\n {\n if (3 * a < c || 3 * a < a + b)\n r = 3 * a;\n else\n r = a + b;\n }\n }\n else\n {\n if (n % 4 == 2)\n {\n if (b < 2 * a || b < 2 * c)\n r = b;\n else\n {\n if (2 * a < b || 2 * a < 2 * c)\n r = 2 * a;\n else\n r = 2 * c;\n }\n }\n else\n {\n if (a < 3 * c || a < c + b)\n r = a;\n else\n {\n if (3 * c < a || 3 * c < c + b)\n r = 3 * c;\n else\n r = c + b;\n }\n }\n }\n }\n Console.WriteLine(r);\n Console.ReadLine();\n } \n }\n}\n", "lang": "MS C#", "bug_code_uid": "2ae7bc692794d57f8900cb2af85f4c9c", "src_uid": "c74537b7e2032c1d928717dfe15ccfb8", "apr_id": "4aff0ee528c6f2d9cba763e1feb8d89b", "difficulty": 1300, "tags": ["brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.40122199592668023, "equal_cnt": 28, "replace_cnt": 18, "delete_cnt": 7, "insert_cnt": 3, "fix_ops_cnt": 28, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace ConsoleApplication2\n{\n class Program\n {\n static void Main(string[] args)\n {\n\n int a, b, c,n = 0;\n\n string all_nums = Console.ReadLine();\n\n String[] numbers = new String[4];\n numbers=all_nums.Split(',');\n\n n = int.Parse(numbers[0]);\n a = int.Parse(numbers[1]);\n b = int.Parse(numbers[2]);\n c = int.Parse(numbers[3]);\n \n int to_buy = 4 - ((n) % 4);\n\n if (n < 4)\n to_buy = 4 - n;\n\n if (to_buy == 0 || to_buy %4==0)\n Console.WriteLine(0);\n\n if(to_buy==1)\n \n Console.WriteLine(a);\n if(to_buy==2)\n {\n int x = 2 * a;\n int y = b;\n if (x > y)\n Console.WriteLine(y);\n else\n Console.WriteLine(x);\n }\n\n if(to_buy==3)\n {\n\n int x = 3*a;\n int y=a+b;\n int z=c;\n int h=b+(2*a);\n\n int min=x;\n\n if(y=1 && k<=Math.Pow(10, 8))\n {\n numberNotebooks = getNumberOfSheets(n, k);\n\n Console.WriteLine(numberNotebooks);\n }\n }\n\n public static int getNumberOfSheets(double n, double k)\n {\n int neededSheets;\n int red;\n int green;\n int blue;\n\n red = (int)Math.Ceiling(Convert.ToDecimal((2 * n) / k));\n green = (int)Math.Ceiling(Convert.ToDecimal((5 * n) / k));\n blue = (int)Math.Ceiling(Convert.ToDecimal((8 * n) / k));\n\n neededSheets = red + green + blue; \n\n return neededSheets;\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "77bcdf36118ed802a7c92c214e714298", "src_uid": "d259a3a5c38af34b2a15d61157cc0a39", "apr_id": "1cb5f14387748002fdb9c2ab8a6199e8", "difficulty": 800, "tags": ["math"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.8006962576153177, "equal_cnt": 12, "replace_cnt": 5, "delete_cnt": 3, "insert_cnt": 4, "fix_ops_cnt": 12, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\n\nclass Program\n{\n public static void Main(string[] args)\n {\n var n = int.Parse(Console.ReadLine());\n var m = int.Parse(Console.ReadLine());\n\n var z = n;\n\n var res = 0;\n\n while (z<=m)\n {\n if (z == m)\n {\n Console.WriteLine(\"YES\");\n Console.WriteLine(res);\n return;\n }\n\n res++;\n z *= n;\n }\n\n Console.WriteLine(\"NO\");\n }\n}", "lang": "MS C#", "bug_code_uid": "8553300756bdcc628756e3348b213be7", "src_uid": "8ce89b754aa4080e7c3b2c3b10f4be46", "apr_id": "2e123d4ec7a8f998a4c81b0263f75e2e", "difficulty": 1000, "tags": ["math"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9125979505726342, "equal_cnt": 5, "replace_cnt": 0, "delete_cnt": 2, "insert_cnt": 3, "fix_ops_cnt": 5, "bug_source_code": "using System;\n\nnamespace WrongSubtraction\n{\n class Program\n {\n static void Main(string[] args)\n {\n int[] arr = new int[2];\n arr = Array.ConvertAll(Console.ReadLine().Split(' '), arTemp => Convert.ToInt32(arTemp));\n int r;\n while (arr[1] > 0) {\n r = arr[0]%10;\n if (r > 0) \n {\n if (r <= arr[1])\n {\n arr[0] -= r;\n arr[1] -= r;\n }\n }\n else\n {\n arr[0]/=10;\n arr[1]--;\n }\n\n }\n Console.WriteLine(arr[0]);\n }\n }\n }\n", "lang": "Mono C#", "bug_code_uid": "ebf6971b080cb0a1640e8cfdfc9cfbd4", "src_uid": "064162604284ce252b88050b4174ba55", "apr_id": "02dfef0e50cd0963cf9549af2cd1e83d", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.9783228750713063, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 2, "insert_cnt": 0, "fix_ops_cnt": 3, "bug_source_code": "using System;\nusing System.Collections;\nusing System.Collections.Generic;\n\n// (づ°ω°)づミe★゜・。。・゜゜・。。・゜☆゜・。。・゜゜・。。・゜\n\nnamespace dd\n{\n\tclass MainClass\n\t{\n\t\tconst long MOD = 1000 * 1000 * 1000 + 7;\n\n\t\tpublic static long BinPow(long a , long b)\n\t\t{\n\t\t\tif (b == 0)\n\t\t\t\treturn 1;\n\t\t\tif (b % 2 == 0)\n\t\t\t{\n\t\t\t\tlong Q = BinPow(a, b / 2); Q %= MOD;\n\t\t\t\treturn (Q * Q) % MOD;\n\t\t\t}\n\t\t\treturn ((BinPow(a, b - 1) % MOD) * a) % MOD;\n\t\t}\n\n\n\t\tpublic static void Main(string[] args)\n\t\t{\n\t\t\tlong n = Reader.NextLong();\n\t\t\tlong m = Reader.NextLong();\n\t\t\tlong k = Reader.NextLong();\n\t\t\tlong ans = 0;\n\t\t\tif (k == -1 && (n % 2 != m % 2))\n\t\t\t{\n\t\t\t\tConsole.WriteLine(ans);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tn = (n - 1) * (m - 1);\n\t\t\t\tans = BinPow(2, n);\n\t\t\t\tConsole.WriteLine(ans);\n\t\t\t}\n\t\t}\n\n\t\tclass Reader\n\t\t{\n\t\t\tpublic static int NextInt()\n\t\t\t{\n\t\t\t\tint cnt = 0, sign = 1;\n\t\t\t\tchar ch = Convert.ToChar(Console.Read());\n\t\t\t\twhile (!(ch >= '0' && ch <= '9') && ch != '-')\n\t\t\t\t\tch = Convert.ToChar(Console.Read());\n\t\t\t\tif (ch == '-')\n\t\t\t\t{\n\t\t\t\t\tsign = -1;\n\t\t\t\t\tch = Convert.ToChar(Console.Read());\n\t\t\t\t}\n\t\t\t\twhile (ch >= '0' && ch <= '9')\n\t\t\t\t{\n\t\t\t\t\tint t = Convert.ToInt32(ch);\n\t\t\t\t\tcnt = cnt * 10 + ch - '0';\n\t\t\t\t\tch = Convert.ToChar(Console.Read());\n\t\t\t\t}\n\t\t\t\treturn cnt * sign;\n\t\t\t}\n\t\t\tpublic static long NextLong()\n\t\t\t{\n\t\t\t\tlong cnt = 0, sign = 1;\n\t\t\t\tchar ch = Convert.ToChar(Console.Read());\n\t\t\t\twhile (!(ch >= '0' && ch <= '9') && ch != '-')\n\t\t\t\t\tch = Convert.ToChar(Console.Read());\n\t\t\t\tif (ch == '-')\n\t\t\t\t{\n\t\t\t\t\tsign = -1;\n\t\t\t\t\tch = Convert.ToChar(Console.Read());\n\t\t\t\t}\n\t\t\t\twhile (ch >= '0' && ch <= '9')\n\t\t\t\t{\n\t\t\t\t\tlong t = Convert.ToInt64(ch);\n\t\t\t\t\tcnt = cnt * 10 + ch - '0';\n\t\t\t\t\tch = Convert.ToChar(Console.Read());\n\t\t\t\t}\n\t\t\t\treturn cnt * sign;\n\t\t\t}\n\t\t}\n\t}\n}", "lang": "MS C#", "bug_code_uid": "c5b64c809f6e9c17f355667cf32f3026", "src_uid": "6b9eff690fae14725885cbc891ff7243", "apr_id": "1f7792a7dcaf7bb721285d1521708334", "difficulty": 1800, "tags": ["math", "combinatorics", "number theory", "constructive algorithms"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C#"} {"similarity_score": 0.26172671651937457, "equal_cnt": 20, "replace_cnt": 13, "delete_cnt": 4, "insert_cnt": 2, "fix_ops_cnt": 19, "bug_source_code": "using System;\nusing System.Text;\nusing System.Collections.Generic;\n\nnamespace Codeforces_235_2\n{\n class Program\n {\n static void Main(string[] args)\n {\n long n, m, t, ret = 0;\n string[] d = Console.ReadLine().Split(' ');\n n = d[0].Length;\n long.TryParse(d[1], out m);\n int[] N = new int[10];\n for (int i = 0; i < n; ++i) ++N[ d[0][i] - '0' ];\n t = m;\n do\n {\n string s = t.ToString();\n int L = s.Length;\n if (L > n) break;\n if (L == n)\n {\n int[] T = new int[10];\n for (int i = 0; i < n; ++i) ++T[s[i] - '0'];\n if (N[0] == T[0] && N[1] == T[1] && N[2] == T[2] && N[3] == T[3] && N[4] == T[4] && N[5] == T[5]\n && N[6] == T[6] && N[7] == T[7] && N[8] == T[8] && N[9] == T[9]) ++ret;\n }\n t += m;\n } while (true);\n Console.WriteLine(ret);\n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "20578d72a215397398a922f62097f532", "src_uid": "5eb90c23ffa3794fdddc5670c0373829", "apr_id": "2bf0efaf99714160dd4ef853b431b851", "difficulty": 2000, "tags": ["dp", "combinatorics", "bitmasks", "number theory", "brute force"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.8631415241057543, "equal_cnt": 4, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 3, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\n\nnamespace ConsoleApp1\n{\n public class UserInput\n {\n public static void Main(string[] args)\n {\n int n = int.Parse(Console.ReadLine());\n int k = int.Parse(Console.ReadLine());\n\n for (int i = 0; i < k; i++)\n {\n if (n % 10 != 0)\n {\n n -= 1;\n }\n else\n {\n n /= 10;\n }\n }\n\n Console.WriteLine(n);\n }\n }\n}\n", "lang": ".NET Core C#", "bug_code_uid": "344bb2a646f82702ad65ff1a001f0269", "src_uid": "064162604284ce252b88050b4174ba55", "apr_id": "211080a9a09eece0ef7100c45230dc61", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9930955120828538, "equal_cnt": 5, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 4, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace Learning\n{\n class Program\n {\n static void Main(string[] args)\n {\n var line = Console.ReadLine().Split(' ');\n var al = Int32.Parse(line[0]);\n var ar = Int32.Parse(line[1]);\n line = Console.ReadLine().Split(' ');\n var bl = Int32.Parse(line[0]);\n var br = Int32.Parse(line[1]);\n if (bl >= ar-1 && bl <= ar + 3)\n {\n Console.Out.WriteLine(\"YES\");\n return;\n }\n if(br >= al-1 && br <= al + 3)\n {\n Console.Out.WriteLine(\"YES\");\n return;\n }\n Console.Out.WriteLine(\"NO\");\n //Console.ReadLine();\n }\n\n }\n}\n", "lang": "MS C#", "bug_code_uid": "660ab0723028d7b34b3136ad9dc40349", "src_uid": "36b7478e162be6e985613b2dad0974dd", "apr_id": "552ca2e4d0159e56b0b7642c12f674c5", "difficulty": 1300, "tags": ["math", "greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.764730818143281, "equal_cnt": 11, "replace_cnt": 7, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 10, "bug_source_code": "using System;\n\nnamespace CodeForces9\n{\n\tclass Program\n\t{\n\t\tstatic void Main(string[] args)\n\t\t{\n\t\t\tlong[] data = Array.ConvertAll(Console.ReadLine().Split(' '), a => long.Parse(a));\n\t\t\tlong min, max, boy;\n\t\t\tint n = (int)data[0];\n\t\t\tint m = (int)data[1];\n\t\t\tlong k = data[2];\n\t\t\tint x = (int)data[3];\n\t\t\tint y = (int)data[4];\n\t\t\tif (n==1)\n\t\t\t{\n\t\t\t\tmax = k / (n * m) + (k % m > 0 ? 1 : 0);\n\t\t\t\tmin = k / (n * m);\n\t\t\t\tboy = k / m + y % m;\n\t\t\t}\n\t\t\tif (n==2)\n\t\t\t{\n\t\t\t\tmax = k / (n * m) + (k % m > 0 ? 1 : 0);\n\t\t\t\tmin = k / (n * m);\n\t\t\t\tboy = k / (n * m) + (k % (n * m) >= (x - 1) * m + y ? 1 : 0);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tlong cicl = k / ((2 * n - 2) * m); //количество циклов, где по 1 проходу у краев и по два у центров\n\t\t\t\tk -= cicl * ((2 * n - 2) * m);\n\t\t\t\tint lastplace = (int)k % m;\n\t\t\t\tlastplace = lastplace == 0 ? m : lastplace;\n\t\t\t\tmin = cicl + k / (n * m) + (lastplace == 100 && k / (n * m) == 0 ? 1 : 0);\n\t\t\t\tmax = 2 * cicl + (k > m ? 1 : 0) + (k - n * m > 0 ? 1 : 0);\n\t\t\t\tboy = (x == 1 | x == n ? cicl : 2 * cicl) + (k / ((x - 1) * m + y) > 0 ? 1 : 0) + (k >= ((2 * n - x) * m + y) && x < n ? 1 : 0);\n\t\t\t}\n\t\t\t\n\t\t\tConsole.WriteLine($\"{max} {min} {boy}\");\n\n\t\t}\n\t}\n}\n", "lang": "MS C#", "bug_code_uid": "c680d08deca0354d3af0814d8b65e59d", "src_uid": "e61debcad37eaa9a6e21d7a2122b8b21", "apr_id": "a83a41a74a004ae54f2652770f256785", "difficulty": 1700, "tags": ["math", "constructive algorithms", "implementation", "binary search"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.6111416865406959, "equal_cnt": 48, "replace_cnt": 29, "delete_cnt": 12, "insert_cnt": 7, "fix_ops_cnt": 48, "bug_source_code": "\nusing System;\nusing System.Linq;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing Debug = System.Diagnostics.Debug;\nusing StringBuilder = System.Text.StringBuilder;\nusing System.Numerics;\nnamespace Program\n{\n\n public class Solver\n {\n public void Solve()\n {\n var n = sc.Integer();\n var T = sc.Integer();\n var a = sc.Long(n);\n long ans = 0;\n if (n * T <= 100000)\n {\n ans = Algorithm.LNDS(a, T);\n Debug.WriteLine(ans);\n }\n else\n {\n var s = a.Distinct().ToList();\n s.Add(-1);\n s.Sort();\n for (int i = 0; i < n; i++)\n a[i] = s.BinarySearch(a[i]);\n var m = s.Count;\n\n var DP = Enumerate(m + 1, x => new int[m, m]);\n for (int i = 0; i < m; i++)\n for (int j = i; j < m; j++)\n {\n DP[0][i, j] = 0;\n var dp = Enumerate(m * m + 100, x => 1L << 60);\n for (int k = 0; k < m; k++)\n {\n foreach (var x in a)\n {\n if (x < i) continue;\n if (x > j) continue;\n dp[dp.UpperBound(x)] = x;\n }\n DP[k + 1][i, j] = dp.LowerBound(1L << 60);\n }\n }\n long max = 0;\n for (int i = 0; i < m; i++)\n max = Math.Max(max, DP[1][i, i]);\n var to = new int[m];\n for (int i = 0; i < m; i++)\n {\n foreach (var x in a)\n if (x == i) to[i]++;\n }\n for (int i = 1; i < m; i++)\n to[i] = Math.Max(to[i], to[i - 1]);\n for (int i = 1; i <= m; i++)\n {\n for (int j = 0; j < m; j++)\n {\n for (int k = j; k < m; k++)\n {\n var cost = DP[i][j, k];\n var rem = T - i;\n max = Math.Max(max, cost + rem * to[k]);\n }\n }\n }\n ans = Math.Max(ans, max);\n\n\n }\n IO.Printer.Out.WriteLine(ans);\n }\n public IO.StreamScanner sc = new IO.StreamScanner(Console.OpenStandardInput());\n static T[] Enumerate(int n, Func f) { var a = new T[n]; for (int i = 0; i < n; ++i) a[i] = f(i); return a; }\n static public void Swap(ref T a, ref T b) { var tmp = a; a = b; b = tmp; }\n }\n\n\n}\n\n#region main\nstatic class Ex\n{\n static public string AsString(this IEnumerable ie) { return new string(System.Linq.Enumerable.ToArray(ie)); }\n static public string AsJoinedString(this IEnumerable ie, string st = \" \") { return string.Join(st, ie); }\n static public void Main()\n {\n var solver = new Program.Solver();\n solver.Solve();\n Program.IO.Printer.Out.Flush();\n }\n}\n#endregion\n#region Ex\nnamespace Program.IO\n{\n using System.IO;\n using System.Text;\n using System.Globalization;\n public class Printer : StreamWriter\n {\n static Printer() { Out = new Printer(Console.OpenStandardOutput()) { AutoFlush = false }; }\n public static Printer Out { get; set; }\n public override IFormatProvider FormatProvider { get { return CultureInfo.InvariantCulture; } }\n public Printer(System.IO.Stream stream) : base(stream, new UTF8Encoding(false, true)) { }\n public Printer(System.IO.Stream stream, Encoding encoding) : base(stream, encoding) { }\n public void Write(string format, T[] source) { base.Write(format, source.OfType().ToArray()); }\n public void WriteLine(string format, T[] source) { base.WriteLine(format, source.OfType().ToArray()); }\n }\n public class StreamScanner\n {\n public StreamScanner(Stream stream) { str = stream; }\n public readonly Stream str;\n private readonly byte[] buf = new byte[1024];\n private int len, ptr;\n public bool isEof = false;\n public bool IsEndOfStream { get { return isEof; } }\n private byte read()\n {\n if (isEof) return 0;\n if (ptr >= len) { ptr = 0; if ((len = str.Read(buf, 0, 1024)) <= 0) { isEof = true; return 0; } }\n return buf[ptr++];\n }\n public char Char() { byte b = 0; do b = read(); while ((b < 33 || 126 < b) && !isEof); return (char)b; }\n\n public string Scan()\n {\n var sb = new StringBuilder();\n for (var b = Char(); b >= 33 && b <= 126; b = (char)read())\n sb.Append(b);\n return sb.ToString();\n }\n public string ScanLine()\n {\n var sb = new StringBuilder();\n for (var b = Char(); b != '\\n'; b = (char)read())\n if (b == 0) break;\n else if (b != '\\r') sb.Append(b);\n return sb.ToString();\n }\n public long Long()\n {\n if (isEof) return long.MinValue;\n long ret = 0; byte b = 0; var ng = false;\n do b = read();\n while (b != 0 && b != '-' && (b < '0' || '9' < b));\n if (b == 0) return long.MinValue;\n if (b == '-') { ng = true; b = read(); }\n for (; true; b = read())\n {\n if (b < '0' || '9' < b)\n return ng ? -ret : ret;\n else ret = ret * 10 + b - '0';\n }\n }\n public int Integer() { return (isEof) ? int.MinValue : (int)Long(); }\n public double Double() { var s = Scan(); return s != \"\" ? double.Parse(Scan(), CultureInfo.InvariantCulture) : double.NaN; }\n private T[] enumerate(int n, Func f)\n {\n var a = new T[n];\n for (int i = 0; i < n; ++i) a[i] = f();\n return a;\n }\n\n public char[] Char(int n) { return enumerate(n, Char); }\n public string[] Scan(int n) { return enumerate(n, Scan); }\n public double[] Double(int n) { return enumerate(n, Double); }\n public int[] Integer(int n) { return enumerate(n, Integer); }\n public long[] Long(int n) { return enumerate(n, Long); }\n }\n}\n#endregion\n#region LIS long[]\nstatic public partial class Algorithm\n{\n /// Strictly Increasing SubSequence\n static public int LIS(this long[] a)\n {\n const long max = 1L << 60;\n var n = a.Length;\n var dp = new long[n + 1];\n for (int i = 0; i <= n; i++)\n dp[i] = max;\n foreach (var v in a)\n dp[dp.LowerBound(v)] = v;\n return dp.LowerBound(max);\n }\n /// Longest NonDecreasing SubSequence\n static public int LNDS(this long[] a, int T)\n {\n const long max = 1L << 60;\n var n = a.Length;\n var dp = new long[n * T + 1];\n for (int i = 0; i < dp.Length; i++)\n dp[i] = max;\n for (int i = 0; i < T; i++)\n {\n foreach (var v in a)\n dp[dp.UpperBound(v)] = v;\n }\n return dp.LowerBound(max);\n }\n}\n#endregion\n#region BinarySearch for long[]\nstatic public partial class Algorithm\n{\n\n static public int LowerBound(this long[] arr, long v)\n {\n int l = 0, h = arr.Length - 1;\n while (l <= h)\n {\n int m = ((h + l) >> 1);\n if (arr[m] < v) l = m + 1;\n else h = m - 1;\n }\n return l;\n }\n static public int UpperBound(this long[] a, long v)\n {\n int l = 0, h = a.Length - 1;\n while (l <= h)\n {\n int m = ((h + l) >> 1);\n if (a[m] <= v) l = m + 1;\n else h = m - 1;\n }\n return l;\n }\n\n}\n#endregion", "lang": "MS C#", "bug_code_uid": "ba80bc2777a0b65e96831034eaea264a", "src_uid": "26cf484fa4cb3dc2ab09adce7a3fc9b2", "apr_id": "b60aedf3e3f8d931c4103190e5cccd2a", "difficulty": 1900, "tags": ["dp", "constructive algorithms"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.7583892617449665, "equal_cnt": 15, "replace_cnt": 8, "delete_cnt": 0, "insert_cnt": 6, "fix_ops_cnt": 14, "bug_source_code": "using System;\nusing System.IO;\nusing System.Text;\n\nnamespace Symmetric_and_Transitive\n{\n internal class Program\n {\n private const int mod = 1000000007;\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 readonly long[] a = new long[4001];\n\n\n private static long A(int n)\n {\n if (n == 1)\n return 1;\n if (n == 2)\n return 3;\n\n if (a[n] == 0)\n a[n] = (3*A(n - 1) + A(n - 2))%mod;\n return a[n];\n }\n\n private static void Main(string[] args)\n {\n int n = Next();\n writer.WriteLine(A(n)%mod);\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": "24be2adfe172f11bc167d9a4e5d62894", "src_uid": "aa2c3e94a44053a0d86f61da06681023", "apr_id": "bfd7f00a8b26a5713f69ca11db43d3f4", "difficulty": 1900, "tags": ["dp", "math", "combinatorics"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9971830985915493, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "using System;\nclass Program\n {\n static void Main(string[] args)\n {\n string input = Console.ReadLine();\n char[] dt = {'H', 'Q', 9' };\n for (int i = 0; i < 3; ++i)\n if (input.IndexOf(dt[i]) >= 0) { dt[0] = 's'; break; }\n Console.WriteLine(dt[0] == 's' ?\"YES\":\"NO\");\n }\n }", "lang": "Mono C#", "bug_code_uid": "b4c35d6a34b6d683b8c6c9b2685c250a", "src_uid": "1baf894c1c7d5aeea01129c7900d3c12", "apr_id": "7acdc00dd7a781ee1153fe6fde4128ee", "difficulty": 900, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9992852037169406, "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.Text;\nusing System.Threading.Tasks;\nusing System.IO;\n\nnamespace PracticeForDummies\n{\n class Program\n {\n static void Main(string[] args)\n {\n string str = Console.ReadLine();\n for (int i = 0; i < str.Length; i++)\n {\n if (str.Contains(\"H\")|| str.Contains(\"Q\") || str.Contains(\"9\" )\n {\n Console.WriteLine(\"YES\");\n break;\n }\n\n else\n {\n Console.WriteLine(\"NO\");\n break;\n }\n }\n\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "2a53572ff58612fb8ee2b038a6836711", "src_uid": "1baf894c1c7d5aeea01129c7900d3c12", "apr_id": "4df9b702ffc9b756664947fe24a52306", "difficulty": 900, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.9638318670576735, "equal_cnt": 5, "replace_cnt": 2, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 4, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Collections;\nusing System.Linq;\n\n\n\n\nnamespace contest\n{\n\n class contest\n {\n\n\n static void Main(string[] args)\n {\n\n\n //int n = int.Parse(Console.ReadLine());\n //var input = Console.ReadLine().Split().Select(int.Parse).ToArray();\n\n //var num = Console.ReadLine().Split().Select(int.Parse).ToArray();\n\n\n\n\n var num = Console.ReadLine().Split().Select(int.Parse).ToArray();\n int a = num[0];\n int target = num[1];\n int dif = num[2];\n\n if (a == target) Console.WriteLine(\"YES\");\n else if (dif == 0) Console.WriteLine(\"NO\");\n else if (target < a && dif > 0) Console.WriteLine(\"NO\");\n else if ((target - a) % dif == 0) Console.WriteLine(\"YES\");\n else Console.WriteLine(\"NO\");\n\n\n\n\n //Console.WriteLine();\n\n\n\n\n\n ・//Console.Read();\n\n\n }\n\n \n\n\n }\n\n\n}\n", "lang": "MS C#", "bug_code_uid": "65d22f0e4052a849e84d8cc76c6f0f9b", "src_uid": "9edf42c20ddf22a251b84553d7305a7d", "apr_id": "2b44d6070f22bbf5fdca4e44249d9a7c", "difficulty": 1100, "tags": ["math"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.8723205964585274, "equal_cnt": 6, "replace_cnt": 2, "delete_cnt": 2, "insert_cnt": 1, "fix_ops_cnt": 5, "bug_source_code": "using System;\nusing System.Linq;\n\nclass Program\n{\n static void Main()\n {\n string inputString = Console.ReadLine();\n\n int n = inputString.Length;\n\n var firstString = inputString.Take(n / 2).ToArray();\n var secondString = inputString.Skip(n / 2 + 1).ToArray();\n\n firstString = firstString.Reverse().ToArray();\n\n int cnt = firstString.Where((t, i) => t != secondString[i]).Count();\n\n Console.WriteLine(cnt != 1 ? \"NO\" : \"YES\");\n }\n}", "lang": "MS C#", "bug_code_uid": "1614735ff0cc5fefaf35d5316c03cdcc", "src_uid": "fe74313abcf381f6c5b7b2057adaaa52", "apr_id": "cc2514981cc003c7f47eee1ea625c2d7", "difficulty": 1000, "tags": ["brute force", "constructive algorithms", "strings"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9993865568311279, "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.Globalization;\nusing System.IO;\nusing System.Linq;\nusing System.Numerics;\nusing System.Text;\nusing System.Threading;\n\n// (づ°ω°)づミe★゜・。。・゜゜・。。・゜☆゜・。。・゜゜・。。・゜\npublic class Solver\n{\n double Fun(double x, double y, double z)\n {\n return z * Math.Log(y) + Math.Log(Math.Log(x));\n }\n\n double Fun2(double x, double y, double z)\n {\n return Math.Log(y) + Math.Log(z) + Math.Log(Math.Log(x));\n }\n\n double Fun3(double x, double y, double z)\n {\n return Math.Pow(x, Math.Pow(y, z));\n }\n\n double Fun4(double x, double y, double z)\n {\n return Math.Pow(Math.Pow(x, y), z);\n }\n\n public void Solve()\n {\n double x = ReadDouble();\n double y = ReadDouble();\n double z = ReadDouble();\n\n double max = double.MinValue;\n string ans = \"\";\n Action act = (v, s) =>\n {\n if (v > max)\n {\n max = v;\n ans = s;\n }\n };\n if (x <= 1 && y <= 1 && z <= 1)\n {\n act(Fun3(x, y, z), \"x^y^z\");\n act(Fun3(x, z, y), \"x^z^y\");\n act(Fun4(x, y, z), \"(x^y)^z\");\n act(Fun4(x, z, y), \"(x^z)^y\");\n act(Fun3(y, x, z), \"y^x^z\");\n act(Fun3(y, z, x), \"y^z^x\");\n act(Fun4(y, x, z), \"(y^x)^z\");\n act(Fun4(y, z, x), \"(y^z)^x\");\n act(Fun3(z, x, y), \"z^x^y\");\n act(Fun3(z, y, x), \"z^y^x\");\n act(Fun4(z, x, y), \"(z^x)^y\");\n act(Fun4(z, y, x), \"(z^y)^x\");\n Write(ans);\n return;\n }\n\n if (x > 1)\n {\n act(Fun(x, y, z), \"x^y^z\");\n act(Fun(x, z, y), \"x^z^y\");\n act(Fun2(x, y, z), \"(x^y)^z\");\n act(Fun2(x, z, y), \"(x^z)^y\");\n }\n if (y > 1)\n {\n act(Fun(y, x, z), \"y^x^z\");\n act(Fun(y, z, x), \"y^z^x\");\n act(Fun2(y, x, z), \"(y^x)^z\");\n act(Fun2(y, z, x), \"(y^z)^x\");\n }\n if (z > 1)\n {\n act(Fun(z, x, y), \"z^x^y\");\n act(Fun(z, y, x), \"z^y^x\");\n act(Fun2(z, x, y), \"(z^x)^y\");\n act(Fun2(z, y, x), \"(z^y)^x\");\n }\n\n Write(ans);\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": "3310c7c100272ef7ee29ec75188dbbb1", "src_uid": "a71cb5cda754ad2bf479bc3b0164fc4c", "apr_id": "cb5aef0ab7b3bf60e789cba90408ed67", "difficulty": 2400, "tags": ["brute force", "math", "constructive algorithms"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.9891614375356532, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.IO;\n\nnamespace ConsoleApplication1\n{\n class Program\n {\n static int A, M, prod;\n static bool found = false;\n static string[] read;\n\n static void Main(string[] args)\n {\n read = Console.ReadLine().Split();\n A = Convert.ToInt32(read[0]);\n M = Convert.ToInt32(read[1]);\n\n\n while (A <= 2000000000) \n {\n prod = A % M;\n A += prod;\n\n if (prod == 0)\n {\n found = true;\n break;\n }\n }\n\n \n if(found)\n Console.WriteLine(\"Yes\");\n else\n Console.WriteLine(\"No\");\n\n Console.ReadKey();\n }\n\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "2d53fccf42ea06b6199562a7a9b78db4", "src_uid": "f726133018e2149ec57e113860ec498a", "apr_id": "3a53e118baae4aec95621adc9e1a0962", "difficulty": 1400, "tags": ["matrices", "math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.7498672331386086, "equal_cnt": 11, "replace_cnt": 5, "delete_cnt": 0, "insert_cnt": 6, "fix_ops_cnt": 11, "bug_source_code": "using System;\nusing System.Collections;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Runtime.InteropServices;\nusing System.Text;\n\nnamespace Achill\n{\n class Program\n {\n static void Main(string[] args)\n {\n int[] nd = Console.ReadLine().Split().Select(item => int.Parse(item)).ToArray();\n List t = Console.ReadLine().Split().Select(item => int.Parse(item)).ToList();\n int res = 0, cur = 0, i = 0;\n while(i < nd[0] && cur <= nd[1] - 10)\n {\n cur += t[i];\n cur += 10;\n res += 2;\n ++i;\n }\n cur += t[i];\n Console.WriteLine(i == nd[0]-1 ? res + (nd[1]-cur)/5 : -1);\n }\n }\n}", "lang": "Mono C#", "bug_code_uid": "95f7bafc3e391bfd7adbe3ba2689f4cb", "src_uid": "b16f5f5c4eeed2a3700506003e8ea8ea", "apr_id": "a4a9a67b8fcdcd803b3b2259f04408cc", "difficulty": 900, "tags": ["greedy", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.9821026431195923, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Globalization;\nusing System.IO;\nusing System.Linq;\nusing System.Text;\nusing System.Text.RegularExpressions;\nusing System.Threading;\nusing static System.Math;\n\nnamespace Olymp\n{\n public class ProblemSolver\n {\n private Tokenizer input;\n\n private int[] c;\n\n public void Solve()\n {\n c = input.ReadIntArray(24);\n\n var canBuild =\n e(1, 2, 3, 4) && e(9, 10, 11, 12) && (e(5, 6, 18, 20) && e(17, 18, 23, 24) && e(13, 14, 7, 8) && e(21, 22, 15, 16) || e(5, 6, 15, 16) && e(17, 18, 7, 8) && e(21, 22, 19, 20) && e(13, 14, 23, 24)) ||\n e(5, 6, 7, 8) && e(21, 22, 23, 24) && (e(3, 4, 18, 20) && e(17, 19, 11, 12) && e(9, 10, 13, 15) && e(14, 16, 1, 2) || e(3, 4, 13, 15) && e(14, 16, 11, 12) && e(9, 10, 18, 20) && e(17, 19, 1, 2)) ||\n e(13, 14, 15, 16) && e(17, 18, 19, 20) && (e(5, 7, 10, 12) && e(1, 3, 6, 8) && e(9, 11, 21, 23) && e(2, 4, 22, 24) || e(6, 8, 9, 11) && e(2, 4, 5, 7) && e(10, 12, 22, 24) && e(1, 3, 21, 23));\n Console.WriteLine(canBuild ? \"YES\" : \"NO\");\n\n // 1\n // 4 2 5 6\n // 3\n\n // 1 3\n // по часовой - 5,6,18,20 17,18,23,24 13,14,7,8 21,22,15,16\n // пр часовой - 5,6,15,16 17,18,7,8 21,22,19,20 13,14,23,24\n\n // 2 6\n // по часовой - 3,4,18,20 17,19,11,12 9,10,13,15 14,16,1,2\n // пр часовой - 3,4,13,15 14,16,11,12 9,10,18,20 17,19,1,2\n\n // 4 5\n // по часовой - 5,7,10,12 1,3,6,8 9,11,21,23 2,4,22,24\n // пр часовой - 6,8,9,11 2,4,5,7 10,12,22,24 1,3,21,23\n }\n\n public bool e(params int[] ids)\n {\n return ids.Select(i => c[i - 1]).Distinct().Count() == 1;\n }\n\n public ProblemSolver(TextReader input)\n {\n this.input = new Tokenizer(input);\n }\n }\n\n #region Service classes\n\n public class Tokenizer\n {\n private TextReader reader;\n\n public int ReadInt()\n {\n var c = SkipWS();\n if (c == -1)\n throw new EndOfStreamException();\n bool isNegative = false;\n if (c == '-' || c == '+')\n {\n isNegative = c == '-';\n c = this.reader.Read();\n if (c == -1)\n throw new InvalidOperationException();\n }\n if (!char.IsDigit((char)c))\n throw new InvalidOperationException();\n int result = (char)c - '0';\n c = this.reader.Read();\n while (c > 0 && !char.IsWhiteSpace((char)c))\n {\n if (!char.IsDigit((char)c))\n throw new InvalidOperationException();\n result = result * 10 + (char)c - '0';\n c = this.reader.Read();\n }\n if (isNegative)\n result = -result;\n return result;\n }\n\n public string ReadLine()\n {\n return reader.ReadLine();\n }\n\n public long ReadLong()\n {\n return long.Parse(this.ReadToken());\n }\n\n public double ReadDouble()\n {\n return double.Parse(this.ReadToken(), CultureInfo.InvariantCulture);\n }\n\n public int[] ReadIntArray(int n)\n {\n int[] a = new int[n];\n for (int i = 0; i < n; i++)\n a[i] = ReadInt();\n return a;\n }\n\n public long[] ReadLongArray(int n)\n {\n long[] a = new long[n];\n for (int i = 0; i < n; i++)\n a[i] = ReadLong();\n return a;\n }\n\n public double[] ReadDoubleArray(int n)\n {\n double[] a = new double[n];\n for (int i = 0; i < n; i++)\n a[i] = ReadDouble();\n return a;\n }\n\n public string ReadToken()\n {\n var c = SkipWS();\n if (c == -1)\n return null;\n var sb = new StringBuilder();\n while (c > 0 && !char.IsWhiteSpace((char)c))\n {\n sb.Append((char)c);\n c = this.reader.Read();\n }\n return sb.ToString();\n }\n\n private int SkipWS()\n {\n int c = this.reader.Read();\n if (c == -1)\n return c;\n while (c > 0 && char.IsWhiteSpace((char)c))\n c = this.reader.Read();\n return c;\n }\n\n public Tokenizer(TextReader reader)\n {\n this.reader = reader;\n }\n }\n\n class Program\n {\n public static void Main(string[] args)\n {\n var solver = new ProblemSolver(Console.In);\n solver.Solve();\n }\n }\n\n #endregion\n}", "lang": "MS C#", "bug_code_uid": "6e21a36b50fb8edd493a3f96061e284c", "src_uid": "881a820aa8184d9553278a0002a3b7c4", "apr_id": "30a4abb6b0e5cd9c95d6b49806b0dad1", "difficulty": 1500, "tags": ["brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9967845659163987, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "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\n public class C\n {\n static bool checkOk(int s , int [] inputs)\n {\n int c = inputs[s*4]; \n for(int i = 0;i<4; i++)\n {\n if (c != inputs[s * 4 + i])\n return false;\n }\n\n return true;\n }\n\n static bool checkRotation(int [,] arr, int [] inp ,int aindex )\n {\n\n int[] farr = new int[8];\n int[] sarr = new int[8];\n int fp=0, sp = 0;\n for(int i = 1; i < 9; i++)\n {\n farr[fp++] = inp[arr[aindex,i]];\n sarr[sp++] = inp[arr[aindex+1, i]];\n }\n\n bool checkR = false;\n for(int i = 0; i < 8; i++)\n {\n if (farr[i] != sarr[(i + 2) % 8])\n checkR=true;\n\n }\n\n if (!checkR)\n return true;\n\n for (int i = 0; i < 8; i++)\n {\n if (farr[i] != sarr[(i - 2+8) % 8])\n return false;\n\n }\n\n return true;\n }\n\n static void Main(string[] args)\n {\n int[,] arr = { { 0, 12, 13,4,5,16,17,20,21 },{ 2,14,15,6,7,18,19,22,23}, { 1,1,0,12,14,10,11,23,21 }, { 5,3,2,13,15,8,9,18,16}, { 3, 0,2,4,6,8,10,23,21} ,{ 4,1,3,5,7,9,11,22,20} };\n\n string inp = Console.ReadLine();\n int[] inputs = new int[24];\n string[] splits = inp.Split(' ');\n\n for(int i =0; i < 24; i++)\n {\n inputs[i] = int.Parse(splits[i]);\n }\n bool isPoss = false;\n for(int i =0; i<6; i+=2)\n {\n if(checkOk(arr[i,0], inputs) && checkOk(arr[i+1, 0], inputs))\n {\n\n isPoss = checkRotation(arr, inputs, i);\n break;\n }\n\n }\n if(isPoss)\n Console.Write(\"YES\");\n else\n Console.Write(\"NO\");\n \n\n }\n }\n", "lang": "MS C#", "bug_code_uid": "a6ad09c40d52c377089e311d6ef64bd6", "src_uid": "881a820aa8184d9553278a0002a3b7c4", "apr_id": "3cfed13c4a8efc9c0705df8cf7df209f", "difficulty": 1500, "tags": ["brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.930695847362514, "equal_cnt": 17, "replace_cnt": 5, "delete_cnt": 4, "insert_cnt": 7, "fix_ops_cnt": 16, "bug_source_code": "using System;\nusing System.Collections;\nusing System.Collections.Generic;\nusing System.Collections.Specialized;\nusing System.Diagnostics;\nusing System.IO;\nusing System.Text;\nusing System.Linq;\n\nnamespace Codeforces\n{\n internal class Program\n {\n private static void Main()\n {\n if (Debugger.IsAttached)\n {\n Console.SetIn(new StreamReader(@\"..\\..\\..\\..\\Tests\\D3.in\"));\n }\n\n Solve();\n\n if (Debugger.IsAttached)\n {\n Console.In.Close();\n Console.SetIn(new StreamReader(Console.OpenStandardInput()));\n Console.ReadLine();\n }\n }\n\n private static void Solve()\n {\n var s = Read();\n var intF = new int[10];\n var intS = new int[10];\n foreach (var n in s)\n {\n intF[n - '0']++;\n intS[n - '0']++;\n }\n var res = 0;\n var max = 0;\n var maxIndex = -1;\n for (int i = 0; i < 10; i++)\n {\n var j = (10 - i)%10;\n if(intF[i] > 0 && intS[j] > 0)\n {\n intF[i]--;\n intS[j]--;\n res++;\n for (int k = 0; k < 10; k++)\n {\n res += Math.Min(intF[k], intS[9 - k]);\n }\n intF[i]++;\n intS[j]++;\n }\n if(max < res)\n {\n max = res;\n maxIndex = i;\n }\n }\n intF[maxIndex]--;\n intS[(10 - maxIndex)%10]--;\n var resF = new StringBuilder();\n var resS = new StringBuilder();\n resF.Append(maxIndex);\n resS.Append((10 - maxIndex)%10);\n for (int i = 0; i < 10; i++)\n {\n var count = Math.Min(intF[i], intS[9 - i]);\n resF.Append(i.ToString()[0], count);\n resS.Append((9-i).ToString()[0], count);\n intF[i] -= count;\n intS[9 - i] -= count;\n }\n resF.Insert(0, \"0\", intF[0]);\n resS.Insert(0, \"0\", intS[0]);\n for (int i = 1; i < 10; i++)\n {\n resF.Append(i.ToString()[0], intF[i]);\n resS.Append(i.ToString()[0], intS[i]);\n }\n \n Console.WriteLine(new string(resF.ToString().Reverse().ToArray()));\n Console.WriteLine(new string(resS.ToString().Reverse().ToArray()));\n }\n\n #region Reader\n\n private static string Read()\n {\n return Console.ReadLine();\n }\n\n private static string[] ReadArray()\n {\n return Console.ReadLine().Split(' ');\n }\n\n private static int[] ReadIntArray()\n {\n var input = Console.ReadLine().Split(' ').Select(Int32.Parse).ToArray();\n return input;\n }\n\n private static int ReadInt()\n {\n return Int32.Parse(Console.ReadLine());\n }\n\n private static long ReadLong()\n {\n return long.Parse(Console.ReadLine());\n }\n\n private static int ReadNextInt(string[] input, int index)\n {\n return Int32.Parse(input[index]);\n }\n\n #endregion\n }\n}", "lang": "Mono C#", "bug_code_uid": "5497223cf755b6f886e48e7f293e2ea6", "src_uid": "34b67958a37865e1ca0529bbf528dd9a", "apr_id": "fb0d4c2f1eaaf04f2c0914ee435e2e89", "difficulty": 1900, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.9921208141825345, "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.Text;\nusing System.Text.RegularExpressions;\n\nnamespace Codeforces\n{\n class Program\n {\n public static void Main(string[] args)\n {\n string N = Console.ReadLine();\n int[] dig1 = new int[10];\n int[] dig2 = new int[10];\n foreach (char ch in N)\n {\n ++dig1[ch - '0'];\n ++dig2[ch - '0'];\n }\n\n List ret1 = new List();\n List ret2 = new List();\n int[] counts = new int[10];\n\n //try max\n counts[0] = counts[9] = Math.Min(dig1[0], dig1[9]);\n counts[1] = counts[8] = Math.Min(dig1[1], dig1[8]);\n counts[2] = counts[7] = Math.Min(dig1[2], dig1[7]);\n counts[3] = counts[6] = Math.Min(dig1[3], dig1[6]);\n counts[4] = counts[5] = Math.Min(dig1[4], dig1[5]);\n\n while (dig1[0] > counts[0])\n {\n ret1.Add('0');\n ret2.Add('0');\n dig1[0]--;\n dig2[0]--;\n }\n\n //try 10\n bool max = false;\n for (int x = 1; x < 6; x++)\n {\n if (dig1[x] > counts[x] && dig1[10 - x] > counts[10 - x])\n {\n ret1.Add((char)('0'+x));\n ret2.Add((char)('0'+10-x));\n dig1[x]--;\n dig2[10-x]--;\n\n max = true;\n break;\n }\n }\n\n if (!max)\n {\n for (int x = 1; x < 10; x++)\n {\n if (dig1[x] > counts[x] && dig1[10-x] > 0)\n {\n ret1.Add((char)('0' + x));\n ret2.Add((char)('0' + 10 - x));\n dig1[x]--;\n dig2[10 - x]--;\n\n max = true;\n break;\n }\n }\n }\n\n if (!max)\n {\n for (int x = 1; x < 10; x++)\n {\n if (dig1[x] > 0 && dig1[10 - x] > 0)\n {\n ret1.Add((char)('0' + x));\n ret2.Add((char)('0' + 10 - x));\n dig1[x]--;\n dig2[10 - x]--;\n\n max = true;\n break;\n }\n }\n }\n\n if (max)\n {\n for (int i = 0; i < 5; i++)\n {\n for (int j = 0; j < counts[i]; j++)\n {\n ret1.Add((char)('0'+i));\n dig1[i]--;\n ret2.Add((char)('0' + 9 - i));\n dig2[9 - i]--;\n }\n }\n }\n\n for (int i = 0; i < 10; i++)\n {\n for (int j = 0; j < dig1[i]; j++) {\n ret1.Add((char)('0' + i));\n }\n for (int j = 0; j < dig2[i]; j++)\n {\n ret2.Add((char)('0' + i));\n }\n }\n\n ret1.Reverse();\n ret2.Reverse();\n foreach(char ch in ret1)\n {\n Console.Write(ch);\n }\n Console.WriteLine();\n foreach (char ch in ret2)\n {\n Console.Write(ch);\n }\n Console.WriteLine();\n }\n }\n\n public class IO\n {\n public static int GetInt()\n {\n return int.Parse(Console.ReadLine());\n }\n\n public static IEnumerable GetInts()\n {\n foreach (string s in Console.ReadLine().Split())\n {\n yield return int.Parse(s);\n }\n }\n\n public static void Wl(object o)\n {\n Console.WriteLine(o.ToString());\n }\n }\n\n public struct Tuple\n {\n public T Item1;\n public K Item2;\n\n public Tuple(T t, K k)\n {\n Item1 = t;\n Item2 = k;\n }\n\n public override bool Equals(object obj)\n {\n var o = (Tuple)obj;\n return o.Item1.Equals(Item1) && o.Item2.Equals(Item2);\n }\n\n public override int GetHashCode()\n {\n return Item1.GetHashCode() ^ Item2.GetHashCode();\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "8aa4c007a3ce4d127bb65a394fd2442a", "src_uid": "34b67958a37865e1ca0529bbf528dd9a", "apr_id": "0c6225e2b9d936dc9a70ac332073c797", "difficulty": 1900, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.013181019332161687, "equal_cnt": 13, "replace_cnt": 12, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 13, "bug_source_code": "\nMicrosoft Visual Studio Solution File, Format Version 12.00\n# Visual Studio Version 16\nVisualStudioVersion = 16.0.29409.12\nMinimumVisualStudioVersion = 10.0.40219.1\nProject(\"{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}\") = \"ConsoleApp2\", \"ConsoleApp2\\ConsoleApp2.csproj\", \"{83EFF6B1-8685-4A9F-9201-CAAFE79E8D92}\"\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{83EFF6B1-8685-4A9F-9201-CAAFE79E8D92}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{83EFF6B1-8685-4A9F-9201-CAAFE79E8D92}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{83EFF6B1-8685-4A9F-9201-CAAFE79E8D92}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{83EFF6B1-8685-4A9F-9201-CAAFE79E8D92}.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 = {C8907E5D-AE25-4EE4-8690-EFEE58E0ACAD}\n\tEndGlobalSection\nEndGlobal\n", "lang": "Mono C#", "bug_code_uid": "fe051e1ec7eb4080fa5bc43b09b547cf", "src_uid": "76c7312733ef9d8278521cf09d3ccbc8", "apr_id": "76faaeeb3cb59440c315b7acca4f4e11", "difficulty": 800, "tags": ["greedy", "strings", "sortings", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9905482041587902, "equal_cnt": 14, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 12, "fix_ops_cnt": 13, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\n\nnamespace Help_Vasilisa_the_Wise_2\n{\n class Program\n {\n static void Main(string[] args)\n {\n string line = Console.ReadLine();\n byte r1 = byte.Parse(line.Split(' ')[0]),\n r2 = byte.Parse(line.Split(' ')[1]);\n\n line = Console.ReadLine();\n byte c1 = byte.Parse(line.Split(' ')[0]),\n c2 = byte.Parse(line.Split(' ')[1]);\n\n line = Console.ReadLine();\n byte d1 = byte.Parse(line.Split(' ')[0]),\n d2 = byte.Parse(line.Split(' ')[1]);\n\n byte min = Math.Min(Math.Min(r1,c1),d1);\n min--;\n List ans = new List();\n while(min> 0)\n {\n byte A = min;\n byte B =Convert.ToByte(r1 - A);\n byte C = Convert.ToByte(c1 - A);\n byte D = Convert.ToByte(c2 - B);\n if((A+B) != r1 || (C+D) !=r2 || (C+B) != d2)\n {\n min--;\n continue;\n }\n ans.Add(A);\n ans.Add(B);\n ans.Add(C);\n ans.Add(D);\n ans = ans.Distinct().ToList().Where(i=> i<=9).ToList();\n if (ans.Count < 4)\n {\n ans.Clear();\n min--;\n continue;\n }\n else\n {\n break;\n }\n }\n if(ans.Count == 0)\n {\n Console.WriteLine(-1);\n }\n else\n {\n Console.WriteLine($\"{ans[0]} {ans[1]}\");\n Console.WriteLine($\"{ans[2]} {ans[3]}\");\n }\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "54cd3bb66e35385a150d0750346c550b", "src_uid": "6821f502f5b6ec95c505e5dd8f3cd5d3", "apr_id": "8f8d5dffd6e5354829baee5aab699f91", "difficulty": 1000, "tags": ["math", "brute force"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.9991742361684558, "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 Dima_and_the_equation\n{\n class Program\n {\n static void Main(string[] args)\n {\n int c, a, a;\n long x;\n string[] hold;\n List result = new List();\n hold = Console.ReadLine().Split(' ');\n a = Int32.Parse(hold[0]);\n b = Int32.Parse(hold[1]);\n c = Int32.Parse(hold[2]);\n for (int i = 1; i <= 81; i++)\n {\n x = b *(long) Math.Pow(i, a) + c;\n if (x>0&& x< Math.Pow(10,9))\n if (sum(x) == i)\n result.Add(x);\n }\n Console.WriteLine(result.Count);\n foreach (int i in result)\n {\n Console.Write(i + \" \");\n }\n Console.ReadLine();\n }\n static int sum(long number)\n {\n string k = number.ToString();\n int sum = 0;\n foreach (char i in k)\n {\n sum += Int32.Parse(i.ToString());\n }\n return sum;\n }\n }\n}", "lang": "MS C#", "bug_code_uid": "27a513ab84edf7178ba06e24436240a0", "src_uid": "e477185b94f93006d7ae84c8f0817009", "apr_id": "990dac29ba3c9d174ccb9ebab7fd9046", "difficulty": 1500, "tags": ["number theory", "math", "brute force", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9619965967101531, "equal_cnt": 13, "replace_cnt": 11, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 12, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing Solver.Ex;\nusing Debug = System.Diagnostics.Debug;\nusing Watch = System.Diagnostics.Stopwatch;\nusing StringBuilder = System.Text.StringBuilder;\nnamespace Solver\n{\n public class Solver\n {\n public void Solve()\n {\n var a = sc.Integer();\n var b = sc.Integer();\n var c = sc.Integer();\n var ans = new List();\n var max = (long)Math.Pow(81, a);\n for (long x = c; x < (long)1e9; x += b)\n {\n if (x <= 0)\n continue;\n var v = (x - c) / b;\n if (v > max)\n break;\n var u = x;\n long s = 0;\n while (u > 0)\n {\n s += u % 10;\n u /= 10;\n }\n if (v == (long)Math.Pow(s, a))\n ans.Add(x);\n }\n IO.Printer.Out.WriteLine(ans.Count);\n if (ans.Count > 0) IO.Printer.Out.WriteLine(ans.AsJoinedString());\n }\n internal IO.StreamScanner sc;\n }\n #region Main and Settings\n static class Program\n {\n static void Main(string[] arg)\n {\n#if DEBUG\n var errStream = new System.IO.FileStream(@\"..\\..\\dbg.out\", System.IO.FileMode.Create, System.IO.FileAccess.Write, System.IO.FileShare.ReadWrite);\n Debug.Listeners.Add(new System.Diagnostics.TextWriterTraceListener(errStream, \"debugStream\"));\n Debug.AutoFlush = false;\n var sw = new Watch(); sw.Start();\n IO.Printer.Out.AutoFlush = true;\n try\n {\n#endif\n\n var solver = new Solver();\n solver.sc = new IO.StreamScanner(Console.OpenStandardInput());\n solver.Solve();\n IO.Printer.Out.Flush();\n#if DEBUG\n }\n catch (Exception ex)\n {\n Console.Error.WriteLine(ex.Message);\n Console.Error.WriteLine(ex.StackTrace);\n }\n finally\n {\n sw.Stop();\n Console.ForegroundColor = ConsoleColor.Green;\n Console.Error.WriteLine(\"Time:{0}ms\", sw.ElapsedMilliseconds);\n Debug.Close();\n System.Threading.Thread.Sleep(System.Threading.Timeout.Infinite);\n }\n#endif\n }\n\n\n }\n #endregion\n}\n#region IO Helper\nnamespace Solver.IO\n{\n public class Printer : System.IO.StreamWriter\n {\n static Printer()\n {\n Out = new Printer(Console.OpenStandardOutput()) { AutoFlush = false };\n#if DEBUG\n Error = new Printer(Console.OpenStandardOutput()) { AutoFlush = false };\n#else\n Error = new Printer(System.IO.Stream.Null) { AutoFlush = false };\n#endif\n }\n public static Printer Out { get; set; }\n public static Printer Error { get; set; }\n public override IFormatProvider FormatProvider { get { return System.Globalization.CultureInfo.InvariantCulture; } }\n public Printer(System.IO.Stream stream) : base(stream, new System.Text.UTF8Encoding(false, true)) { }\n public Printer(System.IO.Stream stream, System.Text.Encoding encoding) : base(stream, encoding) { }\n public void Write(string format, IEnumerable source) { Write(format, source.OfType().ToArray()); }\n public void WriteLine(string format, IEnumerable source) { WriteLine(format, source.OfType().ToArray()); }\n }\n public class StreamScanner\n {\n public StreamScanner(System.IO.Stream stream) { iStream = stream; }\n private readonly System.IO.Stream iStream;\n private readonly byte[] buf = new byte[1024];\n private int len, ptr;\n private bool eof = false;\n public bool IsEndOfStream { get { return eof; } }\n const byte lb = 33, ub = 126, el = 10, cr = 13;\n public byte read()\n {\n if (eof) throw new System.IO.EndOfStreamException();\n if (ptr >= len) { ptr = 0; if ((len = iStream.Read(buf, 0, 1024)) <= 0) { eof = true; return 0; } }\n return buf[ptr++];\n }\n public char Char() { byte b = 0; do b = read(); while (b < lb || ub < b); return (char)b; }\n public char[] Char(int n) { var a = new char[n]; for (int i = 0; i < n; i++) a[i] = Char(); return a; }\n public char[][] Char(int n, int m) { var a = new char[n][]; for (int i = 0; i < n; i++) a[i] = Char(m); return a; }\n public string Scan()\n {\n if (eof) throw new System.IO.EndOfStreamException();\n StringBuilder sb = null;\n var enc = System.Text.UTF8Encoding.Default;\n do\n {\n for (; ptr < len && (buf[ptr] < lb || ub < buf[ptr]); ptr++) ;\n if (ptr < len) break;\n ptr = 0;\n if ((len = iStream.Read(buf, 0, 1024)) <= 0) { eof = true; return \"\"; }\n } while (true);\n do\n {\n var f = ptr;\n for (; ptr < len; ptr++)\n //if (buf[ptr] < lb || ub < buf[ptr])\n if (buf[ptr] == cr || buf[ptr] == el)\n {\n string s;\n if (sb == null) s = enc.GetString(buf, f, ptr - f);\n else { sb.Append(enc.GetChars(buf, f, ptr - f)); s = sb.ToString(); }\n ptr++; return s;\n }\n if (sb == null) sb = new StringBuilder(enc.GetString(buf, f, len - f));\n else sb.Append(enc.GetChars(buf, f, len - f));\n ptr = 0;\n\n }\n while (!eof && (len = iStream.Read(buf, 0, 1024)) > 0);\n eof = true; return (sb != null) ? sb.ToString() : \"\";\n }\n public long Long()\n {\n long ret = 0; byte b = 0; bool isMynus = false;\n const byte zr = 48, nn = 57, my = 45;\n do b = read();\n while (b != my && (b < zr || nn < b));\n if (b == my) { isMynus = true; b = read(); }\n for (; true; b = read())\n if (b < zr || nn < b)\n return isMynus ? -ret : ret;\n else ret = ret * 10 + b - zr;\n }\n public int Integer()\n {\n int ret = 0; byte b = 0; bool isMynus = false;\n const byte zr = 48, nn = 57, my = 45;\n do b = read();\n while (b != my && (b < zr || nn < b));\n if (b == my) { isMynus = true; b = read(); }\n for (; true; b = read())\n if (b < zr || nn < b)\n return isMynus ? -ret : ret;\n else ret = ret * 10 + b - zr;\n }\n public double Double() { return double.Parse(Scan(), System.Globalization.CultureInfo.InvariantCulture); }\n public string[] Scan(int n) { var a = new string[n]; for (int i = 0; i < n; i++) a[i] = Scan(); return a; }\n public double[] Double(int n) { var a = new double[n]; for (int i = 0; i < n; i++) a[i] = Double(); return a; }\n public int[] Integer(int n) { var a = new int[n]; for (int i = 0; i < n; i++) a[i] = Integer(); return a; }\n public long[] Long(int n) { var a = new long[n]; for (int i = 0; i < n; i++)a[i] = Long(); return a; }\n public void Flush() { iStream.Flush(); }\n }\n}\n#endregion\n#region Extension\nnamespace Solver.Ex\n{\n static public partial class EnumerableEx\n {\n static public string AsString(this IEnumerable ie) { return new string(ie.ToArray()); }\n static public string AsJoinedString(this IEnumerable ie, string st = \" \") { return string.Join(st, ie); }\n static public T[] Enumerate(this int n, Func f) { var a = new T[n]; for (int i = 0; i < n; i++) a[i] = f(i); return a; }\n }\n}\n#endregion\n", "lang": "MS C#", "bug_code_uid": "1a621a7b0f6425d94c274179f69e300c", "src_uid": "e477185b94f93006d7ae84c8f0817009", "apr_id": "c589d868a708a4912c24e4a10e6aaadc", "difficulty": 1500, "tags": ["number theory", "math", "brute force", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9992156862745099, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "using System;\n\nnamespace Codeforces\n{\n\tclass Problem74t6A\n\t{\n\t \tstatic void Main() {\n\t\t string[] args = Console.In.ReadLine().Split(' ');\n long S = long.Parse(args[0]);\n long xIgor = long.Parse(args[1]);\n long xGoal = long.Parse(args[2]);\n args = Console.In.ReadLine().Split(' ');\n long tTram = long.Parse(args[0]);\n long tIgor = long.Parse(args[1]);\n args = Console.In.ReadLine().Split(' ');\n long xTram = long.Parse(args[0]);\n int dirTram = int.Parse(args[1]);\n \n if (xIgor > xGoal){\n xIgor = S - xIgor;\n xGoal = S - xGoal;\n xTram = S - xTram;\n dirTram = -dirTram;\n }\n \n long resIgor = (xGoal - xIgor) * tIgor;\n long resTram = 0;\n if (dirTram == 1){\n if (xTram < xIgor){\n resTram = (xGoal - xTram) * tTram;\n } else{\n resTram =((S - xTram) + S + (xGoal)) * tTram;\n }\n } else{a\n resTram =(xTram + xGoal) * tTram;\n }\n\n\t\t\tConsole.Out.WriteLine(resTram < resIgor ? resTram : resIgor);\n\t\t\tConsole.In.ReadLine();\n\t\t}\n\t}\n}", "lang": "Mono C#", "bug_code_uid": "94f24fb700f9fff7e567c33a7b24b014", "src_uid": "fb3aca6eba3a952e9d5736c5d8566821", "apr_id": "fc3e9db19aaaddb16d1ff3fca7adec04", "difficulty": 1600, "tags": ["math", "constructive algorithms", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C#"} {"similarity_score": 0.9697347893915756, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "using System;\nusing System.IO;\nusing System.Text;\n\nnamespace The_Same_Calendar\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 m = n/2000;\n n = n%2000;\n\n var dn1 = new DateTime(n, 1, 1);\n var dn2 = new DateTime(n, 12, 31);\n\n for (n++;; n++)\n {\n var d1 = new DateTime(n, 1, 1);\n if (d1.DayOfWeek == dn1.DayOfWeek)\n {\n var d2 = new DateTime(n, 12, 31);\n if (d2.DayOfWeek == dn2.DayOfWeek)\n break;\n }\n }\n\n writer.WriteLine(m*2000 + n);\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": "c94f452cc8b12e24eef2f2e396e988bc", "src_uid": "565bbd09f79eb7bfe2f2da46647af0f2", "apr_id": "1d31701ece6b132e7fda4561ecbab945", "difficulty": 1600, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.9987716664391975, "equal_cnt": 6, "replace_cnt": 3, "delete_cnt": 2, "insert_cnt": 0, "fix_ops_cnt": 5, "bug_source_code": "using System;\nusing System.Text;\nusing System.Linq;\nusing System.Collections;\nusing System.Globalization;\nusing System.Collections.Generic;\n\nnamespace ConsoleApplication1\n{\n public static class Cin\n {\n public static string NextToken()\n {\n StringBuilder tokenChars = new StringBuilder();\n bool tokenFinished = false;\n bool skipWhiteSpaceMode = true;\n while (!tokenFinished)\n {\n int nextChar = Console.Read();\n if (nextChar == -1)\n {\n tokenFinished = true;\n }\n else\n {\n char ch = (char)nextChar;\n if (char.IsWhiteSpace(ch))\n {\n if (!skipWhiteSpaceMode)\n {\n tokenFinished = true;\n if (ch == '\\r' && (Environment.NewLine == \"\\r\\n\"))\n {\n Console.Read();\n }\n }\n }\n else\n {\n skipWhiteSpaceMode = false;\n tokenChars.Append(ch);\n }\n }\n }\n\n string token = tokenChars.ToString();\n return token;\n }\n\n public static int NextInt()\n {\n string token = Cin.NextToken();\n return int.Parse(token);\n }\n public static long NextLong()\n {\n string token = Cin.NextToken();\n return long.Parse(token);\n }\n\n public static double NextDouble(bool acceptAnyDecimalSeparator = true)\n {\n string token = Cin.NextToken();\n if (acceptAnyDecimalSeparator)\n {\n token = token.Replace(',', '.');\n double result = double.Parse(token, CultureInfo.InvariantCulture);\n return result;\n }\n else\n {\n double result = double.Parse(token);\n return result;\n }\n }\n\n public static decimal NextDecimal(bool acceptAnyDecimalSeparator = true)\n {\n string token = Cin.NextToken();\n if (acceptAnyDecimalSeparator)\n {\n token = token.Replace(',', '.');\n decimal result = decimal.Parse(token, CultureInfo.InvariantCulture);\n return result;\n }\n else\n {\n decimal result = decimal.Parse(token);\n return result;\n }\n }\n }\n\n class Program\n {\n static bool isLeapYear(int x)\n {\n if (x%100 == 0)\n {\n return x%400 == 0;\n }\n else\n {\n return x%4 == 0;\n }\n }\n static void Main(string[] args)\n {\n int a = Cin.NextInt();\n int b = a / 10000 * 10000;\n a %= 10000;\n \n for (int i = a + 1; /* pass */; i++)\n {\n var d1 = DateTime.Parse(string.Format(\"{0}-01-01\", a));\n var d2 = DateTime.Parse(string.Format(\"{0}-01-01\", i));\n \n var diff = d2 - d1;\n bool ly = !(isLeapYear(a) ^ isLeapYear(i));\n bool wd = diff.Days%7 == 0;\n\n if (ly && wd)\n {\n Console.WriteLine(i + b);\n break;\n }\n }\n }\n }\n}", "lang": "MS C#", "bug_code_uid": "b4cb72ef269fb1678d13b7c164f3605c", "src_uid": "565bbd09f79eb7bfe2f2da46647af0f2", "apr_id": "de2a616348917bebe7ebbb90903e86d0", "difficulty": 1600, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9464575446187128, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "using System;\nusing System.IO;\nusing System.Collections.Generic;\n\n//string[] lines = File.ReadAllLines (@\"D:\\Projects\\cpp\\input.txt\");\n//string s = File.ReadAllLines(@\"D:\\Projects\\cpp\\input.txt\")[0];\n\nnamespace first\n{\n\tclass MainClass\n\t{\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\t\tpublic static void Main(string[] args)\n\t\t{\n\t\t\t//var textReader = new StreamReader(@\"D:\\Projects\\cpp\\input.txt\");\n\t\t\t//Console.SetIn(textReader);\n\n\t\t\tstring[] s = Console.ReadLine().Split(' ');\n\n\t\t\tdecimal d = (decimal)Convert.ToInt32(s[0]);\n\t\t\tdecimal l = (decimal)Convert.ToInt32(s[1]);\n\t\t\tdecimal v1 = (decimal)Convert.ToInt32(s[2]);\n\t\t\tdecimal v2 = (decimal)Convert.ToInt32(s[3]);\n\n\t\t\tdecimal res = ((l - d)) / ((v1 + v2));\n\t\t\tConsole.WriteLine( res);\n\t\t\t//Console.ReadKey();\n\t\t}\n\t}\n}", "lang": "MS C#", "bug_code_uid": "15af957f6281b8e05b1707bf4f4f81d0", "src_uid": "f34f3f974a21144b9f6e8615c41830f5", "apr_id": "25d4e3fb6a36f6ca68762fd69985215b", "difficulty": 800, "tags": ["math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9573590096286108, "equal_cnt": 5, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 3, "fix_ops_cnt": 4, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace A\n{\n class Program\n {\n static void Main(string[] args)\n {\n int a, b, c, d, e, f;\n string s = Console.ReadLine();\n string[] mas = s.Split(' ');\n a = Convert.ToInt32(mas[0]);\n b = Convert.ToInt32(mas[1]);\n c = Convert.ToInt32(mas[2]);\n d = Convert.ToInt32(mas[3]);\n e = Convert.ToInt32(mas[4]);\n f = Convert.ToInt32(mas[5]);\n if (b*d*f > a*c*e)\n {\n s = \"Ron\";\n }\n else\n {\n s = \"Hermione\";\n }\n if ((b*d*f == 0) && (a*c*e == 0))\n {\n if (((b != 0) && (d != 0) && (e != 0)) || (((b == 0) && (a == 0)) && (d != 0)) || ((c == 0) && (d!=0))\n {\n s = \"Ron\";\n }\n }\n Console.WriteLine(s);\n \n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "42ac467e09a8accb0a9c36044a296eca", "src_uid": "44d608de3e1447f89070e707ba550150", "apr_id": "bd42aea2102994734a2dfe45e6d2f796", "difficulty": 1800, "tags": ["math", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.5750679347826086, "equal_cnt": 41, "replace_cnt": 32, "delete_cnt": 5, "insert_cnt": 4, "fix_ops_cnt": 41, "bug_source_code": "\nusing System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace AlgoTraining.Codeforces.E_s\n{\n public class FastScanner : StreamReader\n {\n private string[] _line;\n private int _iterator;\n\n public FastScanner(Stream stream) : base(stream)\n {\n _line = null;\n _iterator = 0;\n }\n public string NextToken()\n {\n if (_line == null || _iterator >= _line.Length)\n {\n _line = base.ReadLine().Split(' ');\n _iterator = 0;\n }\n if (_line.Count() == 0) throw new IndexOutOfRangeException(\"Input string is empty\");\n return _line[_iterator++];\n }\n public int NextInt()\n {\n return Convert.ToInt32(NextToken());\n }\n public long NextLong()\n {\n return Convert.ToInt64(NextToken());\n }\n public float NextFloat()\n {\n return float.Parse(NextToken());\n }\n public double NextDouble()\n {\n return Convert.ToDouble(NextToken());\n }\n }\n class RidingALift274\n {\n public static int mod = (int)1e9 + 7, size = 5001, maxFloors, secretFloor;\n public static int[,] dp = new int[size, size];\n public static void Main(string[] args)\n {\n using (FastScanner fs = new FastScanner(new BufferedStream(Console.OpenStandardInput())))\n using (StreamWriter writer = new StreamWriter(new BufferedStream(Console.OpenStandardOutput())))\n {\n maxFloors = fs.NextInt();\n int a = fs.NextInt();\n secretFloor = fs.NextInt();\n int k = fs.NextInt();\n for (int i = 0; i < size; i++)\n {\n for (int j = 0; j < size; j++)\n {\n dp[i, j] = -1;\n }\n }\n writer.WriteLine(Calculate(a, k));\n }\n }\n public static int Calculate(int floor, int trip)\n {\n if (dp[floor, trip] == -1)\n {\n if (trip == 0)\n {\n dp[floor, trip] = 1;\n }\n else\n {\n dp[floor, trip] = 0;\n int delta = Math.Abs(floor - secretFloor) - 1;\n for (int i = Math.Max(1, floor - delta); i <= Math.Min(maxFloors, floor + delta); i++)\n {\n if (i != floor) dp[floor, trip] = (dp[floor, trip] + Calculate(i, trip - 1)) % mod;\n }\n }\n }\n return dp[floor, trip];\n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "db37dd6d42c31330ec2750772d1a7bf8", "src_uid": "142b06ed43b3473513995de995e19fc3", "apr_id": "b895a099e7b0de4fc180f26aab77b89a", "difficulty": 1900, "tags": ["dp", "combinatorics", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9030803906836965, "equal_cnt": 10, "replace_cnt": 4, "delete_cnt": 2, "insert_cnt": 3, "fix_ops_cnt": 9, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace Task1\n{\n class Program\n {\n static void Main(string[] args)\n {\n Console.ReadLine();\n string enter = Console.ReadLine();\n Stackstring parasites = new Stackstring();\n string par = ogo;\n while (par.Length 100)\n {\n parasites.Push(par);\n par += go;\n }\n while(parasites.Count0) {\n enter = enter.Replace(parasites.Pop(), );\n }\n Console.WriteLine(enter);\n Console.ReadKey();\n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "0f0342ee9e3a3405f395f01748bfb072", "src_uid": "619665bed79ecf77b083251fe6fe7eb3", "apr_id": "f74dca65d387bd28cf6ee6e7b7500314", "difficulty": 900, "tags": ["strings", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.43866171003717475, "equal_cnt": 32, "replace_cnt": 21, "delete_cnt": 3, "insert_cnt": 7, "fix_ops_cnt": 31, "bug_source_code": "using 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 string str = Console.ReadLine();\n\n int amountChar = Int32.Parse(str);\n\n string strChar = Console.ReadLine();\n\n char[] arrayChar = new char[amountChar];\n\n int[] arrayOgo = new int[3];\n\n int p = 0;\n foreach (var el in strChar)\n {\n arrayChar[p] = el;\n p++;\n }\n \n string extStr = \"ogo\";\n \n int indexEndSubstring = 0;\n\n while (strChar.Contains(\"ogo\"))\n {\n indexEndSubstring = strChar.IndexOf(\"ogo\", StringComparison.Ordinal) + 2;\n\n if (strChar.Length - indexEndSubstring < 2)\n {\n strChar = strChar.Replace(\"ogo\", \"***\");\n goto label2;\n }\n\n if (strChar[indexEndSubstring + 1] != 'g' || strChar[indexEndSubstring + 2] != 'o')\n {\n strChar = strChar.Remove(indexEndSubstring - 2, 3);\n strChar = strChar.Insert(indexEndSubstring - 2, \"***\");\n }\n\n int i = 1;\n label1:\n if (indexEndSubstring + i + 1 < strChar.Length)\n {\n if (strChar[indexEndSubstring + i] == 'g' && strChar[indexEndSubstring + i + 1] == 'o')\n {\n extStr += arrayChar[indexEndSubstring + i].ToString() +\n arrayChar[indexEndSubstring + i + 1].ToString();\n i = i + 2;\n goto label1;\n }\n }\n else\n {\n goto label2;\n }\n }\n\n label2:\n strChar = strChar.Replace(extStr, \"***\");\n\n Console.WriteLine(strChar);\n \n }\n }\n}", "lang": "MS C#", "bug_code_uid": "6ba9704b7484ff7d20d82185421dd9c4", "src_uid": "619665bed79ecf77b083251fe6fe7eb3", "apr_id": "f6103c9fd92745d14f2d3ab1bf4481d7", "difficulty": 900, "tags": ["strings", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.3757380568974772, "equal_cnt": 22, "replace_cnt": 4, "delete_cnt": 0, "insert_cnt": 19, "fix_ops_cnt": 23, "bug_source_code": "public static void FindAVG(int num)\n {\n\n int sum = 0;\n int tempnum = num;\n\n for (int i = 2; i < num; i++)\n {\n tempnum = num;\n while (tempnum > 0)\n {\n sum += tempnum % i;\n tempnum /= i;\n }\n }\n\n Console.WriteLine(sum+\"/\"+(num-2).ToString());\n }", "lang": "Mono C#", "bug_code_uid": "2dcec8b1784004a6a7267953ba403250", "src_uid": "1366732dddecba26db232d6ca8f35fdc", "apr_id": "43af0f30bf3582c1180455ee95c31309", "difficulty": 1000, "tags": ["math", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.9694965086365307, "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.Text;\n\nnamespace CodeForces\n{\n class Program\n {\n static void Main(string[] args)\n {\n int A = Convert.ToInt32(Console.ReadLine());\n Program p = new Program();\n Console.WriteLine(p.Numbers(A));\n Console.ReadLine();\n }\n\n public void Numbers(int A)\n {\n int i = 0;\n int a1 = 0;\n int a2 = A - 2;\n\n for (i = 2; i < A; i++)\n {\n a1 += ChangeBase(i, A);\n }\n\n i = GCD(a1, a2);\n a1 /= i;\n a2 /= i;\n\n Console.WriteLine(a1 + \"/\" + a2);\n }\n\n private int ChangeBase(int b, int A)\n {\n int i = 0;\n int count = 0;\n int[] d = new int[15];\n\n for (; i < 15 && A >= 1; i++)\n {\n d[i] = A % b;\n A = (int)(A / b);\n }\n\n for (i = 0; i < 15; i++)\n {\n count += d[i];\n }\n\n return count;\n }\n\n private int GCD(int a, int b)\n {\n int g = 0;\n\n if (b == 0)\n {\n g = a;\n }\n else\n {\n g = GCD(b, a % b);\n }\n\n return g;\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "3a76d91122a30d6524dea4614bb3031d", "src_uid": "1366732dddecba26db232d6ca8f35fdc", "apr_id": "5d7b6fa048c38a7d2e1488007b229ed5", "difficulty": 1000, "tags": ["math", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.6858974358974359, "equal_cnt": 17, "replace_cnt": 11, "delete_cnt": 4, "insert_cnt": 1, "fix_ops_cnt": 16, "bug_source_code": "using System;\nusing System.Linq;\nusing System.Collections.Generic;\n \nnamespace round596div2\n{\n \n class Solution\n {\n public int N {get;set;}\n public int P {get;set;}\n \n public Solution(int n, int p)\n {\n N = n;\n P = p;\n }\n \n public int Apply()\n {\n for(int i = 1; i <= 30; ++i)\n {\n long _n = N - i * P;\n int c = 0;\n int c_p = 0;\n if(_n <= 0)\n continue;\n while(_n > 0)\n {\n int exp = 1;\n long pt = 1;\n for(; pt <= _n; pt *= 2, ++exp);\n pt /= 2;\n --exp;\n _n -= pt;\n int ml = 1;\n while(exp > 0)\n {\n c += ml;\n ml *= 2;\n exp /= 2;\n }\n ++c_p;\n }\n // System.Console.WriteLine(\"c = \" + c + \" c_p = \" + c_p + \" i = \" + i);\n if(c >= i && c_p <= i)\n return i;\n }\n return -1;\n }\n \n protected bool Check(int n, int k, int p)\n {\n return n - k * p >= 0; \n }\n }\n \n class Program\n {\n static void Main(string[] args)\n {\n int[] info = Console.ReadLine().Split().Select(x => Convert.ToInt32(x)).ToArray();\n Solution sl = new Solution(info[0], info[1]);\n System.Console.WriteLine(sl.Apply());\n }\n }\n}", "lang": "Mono C#", "bug_code_uid": "29a0e3ebec740e084cf150a3e6ef83cf", "src_uid": "9e86d87ce5a75c6a982894af84eb4ba8", "apr_id": "749ab5994bfa380e9428aba2af73fe1b", "difficulty": 1600, "tags": ["math", "brute force", "bitmasks"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9977388355002826, "equal_cnt": 5, "replace_cnt": 0, "delete_cnt": 2, "insert_cnt": 2, "fix_ops_cnt": 4, "bug_source_code": "/*\n * Сделано в SharpDevelop.\n * Пользователь: alexey\n * Дата: 16.11.2012\n * Время: 19:15\n * \n * Для изменения этого шаблона используйте Сервис | Настройка | Кодирование | Правка стандартных заголовков.\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 class Program\n {\n public static int ReadInt(){\n \n return int.Parse(Console.ReadLine());\n \n }\n \n public static string[] ReadStrArr(){\n \n return Console.ReadLine().Split(' ');\n \n }\n \n public static int ToInt(Object a){\n \n return int.Parse(a.ToString());\n \n }\n // public static bool[] visited; \n // public static List way;\n \n /* public static void dfs(int[,] g,int n,int v){ \n \n visited[v]=true;\n way.Add(v);\n for(int i=0;i= 0; i--)\n {\n Console.WriteLine(remap((int)l[i]-48));\n }\n }\n }", "lang": "MS C#", "bug_code_uid": "3911ef4087de0db4e17b4d03dab918b8", "src_uid": "c2e3aced0bc76b6484360563355d23a7", "apr_id": "aa091efddb7537371512071ed67be063", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.9757481940144479, "equal_cnt": 8, "replace_cnt": 4, "delete_cnt": 2, "insert_cnt": 1, "fix_ops_cnt": 7, "bug_source_code": "using System;\n\nnamespace 363A\n{\n class Program\n {\n static void Main(string[] args)\n {\n double maxNumber = 1E09;\n double n;\n n = double.Parse(Console.ReadLine());\n if (n< 0 | n > maxNumber)\n {\n return;\n }\n int t = (int)n;\n int[] digits = toDigits(t);\n //printMas(digits);\n\n \n for (int i = 0; i < digits.Length; i++)\n {\n string str = string.Empty;\n int r_int = 0;\n int ost = 0;\n\n r_int = digits[i] / 5;\n ost = digits[i] % 5;\n \n if (r_int == 1)\n {\n str += \"-O|\";\n }\n else\n {\n str += \"O-|\";\n }\n\n int j = 1;\n for ( j = 1; j <= ost; j++)\n {\n str += \"O\";\n }\n if (j <= 4)\n {\n str += \"-\";\n for(int k =j; k <=4;k++)\n str += \"O\";\n }\n \n Console.WriteLine(str);\n \n } \n \n }\n\n private static void printMas(int[] digits)\n {\n for (int i = 0; i < digits.Length; i++)\n Console.WriteLine(digits[i]);\n }\n\n private static int[] toDigits(int n)\n {\n int t = n;\n int size = 0;\n do\n {\n t /= 10;\n ++size;\n } while (t > 0);\n int[] digits = new int[size];\n t = (int)n;\n for (int i = 0; i < size; i++)\n {\n digits[i] = t % 10;\n t /= 10;\n }\n return digits;\n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "8c8e24b7177a1f8f2b4b289747eefab2", "src_uid": "c2e3aced0bc76b6484360563355d23a7", "apr_id": "8cef9dabd3a796d71e4b1a2b7d1f313b", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.3948995363214838, "equal_cnt": 11, "replace_cnt": 7, "delete_cnt": 3, "insert_cnt": 1, "fix_ops_cnt": 11, "bug_source_code": "using System;\nusing System.Collections.Generic;\n\n\nnamespace ConsoleApp11\n{\n class Program\n {\n static void Main(string[] args)\n {\n int c1 = Convert.ToInt32(Console.ReadLine());//((\n int c2 = Convert.ToInt32(Console.ReadLine());//()\n int c3 = Convert.ToInt32(Console.ReadLine());//)(\n int c4 = Convert.ToInt32(Console.ReadLine());//))\n\n string str1 = \"\";\n string str2 = \"\";\n string str3 = \"\";\n string str4 = \"\";\n for (int i = 0; i < c1; i++) {\n str1 += \"((\";\n\n }\n // Console.WriteLine(\"\" + str1);\n for (int i = 0; i < c2; i++)\n {\n str2 += \"()\";\n\n\n }\n // Console.WriteLine(\"\" + str2);\n for (int i = 0; i < c3; i++)\n {\n str3 += \")(\";\n\n }\n // Console.WriteLine(\"\" + str3);\n for (int i = 0; i < c4; i++)\n {\n str4 += \"))\";\n\n }\n // Console.WriteLine(\"\" + str4);\n int sumo = 0;\n int sumc = 0;\n int sum = 0;\n\n\n string strcom = str1 + str2 + str3 + str4;\n foreach (char n in strcom) {\n if (n == '(')\n {\n sumo = sumo + 1;\n }\n else if (n == ')' && sumo > 0)\n {\n sum = sum + 1;\n sumo = sumo - 1;\n }\n }\n\n if (strcom.Length == sum * 2) { \n Console.WriteLine(\"1\");\n // Console.WriteLine(\"\" + strcom); \n }\n else\n Console.WriteLine(\"0\");\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "aa3d69afebb51171abdfe8c2517a6aab", "src_uid": "b99578086043537297d374dc01eeb6f8", "apr_id": "ffca59affadbebbb1d36a57f21e720de", "difficulty": 1100, "tags": ["greedy", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.4419114423498466, "equal_cnt": 10, "replace_cnt": 5, "delete_cnt": 3, "insert_cnt": 2, "fix_ops_cnt": 10, "bug_source_code": "using System;\nusing System.Collections.Generic;\n\n\nnamespace ConsoleApp11\n{\n class Program\n {\n static void Main(string[] args)\n {\n int c1 = Convert.ToInt32(Console.ReadLine());//((\n int c2 = Convert.ToInt32(Console.ReadLine());//()\n int c3 = Convert.ToInt32(Console.ReadLine());//)(\n int c4 = Convert.ToInt32(Console.ReadLine());//))\n\n string str1 = new string ('(', c1*2);\n string str2 = \"\";// new string (\"()\", c2);\n string str3 = \"\"; //new string (\")(\", c3);\n string str4 = new string (')', c4*2);\n\n for (int i = 0; i < c2; i++)\n {\n str2 += \"()\";\n\n\n }\n \n for (int i = 0; i < c3; i++)\n {\n str3 += \")(\";\n\n }\n \n int sumo = 0;\n \n int sum = 0;\n\n\n string strcom = str1 + str2 + str3 + str4;\n foreach (char n in strcom) {\n if (n == '(')\n {\n sumo = sumo + 1;\n }\n else if (n == ')' && sumo > 0)\n {\n sum = sum + 1;\n sumo = sumo - 1;\n }\n }\n\n if (strcom.Length == sum * 2) { \n Console.WriteLine(\"1\");\n \n }\n else\n Console.WriteLine(\"0\");\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "1682f042b5668bcfbf74e530af657fed", "src_uid": "b99578086043537297d374dc01eeb6f8", "apr_id": "ffca59affadbebbb1d36a57f21e720de", "difficulty": 1100, "tags": ["greedy", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.19947978245448098, "equal_cnt": 96, "replace_cnt": 42, "delete_cnt": 49, "insert_cnt": 5, "fix_ops_cnt": 96, "bug_source_code": "using System;\nusing System.ComponentModel.Design.Serialization;\nusing System.IO;\nusing System.Linq;\nusing Contest.CompLib.Mathematics;\n\nnamespace Contest\n{\n class Scanner\n {\n public Scanner()\n {\n _stream = new StreamReader(Console.OpenStandardInput());\n _pos = 0;\n _line = new string[0];\n _separator = ' ';\n }\n\n private char _separator;\n private StreamReader _stream;\n private int _pos;\n private string[] _line;\n\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 row elements\n #region get array\n public string[] Array()\n {\n if (_pos >= _line.Length)\n _line = _stream.ReadLine().Split(_separator);\n\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 #region get 2~4 elements\n public void GetRow(out string a, out string b)\n {\n a = Next();\n b = Next();\n }\n public void GetRow(out string a, out string b, out string c)\n {\n a = Next();\n b = Next();\n c = Next();\n }\n public void GetRow(out string a, out string b, out string c, out string d)\n {\n a = Next();\n b = Next();\n c = Next();\n d = Next();\n }\n\n public void GetIntRow(out int a, out int b)\n {\n a = NextInt();\n b = NextInt();\n }\n public void GetIntRow(out int a, out int b, out int c)\n {\n a = NextInt();\n b = NextInt();\n c = NextInt();\n }\n public void GetIntRow(out int a, out int b, out int c, out int d)\n {\n a = NextInt();\n b = NextInt();\n c = NextInt();\n d = NextInt();\n }\n\n public void GetLongRow(out long a, out long b)\n {\n a = NextLong();\n b = NextLong();\n }\n public void GetLongRow(out long a, out long b, out long c)\n {\n a = NextLong();\n b = NextLong();\n c = NextLong();\n }\n public void GetLongRow(out long a, out long b, out long c, out long d)\n {\n a = NextLong();\n b = NextLong();\n c = NextLong();\n d = NextLong();\n }\n\n public void GetDoubleRow(out double a, out double b)\n {\n a = NextDouble();\n b = NextDouble();\n }\n public void GetDoubleRow(out double a, out double b, out double c)\n {\n a = NextDouble();\n b = NextDouble();\n c = NextDouble();\n }\n public void GetDoubleRow(out double a, out double b, out double c, out double d)\n {\n a = NextDouble();\n b = NextDouble();\n c = NextDouble();\n d = NextDouble();\n }\n #endregion\n #endregion\n #region get 2~4 column elements\n public void GetColumn(int n, out string[] a)\n {\n a = new string[n];\n for (int i = 0; i < n; i++)\n {\n a[i] = Next();\n }\n }\n public void GetColumn(int n, out string[] a, out string[] b)\n {\n a = new string[n];\n b = new string[n];\n for (int i = 0; i < n; i++)\n {\n GetRow(out a[i], out b[i]);\n }\n }\n public void GetColumn(int n, out string[] a, out string[] b, out string[] c)\n {\n a = new string[n];\n b = new string[n];\n c = new string[n];\n for (int i = 0; i < n; i++)\n {\n GetRow(out a[i], out b[i], out c[i]);\n }\n }\n public void GetColumn(int n, out string[] a, out string[] b, out string[] c, out string[] d)\n {\n a = new string[n];\n b = new string[n];\n c = new string[n];\n d = new string[n];\n for (int i = 0; i < n; i++)\n {\n GetRow(out a[i], out b[i], out c[i], out d[i]);\n }\n }\n\n public void GetIntColumn(int n, out int[] a)\n {\n string[] sa;\n GetColumn(n, out sa);\n a = ToIntArray(sa);\n }\n public void GetIntColumn(int n, out int[] a, out int[] b)\n {\n string[] sa, sb;\n GetColumn(n, out sa, out sb);\n a = ToIntArray(sa);\n b = ToIntArray(sb);\n }\n public void GetIntColumn(int n, out int[] a, out int[] b, out int[] c)\n {\n string[] sa, sb, sc;\n GetColumn(n, out sa, out sb, out sc);\n a = ToIntArray(sa);\n b = ToIntArray(sb);\n c = ToIntArray(sc);\n }\n public void GetIntColumn(int n, out int[] a, out int[] b, out int[] c, out int[] d)\n {\n string[] sa, sb, sc, sd;\n GetColumn(n, out sa, out sb, out sc, out sd);\n a = ToIntArray(sa);\n b = ToIntArray(sb);\n c = ToIntArray(sc);\n d = ToIntArray(sd);\n }\n\n public void GetLongColumn(int n, out long[] a)\n {\n string[] sa;\n GetColumn(n, out sa);\n a = ToLongArray(sa);\n }\n public void GetLongColumn(int n, out long[] a, out long[] b)\n {\n string[] sa, sb;\n GetColumn(n, out sa, out sb);\n a = ToLongArray(sa);\n b = ToLongArray(sb);\n }\n public void GetLongColumn(int n, out long[] a, out long[] b, out long[] c)\n {\n string[] sa, sb, sc;\n GetColumn(n, out sa, out sb, out sc);\n a = ToLongArray(sa);\n b = ToLongArray(sb);\n c = ToLongArray(sc);\n }\n public void GetLongColumn(int n, out long[] a, out long[] b, out long[] c, out long[] d)\n {\n string[] sa, sb, sc, sd;\n GetColumn(n, out sa, out sb, out sc, out sd);\n a = ToLongArray(sa);\n b = ToLongArray(sb);\n c = ToLongArray(sc);\n d = ToLongArray(sd);\n }\n\n public void GetDoubleColumn(int n, out double[] a)\n {\n string[] sa;\n GetColumn(n, out sa);\n a = ToDoubleArray(sa);\n }\n public void GetDoubleColumn(int n, out double[] a, out double[] b)\n {\n string[] sa, sb;\n GetColumn(n, out sa, out sb);\n a = ToDoubleArray(sa);\n b = ToDoubleArray(sb);\n }\n public void GetDoubleColumn(int n, out double[] a, out double[] b, out double[] c)\n {\n string[] sa, sb, sc;\n GetColumn(n, out sa, out sb, out sc);\n a = ToDoubleArray(sa);\n b = ToDoubleArray(sb);\n c = ToDoubleArray(sc);\n }\n public void GetDoubleColumn(int n, out double[] a, out double[] b, out double[] c, out double[] d)\n {\n string[] sa, sb, sc, sd;\n GetColumn(n, out sa, out sb, out sc, out sd);\n a = ToDoubleArray(sa);\n b = ToDoubleArray(sb);\n c = ToDoubleArray(sc);\n d = ToDoubleArray(sd);\n }\n #endregion\n #region get matrix\n string[][] GetMatrix(int h)\n {\n string[][] result = new string[h][];\n for (int i = 0; i < h; i++)\n {\n result[i] = Array();\n }\n\n return result;\n\n }\n int[][] GetIntMatrix(int h)\n {\n int[][] result = new int[h][];\n for (int i = 0; i < h; i++)\n {\n result[i] = IntArray();\n }\n\n return result;\n }\n long[][] GetLongMatrix(int h)\n {\n long[][] result = new long[h][];\n for (int i = 0; i < h; i++)\n {\n result[i] = LongArray();\n }\n\n return result;\n }\n double[][] GetDoubleMatrix(int h)\n {\n double[][] result = new double[h][];\n for (int i = 0; i < h; i++)\n {\n result[i] = DoubleArray();\n }\n\n return result;\n }\n char[][] GetCharMatrix(int h)\n {\n char[][] result = new char[h][];\n for (int i = 0; i < h; i++)\n {\n result[i] = Next().ToCharArray();\n }\n\n return result;\n }\n #endregion\n }\n\n namespace CompLib.Mathematics\n {\n using N = System.Int32;\n #region Matrix\n public class Matrix\n {\n int row, col;\n public N[] mat;\n /// \n /// 列目の要素へのアクセスを提供します。\n /// \n /// 行の番号\n /// 列の番号\n public N this[int r, int c]\n {\n get { return mat[r * col + c]; }\n set { mat[r * col + c] = value; }\n }\n public Matrix(int r, int c)\n {\n row = r; col = c;\n mat = new N[row * col];\n }\n public static Matrix operator *(Matrix l, Matrix r)\n {\n System.Diagnostics.Debug.Assert(l.col == r.row);\n var ret = new Matrix(l.row, r.col);\n for (int i = 0; i < l.row; i++)\n for (int k = 0; k < l.col; k++)\n for (int j = 0; j < r.col; j++)\n ret.mat[i * r.col + j] = (ret.mat[i * r.col + j] + l.mat[i * l.col + k] * r.mat[k * r.col + j]) % 1000000007;\n return ret;\n }\n /// \n /// ^ を O(^3 log ) で計算します。\n /// \n public static Matrix Pow(Matrix m, long n)\n {\n var ret = new Matrix(m.row, m.col);\n for (int i = 0; i < m.row; i++)\n ret.mat[i * m.col + i] = 1;\n for (; n > 0; m *= m, n >>= 1)\n if ((n & 1) == 1)\n ret = ret * m;\n return ret;\n\n }\n public N[][] Items\n {\n get\n {\n var a = new N[row][];\n for (int i = 0; i < row; i++)\n {\n a[i] = new N[col];\n for (int j = 0; j < col; j++)\n a[i][j] = mat[i * col + j];\n }\n return a;\n }\n }\n }\n #endregion\n }\n\n class Program\n {\n private long N;\n private int M;\n public void Solve()\n {\n var s = new Scanner();\n N = s.NextLong();\n M = s.NextInt();\n CompLib.Mathematics.Matrix matrix = new Matrix(M, M);\n for (int i = 0; i < M; i++)\n {\n matrix[0, i] = 1;\n\n }\n\n for (int i = 1; i < M; i++)\n {\n matrix[i, i - 1] = 1;\n }\n\n var p = CompLib.Mathematics.Matrix.Pow(matrix, N);\n\n Console.WriteLine(p[0, 0]);\n }\n\n static void Main(string[] args) => new Program().Solve();\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "4b3039d336f2e81a3de5219621c41023", "src_uid": "e7b9eec21d950f5d963ff50619c6f119", "apr_id": "4ed4232abfeb05b2286e3e77fcba73c2", "difficulty": 2100, "tags": ["matrices", "dp", "math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "C#"} {"similarity_score": 0.9991215961852177, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "using System;\nusing CompLib.Mathematics;\nusing CompLib.Util;\n\npublic class Program\n{\n public void Solve()\n {\n var sc = new Scanner();\n long n = sc.NextInt();\n int m = sc.NextInt();\n\n var a = new Matrix(1, m);\n for (int i = 0; i < m; i++)\n {\n a[0, i] = 1;\n }\n\n var b = new Matrix(m, m);\n\n for (int i = 0; i < m - 1; i++)\n {\n b[i + 1, i] = 1;\n }\n\n b[0, m - 1] = 1;\n b[m - 1, m - 1] = 1;\n\n var c = Matrix.Pow(b, n);\n\n var d = a * c;\n\n Console.WriteLine(d[0, 0]);\n }\n\n public static void Main(string[] args) => new Program().Solve();\n}\n\n// https://bitbucket.org/camypaper/complib\nnamespace CompLib.Mathematics\n{\n #region ModInt\n\n /// \n /// [0,) までの値を取るような数\n /// \n public struct ModInt\n {\n /// \n /// 剰余を取る値.\n /// \n public const long Mod = (int) 1e9 + 7;\n\n /// \n /// 実際の数値.\n /// \n public long num;\n\n /// \n /// 値が であるようなインスタンスを構築します.\n /// \n /// インスタンスが持つ値\n /// パフォーマンスの問題上,コンストラクタ内では剰余を取りません.そのため, ∈ [0,) を満たすような を渡してください.このコンストラクタは O(1) で実行されます.\n public ModInt(long n)\n {\n num = n;\n }\n\n /// \n /// このインスタンスの数値を文字列に変換します.\n /// \n /// [0,) の範囲内の整数を 10 進表記したもの.\n public override string ToString()\n {\n return num.ToString();\n }\n\n public static ModInt operator +(ModInt l, ModInt r)\n {\n l.num += r.num;\n if (l.num >= Mod) l.num -= Mod;\n return l;\n }\n\n public static ModInt operator -(ModInt l, ModInt r)\n {\n l.num -= r.num;\n if (l.num < 0) l.num += Mod;\n return l;\n }\n\n public static ModInt operator *(ModInt l, ModInt r)\n {\n return new ModInt(l.num * r.num % Mod);\n }\n\n public static implicit operator ModInt(long n)\n {\n n %= Mod;\n if (n < 0) n += Mod;\n return new ModInt(n);\n }\n\n /// \n /// 与えられた 2 つの数値からべき剰余を計算します.\n /// \n /// べき乗の底\n /// べき指数\n /// 繰り返し二乗法により O(N log N) で実行されます.\n public static ModInt Pow(ModInt v, long k)\n {\n return Pow(v.num, k);\n }\n\n /// \n /// 与えられた 2 つの数値からべき剰余を計算します.\n /// \n /// べき乗の底\n /// べき指数\n /// 繰り返し二乗法により O(N log N) で実行されます.\n public static ModInt Pow(long v, long k)\n {\n long ret = 1;\n for (k %= Mod - 1; k > 0; k >>= 1, v = v * v % Mod)\n if ((k & 1) == 1)\n ret = ret * v % Mod;\n return new ModInt(ret);\n }\n\n /// \n /// 与えられた数の逆元を計算します.\n /// \n /// 逆元を取る対象となる数\n /// 逆元となるような値\n /// 法が素数であることを仮定して,フェルマーの小定理に従って逆元を O(log N) で計算します.\n public static ModInt Inverse(ModInt v)\n {\n return Pow(v, Mod - 2);\n }\n }\n\n #endregion\n\n #region Binomial Coefficient\n\n public class BinomialCoefficient\n {\n public ModInt[] fact, ifact;\n\n public BinomialCoefficient(int n)\n {\n fact = new ModInt[n + 1];\n ifact = new ModInt[n + 1];\n fact[0] = 1;\n for (int i = 1; i <= n; i++)\n fact[i] = fact[i - 1] * i;\n ifact[n] = ModInt.Inverse(fact[n]);\n for (int i = n - 1; i >= 0; i--)\n ifact[i] = ifact[i + 1] * (i + 1);\n ifact[0] = ifact[1];\n }\n\n public ModInt this[int n, int r]\n {\n get\n {\n if (n < 0 || n >= fact.Length || r < 0 || r > n) return 0;\n return fact[n] * ifact[n - r] * ifact[r];\n }\n }\n\n public ModInt RepeatedCombination(int n, int k)\n {\n if (k == 0) return 1;\n return this[n + k - 1, k];\n }\n }\n\n #endregion\n}\n\n// https://bitbucket.org/camypaper/complib\nnamespace CompLib.Mathematics\n{\n using System.Diagnostics;\n using N = ModInt;\n\n #region Matrix\n\n public class Matrix\n {\n int row, col;\n public N[] mat;\n\n /// \n /// 列目の要素へのアクセスを提供します。\n /// \n /// 行の番号\n /// 列の番号\n public N this[int r, int c]\n {\n get { return mat[r * col + c]; }\n set { mat[r * col + c] = value; }\n }\n\n public Matrix(int r, int c)\n {\n row = r;\n col = c;\n mat = new N[row * col];\n }\n\n public static Matrix operator *(Matrix l, Matrix r)\n {\n Debug.Assert(l.col == r.row);\n var ret = new Matrix(l.row, r.col);\n for (int i = 0; i < l.row; i++)\n for (int k = 0; k < l.col; k++)\n for (int j = 0; j < r.col; j++)\n ret.mat[i * r.col + j] = (ret.mat[i * r.col + j] + l.mat[i * l.col + k] * r.mat[k * r.col + j]);\n return ret;\n }\n\n /// \n /// ^ を O(^3 log ) で計算します。\n /// \n public static Matrix Pow(Matrix m, long n)\n {\n var ret = new Matrix(m.row, m.col);\n for (int i = 0; i < m.row; i++)\n ret.mat[i * m.col + i] = 1;\n for (; n > 0; m *= m, n >>= 1)\n if ((n & 1) == 1)\n ret = ret * m;\n return ret;\n }\n\n public N[][] Items\n {\n get\n {\n var a = new N[row][];\n for (int i = 0; i < row; i++)\n {\n a[i] = new N[col];\n for (int j = 0; j < col; j++)\n a[i][j] = mat[i * col + j];\n }\n\n return a;\n }\n }\n }\n\n #endregion\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}", "lang": "Mono C#", "bug_code_uid": "3c23f1fcb663ebd5f29b4e3a4044076b", "src_uid": "e7b9eec21d950f5d963ff50619c6f119", "apr_id": "4ed4232abfeb05b2286e3e77fcba73c2", "difficulty": 2100, "tags": ["matrices", "dp", "math"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.971764705882353, "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.Text;\n\nnamespace ConsoleApplication1\n{\n class Program\n {\n static void Main(string[] args)\n {\n ulong n = Convert.ToUInt64(Console.ReadLine());\n ulong k = n * n * (n - 1) * (n - 1) * (n - 2) * (n - 2) * (n - 3) * (n - 3) * (n - 4) * (n - 4);\n Console.WriteLine(k/5/4/3/2);\n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "ea3ed7f5b86c87b71d504b5098c690bc", "src_uid": "92db14325cd8aee06b502c12d2e3dd81", "apr_id": "2b98e073655e70b3315b095b6ae2b176", "difficulty": 1400, "tags": ["math", "combinatorics"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.8302521008403362, "equal_cnt": 6, "replace_cnt": 5, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 5, "bug_source_code": "using System;\nusing System.Linq;\nusing System.Globalization;\n\nnamespace _630\n{\n class Program\n {\n static void Main()\n {\n var n = long.Parse(Console.ReadLine());\n Console.WriteLine(n*(n-1)*(n-2)*(n-3)*(n-4));\n }\n }\n}", "lang": "MS C#", "bug_code_uid": "18cff0edc56b00aee19e12253445c45f", "src_uid": "92db14325cd8aee06b502c12d2e3dd81", "apr_id": "2df2fecf9112c4f2af6e42471de73768", "difficulty": 1400, "tags": ["math", "combinatorics"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9965059399021663, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "using System;\nclass Program\n {\n static void Main(string[] args)\n {\n int ln, sm;\n {\n string[] input = Console.ReadLine().Split(new char[] { ' ', '\\t' }, StringSplitOptions.RemoveEmptyEntries);\n ln = int.Parse(input[0]);\n sm = int.Parse(input[1]);\n }\n if (ln * 9 < sm) Console.WriteLine(\"-1 -1\");\n else if (sm == 0) Console.WriteLine(ln > 1?\"-1 -1\":\"0 0\");\n else\n {\n char[] res = new char[ln];\n res[0] = '1';\n {\n int smm = sm - 1;\n for (int i = ln - 1; i > 0; i--)\n {\n if (smm > 0) { res[i] = smm > 8 ? '9' : (char)(smm); smm -= 9; }\n else while (i > 0) res[i--] = '0';\n }\n if (smm > 0) res[0] = (char)(res[0] + smm);\n }\n Console.Write(new string(res));\n Console.Write(' ');\n for(int i = 0; i 0)\n {\n res[i] = sm > 8 ? '9' : (char)(sm+48);\n sm -= 9;\n }\n else while (i > 0) res[i++] = '0';\n }\n Console.WriteLine(new string(res));\n }\n }\n }", "lang": "Mono C#", "bug_code_uid": "78e3e0273f9510423fa1b0880445a26e", "src_uid": "75d062cece5a2402920d6706c655cad7", "apr_id": "889ba4a60de9192c4f239c203753189f", "difficulty": 1400, "tags": ["dp", "greedy", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9322519083969466, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\n\nnamespace Codeforces\n{\n\tstatic class Program\n\t{\n\t\tstatic void Main(string[] args)\n\t\t{\n\t\t\tvar ms = Console.ReadLine().Split().Select(int.Parse).ToList();\n\t\t\tstring min = \"\", max = \"\";\n\t\t\tint sum = ms[1];\n\n\t\t\tfor (int i = 0; i < ms[0]; i++)\n\t\t\t{\n\t\t\t\tfor (int d = 0; d < 10; d++)\n\t\t\t\t{\n\t\t\t\t\tif((i > 0 || d > 0 || (ms[0] == 1 && d == 0)) && Check(ms[0] - i - 1, sum - d))\n\t\t\t\t\t{\n\t\t\t\t\t\tmin += (char)('0' + d);\n\t\t\t\t\t\tsum -= d;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tsum = ms[1];\n\n\t\t\tfor (int i = 0; i < ms[0]; i++)\n\t\t\t{\n\t\t\t\tfor (int d = 9; d >= 0; d--)\n\t\t\t\t{\n\t\t\t\t\tif ((i > 0 || d > 0 || (ms[0] == 1 && d == 0)) && Check(ms[0] - i - 1, sum - d))\n\t\t\t\t\t{\n\t\t\t\t\t\tmax += (char)('0' + d);\n\t\t\t\t\t\tsum -= d;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(min[0] == '0') Console.WriteLine($\"-1 -1\");\n\t\t\telse Console.WriteLine($\"{min} {max}\");\n\t\t\tConsole.ReadLine();\n\t\t}\n\n\t\tstatic bool Check(int m, int s)\n\t\t{\n\t\t\treturn s <= 9 * m && s >= 0;\n\t\t}\n\t}\n};", "lang": "Mono C#", "bug_code_uid": "6b6521746357274eddb7974915f7f8c5", "src_uid": "75d062cece5a2402920d6706c655cad7", "apr_id": "e50cd31cd4558b74e56c020d6f5c1557", "difficulty": 1400, "tags": ["dp", "greedy", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9969686763219939, "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;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace ConsoleApp1\n{\n class Program\n {\n static void Main(string[] args)\n {\n\n var input = Console.ReadLine().Split();\n int a = int.Parse(input[0]);\n int b = int.Parse(input[1]);\n int l = int.Parse(input[2]);\n int r = int.Parse(input[3]);\n if (a == 3 && b == 1 && l == 4 && r == 10)\n {\n Console.WriteLine(4);\n }\n else\n {\n String ini_s = \"abcdefghijklmnopqrstuvwxyz\", s = \"\", temp = \"\";\n int last = a, ostL = l % (2 * (a + b)), ostR = r % (2 * (a + b));\n for (int i = 0; i < a; i++)\n {\n s += ini_s[i];\n }\n int minJ = 0;\n last = s.Length - 1;\n for (int i = 0; i < b; i++)\n {\n s += s[last];\n }\n last = s.Length;\n for (int i = 0; i < a; i++)\n {\n temp = s.Substring(last - a, a + i);\n //Console.WriteLine(temp);\n for (int j = minJ; j < 25; j++)\n {\n if (!temp.Contains(ini_s[j]))\n {\n minJ = j + 1;\n s += ini_s[j];\n break;\n }\n }\n }\n last = s.Length - 1;\n for (int i = 0; i < b; i++)\n {\n s += s[last];\n }\n //Console.WriteLine(s);\n\n if (r - l >= 2 * (a + b))\n {\n Console.WriteLine((a > b) ? 2 * a - b : a + 1);\n }\n else\n {\n if (ostL < ostR)\n {\n String resR = (ostR != 0) ? s.Substring(0, ostR) : s;\n String resL = resR.Substring((ostL == 0) ? 0 : ostL - 1);\n Console.WriteLine((ostL == 0) ? 1 + resL.Distinct().ToArray().Length : resL.Distinct().ToArray().Length);\n }\n else\n {\n if (ostL == ostR)\n {\n Console.WriteLine((r - l > 0) ? 2 * (a + b) : 1);\n }\n else\n {\n String hren = s.Substring(0, (ostR == 0) ? 1 : ostR) + s.Substring(ostL - 1);\n Console.WriteLine(hren.Distinct().ToArray().Length);\n }\n }\n }\n\n //Console.WriteLine(resR);\n //Console.WriteLine(resL);\n\n }\n\n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "8114afc3a8a140bef34ee9b291d52981", "src_uid": "d055b2a594ae7788ecafb3ef80f246ec", "apr_id": "08220680c11ba2a0f5280adc071eac0a", "difficulty": 2200, "tags": ["games", "greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "C#"} {"similarity_score": 0.8583989741710936, "equal_cnt": 73, "replace_cnt": 10, "delete_cnt": 1, "insert_cnt": 62, "fix_ops_cnt": 73, "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\n var input = Console.ReadLine().Split();\n int a = int.Parse(input[0]);\n int b = int.Parse(input[1]);\n int l = int.Parse(input[2]);\n int r = int.Parse(input[3]);\n String ini_s = \"abcdefghijklmnopqrstuvwxyz\", s = \"\", temp = \"\";\n int last = a, ostL = l % (2 * (a + b)), ostR = r % (2 * (a + b));\n for (int i = 0; i < a; i++)\n {\n s += ini_s[i];\n }\n int minJ = 0;\n last = s.Length - 1;\n for (int i = 0; i < b; i++)\n {\n s += s[last];\n }\n last = s.Length;\n for (int i = 0; i < a; i++)\n {\n temp = s.Substring(last - a, a + i);\n //Console.WriteLine(temp);\n for (int j = minJ; j < 25; j++)\n {\n if (!temp.Contains(ini_s[j]))\n {\n minJ = j + 1;\n s += ini_s[j];\n break;\n }\n }\n }\n last = s.Length - 1;\n for (int i = 0; i < b; i++)\n {\n s += s[last];\n }\n //Console.WriteLine(s);\n if (r - l >= 2 * (a + b))\n {\n Console.WriteLine(s.Distinct().ToArray().Length);\n }\n else\n {\n if (ostL < ostR)\n {\n String resR = (ostR != 0) ? s.Substring(0, ostR) : s;\n String resL = resR.Substring(ostL - 1);\n Console.WriteLine(resL.Distinct().ToArray().Length);\n }\n else\n {\n if(ostL == ostR)\n {\n Console.WriteLine((r-l>0)?2 * (a + b):1); \n }\n else\n {\n String hren = s.Substring(0, ostR) + s.Substring(ostL-1);\n Console.WriteLine(hren.Distinct().ToArray().Length);\n }\n }\n }\n \n //Console.WriteLine(resR);\n //Console.WriteLine(resL);\n \n\n\n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "9e2c002f1c1e7e9aaf197b4c8456951e", "src_uid": "d055b2a594ae7788ecafb3ef80f246ec", "apr_id": "08220680c11ba2a0f5280adc071eac0a", "difficulty": 2200, "tags": ["games", "greedy"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.9911718466561857, "equal_cnt": 5, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 3, "fix_ops_cnt": 4, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Globalization;\nusing System.IO;\nusing System.Linq;\nusing System.Text;\nusing System.Threading;\n\n// (づ°ω°)づミe★゜・。。・゜゜・。。・゜☆゜・。。・゜゜・。。・゜\npublic class Solver\n{\n const int MOD = 1000000007;\n\n public void Solve()\n {\n int p = ReadInt();\n int k = ReadInt();\n \n long ans = 1;\n var f = new bool[p];\n for (int i = 1; i < p; i++)\n if (!f[i])\n {\n ans = ans * p % MOD;\n int x = i;\n while (!f[x])\n {\n f[x] = true;\n x = x * k % p;\n }\n }\n\n Write(ans);\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(\"atoms.in\");\n //writer = new StreamWriter(\"atoms.out\");\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": "8662b2a71ff30c01c2ef59f5cac813bd", "src_uid": "580bf65af24fb7f08250ddbc4ca67e0e", "apr_id": "4dbf50db407df727bbeff758960bd3bb", "difficulty": 1800, "tags": ["combinatorics", "dfs and similar", "number theory", "dsu", "math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.9385180087175958, "equal_cnt": 6, "replace_cnt": 1, "delete_cnt": 2, "insert_cnt": 2, "fix_ops_cnt": 5, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Globalization;\nusing System.IO;\nusing System.Linq;\nusing System.Text;\nusing System.Threading;\n\n// (づ°ω°)づミe★゜・。。・゜゜・。。・゜☆゜・。。・゜゜・。。・゜\npublic class Solver\n{\n const int MOD = 1000000007;\n\n int Fun(int n, int c, int[] a, int k)\n {\n if (c == n)\n {\n for (int i = 0; i < n; i++)\n if (a[k * i % n] != k * a[i] % n)\n return 0;\n return 1;\n }\n int ret = 0;\n for (int i = 0; i < n; i++)\n {\n a[c] = i;\n ret += Fun(n, c + 1, a, k);\n }\n return ret;\n }\n\n public void Solve()\n {\n int p = ReadInt();\n int k = ReadInt();\n \n long ans = 1;\n var f = new bool[p];\n for (int i = 1; i < p; i++)\n if (!f[i])\n {\n ans = ans * p % MOD;\n int x = i;\n while (!f[x])\n {\n f[x] = true;\n x = x * k % p;\n }\n }\n if (k == 1)\n ans = ans * p % MOD;\n\n Write(ans);\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(\"atoms.in\");\n //writer = new StreamWriter(\"atoms.out\");\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": "522181c6d4d723bbcebea4e60d2d7798", "src_uid": "580bf65af24fb7f08250ddbc4ca67e0e", "apr_id": "4dbf50db407df727bbeff758960bd3bb", "difficulty": 1800, "tags": ["combinatorics", "dfs and similar", "number theory", "dsu", "math"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C#"} {"similarity_score": 0.6440564137004701, "equal_cnt": 12, "replace_cnt": 4, "delete_cnt": 1, "insert_cnt": 7, "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 zadacha2\n{\n \n class Program\n {\n static void Main()\n {\n byte n;\n short[] x = new short[0];\n short[] y = new short[0];\n n = Convert.ToByte(Console.ReadLine());\n\n for (byte i = 0; i < n; i++)\n {\n string[] N = Console.ReadLine().Split(' ');\n Array.Resize(ref x, x.Length + 1);\n Array.Resize(ref y, y.Length + 1);\n x[i] = Convert.ToInt16(N[i]);\n y[i] = Convert.ToInt16(N[i]);\n }\n\n if(n < 2)\n Console.WriteLine(-1);\n else if (n > 2)\n Console.WriteLine(1);\n else\n {\n if(x[1] == x[0] || y[1] == y[0])\n Console.WriteLine(-1);\n else\n Console.WriteLine(1);\n }\n }\n }\n}", "lang": "MS C#", "bug_code_uid": "37d02de019cc3a689492d326968b0ed5", "src_uid": "ba49b6c001bb472635f14ec62233210e", "apr_id": "cc90f0045d7f1a6565729ce101b1b832", "difficulty": 1100, "tags": ["geometry", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.9994932860400304, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Globalization;\nusing System.IO;\nusing System.Linq;\nusing System.Text;\nusing System.Threading;\n\n// (づ°ω°)づミe★゜・。。・゜゜・。。・゜☆゜・。。・゜゜・。。・゜\npublic class Solver\n{\n public void Solve()\n {\n int n = ReadInt();\n \n var data = ReadAndTransposeIntMatrix(n);\n var x = data[0];\n var y = data[1];\n\n if (n == 1 || n == 2 && (x[0] == x[1] || y[0] == y[1]))\n Write(-1);\n else\n Write((x.Max() - x.Min()) * (y.Max() - y.Min()));\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": "ff297315a25ded31a67d82c24fed892b", "src_uid": "ba49b6c001bb472635f14ec62233210e", "apr_id": "5f5849cee6a5140d8953fff6f8b1c33b", "difficulty": 1100, "tags": ["geometry", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.8292682926829268, "equal_cnt": 32, "replace_cnt": 10, "delete_cnt": 6, "insert_cnt": 16, "fix_ops_cnt": 32, "bug_source_code": "using System;\npublic class CF{\n public static void Main(){\n int n = int.Parse(Console.ReadLine());\n int xmin = int.MaxValue, ymin = int.MaxValue, xmax = int.MinValue, ymax = int.MinValue; \n for (int i = 0; i < n; i++)\n\t\t\t{\n var xy = Console.ReadLine().Split(' ').Select(x=>int.Parse(x)).ToArray();\n xmin = Math.Min(xy[0],xmin);\n ymin = Math.Min(xy[1],xmin);\n xmax = Math.Max(xy[0],xmax);\n ymax = Math.Max(xy[1],xmax);\n\t\t\t \n\t\t\t}\n Console.WriteLine(Math.Abs(xmax-xmin)*Math.Abs(ymax-ymin)>0?Math.Abs(xmax-xmin)*Math.Abs(ymax-ymin):-1);\n //Console.ReadKey();\n }\n}", "lang": "MS C#", "bug_code_uid": "a39c62f6fe65917d2582c1f9e0541f5f", "src_uid": "ba49b6c001bb472635f14ec62233210e", "apr_id": "0c44ab3f46690d2325449c96b2679c16", "difficulty": 1100, "tags": ["geometry", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.9994366197183099, "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 ConsoleApp2\n{\n class Program\n {\n const long MOD = 1000000009;\n static int before(int x, int ost)\n {\n if (x < ost)\n return 0;\n return (x - ost) / 3 + 1;\n }\n static void Main(string[] args)\n {\n int n, l, r;\n string[] input = Console.ReadLine().Split();\n n = int.Parse(input[0]);\n l = int.Parse(input[1]);\n r = int.Parse(input[2]);\n long[,] dp = new long[n, 3];\n dp[0, 0] = before(r, 0) - before(l - 1, 0);\n dp[0, 1] = before(r, 1) - before(l - 1, 1);\n dp[0, 2] = before(r, 2) - before(l - 1, 2);\n for (int i = 1; i < n; i++)\n {\n for (int j = 0; j < 3; j++)\n {\n int pred0 = j;\n int pred1 = j - 1;\n int pred2 = j - 2;\n if (pred1 < 0)\n pred1 += 3;\n if (pred2 < 0)\n pred2 += 3;\n dp[i, j] += dp[i - 1, pred0] * dp[0, 0];\n dp[i, j] %= MOD;\n dp[i, j] += dp[i - 1, pred1] * dp[0, 1];\n dp[i, j] %= MOD;\n dp[i, j] += dp[i - 1, pred2] * dp[0, 2];\n dp[i, j] %= MOD;\n }\n }\n /*for (int i = 0; i < n; i++)\n {\n for (int j = 0; j < 3; j++)\n Console.Write($\"{dp[i, j]} \");\n Console.WriteLine();\n }*/\n Console.WriteLine((dp[n - 1, 0])%MOD);\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "1424f6d5d088267e35f7f70225b23237", "src_uid": "4c4852df62fccb0a19ad8bc41145de61", "apr_id": "8d08be95c9e4d31692dd6ac2ed0386ca", "difficulty": 1500, "tags": ["dp", "math", "combinatorics"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.5531531531531532, "equal_cnt": 18, "replace_cnt": 6, "delete_cnt": 2, "insert_cnt": 10, "fix_ops_cnt": 18, "bug_source_code": "using System;\nusing System.Linq;\n\nnamespace ConsoleApplication8\n{\n internal class Program\n {\n public static void Main(string[] args)\n {\n int[] array = Console.ReadLine().Split().Select(n => int.Parse(n)).ToArray();\n if (array[0] == array[1] || array[1] == 1) Console.WriteLine(array[0] * 3);\n else\n {\n Console.WriteLine(array[0] * 3 + 1);\n }\n }\n }\n}", "lang": "Mono C#", "bug_code_uid": "3334173fc170440e1ba5a88942cdcca2", "src_uid": "24b02afe8d86314ec5f75a00c72af514", "apr_id": "ecf1bc1f084f12e0534aaf6ce32fdfb3", "difficulty": 1000, "tags": ["math", "constructive algorithms"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.8671428571428571, "equal_cnt": 8, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 5, "fix_ops_cnt": 7, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\n\nnamespace ConsoleApp1\n{\n class Program\n {\n static void Main(string[] args)\n {\n int[] nums = new int[2];\n int count = 0;\n\n nums = Console.ReadLine().Trim().Split(' ').Select(x => Convert.ToInt32(x)).ToArray();\n int man = nums[0];\n int index = nums[1];\n\n count = count + 3 * man;\n\n if (index != 1 && index != man)\n {\n count = count + index + man - man - 1;\n }\n\n Console.WriteLine(count);\n }\n }\n}", "lang": "Mono C#", "bug_code_uid": "5c9f478b508577c4da4de0da4082a029", "src_uid": "24b02afe8d86314ec5f75a00c72af514", "apr_id": "4f2ee3b0231c9bf5df17b27740eddec6", "difficulty": 1000, "tags": ["math", "constructive algorithms"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.9544039678467591, "equal_cnt": 37, "replace_cnt": 12, "delete_cnt": 8, "insert_cnt": 16, "fix_ops_cnt": 36, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Collections;\nusing System.Globalization;\nusing System.IO;\nusing System.Linq;\n//Гавно код недорешенный\npublic class Source\n{\n public void Program()\n {\n }\n void dfs(int pos, int start, int wavenum)\n {\n if (d[start][pos] > wavenum)\n {\n d[start][pos] = wavenum;\n // d[pos][start] = wavenum;\n dfs(a[pos], start, wavenum + 1);\n }\n }\n int n;\n int[] a;\n bool[] color;\n int[][] d;\n void Read()\n {\n n = ri();\n newarray(ref d, n, n);\n fill(d, int.MaxValue);\n a = ReadIntArray();\n color = new bool[n];\n for (int i = 0; i < n; i++)\n {\n a[i] = a[i] - 1;\n }\n for (int i = 0; i < n; i++)\n {\n dfs(a[i], i, 1);\n }\n /* for (int i = 0; i < n; i++)\n {\n Array.Sort(d[i]);\n }*/\n int endn = int.MaxValue;\n for (int i = 1; i < 10000000; i++)\n {\n for (int j = 0; j < n; j++)\n {\n bool ex = false;\n for (int l = 0; l < n; l++)\n {\n if (i % d[j][j] == d[j][l] || i % d[j][j] == 0)\n {\n if (d[l][j] == d[j][l])\n ex = true;\n }\n if (ex)\n break;\n }\n if (!ex)\n goto br;\n if (j == n - 1)\n {\n endn = Math.Min(i, endn);\n //writeLine(num);\n //return;\n }\n }\n br:;\n }\n if (endn == int.MaxValue)\n writeLine(-1);\n else\n writeLine(endn);\n }\n\n #region hide it\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 var source = new Source();\n source.Read();\n source.Program();\n\n /* try\n {\n new Source().Program();\n }\n catch (Exception ex)\n {\n #if DEBUG\n Console.WriteLine(ex);\n #else\n throw;\n #endif\n }*/\n reader.Close();\n writer.Close();\n }\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()\n {\n while (currentLineTokens.Count == 0)\n currentLineTokens = new Queue(ReadAndSplitLine());\n return currentLineTokens.Dequeue();\n }\n public static int ri() { return int.Parse(ReadToken()); }\n public static char ReadChar() { return char.Parse(ReadToken()); }\n public static long ReadLong() { return long.Parse(ReadToken()); }\n public static ulong ReaduLong() { return ulong.Parse(ReadToken()); }\n public static double ReadDouble() { return double.Parse(ReadToken(), CultureInfo.InvariantCulture); }\n public static int[] ReadIntArray() { return ReadAndSplitLine().Select(i => int.Parse(i)).ToArray(); }\n public static char[] ReadCharArray() { return ReadAndSplitLine().Select(i => char.Parse(i)).ToArray(); }\n public static long[] ReadLongArray() { return ReadAndSplitLine().Select(i => long.Parse(i)).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 char[][] ReadCharMatrix(int numberOfRows) { char[][] matrix = new char[numberOfRows][]; for (int i = 0; i < numberOfRows; i++) matrix[i] = ReadCharArray(); 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]; }\n 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 write(T value) { writer.Write(value); }\n public static void writeLine(T value) { writer.WriteLine(value); }\n public static void writeArray(T[] array, string split) { for (int i = 0; i < array.Length; i++) { write(array[i] + split); } }\n public static void writeMatrix(T[][] matrix, string split) { for (int i = 0; i < matrix.Length; i++) { writeArray(matrix[i], split); writer.Write(\"\\n\"); } }\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\n #region Methods\n #region DSU\n public void MakeSet(int[] poi)\n {\n for (int i = 0; i < poi.Length; i++)\n {\n poi[i] = i;\n }\n }\n public int Find(int x, int[] poi)\n {\n if (poi[x] == x) return x;\n return poi[x] = Find(poi[x], poi);\n }\n Random rand = new Random();\n public void Unite(int x, int y, int[] poi)\n {\n y = Find(y, poi);\n x = Find(x, poi);\n if (rand.Next() % 2 == 0)\n Swap(ref x, ref y);\n poi[x] = y;\n }\n #endregion\n\n class Deque\n {\n T[] array;\n int start, length;\n public Deque()\n {\n start = 0; length = 0; array = new T[1];\n }\n public T this[int index] { get { return array[(start + index) % array.Length]; } set { array[(start + index) % array.Length] = value; } }\n int last { get { return (start + length) % array.Length; } }\n /// \n /// сÑâ€Ã\n /// \n public T PeekFirst()\n {\n return array[start];\n }\n public int Count { get { return length; } }\n /// \n /// конецбез удаления\n /// \n public T PeekLsat()\n {\n return array[last];\n }\n public T PopLast()\n {\n if (length == 0)\n throw new IndexOutOfRangeException(\"OutOfRange\");\n length--;\n return array[last];\n }\n public T PopFirst()\n {\n if (length == 0)\n throw new IndexOutOfRangeException(\"OutOfRange\");\n length--;\n if (start >= array.Length - 1) start = 0; else start++;\n return array[start - 1 < 0 ? array.Length - 1 : start - 1];\n }\n public void AddFirst(T value)\n {\n IncreaseAndInspection();\n if (start <= 0) start = array.Length - 1; else start--;\n array[start] = value;\n length++;\n }\n public void AddLast(T value)\n {\n IncreaseAndInspection();\n array[last] = value;\n length++;\n }\n bool overflow { get { return length == array.Length; } }\n void IncreaseAndInspection()\n {\n if (overflow)\n increase();\n\n }\n void increase()\n {\n T[] array2 = new T[array.Length * 2];\n for (int i = 0; i < array.Length; i++)\n {\n int pos = (start + i) % array.Length;\n array2[i] = array[pos];\n }\n array = array2;\n start = 0;\n array2 = null;\n }\n public void Clear()\n {\n start = 0; length = 0; array = new T[1];\n }\n }\n class Heap\n {\n Comparison ic;\n List storage = new List();\n public Heap(Comparison ic)\n {\n this.ic = ic;\n }\n public void Add(T element)\n {\n storage.Add(element);\n int pos = storage.Count - 1;\n while (pos != 0 && ic(storage[((int)(pos - 1) >> 1)], element) > 0)\n {\n Swap(storage, pos, ((int)(pos - 1) / 2));\n pos = ((int)(pos - 1) / 2);\n }\n }\n public T Pop()\n {\n T t = storage[0];\n Swap(storage, 0, storage.Count - 1);\n int pos = 0;\n storage.RemoveAt(storage.Count - 1);\n if (Count > 0)\n while (true)\n {\n T my = storage[pos];\n if (pos * 2 + 1 >= Count)\n break;\n T left = storage[pos * 2 + 1];\n if (pos * 2 + 2 >= Count)\n {\n if (ic(left, my) < 0)\n {\n Swap(storage, pos, pos * 2 + 1);\n pos = pos * 2 + 1;\n }\n break;\n }\n T right = storage[pos * 2 + 2];\n if (ic(left, my) < 0 || ic(right, my) < 0)\n {\n if (ic(left, right) < 0)\n {\n Swap(storage, pos, pos * 2 + 1);\n pos = pos * 2 + 1;\n }\n else\n {\n\n Swap(storage, pos, pos * 2 + 2);\n pos = pos * 2 + 2;\n }\n }\n else break;\n }\n return t;\n }\n\n public void Clear()\n {\n storage.Clear();\n }\n /// \n /// без удаления\n /// \n /// \n public T Peek()\n {\n return storage[0];\n }\n public int Count\n {\n get { return storage.Count; }\n }\n //void RemoveLast, Size, peeklast, add\n }\n static void Swap(ref T lhs, ref T rhs)\n {\n T temp;\n temp = lhs;\n lhs = rhs;\n rhs = temp;\n }\n static void Swap(T[] a, int l, int r)\n {\n T temp;\n temp = a[l];\n a[l] = a[r];\n a[r] = temp;\n }\n static void Swap(List a, int l, int r)\n {\n T temp;\n temp = a[l];\n a[l] = a[r];\n a[r] = temp;\n }\n\n bool outregion(long y, long x, long n, long m)\n {\n if (x < 0 || x >= m || y < 0 || y >= n)\n return true;\n return false;\n }\n static void initlist(ref List[] list, int n)\n {\n list = new List[n];\n for (int i = 0; i < n; i++)\n list[i] = new List();\n }\n static void newarray(ref T[][] array, int n, int m)\n {\n array = new T[n][];\n for (int i = 0; i < n; i++)\n array[i] = new T[m];\n }\n static void newarray(ref T[] array, int n)\n {\n array = new T[n];\n }\n static void fill(T[] array, T value)\n {\n for (int i = 0; i < array.Length; i++)\n array[i] = value;\n }\n static void fill(T[][] array, T value)\n {\n for (int i = 0; i < array.Length; i++)\n for (int j = 0; j < array[i].Length; j++)\n array[i][j] = value;\n }\n public bool NextPermutation(T[] b, Comparison ic)\n {\n for (int j = b.Length - 2; j >= 0; j--)\n {\n if (ic(b[j], b[j + 1]) < 0)\n {\n for (int l = b.Length - 1; l >= 0; l--)\n {\n if (ic(b[l], b[j]) > 0)\n {\n Swap(b, j, l);\n Array.Reverse(b, j + 1, b.Length - (j + 1));\n return true;\n }\n }\n }\n }\n return false;\n }\n int[,] step8 = new int[,]\n {\n {-1,0 },\n {1,0 },\n {0,-1 },\n {0,1 },\n {1,1 },\n {-1,1 },\n {-1,-1 },\n {1,-1 },\n };\n int[,] step4 = new int[,]\n {\n {-1,0 },\n {1,0 },\n {0,-1 },\n {0,1 },\n };\n struct Vector2\n {\n public double x;\n public double y;\n public Vector2(double x, double y)\n {\n this.x = x;\n this.y = y;\n }\n public double Dist(Vector2 to)\n {\n return Math.Sqrt(Math.Abs(Math.Pow(to.x - x, 2)) + Math.Abs(Math.Pow(to.y - y, 2)));\n }\n public static bool operator ==(Vector2 left, Vector2 right) { return left.x == right.x && left.y == right.y; }\n public static bool operator !=(Vector2 left, Vector2 right) { return left.x != right.x || left.y != right.y; }\n }\n #endregion\n #endregion\n\n}", "lang": "MS C#", "bug_code_uid": "c895e3930db07e267970d04fef7a0aeb", "src_uid": "149221131a978298ac56b58438df46c9", "apr_id": "d20df6d15d904d78383d97eb6a42a2ae", "difficulty": 1600, "tags": ["math", "dfs and similar"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.9741863075196409, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 2, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "using Codeforces.R270;\nusing System;\nusing System.Diagnostics.Contracts;\nusing System.Globalization;\nusing System.IO;\nusing System.Linq;\nusing System.Runtime.CompilerServices;\nusing System.Security.Cryptography.X509Certificates;\n\nnamespace Codeforces.R275A\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 Contract.Requires(tr != null);\n Contract.Requires(tw != null);\n\n var info = CultureInfo.InvariantCulture;\n\n var a = new int[3][];\n for (int i = 0; i < 3; ++i)\n {\n a[i] = tr.ReadLine().Split().Select(x => int.Parse(x, info)).ToArray();\n }\n\n var res = Calc(a);\n foreach (var l in res)\n {\n tw.WriteLine(l);\n }\n }\n\n private static string[] Calc(int[][] a)\n {\n Contract.Requires(a != null);\n\n var board = Enumerable.Range(0, 3).Select(i => Enumerable.Repeat(true, 3).ToArray()).ToArray();\n\n for (int i = 0; i < 3; ++i)\n {\n for (int j = 0; j < 3; ++j)\n {\n if (a[i][j] % 2 == 1)\n {\n board[i][j] = !board[i][j];\n if (i > 0)\n {\n board[i - 1][j] = !board[i - 1][j];\n }\n if (i < 2)\n {\n board[i + 1][j] = !board[i + 1][j];\n }\n if (j > 0)\n {\n board[i][j - 1] = !board[i][j - 1];\n }\n if (j < 2)\n {\n board[i][j + 1] = !board[i][j + 1];\n }\n }\n }\n }\n\n return board.Select(line => new string(line.Select(b => b ? '1' : '0').ToArray())).ToArray();\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "cfb6eb46a65b8dfe4b5c4e23e6bbeb19", "src_uid": "b045abf40c75bb66a80fd6148ecc5bd6", "apr_id": "7c3d7a9fefcc673b2dadf3456d715cf8", "difficulty": 900, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C#"} {"similarity_score": 0.998667428136303, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\n\nnamespace Mashmokh_and_Lights\n{\n class Program\n {\n static void Main(string[] args)\n {\n IO io = new IO();\n\n int i_N = io.ReadNextInt();\n int i_M = io.ReadNextInt();\n int[] arr_T = new int[i_N];\n int i_X = 0;\n for (int i = 0; i < i_M; i++)\n {\n i_X = io.ReadNextInt();\n for (int j = 0; j < i_N; j++)\n {\n if (arr_T[j]==0)\n {\n arr_T[j] = i_X;\n }\n }\n }\n for (int i = 0; i <= i_N; i++)\n {\n Console.Write(arr_T[i]+\" \");\n }\n }\n }\n\n\n class IO\n {\n private static Queue currentLineTokens = new Queue();\n private static string[] ReadAndSplitLine()\n {\n return Console.ReadLine().Split(new[] { ' ', '\\t' }, StringSplitOptions.RemoveEmptyEntries);\n }\n public int ReadNextInt()\n {\n return int.Parse(ReadToken());\n }\n public long ReadNextLong()\n {\n return long.Parse(ReadToken());\n }\n\n public int ReadInt()\n {\n return Convert.ToInt32(Console.ReadLine());\n }\n public long ReadLong()\n {\n return Convert.ToInt64(Console.ReadLine());\n }\n public string ReadStr()\n {\n return Console.ReadLine();\n }\n public string[] ReadStrArr()\n {\n return Console.ReadLine().Split(' ');\n }\n public int[] ReadIntArr()\n {\n return Array.ConvertAll(Console.ReadLine().Split(' '), s => int.Parse(s));\n }\n public long[] ReadLongArr()\n {\n return Array.ConvertAll(Console.ReadLine().Split(' '), s => long.Parse(s));\n }\n public void PutStr(string str)\n {\n Console.WriteLine(str);\n }\n public void PutStr(int str)\n {\n Console.WriteLine(str);\n }\n public void PutStr(long str)\n {\n Console.WriteLine(str);\n }\n public void PutStr(double str)\n {\n Console.WriteLine(str);\n }\n\n\n public static string ReadToken()\n {\n while (currentLineTokens.Count == 0)\n currentLineTokens = new Queue(ReadAndSplitLine());\n return currentLineTokens.Dequeue();\n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "01c6c7805f096bfdd079a911f0f7db3d", "src_uid": "2e44c8aabab7ef7b06bbab8719a8d863", "apr_id": "40017432750ec76bbb69676eb26bdddd", "difficulty": 900, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9728876020005265, "equal_cnt": 6, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 4, "fix_ops_cnt": 5, "bug_source_code": "using System;\nusing System.Globalization;\nusing System.IO;\nusing System.Text;\n\nnamespace Bag_of_mice\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 private static double[,] nn;\n\n private static void Main(string[] args)\n {\n int w = Next();\n int b = Next();\n\n\n nn = new double[w + 1,b + 1];\n for (int i = 1; i <= w; i++)\n {\n nn[i, 0] = 1;\n }\n\n for (int j = 1; j <= b; j++)\n {\n for (int i = 1; i <= w; i++)\n {\n nn[i, j] = 1.0*i/(i + j) +\n 1.0*j/(i + j)*(1.0*(j - 1)/(i + j - 1)*(gnn(i, j - 3)*(j - 2)/(i + j - 2) + gnn(i - 1, j - 2)*(i)/(i + j - 2)));\n }\n }\n\n\n writer.WriteLine(nn[w, b].ToString(\"#0.000000000\", CultureInfo.InvariantCulture));\n writer.Flush();\n }\n\n private static double gnn(int i, int j)\n {\n if (j < 0)\n return 0;\n return nn[i, j];\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": "244e5f859f467a1bdc14588559c5e50e", "src_uid": "7adb8bf6879925955bf187c3d05fde8c", "apr_id": "3af8f40a7155570a29389a7c41ce6b14", "difficulty": 1800, "tags": ["math", "dp", "games", "probabilities"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.8098148481035412, "equal_cnt": 18, "replace_cnt": 11, "delete_cnt": 3, "insert_cnt": 3, "fix_ops_cnt": 17, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\nusing System.Text;\n\nnamespace TaskC\n{\n class Program\n {\n static void Main(string[] args)\n {\n new Solver().Solve().OutputResult();\n }\n\n private class ExtendedReader : StreamReader\n {\n private static readonly char Separator = ' ';\n\n public ExtendedReader(Stream stream) : base(stream) { }\n public ExtendedReader(Stream stream, bool detectEncodingFromByteOrderMarks) : base(stream, detectEncodingFromByteOrderMarks) { }\n public ExtendedReader(Stream stream, Encoding encoding) : base(stream, encoding) { }\n public ExtendedReader(Stream stream, Encoding encoding, bool detectEncodingFromByteOrderMarks) : base(stream, encoding, detectEncodingFromByteOrderMarks) { }\n public ExtendedReader(Stream stream, Encoding encoding, bool detectEncodingFromByteOrderMarks, int bufferSize) : base(stream, encoding, detectEncodingFromByteOrderMarks, bufferSize) { }\n public ExtendedReader(Stream stream, Encoding encoding, bool detectEncodingFromByteOrderMarks, int bufferSize, bool leaveOpen) : base(stream, encoding, detectEncodingFromByteOrderMarks, bufferSize, leaveOpen) { }\n public ExtendedReader(string path) : base(path) { }\n public ExtendedReader(string path, bool detectEncodingFromByteOrderMarks) : base(path, detectEncodingFromByteOrderMarks) { }\n public ExtendedReader(string path, Encoding encoding) : base(path, encoding) { }\n public ExtendedReader(string path, Encoding encoding, bool detectEncodingFromByteOrderMarks) : base(path, encoding, detectEncodingFromByteOrderMarks) { }\n public ExtendedReader(string path, Encoding encoding, bool detectEncodingFromByteOrderMarks, int bufferSize) : base(path, encoding, detectEncodingFromByteOrderMarks, bufferSize) { }\n\n public char ReadChar()\n {\n return (char)this.Read();\n }\n\n public double ReadDoubleFromArray()\n {\n StringBuilder sb = new StringBuilder();\n char ch = this.ReadChar();\n while (ch != Separator && ch != '\\n')\n {\n sb.Append(ch);\n ch = this.ReadChar();\n }\n return Convert.ToDouble(sb.ToString());\n }\n\n public int ReadInt()\n {\n return int.Parse(this.ReadLine());\n }\n\n public Int64 ReadInt64()\n {\n return Int64.Parse(this.ReadLine());\n }\n\n public int[] ReadIntArray()\n {\n return this.ReadLine().Split(' ').Select(int.Parse).ToArray();\n }\n\n public char[] ReadCharArray()\n {\n return this.ReadLine().ToCharArray();\n }\n\n public string ReadString()\n {\n return this.ReadLine();\n }\n\n public Int64[] ReadInt64Array()\n {\n return this.ReadLine().Split(Separator).Select(Int64.Parse).ToArray();\n }\n\n public Double[] ReadDoubleArray()\n {\n return this.ReadLine().Split(Separator).Select(Double.Parse).ToArray();\n }\n }\n\n private abstract class SolverBase\n {\n protected readonly ExtendedReader _reader;\n protected readonly TextWriter _writer;\n\n protected SolverBase()\n {\n#if DEBUG\n _reader = new ExtendedReader(@\"input.txt\");\n //_writer = new StreamWriter(@\"output.txt\");\n _writer = new StreamWriter(Console.OpenStandardOutput());\n#else\n _reader = new ExtendedReader(Console.OpenStandardInput());\n _writer = new StreamWriter(Console.OpenStandardOutput());\n#endif\n }\n\n public abstract Solver Solve();\n\n public abstract void OutputResult();\n }\n\n private class Solver : SolverBase\n {\n private int result = 0;\n\n public override Solver Solve()\n {\n // link to task: http://codeforces.com/contest//problem/B\n\n var input = _reader.ReadIntArray();\n int length = input[0];\n int changes = input[1];\n var str = _reader.ReadString();\n\n var a = GetMaximum(changes, str, 'a', 0);\n var b = GetMaximum(changes, str, 'b', 0);\n\n result = Math.Max(a, b);\n\n return this;\n }\n\n private int GetMaximum(int changes, string str, char ch, int index)\n {\n int current = 0;\n int max = 0;\n\n for (int i = 0; i < str.Length; i++)\n {\n if (str[i] == ch)\n {\n current++;\n }\n else\n {\n if (changes > 0 && i >= index)\n {\n var test = GetMaximum(changes, str, ch, i + 1);\n if (max < test)\n {\n max = test;\n }\n\n changes--;\n current++;\n }\n else\n {\n current = 0;\n }\n }\n\n if (max < current) max = current;\n }\n\n return max;\n }\n\n public override void OutputResult()\n {\n string answer = result.ToString();\n\n _writer.WriteLine(answer);\n _writer.Dispose();\n }\n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "2a3449029fffb510cda73db11219bbbf", "src_uid": "1d2b81ce842f8c97656d96bddff4e8b4", "apr_id": "e4f4624ae2d9d6c01eee50d3a05df236", "difficulty": 800, "tags": ["constructive algorithms", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.995862395082161, "equal_cnt": 7, "replace_cnt": 4, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 6, "bug_source_code": "#define Online\nusing System;\nusing System.Collections.Generic;\nusing System.Diagnostics;\nusing System.Text;\nusing System.IO;\n\ndelegate double F (double x);\n\ndelegate decimal Fdec (decimal x);\n\npartial class Program\n{\n\tpublic static StreamReader sr;\n\tpublic static StreamWriter sw;\n\n\tstatic void Main (string[] args)\n\t{\n\n#if FileIO\n\t\tsr = new StreamReader (\"maxincycle.in\");\n\t\tsw = new StreamWriter (\"maxincycle.out\");\n\t\tConsole.SetIn (sr);\n\t\tConsole.SetOut (sw);\n#endif\n\n\t\tB ();\n\n#if Online\n\t\tConsole.ReadLine ();\n#endif\n\n#if FileIO\n\t\tsr.Close ();\n\t\tsw.Close ();\n#endif\n\n\t}\n\n\tstatic void A ()\n\t{\n\t}\n\n\tstatic void B ()\n\t{\n\t\tint a, b, w, x, c;\n\t\ta = NextInt ();\n\t\tb = NextInt ();\n\t\tw = NextInt ();\n\t\tx = NextInt ();\n\t\tc = NextInt ();\n\t\tlong time = (long)Math.Max (a, c) * 10;\n\t\tlong[] t = new long[1001];\n\t\tlong[] d = new long[1001];\n\t\tint[] last = new int[1001];\n\t\tlong[] th = new long[1001];\n\t\tlong[] th_t = new long[1001];\n\t\tint[] last_th = new int[1001];\n\t\tfor (int i=0; i=x) {\n\t\t\t\t_b -= x;\n\t\t\t\t++j;\n\t\t\t}\n\t\t\twhile (_b_a-th[_b]) {\n\t\t\t\t_a -= th [_b];\n\t\t\t\t_c -= th_t [_b];\n\t\t\t\ttime -= th_t [_b];\n\t\t\t\t_b = last_th [_b];\n\t\t\t}\n\t\t\twhile (_c-t[_b]>_a-d[_b]) {\n\t\t\t\ttime -= t [_b];\n\t\t\t\t_c -= t [_b];\n\t\t\t\t_a -= d [_b];\n\t\t\t\t_b = last [_b];\n\t\t\t}\n\t\t\twhile (_b>=x && _c>_a) {\n\t\t\t\t--_c;\n\t\t\t\t--time;\n\t\t\t\t_b -= x;\n\t\t\t}\n\t\t\twhile (_b_a) {\n\t\t\t\t--_a;\n\t\t\t\t--_c;\n\t\t\t\t_b = w - (x - _b);\n\t\t\t\t--time;\n\t\t\t}\n\t\t\tif (time >= 0) {\n\t\t\t\tright = mid;\n\t\t\t} else {\n\t\t\t\tleft = mid + 1;\n\t\t\t}\n\t\t}\n\t\tConsole.WriteLine (right);\n\t}\n\n\tstatic void C ()\n\t{\n\n\t}\n\t\n\tstatic void D ()\n\t{\n\n\t}\n\n\tstatic void E ()\n\t{\n\n\t}\n\n\tstatic void TestGen ()\n\t{\n\n\t}\n\n}\n\npublic static class MyMath\n{\n\tpublic static long BinPow (long a, long n, long mod)\n\t{\n\t\tlong res = 1;\n\t\twhile (n > 0) {\n\t\t\tif ((n & 1) == 1) {\n\t\t\t\tres = (res * a) % mod;\n\t\t\t}\n\t\t\ta = (a * a) % mod;\n\t\t\tn >>= 1;\n\t\t}\n\t\treturn res;\n\t}\n\n\tpublic static long GCD (long a, long b)\n\t{\n\t\twhile (b != 0)\n\t\t\tb = a % (a = b);\n\t\treturn a;\n\t}\n\n\tpublic static int GCD (int a, int b)\n\t{\n\t\twhile (b != 0)\n\t\t\tb = a % (a = b);\n\t\treturn a;\n\t}\n\n\tpublic static long LCM (long a, long b)\n\t{\n\t\treturn (a * b) / GCD (a, b);\n\t}\n\n\tpublic static int LCM (int a, int b)\n\t{\n\t\treturn (a * b) / GCD (a, b);\n\t}\n}\n\nstatic class ArrayUtils\n{\n\tstatic void Swap (T[] a, int l, int r)\n\t{\n\t\tT t = a [l];\n\t\ta [l] = a [r];\n\t\ta [r] = t;\n\t}\n\n\tpublic static bool NextPermutation (int[] a)\n\t{\n\t\tbool isOkay = false;\n\t\tint n = a.Length;\n\t\tfor (int i=n-2; i>=0; i--) {\n\t\t\tif (a [i] < a [i + 1]) {\n\t\t\t\tisOkay = true;\n\t\t\t\tint j = i + 1;\n\t\t\t\twhile (j+1a[i]) {\n\t\t\t\t\tj++;\n\t\t\t\t}\n\t\t\t\tSwap (a, i, j);\n\t\t\t\tfor (j=1; i+j> 1);\n\t\t\tif (val <= a [mid]) {\n\t\t\t\tright = mid;\n\t\t\t} else {\n\t\t\t\tleft = mid + 1;\n\t\t\t}\n\t\t}\n\n\t\tif (a [left] == val)\n\t\t\treturn left;\n\t\telse\n\t\t\treturn -1;\n\t}\n\n\tpublic static double Bisection (F f, double left, double right, double eps)\n\t{\n\t\tdouble mid;\n\t\twhile (right - left > eps) {\n\t\t\tmid = left + ((right - left) / 2d);\n\t\t\tif (Math.Sign (f (mid)) != Math.Sign (f (left)))\n\t\t\t\tright = mid;\n\t\t\telse\n\t\t\t\tleft = mid;\n\t\t}\n\t\treturn (left + right) / 2d;\n\t}\n\n\tpublic static decimal TernarySearchDec (Fdec f, decimal eps, decimal l, decimal r, bool isMax)\n\t{\n\t\tdecimal m1, m2;\n\t\twhile (r - l > eps) {\n\t\t\tm1 = l + (r - l) / 3m;\n\t\t\tm2 = r - (r - l) / 3m;\n\t\t\tif (f (m1) < f (m2))\n\t\t\tif (isMax)\n\t\t\t\tl = m1;\n\t\t\telse\n\t\t\t\tr = m2;\n\t\t\telse\n if (isMax)\n\t\t\t\tr = m2;\n\t\t\telse\n\t\t\t\tl = m1;\n\t\t}\n\t\treturn r;\n\t}\n\n\tpublic static double TernarySearch (F f, double eps, double l, double r, bool isMax)\n\t{\n\t\tdouble m1, m2;\n\t\twhile (r - l > eps) {\n\t\t\tm1 = l + (r - l) / 3d;\n\t\t\tm2 = r - (r - l) / 3d;\n\t\t\tif (f (m1) < f (m2))\n\t\t\tif (isMax)\n\t\t\t\tl = m1;\n\t\t\telse\n\t\t\t\tr = m2;\n\t\t\telse\n if (isMax)\n\t\t\t\tr = m2;\n\t\t\telse\n\t\t\t\tl = m1;\n\t\t}\n\t\treturn r;\n\t}\n\n\tpublic static void Merge_Sort (T[]A, int p, int r, Comparison comp)\n\t{\n\t\tT[] L = new T[A.Length];\n\t\tT[] R = new T[A.Length];\n\t\tMerge_Sort (A, p, r, L, R, comp);\n\t}\n\n\tpublic static void Merge (T[] A, int p, int q, int r, T[] L, T[] R, Comparison comp)\n\t{\n\t\tfor (int i = p; i <= q; i++)\n\t\t\tL [i] = A [i];\n\t\tfor (int i = q + 1; i <= r; i++)\n\t\t\tR [i] = A [i];\n\n\t\tfor (int k = p, i = p, j = q + 1; k <= r; k++) {\n\t\t\tif (i > q) {\n\t\t\t\tfor (; k <= r; k++, j++)\n\t\t\t\t\tA [k] = R [j];\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (j > r) {\n\t\t\t\tfor (; k <= r; k++, i++)\n\t\t\t\t\tA [k] = L [i];\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (comp (L [i], R [j]) <= 0) {\n\t\t\t\tA [k] = L [i];\n\t\t\t\ti++;\n\t\t\t} else {\n\t\t\t\tA [k] = R [j];\n\t\t\t\tj++;\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate static void Merge_Sort (T[] A, int p, int r, T[] L, T[] R, Comparison comp)\n\t{\n\t\tif (p >= r)\n\t\t\treturn;\n\t\tint q = p + ((r - p) >> 1);\n\t\tMerge_Sort (A, p, q, L, R, comp);\n\t\tMerge_Sort (A, q + 1, r, L, R, comp);\n\t\tMerge (A, p, q, r, L, R, comp);\n\t}\n\n\tpublic static void Merge_Sort (T[]A, int p, int r)where T:IComparable\n\t{\n\t\tT[] L = new T[A.Length];\n\t\tT[] R = new T[A.Length];\n\t\tMerge_Sort (A, p, r, L, R);\n\t}\n\n\tpublic static void Merge (T[] A, int p, int q, int r, T[] L, T[] R) where T : IComparable\n\t{\n\t\tfor (int i = p; i <= q; i++)\n\t\t\tL [i] = A [i];\n\t\tfor (int i = q + 1; i <= r; i++)\n\t\t\tR [i] = A [i];\n\n\t\tfor (int k = p, i = p, j = q + 1; k <= r; k++) {\n\t\t\tif (i > q) {\n\t\t\t\tfor (; k <= r; k++, j++)\n\t\t\t\t\tA [k] = R [j];\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (j > r) {\n\t\t\t\tfor (; k <= r; k++, i++)\n\t\t\t\t\tA [k] = L [i];\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (L [i].CompareTo (R [j]) <= 0) {\n\t\t\t\tA [k] = L [i];\n\t\t\t\ti++;\n\t\t\t} else {\n\t\t\t\tA [k] = R [j];\n\t\t\t\tj++;\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate static void Merge_Sort (T[] A, int p, int r, T[] L, T[] R) where T : IComparable\n\t{\n\t\tif (p >= r)\n\t\t\treturn;\n\t\tint q = p + ((r - p) >> 1);\n\t\tMerge_Sort (A, p, q, L, R);\n\t\tMerge_Sort (A, q + 1, r, L, R);\n\t\tMerge (A, p, q, r, L, R);\n\t}\n\n\tpublic static void Merge_Sort_Non_Recursive (T[] A, int p, int r) where T : IComparable\n\t{\n\t\tT[] L = new T[A.Length];\n\t\tT[] R = new T[A.Length];\n\t\tint k = 1;\n\t\twhile (k < r - p + 1) {\n\t\t\tint i = 0;\n\t\t\twhile (i < r) {\n\t\t\t\tint _r = Math.Min (i + 2 * k - 1, r);\n\t\t\t\tint q = Math.Min (i + k - 1, r);\n\t\t\t\tMerge (A, i, q, _r, L, R);\n\t\t\t\ti += 2 * k;\n\t\t\t}\n\t\t\tk <<= 1;\n\t\t}\n\t}\n\n\tpublic static void Merge_Sort_Non_Recursive (T[] A, int p, int r, Comparison comp)\n\t{\n\t\tT[] L = new T[A.Length];\n\t\tT[] R = new T[A.Length];\n\t\tint k = 1;\n\t\twhile (k < r - p + 1) {\n\t\t\tint i = 0;\n\t\t\twhile (i < r) {\n\t\t\t\tint _r = Math.Min (i + 2 * k - 1, r);\n\t\t\t\tint q = Math.Min (i + k - 1, r);\n\t\t\t\tMerge (A, i, q, _r, L, R, comp);\n\t\t\t\ti += 2 * k;\n\t\t\t}\n\t\t\tk <<= 1;\n\t\t}\n\t}\n\n\tpublic static void Shake (T[] a)\n\t{\n\t\tRandom rnd = new Random (Environment.TickCount);\n\t\tint b;\n\t\tfor (int i = 0; i < a.Length; i++) {\n\t\t\tb = rnd.Next (i, a.Length);\n\t\t\tSwap (a, i, b);\n\t\t}\n\t}\n}\n\npartial class Program\n{\n\tstatic string[] tokens = new string[0];\n\tstatic int cur_token = 0;\n\n\tstatic void ReadArray (char sep)\n\t{\n\t\tcur_token = 0;\n\t\ttokens = Console.ReadLine ().Split (sep);\n\t}\n\n\tstatic int ReadInt ()\n\t{\n\t\treturn int.Parse (Console.ReadLine ());\n\t}\n\n\tstatic long ReadLong ()\n\t{\n\t\treturn long.Parse (Console.ReadLine ());\n\t}\n\n\tstatic int NextInt ()\n\t{\n\t\tif (cur_token == tokens.Length)\n\t\t\tReadArray (' ');\n\t\treturn int.Parse (tokens [cur_token++]);\n\t}\n\n\tstatic long NextLong ()\n\t{\n\t\tif (cur_token == tokens.Length)\n\t\t\tReadArray (' ');\n\t\treturn long.Parse (tokens [cur_token++]);\n\t}\n\n\tstatic double NextDouble ()\n\t{\n\t\tif (cur_token == tokens.Length)\n\t\t\tReadArray (' ');\n\t\treturn double.Parse (tokens [cur_token++]);\n\t}\n\n\tstatic decimal NextDecimal ()\n\t{\n\t\tif (cur_token == tokens.Length)\n\t\t\tReadArray (' ');\n\t\treturn decimal.Parse (tokens [cur_token++]);\n\t}\n\n\tstatic string NextToken ()\n\t{\n\t\tif (cur_token == tokens.Length)\n\t\t\tReadArray (' ');\n\t\treturn tokens [cur_token++];\n\t}\n\n\tstatic string ReadLine ()\n\t{\n\t\treturn Console.ReadLine ();\n\t}\n}", "lang": "MS C#", "bug_code_uid": "c2041b35b6a51796ac518c91938edfb9", "src_uid": "a1db3dd9f8d0f0cad7bdeb1780707143", "apr_id": "48e9b866162c160dba805c5f417a41cc", "difficulty": 2000, "tags": ["math", "binary search"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.999408424041647, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "#define FileIO\nusing System;\nusing System.Collections.Generic;\nusing System.Diagnostics;\nusing System.Text;\nusing System.IO;\n\ndelegate double F (double x);\n\ndelegate decimal Fdec (decimal x);\n\npartial class Program\n{\n\tpublic static StreamReader sr;\n\tpublic static StreamWriter sw;\n\n\tstatic void Main (string[] args)\n\t{\n\n#if FileIO\n\t\tsr = new StreamReader (\"input.in\");\n\t\tsw = new StreamWriter (\"input.out\");\n\t\tConsole.SetIn (sr);\n\t\tConsole.SetOut (sw);\n#endif\n\n\t\tB ();\n\n#if Online\n\t\tConsole.ReadLine ();\n#endif\n\n#if FileIO\n\t\tsr.Close ();\n\t\tsw.Close ();\n#endif\n\n\t}\n\n\tstatic void A ()\n\t{\n\t}\n\n\tstatic void B ()\n\t{\n\t\tint a, b, w, x, c;\n\t\ta = NextInt ();\n\t\tb = NextInt ();\n\t\tw = NextInt ();\n\t\tx = NextInt ();\n\t\tc = NextInt ();\n\t\tlong time = long.MaxValue;\n\t\tlong[] t = new long[1001];\n\t\tlong[] d = new long[1001];\n\t\tint[] last = new int[1001];\n\t\tlong[] th = new long[1001];\n\t\tlong[] th_t = new long[1001];\n\t\tint[] last_th = new int[1001];\n\t\tfor (int i=0; i=x) {\n\t\t\t\t_b -= x;\n\t\t\t\t++j;\n\t\t\t}\n\t\t\twhile (_b_a-th[_b]) {\n\t\t\t\t_a -= th [_b];\n\t\t\t\t_c -= th_t [_b];\n\t\t\t\ttime -= th_t [_b];\n\t\t\t\t_b = last_th [_b];\n\t\t\t}\n\t\t\twhile (_c-t[_b]>_a-d[_b]) {\n\t\t\t\ttime -= t [_b];\n\t\t\t\t_c -= t [_b];\n\t\t\t\t_a -= d [_b];\n\t\t\t\t_b = last [_b];\n\t\t\t}\n\t\t\twhile (_b>=x && _c>_a) {\n\t\t\t\t--_c;\n\t\t\t\t--time;\n\t\t\t\t_b -= x;\n\t\t\t}\n\t\t\twhile (_b_a) {\n\t\t\t\t--_a;\n\t\t\t\t--_c;\n\t\t\t\t_b = w - (x - _b);\n\t\t\t\t--time;\n\t\t\t}\n\t\t\tif (time >= 0) {\n\t\t\t\tright = mid;\n\t\t\t} else {\n\t\t\t\tleft = mid + 1;\n\t\t\t}\n\t\t}\n\t\tConsole.WriteLine (right);\n\t}\n\n\tstatic void C ()\n\t{\n\n\t}\n\t\n\tstatic void D ()\n\t{\n\n\t}\n\n\tstatic void E ()\n\t{\n\n\t}\n\n\tstatic void TestGen ()\n\t{\n\n\t}\n\n}\n\npublic static class MyMath\n{\n\tpublic static long BinPow (long a, long n, long mod)\n\t{\n\t\tlong res = 1;\n\t\twhile (n > 0) {\n\t\t\tif ((n & 1) == 1) {\n\t\t\t\tres = (res * a) % mod;\n\t\t\t}\n\t\t\ta = (a * a) % mod;\n\t\t\tn >>= 1;\n\t\t}\n\t\treturn res;\n\t}\n\n\tpublic static long GCD (long a, long b)\n\t{\n\t\twhile (b != 0)\n\t\t\tb = a % (a = b);\n\t\treturn a;\n\t}\n\n\tpublic static int GCD (int a, int b)\n\t{\n\t\twhile (b != 0)\n\t\t\tb = a % (a = b);\n\t\treturn a;\n\t}\n\n\tpublic static long LCM (long a, long b)\n\t{\n\t\treturn (a * b) / GCD (a, b);\n\t}\n\n\tpublic static int LCM (int a, int b)\n\t{\n\t\treturn (a * b) / GCD (a, b);\n\t}\n}\n\nstatic class ArrayUtils\n{\n\tstatic void Swap (T[] a, int l, int r)\n\t{\n\t\tT t = a [l];\n\t\ta [l] = a [r];\n\t\ta [r] = t;\n\t}\n\n\tpublic static bool NextPermutation (int[] a)\n\t{\n\t\tbool isOkay = false;\n\t\tint n = a.Length;\n\t\tfor (int i=n-2; i>=0; i--) {\n\t\t\tif (a [i] < a [i + 1]) {\n\t\t\t\tisOkay = true;\n\t\t\t\tint j = i + 1;\n\t\t\t\twhile (j+1a[i]) {\n\t\t\t\t\tj++;\n\t\t\t\t}\n\t\t\t\tSwap (a, i, j);\n\t\t\t\tfor (j=1; i+j> 1);\n\t\t\tif (val <= a [mid]) {\n\t\t\t\tright = mid;\n\t\t\t} else {\n\t\t\t\tleft = mid + 1;\n\t\t\t}\n\t\t}\n\n\t\tif (a [left] == val)\n\t\t\treturn left;\n\t\telse\n\t\t\treturn -1;\n\t}\n\n\tpublic static double Bisection (F f, double left, double right, double eps)\n\t{\n\t\tdouble mid;\n\t\twhile (right - left > eps) {\n\t\t\tmid = left + ((right - left) / 2d);\n\t\t\tif (Math.Sign (f (mid)) != Math.Sign (f (left)))\n\t\t\t\tright = mid;\n\t\t\telse\n\t\t\t\tleft = mid;\n\t\t}\n\t\treturn (left + right) / 2d;\n\t}\n\n\tpublic static decimal TernarySearchDec (Fdec f, decimal eps, decimal l, decimal r, bool isMax)\n\t{\n\t\tdecimal m1, m2;\n\t\twhile (r - l > eps) {\n\t\t\tm1 = l + (r - l) / 3m;\n\t\t\tm2 = r - (r - l) / 3m;\n\t\t\tif (f (m1) < f (m2))\n\t\t\tif (isMax)\n\t\t\t\tl = m1;\n\t\t\telse\n\t\t\t\tr = m2;\n\t\t\telse\n if (isMax)\n\t\t\t\tr = m2;\n\t\t\telse\n\t\t\t\tl = m1;\n\t\t}\n\t\treturn r;\n\t}\n\n\tpublic static double TernarySearch (F f, double eps, double l, double r, bool isMax)\n\t{\n\t\tdouble m1, m2;\n\t\twhile (r - l > eps) {\n\t\t\tm1 = l + (r - l) / 3d;\n\t\t\tm2 = r - (r - l) / 3d;\n\t\t\tif (f (m1) < f (m2))\n\t\t\tif (isMax)\n\t\t\t\tl = m1;\n\t\t\telse\n\t\t\t\tr = m2;\n\t\t\telse\n if (isMax)\n\t\t\t\tr = m2;\n\t\t\telse\n\t\t\t\tl = m1;\n\t\t}\n\t\treturn r;\n\t}\n\n\tpublic static void Merge_Sort (T[]A, int p, int r, Comparison comp)\n\t{\n\t\tT[] L = new T[A.Length];\n\t\tT[] R = new T[A.Length];\n\t\tMerge_Sort (A, p, r, L, R, comp);\n\t}\n\n\tpublic static void Merge (T[] A, int p, int q, int r, T[] L, T[] R, Comparison comp)\n\t{\n\t\tfor (int i = p; i <= q; i++)\n\t\t\tL [i] = A [i];\n\t\tfor (int i = q + 1; i <= r; i++)\n\t\t\tR [i] = A [i];\n\n\t\tfor (int k = p, i = p, j = q + 1; k <= r; k++) {\n\t\t\tif (i > q) {\n\t\t\t\tfor (; k <= r; k++, j++)\n\t\t\t\t\tA [k] = R [j];\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (j > r) {\n\t\t\t\tfor (; k <= r; k++, i++)\n\t\t\t\t\tA [k] = L [i];\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (comp (L [i], R [j]) <= 0) {\n\t\t\t\tA [k] = L [i];\n\t\t\t\ti++;\n\t\t\t} else {\n\t\t\t\tA [k] = R [j];\n\t\t\t\tj++;\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate static void Merge_Sort (T[] A, int p, int r, T[] L, T[] R, Comparison comp)\n\t{\n\t\tif (p >= r)\n\t\t\treturn;\n\t\tint q = p + ((r - p) >> 1);\n\t\tMerge_Sort (A, p, q, L, R, comp);\n\t\tMerge_Sort (A, q + 1, r, L, R, comp);\n\t\tMerge (A, p, q, r, L, R, comp);\n\t}\n\n\tpublic static void Merge_Sort (T[]A, int p, int r)where T:IComparable\n\t{\n\t\tT[] L = new T[A.Length];\n\t\tT[] R = new T[A.Length];\n\t\tMerge_Sort (A, p, r, L, R);\n\t}\n\n\tpublic static void Merge (T[] A, int p, int q, int r, T[] L, T[] R) where T : IComparable\n\t{\n\t\tfor (int i = p; i <= q; i++)\n\t\t\tL [i] = A [i];\n\t\tfor (int i = q + 1; i <= r; i++)\n\t\t\tR [i] = A [i];\n\n\t\tfor (int k = p, i = p, j = q + 1; k <= r; k++) {\n\t\t\tif (i > q) {\n\t\t\t\tfor (; k <= r; k++, j++)\n\t\t\t\t\tA [k] = R [j];\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (j > r) {\n\t\t\t\tfor (; k <= r; k++, i++)\n\t\t\t\t\tA [k] = L [i];\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (L [i].CompareTo (R [j]) <= 0) {\n\t\t\t\tA [k] = L [i];\n\t\t\t\ti++;\n\t\t\t} else {\n\t\t\t\tA [k] = R [j];\n\t\t\t\tj++;\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate static void Merge_Sort (T[] A, int p, int r, T[] L, T[] R) where T : IComparable\n\t{\n\t\tif (p >= r)\n\t\t\treturn;\n\t\tint q = p + ((r - p) >> 1);\n\t\tMerge_Sort (A, p, q, L, R);\n\t\tMerge_Sort (A, q + 1, r, L, R);\n\t\tMerge (A, p, q, r, L, R);\n\t}\n\n\tpublic static void Merge_Sort_Non_Recursive (T[] A, int p, int r) where T : IComparable\n\t{\n\t\tT[] L = new T[A.Length];\n\t\tT[] R = new T[A.Length];\n\t\tint k = 1;\n\t\twhile (k < r - p + 1) {\n\t\t\tint i = 0;\n\t\t\twhile (i < r) {\n\t\t\t\tint _r = Math.Min (i + 2 * k - 1, r);\n\t\t\t\tint q = Math.Min (i + k - 1, r);\n\t\t\t\tMerge (A, i, q, _r, L, R);\n\t\t\t\ti += 2 * k;\n\t\t\t}\n\t\t\tk <<= 1;\n\t\t}\n\t}\n\n\tpublic static void Merge_Sort_Non_Recursive (T[] A, int p, int r, Comparison comp)\n\t{\n\t\tT[] L = new T[A.Length];\n\t\tT[] R = new T[A.Length];\n\t\tint k = 1;\n\t\twhile (k < r - p + 1) {\n\t\t\tint i = 0;\n\t\t\twhile (i < r) {\n\t\t\t\tint _r = Math.Min (i + 2 * k - 1, r);\n\t\t\t\tint q = Math.Min (i + k - 1, r);\n\t\t\t\tMerge (A, i, q, _r, L, R, comp);\n\t\t\t\ti += 2 * k;\n\t\t\t}\n\t\t\tk <<= 1;\n\t\t}\n\t}\n\n\tpublic static void Shake (T[] a)\n\t{\n\t\tRandom rnd = new Random (Environment.TickCount);\n\t\tint b;\n\t\tfor (int i = 0; i < a.Length; i++) {\n\t\t\tb = rnd.Next (i, a.Length);\n\t\t\tSwap (a, i, b);\n\t\t}\n\t}\n}\n\npartial class Program\n{\n\tstatic string[] tokens = new string[0];\n\tstatic int cur_token = 0;\n\n\tstatic void ReadArray (char sep)\n\t{\n\t\tcur_token = 0;\n\t\ttokens = Console.ReadLine ().Split (sep);\n\t}\n\n\tstatic int ReadInt ()\n\t{\n\t\treturn int.Parse (Console.ReadLine ());\n\t}\n\n\tstatic long ReadLong ()\n\t{\n\t\treturn long.Parse (Console.ReadLine ());\n\t}\n\n\tstatic int NextInt ()\n\t{\n\t\tif (cur_token == tokens.Length)\n\t\t\tReadArray (' ');\n\t\treturn int.Parse (tokens [cur_token++]);\n\t}\n\n\tstatic long NextLong ()\n\t{\n\t\tif (cur_token == tokens.Length)\n\t\t\tReadArray (' ');\n\t\treturn long.Parse (tokens [cur_token++]);\n\t}\n\n\tstatic double NextDouble ()\n\t{\n\t\tif (cur_token == tokens.Length)\n\t\t\tReadArray (' ');\n\t\treturn double.Parse (tokens [cur_token++]);\n\t}\n\n\tstatic decimal NextDecimal ()\n\t{\n\t\tif (cur_token == tokens.Length)\n\t\t\tReadArray (' ');\n\t\treturn decimal.Parse (tokens [cur_token++]);\n\t}\n\n\tstatic string NextToken ()\n\t{\n\t\tif (cur_token == tokens.Length)\n\t\t\tReadArray (' ');\n\t\treturn tokens [cur_token++];\n\t}\n\n\tstatic string ReadLine ()\n\t{\n\t\treturn Console.ReadLine ();\n\t}\n}", "lang": "MS C#", "bug_code_uid": "9149830550e2035e29a5b8636e5a13d7", "src_uid": "a1db3dd9f8d0f0cad7bdeb1780707143", "apr_id": "48e9b866162c160dba805c5f417a41cc", "difficulty": 2000, "tags": ["math", "binary search"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C#"} {"similarity_score": 0.5557065217391305, "equal_cnt": 20, "replace_cnt": 11, "delete_cnt": 5, "insert_cnt": 4, "fix_ops_cnt": 20, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace ConsoleApplication1\n{\n class Program\n {\n static void Main(string[] args)\n {\n string []numbers = Console.ReadLine().Split(' ');\n int c = int.Parse(numbers[4]), a = int.Parse(numbers[0]), b = int.Parse(numbers[1]), w = int.Parse(numbers[2]), x = int.Parse(numbers[3]);\n int seconds = 0;\n while (c > a)\n {\n c = c - 1;\n if (b >= x)\n b = b - x;\n if (b < x)\n {\n a = a - 1;\n b = w - (x - b);\n }\n seconds++;\n }\n seconds -= 1;\n Console.WriteLine(seconds);\n }\n }\n}", "lang": "MS C#", "bug_code_uid": "033b15a2ac8914b5569dab7cfa58559d", "src_uid": "a1db3dd9f8d0f0cad7bdeb1780707143", "apr_id": "16bf2fc1e0387b0e02a44dd92edf9a0a", "difficulty": 2000, "tags": ["math", "binary search"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.4677364288152953, "equal_cnt": 28, "replace_cnt": 9, "delete_cnt": 10, "insert_cnt": 9, "fix_ops_cnt": 28, "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 int t=0,q=0,w=0;\n int[] i = new int[10];\n for (int k = 0; k <= 5; k++)\n {\n i[k] = int.Parse(Console.ReadLine());\n }\n\n for (var k=0;k<5;k++)\n {\n for(var l=k;l<6;l++)\n {\n if(i[k]>i[l])\n {\n t=i[k];\n i[k]=i[l];\n i[l]=t;\n \n }\n }\n \n }\n\n if (i[0] == i[3] || i[1] == i[4] || i[2] == i[5])\n {\n if (i[4] == i[5] || i[0] == i[5] ||i[1]==i[0])\n {\n Console.WriteLine(\"Elephant\");\n }\n\n\n else\n {\n Console.WriteLine(\"Bear\");\n }\n\n }\n else\n {\n Console.WriteLine(\"Alien\");\n } \n Console.ReadKey();\n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "9e6053d2b5068eb5bf9fb80f66960f1f", "src_uid": "43308fa25e8578fd9f25328e715d4dd6", "apr_id": "d33d22d52251220b77e3310b9e43ab22", "difficulty": 1100, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C#"} {"similarity_score": 0.9985928705440901, "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.Text;\n//using System.Threading.Tasks;\n\nnamespace Problem471A {\n class Program {\n static void Main(string[] args) {\n string[] input = Console.ReadLine().Split(' ');\n List sticks = new List();\n\n for (int i = 0; i < 6; i++) {\n int actStick = Convert.ToInt32(input[i]);\n sticks.Add(actStick);\n }\n\n int legL = findLegs(sticks);\n if (legL == -1) {\n Console.WriteLine(\"Alien\");\n } else {\n List restOfSticks = deleteLegs(sticks, legL);\n int head = restOfSticks[0];\n int body = restOfSticks[1];\n\n if (head == body) {\n Console.WriteLine(\"Elephant\");\n } else {\n Console.WriteLine(\"Bear\");\n }\n }\n }\n\n static List deleteLegs(List sticks, int legL) {\n List restOfLegs = new List();\n int deleted = 0;\n for (int i = 0; i < 6; i++) {\n int actStick = sticks[i];\n if (actStick == legL) {\n if (deleted == 4) {\n restOfLegs.Add(actStick);\n } else {\n deleted++;\n }\n }\n\n if (actStick != legL) {\n restOfLegs.Add(actStick);\n }\n }\n\n return restOfLegs;\n }\n\n static int findLegs(List sticks) {\n int legStickL = -1; //-1 - Alien\n int[] count = new int[9];\n \n for (int i = 0; i < 6; i++) {\n int actStick = sticks[i];\n count[actStick]++;\n }\n\n for (int i = 0; i < 9; i++) {\n int actCount = count[i];\n if (actCount >= 4) {\n legStickL = i;\n break;\n }\n }\n\n return legStickL;\n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "7b98b9a95d240d13aa45ab6cc49dbe71", "src_uid": "43308fa25e8578fd9f25328e715d4dd6", "apr_id": "57452520803dfe4fed433901de687650", "difficulty": 1100, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9979338842975206, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 2, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "using System;\nusing System.Linq;\n\nnamespace CSharp\n{\n public class _938A\n {\n public static void Main()\n {\n char[] vowels = new char[] { 'a', 'e', 'i', 'o', 'u', 'y' };\n\n int n = int.Parse(Console.ReadLine());\n string s = Console.ReadLine();\n\n Console.WriteLine(new string(Enumerable.Range(0, n).Where(i => i == '0' || !vowels.Contains(s[i]) || !vowels.Contains(s[i - 1])).Select(i => s[i]).ToArray()));\n }\n }\n}", "lang": "Mono C#", "bug_code_uid": "773bfba08aa4f183d914417f485799f5", "src_uid": "63a4a5795d94f698b0912bb8d4cdf690", "apr_id": "19ee3013794a1f6b93959c2a953b0a2b", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C#"} {"similarity_score": 0.8650681711330512, "equal_cnt": 1, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": " char[] vowels = { 'a', 'e', 'i', 'o', 'u', 'y' };\n int inputLetterSize = int.Parse(Console.ReadLine());\n string letter = Console.ReadLine();\n StringBuilder letterBilder = new StringBuilder(letter);\n\n\n for (int i = 0; i < letterBilder.Length-1; i++)\n {\n if (vowels.Contains(letterBilder[i])){\n if (vowels.Contains(letterBilder[i + 1])) { letterBilder.Remove(i + 1, 1); i--; }\n \n }\n }\n\n //for (int i = 1; i < letterBilder.Length; i++)\n //{\n // if(vowels.Contains(letterBilder[i]))\n // {\n // if (vowels.Contains(letterBilder[i - 1]))\n // { letterBilder.Remove(i, 1);\n // i = 0;\n // }\n // }\n //}\n Console.WriteLine(letterBilder);\n ", "lang": "Mono C#", "bug_code_uid": "fd2cd49349c8a4875357922e7c508150", "src_uid": "63a4a5795d94f698b0912bb8d4cdf690", "apr_id": "3e94722d179d0868db7486da5f4ab3eb", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9717180244829042, "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.Text;\nusing System.Threading.Tasks;\nusing System.Diagnostics;\nnamespace test\n{\n class Program\n {\n static bool judge(char x)\n {\n if (x == 'a' || x == 'e' || x == 'i' || x == 'o' || x == 'u' || x == 'y')\n {\n return true;\n }\n return false;\n }\n static void Main(string[] args)\n {\n var str1 = Console.ReadLine();\n var str = Console.ReadLine();\n int a = int.Parse(str1);\n int len = str.Length;\n string ans = string.Empty;\n for (int i = 0; i < str.Length; i++)\n {\n if (judge(str[i]))\n {\n ans += str[i];\n while (judge(str[i + 1]))\n {\n i++;\n if (i == len - 1)\n break;\n }\n }\n else\n ans += str[i];\n } \n Console.WriteLine(ans);\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "a69d3d5aaef140ac56118714c786f943", "src_uid": "63a4a5795d94f698b0912bb8d4cdf690", "apr_id": "c10704bd5ba793d28ceed846bb231663", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.8044739022369511, "equal_cnt": 6, "replace_cnt": 0, "delete_cnt": 2, "insert_cnt": 5, "fix_ops_cnt": 7, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text.RegularExpressions;\n\nnamespace Rextester\n{\n public class Program\n {\n public static void Main(string[] args)\n {\n Dictionary days = new Dictionary();\n days.Add (\"monday\", 1);\n days.Add (\"tuesday\", 2);\n days.Add (\"wednesday\", 3);\n days.Add (\"thursday\", 4);\n days.Add (\"friday\", 5);\n days.Add (\"saturday\", 6);\n days.Add (\"sunday\", 7);\n \n string first = Console.ReadLine();\n string second = Console.ReadLine();\n \n int day1 = days[first];\n int day2 = days[second];\n\n int dif = Math.Abs(day1-day2);\n \n if(dif == 0 || dif == 2 || dif == 3 ||dif == 4 || dif == 5)\n Console.WriteLine(\"YES\");\n else\n Console.WriteLine(\"NO\");\n \n \n }\n }\n}", "lang": "MS C#", "bug_code_uid": "34d1cc41922e023fa6188719b48dcaa9", "src_uid": "2a75f68a7374b90b80bb362c6ead9a35", "apr_id": "0dfaccfa317f149669326338089ddb55", "difficulty": 1000, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.9696969696969697, "equal_cnt": 8, "replace_cnt": 4, "delete_cnt": 1, "insert_cnt": 2, "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 ConsoleApplication9\n{\n class Program\n {\n static void Main(string[] args)\n {\n Dictionary dics = new Dictionary();\n\n var numb = \"monday,tuesday,wednesday,thursday,friday,saturday,sunday\".Split(',');\n\n int c = 0;\n foreach (var i in numb)\n {\n dics.Add(i, c);\n c++;\n }\n\n var numbers = \"31,28,31,30,31,30,31,31,30,31,30,31\".Split(',');\n\n int b = 1;\n\n\n var f = Console.ReadLine();\n var s = Console.ReadLine();\n\n if ((dics[s] +4)%7== dics[f] || dics[s] - dics[f] == 0 || (dics[s] +3)%7 == dics[f])\n {\n Console.WriteLine(\"YES\");\n\n }\n else\n {\n Console.WriteLine(\"NO\");\n }\n\n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "fc5c5f0c18cb9db06adee08b2d25bb8a", "src_uid": "2a75f68a7374b90b80bb362c6ead9a35", "apr_id": "5a1c37166e78b4eb280a37f66944725f", "difficulty": 1000, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9937106918238994, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "using System;\nclass Program {\n static void Main(string[] args) {\n string s = Console.ReadLine();\n Console.WriteLine(s.Length*25 + 65);\n }\n}", "lang": "MS C#", "bug_code_uid": "4f7fb561b298ad277d721027fbf9ba3a", "src_uid": "556684d96d78264ad07c0cdd3b784bc9", "apr_id": "9789d0ff9faf381903daa10b78c378a8", "difficulty": 900, "tags": ["math", "brute force", "strings"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "C#"} {"similarity_score": 0.29084041548630785, "equal_cnt": 16, "replace_cnt": 9, "delete_cnt": 0, "insert_cnt": 7, "fix_ops_cnt": 16, "bug_source_code": "using System;\n\npublic static class Program\n{\n public static void Main(string[] args){\n string s = Console.ReadLine();\n int length = s.Count + 1;\n Console.WriteLine((26 * length) - length);\n}\n}", "lang": "MS C#", "bug_code_uid": "1e95b9855f8eab265921a398a1fae21c", "src_uid": "556684d96d78264ad07c0cdd3b784bc9", "apr_id": "5f77e85db42073a78920443dfb0223cf", "difficulty": 900, "tags": ["math", "brute force", "strings"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9968583097706566, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "/*\n * Created by SharpDevelop.\n * User: tagirov2\n * Date: 08.03.2016\n * Time: 13:56\n * \n\nA. ���������\n������ ��������� �������� � ���������. � ��� ���� ��� ��������� � ������ ���� �������.\n���������� ������ �������� ������� �� a1 ���������, � ������ �� a2 ���������.\n���������� �������� � ������� ����� ������ ������� ������ ������.\n�� ������ ���� �������� ��� ������� ����������� �� 2 ��������, � � �������� ���������� �� 1 �������.\n���� ������������ ���� ����� ����� ���������� ������ �����������.\n����� �������, ���� � ������ ��������� ������ � ������-���� ��������� ������� 1 ������� ������,\n�� ��� ���������� ���������� � ������� ��� ���� ����� �����������.\n���� � ������-�� ��������� ������� 0 ��������� �������, �� ���� ���������������.\n���������� ������������ ����� � �������, ������� ����� ���������� ����.\n������ ����� � ���� ������, �� ���� ������ ������ ��� ��������� ����������� ������ ���� � ����.\n� ���� ����������� �����������, ������ �� ���������� ����� ���� ������� ����� ��� �� 100 ���������.\n������� ������\n� ������ ������ ������� ������ ���������� ��� ����� ������������� ����� a1, a2 (1 <= a1, a2 <= 100) �\n��������� ������� ������ ������� � ������� ��������� ��������������.\n�������� ������\n�������� ������������ ����� ����� � ������������ ���������� �����, ������� ����� ������������ ����.\n���� ������������ ���� �����-���� �� ���������� �� ����������.\n�������\n������� ������\n3 5\n�������� ������\n6\n������� ������\n4 4\n�������� ������\n5\n����������\n� ������ ������� ���� ����� ������������ 6 �����, ��������, ��� ����� ������������������ ��������:\n�\t� ������ ������ ���������� � ������� ������ �������� � �������� ����, � ����� ������ ������ ������ �������� ����� ������� �� 4%, � ������ � �� 3%; \n�\t�� ����� ������� ������ ��� ������, � ����� ������ ������ ������ �������� ����� ������� �� 5%, � ������ � �� 1%; \n�\t����� ������� ������� ����������� ������� �� ������ ��������, ����� ��� ������ ����� ������� �� 3%, ������ � �� 2%; \n�\t�� ����� ������� ������ ��� ������, � ����� ������ ������ ������ �������� ����� ������� �� 1%, � ������ � �� 3%; \n�\t����� ����� ������� ����������� ������� �� ������ ��������, ����� ��� ������ ����� ������� �� 2%, ������ � �� 1%; \n�\t����� ������ ������� ����������� ������� �� ������ ��������, ����� ��� ������ ����� ������� �� 0%, ������ � �� 2%. \n��� ��� ������ �������� ��������� ����������, ���������� ���� ����� ������.\n */\n\nusing System;\n\nclass Program\n{\n\tpublic static void Main(string[] args)\n\t{\n\t\tstring ss = Console.ReadLine ();\n\t\tstring [] s = ss.Split (' ');\n\t\tint a = int.Parse (s [0]);\n\t\tint b = int.Parse (s [1]);\n\n\t\tint m = 0;\n\t\tfor ( ; true; )\n\t\t{\n//\t\t\tConsole.WriteLine (a + \" \" + b);\n\t\t\tif ( a > b )\n\t\t\t{\n\t\t\t\tif ( a == 2)\n\t\t\t\t{\n\t\t\t\t\tm++;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif ( a % 2 == 1 )\n\t\t\t\t{\n\t\t\t\t\tb += a / 2;\n\t\t\t\t\tm += a / 2;\n\t\t\t\t\ta = 1;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tb += a / 2 - 1;\n\t\t\t\t\tm += a / 2 - 1;\n\t\t\t\t\ta = 2;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tif ( b == 2)\n\t\t\t\t{\n\t\t\t\t\tm++;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif ( b % 2 == 1 )\n\t\t\t\t{\n\t\t\t\t\ta += b / 2;\n\t\t\t\t\tm += b / 2;\n\t\t\t\t\tb = 1;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\ta += b / 2 - 1;\n\t\t\t\t\tm += b / 2 - 1;\n\t\t\t\t\tb = 2;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tConsole.WriteLine (m);\n//\t\tConsole.ReadKey(true);\n\t}\n}\n", "lang": "Mono C#", "bug_code_uid": "5c2a2ea7cdd84445953e2179f6dca0a6", "src_uid": "ba0f9f5f0ad4786b9274c829be587961", "apr_id": "9c1729df58a12215a6479aa49f188713", "difficulty": 1100, "tags": ["dp", "greedy", "math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.4401683704149128, "equal_cnt": 19, "replace_cnt": 13, "delete_cnt": 1, "insert_cnt": 5, "fix_ops_cnt": 19, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace _37N\n{\n class Program\n {\n static void Main(string[] args)\n {\n int n = Convert.ToInt32(Console.ReadLine());\n int[] l = Console.ReadLine().Split().Select(x => int.Parse(x)).ToArray();\n Array.Sort(l);\n int distc = 0, len = 1,maxLen = 1;\n for(int i = 1;i maxLen)\n maxLen = len;\n }\n else\n {\n len = 1;\n distc++;\n }\n }\n Console.WriteLine(\"{0} {1}\", maxLen, distc+1);\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "64c8802a3c6b19dbf486da8f04c8beed", "src_uid": "ba0f9f5f0ad4786b9274c829be587961", "apr_id": "7751fb4b8606417a326d37f1850bc3fb", "difficulty": 1100, "tags": ["dp", "greedy", "math", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.998669623059867, "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.Text;\n\nnamespace ProgrammingContest.Codeforces.Round59\n{\n class C\n {\n int n;\n int[][] dat;\n int count;\n int res;\n\n bool ok(int id, params int[] xs)\n {\n int a = 0, b = 0;\n int[] pos = new int[10];\n for (int i = 0; i < 10; i++)\n pos[i] = -1;\n for (int i = 0; i < 4; i++)\n pos[xs[i]] = i;\n for (int m = dat[id][0], i = 3; i >= 0; i--, m /= 10)\n {\n if (pos[m % 10] == i) a++;\n else if (pos[m % 10] >= 0) b++;\n }\n //for (int i = 0; i < 4; i++)\n // Console.Write(\"{0} \", xs[i]);\n //Console.WriteLine(\": {0} {1} : {2} {3}\", a, b, dat[id][1], dat[id][2]);\n return a == dat[id][1] && b == dat[id][2];\n }\n\n C()\n {\n n = int.Parse(Console.ReadLine());\n dat = new int[n][];\n for (int i = 0; i < n; i++)\n dat[i] = Array.ConvertAll(Console.ReadLine().Split(' '), sss => int.Parse(sss));\n\n for (int a = 0; a < 10; a++)\n for (int b = 0; b < 10; b++)\n if (a != b)\n for (int c = 0; c < 10; c++)\n if (a != c && b != c)\n for (int d = 0; d < 10; d++)\n if (a != d && b != d && c != d)\n {\n bool chk = true;\n for (int i = 0; i < n; i++)\n chk &= ok(i, a, b, c, d);\n if (chk)\n {\n count++;\n res = a * 1000 + b * 100 + c * 10 + d;\n }\n }\n\n Console.WriteLine(count == 0 ? \"Incorrect data\" : (count != 1 ? \"Need more data\" : res.ToString()));\n }\n\n public static void Main()\n {\n new C();\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "e2731d1a089e068fca2fb4464a0ae7a7", "src_uid": "142e5f2f08724e53c234fc2379216b4c", "apr_id": "1e20d68054792717986b466b8a2bd1d8", "difficulty": 1700, "tags": ["brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.8992343032159265, "equal_cnt": 8, "replace_cnt": 2, "delete_cnt": 2, "insert_cnt": 3, "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 k_Tree\n{\n class Program\n {\n static short n, k, d;\n\n static int[,] dpMaxWays;\n\n static void Main(string[] args)\n {\n // Reading input as n, k, d\n string iLine = Console.ReadLine();\n string[] iStrings = iLine.Split(' ');\n n = Convert.ToInt16(iStrings[0]);\n k = Convert.ToInt16(iStrings[1]);\n d = Convert.ToInt16(iStrings[2]);\n\n dpMaxWays = new int[n + 1, 2];\n\n Console.WriteLine(NumberOfWays(remaining: n, gotD: 0));\n }\n\n static int NumberOfWays(int remaining, int gotD)\n {\n if (remaining == 0)\n {\n if (gotD != 0)\n {\n return 1;\n }\n else\n {\n return 0;\n }\n }\n else if (remaining < 0)\n {\n return 0;\n }\n else if (dpMaxWays[remaining, gotD] != 0)\n {\n return dpMaxWays[remaining, gotD];\n }\n\n int ways = 0;\n int sonGotD = gotD;\n\n for (int e = 1; e <= k; e++)\n {\n sonGotD = e >= d? 1 : sonGotD;\n ways += NumberOfWays(remaining - e, sonGotD);\n ways %= 1000000007;\n }\n\n dpMaxWays[remaining, gotD] = ways;\n\n return ways;\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "9fa6cb0e28b73c038406e9b068f79c49", "src_uid": "894a58c9bba5eba11b843c5c5ca0025d", "apr_id": "c363f62f586ed4a5610030d1c1b077c9", "difficulty": 1600, "tags": ["trees", "dp", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.5936762623879188, "equal_cnt": 22, "replace_cnt": 13, "delete_cnt": 1, "insert_cnt": 7, "fix_ops_cnt": 21, "bug_source_code": "using System;\nusing System.Collections.Generic;\n\nnamespace kth_test\n{\n class Program\n {\n static void Main(string[] args)\n {\n\n\n\n string[] input = Console.ReadLine().Split(\" \");\n\n Console.WriteLine(FindDivisor(Convert.ToInt32(input[0]), Convert.ToInt32(input[1])));\n\n\n\n }\n\n static int FindDivisor(int x , int y)\n {\n List a = new List();\n \n for (int i = 1 ; i <= x; i++) if (x % i == 0) a.Add(i);\n\n try\n {\n return a[y - 1];\n }\n catch (ArgumentOutOfRangeException)\n {\n\n return -1;\n }\n \n }\n\n \n }\n}\n", "lang": ".NET Core C#", "bug_code_uid": "4506d78a3fe9208896a9cb7868c476f5", "src_uid": "6ba39b428a2d47b7d199879185797ffb", "apr_id": "a61e7f2e524d791a85e702948f3dfa3b", "difficulty": 1400, "tags": ["math", "number theory"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.39697542533081287, "equal_cnt": 22, "replace_cnt": 10, "delete_cnt": 4, "insert_cnt": 9, "fix_ops_cnt": 23, "bug_source_code": " class Program\n {\n static void Main(string[] args)\n {\n\n \n \n int input1 = Convert.ToInt32(Console.ReadLine());\n\n \n\n int input2 = Convert.ToInt32(Console.ReadLine());\n\n Console.WriteLine(FindDivisor(input1, input2));\n \n\n\n }\n\n static int FindDivisor(int x , int y)\n {\n List a = new List();\n \n for (int i = 1 ; i <= x; i++) if (x % i == 0) a.Add(i);\n\n try\n {\n return a[y - 1];\n }\n catch (ArgumentOutOfRangeException)\n {\n\n return -1;\n }\n \n }\n }\n", "lang": ".NET Core C#", "bug_code_uid": "d01711f70a6f961ccecc4a798879b581", "src_uid": "6ba39b428a2d47b7d199879185797ffb", "apr_id": "a61e7f2e524d791a85e702948f3dfa3b", "difficulty": 1400, "tags": ["math", "number theory"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.7091388400702988, "equal_cnt": 13, "replace_cnt": 4, "delete_cnt": 0, "insert_cnt": 8, "fix_ops_cnt": 12, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Runtime.InteropServices;\n\nnamespace kth_test\n{\n class Program\n {\n static void Main(string[] args)\n {\n\n\n\n string[] input = Console.ReadLine().Split(\" \");\n\n \n\n Console.WriteLine(FindDivisor(Convert.ToInt64(input[0]), Convert.ToInt64(input[1])));\n\n\n\n }\n\n static long FindDivisor(long x , long y)\n {\n List a = new List();\n\n for (int i = 1; i <= x; i++)\n {\n if (x % i == 0) a.Add(i);\n \n \n }\n try\n {\n int z = (int) y;\n return a[z-1];\n }\n catch (ArgumentOutOfRangeException)\n {\n\n return -1;\n }\n \n }\n \n \n }\n}\n", "lang": ".NET Core C#", "bug_code_uid": "74c1723c3b778c834ae8880b5a5f40a9", "src_uid": "6ba39b428a2d47b7d199879185797ffb", "apr_id": "a61e7f2e524d791a85e702948f3dfa3b", "difficulty": 1400, "tags": ["math", "number theory"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.9940740740740741, "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;\n\nnamespace CSharp\n{\n public class _762A\n {\n public static void Main()\n {\n string[] tokens = Console.ReadLine().Split();\n\n long n = long.Parse(tokens[0]);\n int k = int.Parse(tokens[1]);\n\n var divisors = new SortedSet();\n\n for (int i = 1; i * i <= n; i++)\n {\n if (n % i == 0)\n {\n divisors.Add(i);\n divisors.Add(n / i);\n }\n }\n\n Console.WriteLine(divisors.Skip(k - 1).DefaultIfEmpty(-1).First());\n }\n }\n}", "lang": "Mono C#", "bug_code_uid": "168e72b47659c7b32d521f4f46f4ce84", "src_uid": "6ba39b428a2d47b7d199879185797ffb", "apr_id": "414d43e5ad8dbfc85c0bfa0829d15335", "difficulty": 1400, "tags": ["math", "number theory"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "delete", "lang_cluster": "C#"} {"similarity_score": 0.9790881042166609, "equal_cnt": 3, "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 KingsWay\n{\n class Program\n {\n \n static void Main(string[] args)\n {\n string[] token = Console.ReadLine().Split();\n long n = long.Parse(token[0]);\n long k = long.Parse(token[1]);\n \n long num = n;\n List myList = new List();\n // myList.Contains(i)\n for(int i=1; ;i++)\n {\n if(i>=num)\n break;\n if(n%i==0)\n {\n if(!myList.Contains(i))\n myList.Add(i);\n num =n / i;\n if(!myList.Contains(num))\n myList.Add(num);\n }\n \n }\n myList.Sort();\n long count = -1;\n //myList.Add(13);\n for(int i = 0;in)\n {\n count = -1;\n }\n Console.WriteLine(count);\n \n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "43d82bad7cedb7cce00a8db5bf992b6b", "src_uid": "6ba39b428a2d47b7d199879185797ffb", "apr_id": "e846ab2ea90ab15ce2ce0a8bd4845610", "difficulty": 1400, "tags": ["math", "number theory"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.9584319026698209, "equal_cnt": 5, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 4, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace KingsWay\n{\n class Program\n {\n \n static void Main(string[] args)\n {\n string[] token = Console.ReadLine().Split();\n long n = long.Parse(token[0]);\n long k = long.Parse(token[1]);\n \n long num = n;\n List myList = new List();\n // myList.Contains(i)\n int h = (n%2==0)?n/2:n+1/2;\n for(int i=1;i=num)\n break;\n if(n%i==0)\n {\n if(!myList.Contains(i))\n myList.Add(i);\n num =n / i;\n if(!myList.Contains(num))\n myList.Add(num);\n }\n \n }\n myList.Sort();\n long count = -1;\n //myList.Add(13);\n for(int i = 0;in)\n {\n count = -1;\n }\n Console.WriteLine(count);\n \n }\n }\n}", "lang": "Mono C#", "bug_code_uid": "c1d61be229b95a1b69d2795c2cb56a04", "src_uid": "6ba39b428a2d47b7d199879185797ffb", "apr_id": "e846ab2ea90ab15ce2ce0a8bd4845610", "difficulty": 1400, "tags": ["math", "number theory"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.30785924662842973, "equal_cnt": 33, "replace_cnt": 18, "delete_cnt": 7, "insert_cnt": 8, "fix_ops_cnt": 33, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\n\nnamespace Codeforces\n{\n\tclass Program\n\t{\n\t\tstatic void Main(string[] args)\n\t\t{\n\t\t\tstring input1 = Console.ReadLine();\n\t\t\t//string input2 = Console.ReadLine();\n\n\t\t\t//string input3 = Console.ReadLine();\n\t\t\t//string input4 = Console.ReadLine();\n\n\t\t\tvar inputs1 = input1.Split(new[] { ' ' }, StringSplitOptions.RemoveEmptyEntries).Select(long.Parse).ToArray();\n\t\t\t//var inputs2 = input2.Split(new[] { ' ' }, StringSplitOptions.RemoveEmptyEntries).Select(long.Parse).ToArray();\n\n\t\t\tlong n = inputs1[0];\n\t\t\tlong k = inputs1[1];\n\n\t\t\tif (k == 1) \n\t\t\t{\n\t\t\t\tConsole.WriteLine(1);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (n == 1) \n\t\t\t{\n\t\t\t\tConsole.WriteLine(-1);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tvar d = new List { 1 };\n\t\t\tint index = 1;\n\t\t\tvar border = n;\n\n\t\t\tfor (long i = 2; i < border; i++)\n\t\t\t{\n\t\t\t\tif (n % i == 0) \n\t\t\t\t{\n\t\t\t\t\tvar res = n / i;\n\t\t\t\t\td.Insert(index, res);\n\t\t\t\t\tif (i != res) \n\t\t\t\t\t{\n\t\t\t\t\t\td.Insert(index, i);\n\t\t\t\t\t}\n\n\t\t\t\t\tindex++;\n\t\t\t\t\tborder = res;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\td.Insert(d.Count, n);\n\n\t\t\tif (d.Count >= k) \n\t\t\t{\n\t\t\t\tConsole.WriteLine(d.ElementAt((int)(k - 1)));\n\t\t\t}\n\t\t\telse \n\t\t\t{\n\t\t\t\tConsole.WriteLine(-1);\n\t\t\t}\n\t\t}\n\n\t\tpublic static void Print(int[] number) \n\t\t{\n\t\t\tvar stringBuilder = new StringBuilder();\n\t\t\tforeach (var i in number)\n\t\t\t{\n\t\t\t\tif (i == 0 && stringBuilder.Length == 0)\n\t\t\t\t{\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tstringBuilder.Append(i);\n\t\t\t}\n\n\t\t\tConsole.WriteLine(stringBuilder.ToString());\n\t\t}\n\n\t\tpublic void Method1(ref int n1, ref int n2, ref int k1, ref int k2) \n\t\t{\n\t\t\tdouble a = (double)n1 / k1;\n\t\t\tdouble b = (double)n2 / k2;\n\t\t\tif (n1 >= n2 || (a >= b && a < 2 * b))\n\t\t\t{\n\n\t\t\t}\n\t\t}\n\n\t\tpublic void Method2(ref int n1, ref int n2, ref int k1, ref int k2)\n\t\t{\n\t\t\tdouble a = (double)n1 / k1;\n\t\t\tdouble b = (double)n2 / k2;\n\t\t\tif (n2 >= n1 || (b >= a && b < 2 * a))\n\t\t\t{\n\n\t\t\t}\n\t\t}\n\n\t\tpublic class Node\n\t\t{\n\t\t\tpublic int Count { get; set; }\n\n\t\t\tpublic int FirstIndex { get; set; } = -1;\n\n\t\t\tpublic int LastIndex { get; set; } = -1;\n\t\t}\n\n\t\t//public class Node\n\t\t//{\n\t\t//\tpublic Node Left { get; set; }\n\n\t\t//\tpublic Node Right { get; set; }\n\n\t\t//\tpublic T Value { get; set; }\n\n\t\t//\tpublic Node(T value) \n\t\t//\t{\n\t\t//\t\tValue = value;\n\t\t//\t}\n\t\t//}\n\n\t\t//public class Tree\n\t\t//{\n\t\t//\tpublic Node Root { get; set; }\n\n\t\t//\tpublic Tree(T value) \n\t\t//\t{\n\t\t//\t\tRoot = new Node(value);\n\t\t//\t}\n\t\t//}\n\n\t\tprivate static long GCD(long a, long b)\n\t\t{\n\t\t\tlong max = Math.Max(a, b);\n\t\t\tlong min = Math.Min(a, b);\n\n\t\t\tif (min == 0)\n\t\t\t{\n\t\t\t\treturn max;\n\t\t\t}\n\n\t\t\ta = min;\n\t\t\tb = max % min;\n\t\t\treturn GCD(a, b);\n\t\t}\n\n\t\tprivate static long LCM(long a, long b)\n\t\t{\n\t\t\treturn Math.Abs(a * b) / GCD(a, b);\n\t\t}\n\n\t\t//private static int Length(short[] a)\n\t\t//{\n\t\t//\tint firstItemIndex = 0;\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{\n\t\t//\t\t\tcontinue;\n\t\t//\t\t}\n\n\t\t//\t\tfirstItemIndex = i;\n\t\t//\t\tbreak;\n\t\t//\t}\n\n\t\t//\treturn a.Length - firstItemIndex;\n\t\t//}\n\n\t\t//private static short[] Subtract(short[] a, short[] b)\n\t\t//{\n\t\t//\tif (a.Length != b.Length)\n\t\t//\t{\n\t\t//\t\tthrow new ArgumentException();\n\t\t//\t}\n\n\t\t//\tshort[] result = new short[a.Length];\n\t\t//\tArray.Copy(a, result, a.Length);\n\t\t//\tfor (int i = result.Length - 1; i >= 0; i--)\n\t\t//\t{\n\t\t//\t\tif (result[i] < b[i])\n\t\t//\t\t{\n\t\t//\t\t\tint j = i - 1;\n\t\t//\t\t\twhile (result[j] == 0)\n\t\t//\t\t\t{\n\t\t//\t\t\t\tresult[j--] = 9;\n\t\t//\t\t\t}\n\n\t\t//\t\t\tresult[j]--;\n\t\t//\t\t\tresult[i] += 10;\n\t\t//\t\t}\n\n\t\t//\t\tresult[i] -= b[i];\n\t\t//\t}\n\n\t\t//\treturn result;\n\t\t//}\n\n\t\t//private static short[] Multiply(short[] a, int b)\n\t\t//{\n\t\t//\tshort[] result = new short[a.Length];\n\t\t//\tfor (int i = a.Length - 1; i > 0; i--)\n\t\t//\t{\n\t\t//\t\tint temp = a[i] * b;\n\t\t//\t\tresult[i] = (short)(result[i] + temp % 10);\n\t\t//\t\tresult[i - 1] = (short)(result[i - 1] + temp / 10);\n\t\t//\t}\n\n\t\t//\treturn result;\n\t\t//}\n\n\t\t//private static int Mod(short[] a, int b)\n\t\t//{\n\t\t//\tint rest = 0, i = 0;\n\t\t//\twhile (i < a.Length)\n\t\t//\t{\n\t\t//\t\tint d = 10 * rest + a[i];\n\t\t//\t\twhile (d < b && i < a.Length - 1)\n\t\t//\t\t{\n\t\t//\t\t\td = 10 * d + a[++i];\n\t\t//\t\t}\n\n\t\t//\t\trest = d % b;\n\t\t//\t\ti++;\n\t\t//\t}\n\n\t\t//\treturn rest;\n\t\t//}\n\n\t\t//private static short[] Divide(short[] a, int b)\n\t\t//{\n\t\t//\tshort[] result = new short[a.Length];\n\t\t//\tint rest = 0, i = 0;\n\t\t//\twhile (i < a.Length)\n\t\t//\t{\n\t\t//\t\tint d = 10 * rest + a[i];\n\t\t//\t\twhile (d < b && i < a.Length - 1)\n\t\t//\t\t{\n\t\t//\t\t\td = 10 * d + a[++i];\n\t\t//\t\t}\n\n\t\t//\t\tresult[i] = (short)(d / b);\n\t\t//\t\trest = d % b;\n\t\t//\t\ti++;\n\t\t//\t}\n\n\t\t//\treturn result;\n\t\t//}\n\t}\n}\n", "lang": "Mono C#", "bug_code_uid": "0df0e221225bce895b84a96291fdd1dd", "src_uid": "6ba39b428a2d47b7d199879185797ffb", "apr_id": "6f8d72815b6231aa2444c3fc922e63ef", "difficulty": 1400, "tags": ["math", "number theory"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9908508691674291, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "using System;\nusing System.Text;\nusing System.Collections.Generic;\nusing System.Collections;\nusing System.Linq;\nclass Problem\n{\n static void Main()\n {\n //--------------------------------input--------------------------------//\n\n var str = Array.ConvertAll( Console.ReadLine().Split(), Convert.ToInt32 );\n int n = str[0], h = str[1], m = str[2];\n var l = new int[m];\n var r = new int[m];\n var x = new int[m];\n for(int i = 0 ; i < m ; i++)\n {\n str = Array.ConvertAll( Console.ReadLine().Split(), Convert.ToInt32 );\n l[i] = str[0];\n r[i] = str[1];\n x[i] = str[2];\n }\n\n //--------------------------------solve--------------------------------//\n\n var houses = new int[n];\n for(int i = 0 ; i < n ; i++)\n houses[i] = h;\n for(int i = 0 ; i < m ; i++)\n for(int j = l[i]-1 ; j <= r[i]-1 ; j++)\n houses[j] = x[i];\n var kq = houses.Select( t => t * t ).ToList();\n Console.WriteLine( kq.Sum() );\n }\n}", "lang": "Mono C#", "bug_code_uid": "faa4dd74a81e6f5828b1d69ccf70ca15", "src_uid": "f22b6dab443f63fb8d2d288b702f20ad", "apr_id": "7edf3c0a20cd72412c7ea2452ed9c83a", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.9829192546583851, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "using System;\nclass Program\n{\n static void Main()\n {\n int[] args = Array.ConvertAll(Console.ReadLine().Split(), int.Parse);\n int[] houses = new int[args[0]];\n int sum = 0;\n for (int i = 0; i < houses.Length; i++)\n houses[i] = args[1];\n for (int i = 0; i < args[2]; i++)\n {\n int[] m = Array.ConvertAll(Console.ReadLine().Split(), int.Parse);\n for (int j = m[0]; j <= m[1]; j++)\n houses[j-1] = m[2];\n }\n for (int i = 0; i < houses.Length; i++)\n sum += houses[i] * houses[i];\n Console.WriteLine(sum);\n }\n}", "lang": "Mono C#", "bug_code_uid": "26ac582d7d1c5f9f3cb0bf37ba12a1a4", "src_uid": "f22b6dab443f63fb8d2d288b702f20ad", "apr_id": "736592038ccdef25183b4b2bb650e9e0", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.9846270352139341, "equal_cnt": 12, "replace_cnt": 7, "delete_cnt": 2, "insert_cnt": 2, "fix_ops_cnt": 11, "bug_source_code": "using System;\nusing System.Linq;\nusing CompLib.Util;\nusing System.Threading;\nusing CompLib.Mathematics;\n\npublic class Program\n{\n int N;\n public void Solve()\n {\n var sc = new Scanner();\n N = sc.NextInt();\n // 長さ2Nのかっこ列すべて\n // Trieの最大マッチング\n\n // 木\n // 2色に塗って少ない方\n\n // 頂点増え方\n // 以降>しか置けない\n\n // < >>>>>\n\n\n // 0 1 2 3\n // 0: 1 \n // 1: 1 1 ... 1\n // 2: 2 2 1 ... 3\n // 3: 5 5 3 1\n // 4: \n\n var dp = new ModInt[N + 1][];\n for (int i = 0; i <= N; i++)\n {\n dp[i] = new ModInt[i + 1];\n }\n\n dp[0][0] = 1;\n for (int i = 0; i < N; i++)\n {\n ModInt tmp = 0;\n for (int j = i; j >= 0; j--)\n {\n tmp += dp[i][j];\n dp[i + 1][j + 1] = tmp;\n }\n dp[i + 1][0] = tmp;\n }\n\n //for (int i = 0; i <= N; i++)\n //{\n // Console.WriteLine(string.Join(\" \", dp[i]));\n //}\n ModInt ans = 0;\n for (int i = 1; i <= N; i++)\n {\n ans += dp[N][i];\n }\n\n Console.WriteLine(ans);\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\n// https://bitbucket.org/camypaper/complib\nnamespace CompLib.Mathematics\n{\n #region ModInt\n /// \n /// [0,) までの値を取るような数\n /// \n public struct ModInt\n {\n /// \n /// 剰余を取る値.\n /// \n public const long Mod = (int)1e9 + 7;\n // public const long Mod = 998244353;\n\n /// \n /// 実際の数値.\n /// \n public long num;\n /// \n /// 値が であるようなインスタンスを構築します.\n /// \n /// インスタンスが持つ値\n /// パフォーマンスの問題上,コンストラクタ内では剰余を取りません.そのため, ∈ [0,) を満たすような を渡してください.このコンストラクタは O(1) で実行されます.\n public ModInt(long n) { num = n; }\n /// \n /// このインスタンスの数値を文字列に変換します.\n /// \n /// [0,) の範囲内の整数を 10 進表記したもの.\n public override string ToString() { return num.ToString(); }\n public static ModInt operator +(ModInt l, ModInt r) { l.num += r.num; if (l.num >= Mod) l.num -= Mod; return l; }\n public static ModInt operator -(ModInt l, ModInt r) { l.num -= r.num; if (l.num < 0) l.num += Mod; return l; }\n public static ModInt operator *(ModInt l, ModInt r) { return new ModInt(l.num * r.num % Mod); }\n public static implicit operator ModInt(long n) { n %= Mod; if (n < 0) n += Mod; return new ModInt(n); }\n\n /// \n /// 与えられた 2 つの数値からべき剰余を計算します.\n /// \n /// べき乗の底\n /// べき指数\n /// 繰り返し二乗法により O(N log N) で実行されます.\n public static ModInt Pow(ModInt v, long k) { return Pow(v.num, k); }\n\n /// \n /// 与えられた 2 つの数値からべき剰余を計算します.\n /// \n /// べき乗の底\n /// べき指数\n /// 繰り返し二乗法により O(N log N) で実行されます.\n public static ModInt Pow(long v, long k)\n {\n long ret = 1;\n for (k %= Mod - 1; k > 0; k >>= 1, v = v * v % Mod)\n if ((k & 1) == 1) ret = ret * v % Mod;\n return new ModInt(ret);\n }\n /// \n /// 与えられた数の逆元を計算します.\n /// \n /// 逆元を取る対象となる数\n /// 逆元となるような値\n /// 法が素数であることを仮定して,フェルマーの小定理に従って逆元を O(log N) で計算します.\n public static ModInt Inverse(ModInt v) { return Pow(v, Mod - 2); }\n }\n #endregion\n #region Binomial Coefficient\n public class BinomialCoefficient\n {\n public ModInt[] fact, ifact;\n public BinomialCoefficient(int n)\n {\n fact = new ModInt[n + 1];\n ifact = new ModInt[n + 1];\n fact[0] = 1;\n for (int i = 1; i <= n; i++)\n fact[i] = fact[i - 1] * i;\n ifact[n] = ModInt.Inverse(fact[n]);\n for (int i = n - 1; i >= 0; i--)\n ifact[i] = ifact[i + 1] * (i + 1);\n ifact[0] = ifact[1];\n }\n public ModInt this[int n, int r]\n {\n get\n {\n if (n < 0 || n >= fact.Length || r < 0 || r > n) return 0;\n return fact[n] * ifact[n - r] * ifact[r];\n }\n }\n public ModInt RepeatedCombination(int n, int k)\n {\n if (k == 0) return 1;\n return this[n + k - 1, k];\n }\n }\n #endregion\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 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}\n", "lang": "Mono C#", "bug_code_uid": "e31a2c2d835518cd05e7e830e0858b8d", "src_uid": "8218255989e5eab73ac7107072c3b2af", "apr_id": "b8eb2b2e7ca4ee95a729443a192fe3a0", "difficulty": 2100, "tags": ["trees", "dp", "greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9975635224504003, "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 ProbB\n{\n class ProbC\n {\n\n private long m;\n private long ans = -1;\n\n public void ReadInput()\n {\n m = int.Parse(Console.ReadLine());\n }\n\n public long TestMiddle(long k)\n {\n long p = 2;\n long sum = 0;\n while (true)\n {\n long pow = p * p * p;\n if (k / pow == 0) return sum;\n sum += k / pow;\n if (sum >= k) return sum;\n p++;\n }\n }\n\n public void Solve()\n {\n\n long lowerBound = 8;\n long upperBound = 8 * m;\n\n while(upperBound>=lowerBound)\n {\n long middle = (lowerBound + upperBound) / 2;\n long sol = TestMiddle(middle);\n if (sol0){\n con += v/tmp;\n }else{\n break;\n }\n i++;\n } \n if(con>=n){\n if(v liInput = ReadLineAndParseToList();\n int numberOfRows = liInput[0];\n int numberOfGroups = liInput[1];\n\n int oneSeat = 0;\n int twoSeats = numberOfRows * 2;\n int fourSeats = numberOfRows;\n\n List liSoldiers = ReadLineAndParseToList();\n List liLeft = new List { 0, 0, 0 };\n\n bool blnOk = true;\n\n liSoldiers.Sort();\n liSoldiers.Reverse();\n\n for (int i = 0; i < liSoldiers.Count; i++)\n {\n while (liSoldiers[i]>=3 && blnOk)\n {\n if (fourSeats>0)\n {\n liSoldiers[i] -= 4;\n fourSeats--;\n }\n else if (twoSeats > 0)\n {\n liSoldiers[i] -= 2;\n twoSeats--;\n }\n else\n {\n blnOk = false;\n }\n }\n\n if (blnOk)\n {\n liLeft[liSoldiers[i]]++;\n }\n }\n\n while(liLeft[2]>0 && blnOk)\n {\n if (twoSeats>0)\n {\n twoSeats--;\n }\n else if(fourSeats>0)\n {\n fourSeats--;\n oneSeat++;\n }\n else\n {\n liLeft[1] += 2;\n }\n liLeft[2]--;\n }\n\n if (liLeft[1] > oneSeat + twoSeats + fourSeats * 2)\n {\n blnOk = false;\n }\n Console.WriteLine(\"{0}\",blnOk ? \"YES\":\"NO\");\n }\n\n public static List ReadLineAndParseToList()\n {\n return Console.ReadLine().Split().Select(int.Parse).ToList();\n }\n}", "lang": "MS C#", "bug_code_uid": "7e78da9b8a7ed598add34b4b25837064", "src_uid": "d1f88a97714d6c13309c88fcf7d86821", "apr_id": "0f636c34210481c88e65f79e24f693e1", "difficulty": 1900, "tags": ["greedy", "brute force", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.8617827499097799, "equal_cnt": 29, "replace_cnt": 12, "delete_cnt": 4, "insert_cnt": 13, "fix_ops_cnt": 29, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace codeforce\n{\n class Program\n {\n static void Main(string[] args)\n {\n int n, k, ost2, ost4, sum = 0; ;\n string s = Console.ReadLine();\n n = Convert.ToInt32(s.Split(new char[] { ' ' })[0]);\n k = Convert.ToInt32(s.Split(new char[] { ' ' })[1]);\n s = Console.ReadLine();\n ost2 = n * 2; ost4 = n;\n int[] a = new int[k];\n for (int i = 0; i < k; i++)\n {\n a[i] = Convert.ToInt32(s.Split(new char[] { ' ' })[i]);\n while (true)\n {\n if ((a[i] == 1) || (a[i] == 0)) break;\n if ((ost4 == 0) && (ost2 == 0)) break;\n if ((a[i] >= 4) && (ost4 > 0)) { ost4--; a[i] -= 4; continue; }\n if ((a[i] >= 2) && (ost2 > 0)) { ost2--; a[i] -= 2; continue; }\n }\n sum += a[i];\n }\n if ((ost4 == 0) && (ost2 == 0) && (sum == 0)) Console.WriteLine(\"YES\");\n if ((ost4 > 0) || (ost2 > 0)) { if ((ost4 * 2 + ost2) >= sum) { Console.WriteLine(\"YES\"); } else Console.WriteLine(\"NO\"); } \n \n\n }\n }\n}", "lang": "MS C#", "bug_code_uid": "eea87ac3d5f41eba0b8033d63046dce3", "src_uid": "d1f88a97714d6c13309c88fcf7d86821", "apr_id": "cf89bd2b74ecc6419ffe46142d8da649", "difficulty": 1900, "tags": ["greedy", "brute force", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.9996721956336458, "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.Globalization;\nusing System.IO;\nusing System.Linq;\nusing System.Text;\n\nclass Program\n{\n private static void Main(string[] args)\n\n var n = RI();\n var k = RI();\n\n var c4 = n;\n var c2 = n + n;\n var c1 = 0;\n\n for (int i = 0; i < k; i++)\n {\n var a = RI();\n if (a % 2 == 1)\n {\n c1++;\n a -= (a & 1);\n }\n\n c4 -= a / 4;\n c2 -= (a % 4) / 2;\n }\n\n if (c4 < 0)\n {\n c2 -= Math.Abs(c4) * 2;\n c4 = 0;\n }\n\n if (c4 > 0)\n {\n c2 += c4;\n c1 -= c4;\n c4 = 0;\n }\n\n if (c1 > 0 && c2 > 0)\n {\n c1 -= c2;\n c2 = 0;\n }\n\n if (c2 < 0 && c1 < 0)\n {\n c1 += Math.Abs(c2) * 2;\n c2 = 0;\n }\n\n Console.WriteLine((c2 < 0 || c1 > 0) ? \"NO\" : \"YES\");\n }\n\n private const int Mod = 1000000000 + 7;\n\n #region Data Read\n\n private static int GCD(int a, int b)\n {\n if (a % b == 0) return b;\n return GCD(b, a % b);\n }\n\n private static List[] ReadTree(int n)\n {\n return ReadGraph(n, n - 1);\n }\n\n private static List[] ReadGraph(int n, int m)\n {\n List[] g = new List[n];\n for (int i = 0; i < g.Length; i++) g[i] = new List();\n for (int i = 0; i < m; i++)\n {\n int a = RI() - 1;\n int b = RI() - 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 = RI();\n int b = RI();\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 RI()\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 RUL()\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 RL()\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[] RIA(int n)\n {\n int[] ans = new int[n];\n for (int i = 0; i < n; i++)\n ans[i] = RI();\n return ans;\n }\n\n private static long[] RLA(int n)\n {\n long[] ans = new long[n];\n for (int i = 0; i < n; i++)\n ans[i] = RL();\n return ans;\n }\n\n private static char[] ReadWord()\n {\n int ans;\n\n do\n {\n ans = consoleReader.Read();\n } while (!((ans >= 'a' && ans <= 'z') || (ans >= 'A' && ans <= 'Z') || (ans == '*')));\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') || (ans == '*'));\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[] ReadStringLine()\n {\n int ans;\n\n do\n {\n ans = consoleReader.Read();\n } while (ans == 10 || ans == 13);\n\n List s = new List();\n\n do\n {\n s.Add((char)ans);\n ans = consoleReader.Read();\n } while (ans != 10 && ans != 13 && ans != -1);\n\n return s.ToArray();\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 private static char ReadNonLetter()\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 ReadAnyOf(IEnumerable allowed)\n {\n while (true)\n {\n char ans = (char)consoleReader.Read();\n if (allowed.Contains(ans))\n return 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 private static double DoubleFromString(string x)\n {\n return double.Parse(x, 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(StringBuilder sb)\n {\n PushTestData(sb.ToString());\n }\n private static void PushTestData(string data)\n {\n#if TOLYAN_TEST\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 #endregion\n}", "lang": "MS C#", "bug_code_uid": "adc54dd11cad97817ef3a9fe30ca0b14", "src_uid": "d1f88a97714d6c13309c88fcf7d86821", "apr_id": "3a2fe83619e965cdc5c54302c5f9146c", "difficulty": 1900, "tags": ["greedy", "brute force", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.9336188436830836, "equal_cnt": 8, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 6, "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 ConsoleApp1\n{\n class Program\n {\n static void Main(string[] args)\n {\n int result;\n int n = int.Parse(Console.ReadLine());\n int newNumber = (int)Math.Ceiling(Math.Sqrt(n));\n int fullLineNumber = n / newNumber;\n //int leftBlocksInLine = n % newNumber;\n if (newNumber*newNumber == n)\n result = newNumber * 4;\n else result = newNumber * 2 + fullLineNumber * 2 + 2;\n Console.WriteLine(result);\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "ff3cfaa33d38ec39781678c568eade24", "src_uid": "414cc57550e31d98c1a6a56be6722a12", "apr_id": "46aef74e16f4768396fe8aff60b871aa", "difficulty": 1000, "tags": ["geometry", "math", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.9976851851851852, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "\tusing System;\n\n class Program\n {\n static void Main(string[] args)\n {\n int n = int.Parse(Console.ReadLine());\n\n int prev = 8;\n\n\t\t\tif (n <= 0) { Console.WriteLine(0); return; }\n if (n == 1) { Console.WriteLine(4); return;}\n\t\t\tif (n == 2) { Console.WriteLine(6); return; }\n\t\t\tif (n == 3) { Console.WriteLine(8); return; }\n\t\t\tif (n == 4) { Console.WriteLine(8); return; }\n\n for (int i = 5; i <= n; i ++) \n {\n int c = (int)Math.Sqrt(i);\n\n if (i == c * c + 1)\n {\n prev += 2;\n continue;\n }\n\n if (i == c * (c + 1))\n {\n prev += 2;\n continue;\n }\n\n\n }\n\n Console.WriteLine(prev);\n }\n }", "lang": "Mono C#", "bug_code_uid": "d8dc7ad6f7c7221e819dd8777b5b8a17", "src_uid": "414cc57550e31d98c1a6a56be6722a12", "apr_id": "e83a81c5de72e068af899205d02d3e9f", "difficulty": 1000, "tags": ["geometry", "math", "brute force"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.9812623274161736, "equal_cnt": 8, "replace_cnt": 3, "delete_cnt": 1, "insert_cnt": 3, "fix_ops_cnt": 7, "bug_source_code": "using System;\n\nclass Tanya{\n\tstatic void Main(){\n\t\tint n = Convert.ToInt32(Console.ReadLine());\n\t\tint k = Convert.ToInt32(Console.ReadLine());\n\t\tint A = Convert.ToInt32(Console.ReadLine());\n\t\tint B = Convert.ToInt32(Console.ReadLine());\n\t\tlong mincoins = 0;\n\t\tint x = n;\n\t\tint costA;\n\t\tif (k == 1){\n\t\t\tmincoins = mincoins + (long) A*(x-1);\n\t\t\tConsole.WriteLine(mincoins);\n\t\t}else if (n == 1){\n\t\t\tConsole.WriteLine(mincoins);\n\t\t}else if (n > 1){\n\t\t\twhile (x > 1){\n\t\t\t\tif (x % k == 0){\n\t\t\t\t\tcostA = A*(x - (x/k));\n\t\t\t\t\tif (costA < B){\n\t\t\t\t\t\tif (x > k){\n\t\t\t\t\t\t\tx = x - k;\n\t\t\t\t\t\t\tmincoins = mincoins + (long)(A*k);\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\tx = x - (k-1);\n\t\t\t\t\t\t\tmincoins = mincoins + (long)A*(k-1);\n\t\t\t\t\t\t}\n\t\t\t\t\t}else{\n\t\t\t\t\t\tx = x / k;\n\t\t\t\t\t\tmincoins = mincoins + B;\n\t\t\t\t\t}\n\t\t\t\t}else{\n\t\t\t\t\tif ((x - x%k) > 0){\n\t\t\t\t\t\tmincoins = mincoins + (long) A*(x%k);\n\t\t\t\t\t\tx = x - (x%k);\n\t\t\t\t\t}else{\n\t\t\t\t\t\tmincoins = mincoins + (long) A*((x%k)-1);\n\t\t\t\t\t\tx = x - ((x%k)-1);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tConsole.WriteLine(mincoins);\n\t\t}\n\t}\n}", "lang": "MS C#", "bug_code_uid": "8636b39fbe1b42308f6acb21ba9e108a", "src_uid": "f838fae7c98bf51cfa0b9bd158650b10", "apr_id": "81cdc1fc585f713c3ca75761c936a979", "difficulty": 1400, "tags": ["dp", "greedy"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9831864406779661, "equal_cnt": 12, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 10, "fix_ops_cnt": 11, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Diagnostics;\n//using tuple = System.IComparable;\n//using bsearchTx = System.Int32;\n\npublic sealed class Solution : Helper\n{\n public void __stdioMain()\n {\n checked\n {\n //\n var n = readInt32();\n var k = readInt32();\n long a = readInt32();\n long b = readInt32();\n //\n long res = 0;\n while (n > 1)\n {\n if (n % k == 0)\n {\n var costa = a * (n - (n / k));\n if (costa < b)\n {\n res += costa;\n }\n else\n {\n res += b;\n }\n n = n / k;\n }\n else\n {\n var rem = n % k;\n n -= rem;\n assert(n % k == 0);\n if (n == 0)\n {\n n++;\n rem--;\n }\n res += rem * a;\n }\n }\n assert(n == 1);\n write(res);\n }\n }\n //\n}\n\n\n// additional plugable library\npublic partial class Helper\n{\n\n [DebuggerDisplay(\"{Value}\")]\n internal class Accumulator where T : struct\n {\n Func merge; public T? ValueNullable { get; private set; }\n public Accumulator(Func merge_CHECKED) { this.merge = merge_CHECKED; }\n public Accumulator Add(T value) { ValueNullable = ValueNullable.HasValue ? merge(ValueNullable.Value, value) : value; return this; }\n }\n //\n static bool MULTI_TCs = false;\n #region STDIO\n#if !DEBUG\n static void Main()\n {\n Console.SetIn(new System.IO.StreamReader(new System.IO.BufferedStream(Console.OpenStandardInput())));\n Console.SetOut(new System.IO.StreamWriter(new System.IO.BufferedStream(Console.OpenStandardOutput())));\n var cnt = MULTI_TCs ? readInt32() : 1;\n for (var i = 1; i <= cnt; i++) new Solution().__stdioMain();\n Console.Out.Flush();\n }\n#endif\n // OUTput\n internal string autoSeparator;\n internal void writeLine() { Console.WriteLine(); }\n internal void writeSeparator() { if (!string.IsNullOrEmpty(autoSeparator))Console.Write(autoSeparator); }\n internal void write(char c) { Console.Write(c); writeSeparator(); }\n internal void write(string s) { Console.Write(s); writeSeparator(); }\n internal void write(long i64) { Console.Write(i64); writeSeparator(); }\n internal void write(double dec) { Console.Write(dec); writeSeparator(); }\n // INput\n static void EOF() { throw new System.IO.EndOfStreamException(); }\n static IEnumerable stream() { while (true) { var iread = Console.Read(); if (iread < 0) break; yield return (char)iread; } }\n static bool isWhitespace(char c) { return c == ' ' || c == '\\n' || c == '\\r' || c == '\\t'; }\n static System.Text.StringBuilder sb = new System.Text.StringBuilder(30);\n internal static string readWordString()\n {\n sb.Clear();\n var iter = stream().SkipWhile(isWhitespace).TakeWhile(c => !isWhitespace(c));\n foreach (var c in iter) sb.Append(c);\n if (sb.Length == 0) EOF(); return sb.ToString();\n }\n internal static long readLong64() { return long.Parse(readWordString()); }\n internal static int readInt32() { return Convert.ToInt32(readLong64()); }\n #endregion\n}\nstatic partial class Extension\n{\n //\n}\n\n\n#region Core helper library\n[DebuggerNonUserCode]\npublic partial class Helper\n{\n internal static IEnumerable seq(int low, int high, int step = 1) { checked { for (var i = low; i <= high; i += step) yield return i; } }\n internal static IEnumerable rev(int low, int high, int stepPositive = 1) { checked { for (var i = high; i >= low; i -= stepPositive) yield return i; } }\n internal static T[] collect(params T[] elemS) { return elemS; }\n internal static T? optional(bool isNotNull, T value) where T : struct { return isNotNull ? new T?(value) : null; }\n internal static T identity(T obj) { return obj; }\n internal static void assert(bool truthy) { if (!truthy) throw new PlatformNotSupportedException(\"ASSERT\"); }\n internal static void assert(T actual, T expected) { if (!Equals(actual, expected)) { Debug.WriteLine(\"SALAH {0} / BENAR {1}\", actual, expected); assert(false); } }\n internal static List ll(T emptyExample) { return new List(); }\n}\n[DebuggerNonUserCode]\nstatic partial class Extension\n{\n internal static IEnumerable Select(this IEnumerable stream, Func getter) { return stream.Select(_ => getter()); }\n internal static void elect(this IEnumerable stream, Action act) { foreach (var elem in stream) act(elem); }\n internal static IEnumerable Select(this int count, Func getter) { for (var i = 0; i < count; i++) yield return getter(); }\n internal static void elect(this int count, Action act) { for (var i = 0; i < count; i++) act(); }\n internal static int GetUpperBound(this IList list) { return list.Count - 1; }\n internal static int getUpperBound(this int count) { return count - 1; }\n internal static int getUpperBound(this System.Collections.IList list) { return list.Count - 1; }\n internal static IEnumerable indices(this IList list) { for (var i = 0; i < list.Count; i++) yield return i; }\n internal static List> ToKvpList(this IEnumerable list) { return list.Select((elem, idx) => new KeyValuePair(idx, elem)).ToList(); }\n internal static T? firstOrNullable(this IEnumerable stream) where T : struct { foreach (var val in stream) return val; return null; }\n internal static T? elementAtOrNullable(this IList list, int index) where T : struct { if (index < 0 || index >= list.Count) return null; return list[index]; }\n internal static IEnumerable skip(this IList list, int count) { for (var i = count; i < list.Count; i++) yield return list[i]; }\n internal static IEnumerable reverseView(this IList list) { for (var i = list.Count - 1; i >= 0; i--) yield return list[i]; }\n internal static T? AggregateOrNullable(this IEnumerable stream, Func merge_CHECKED) where T : struct\n { var it = stream.GetEnumerator(); if (!it.MoveNext()) return null; var res = it.Current; while (it.MoveNext()) res = merge_CHECKED(res, it.Current); return res; }\n //\n internal static int? explainSearchIndex(this int rawIndex) { if (rawIndex < 0) return null; return rawIndex; }\n internal static List ll(this IEnumerable stream) { return stream.ToList(); }\n internal static string stringify(this IEnumerable stream) { return new string(stream.ToArray()); }\n internal static T[] sort(this T[] arr) { Array.Sort(arr); return arr; }\n internal static List sort(this List lst) { lst.Sort(); return lst; }\n internal static T removeOrDequeue(this SortedSet pq, bool minimum = true) { var t = minimum ? pq.Min : pq.Max; pq.Remove(t); return t; }\n}\n#endregion\n", "lang": "MS C#", "bug_code_uid": "6227a5dcad610270e103d5d048d9d0fb", "src_uid": "f838fae7c98bf51cfa0b9bd158650b10", "apr_id": "bfcea412aac0518dd73c60a179adaa5b", "difficulty": 1400, "tags": ["dp", "greedy"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.9723584485064646, "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.Text;\nusing System.Threading.Tasks;\n\nnamespace Contest\n{\n class Scanner\n {\n private string[] line = new string[0];\n private int index = 0;\n public string Next()\n {\n if (line.Length <= index)\n {\n line = Console.ReadLine().Split(' ');\n index = 0;\n }\n var res = line[index];\n index++;\n return res;\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 string[] Array()\n {\n line = Console.ReadLine().Split(' ');\n index = line.Length;\n return line;\n }\n public int[] IntArray()\n {\n return Array().Select(int.Parse).ToArray();\n }\n public long[] LongArray()\n {\n return Array().Select(long.Parse).ToArray();\n }\n }\n\n class Program\n {\n private long N, K, A, B;\n private void Scan()\n {\n var sc = new Scanner();\n N = sc.NextInt();\n K = sc.NextInt();\n A = sc.NextInt();\n B = sc.NextInt();\n }\n\n public void Solve()\n {\n Scan();\n long ans = 0;\n while (N > 1)\n {\n if (N % K == 0)\n {\n long aa = (N / K * (K - 1)) * A;\n ans += Math.Min(aa, B);\n N /= K;\n }\n else\n {\n if (N / K == 0)\n {\n ans += (N - 1) * A;\n N = 1;\n }\n else\n {\n ans += (N % K) * A;\n N -= N % K;\n }\n }\n }\n Console.WriteLine(ans);\n }\n\n static void Main(string[] args)\n {\n new Program().Solve();\n }\n }\n}", "lang": "MS C#", "bug_code_uid": "663cae2aec4ead3d594427ab39ca7d87", "src_uid": "f838fae7c98bf51cfa0b9bd158650b10", "apr_id": "9126bdd0797637d2d072fa2e70904640", "difficulty": 1400, "tags": ["dp", "greedy"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.016783216783216783, "equal_cnt": 15, "replace_cnt": 14, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 15, "bug_source_code": "\nMicrosoft Visual Studio Solution File, Format Version 12.00\n# Visual Studio 15\nVisualStudioVersion = 15.0.27130.2036\nMinimumVisualStudioVersion = 10.0.40219.1\nProject(\"{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}\") = \"940B\", \"940B\\940B.csproj\", \"{BE49AD0A-B17E-44CC-8D42-7C169F53497A}\"\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{BE49AD0A-B17E-44CC-8D42-7C169F53497A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{BE49AD0A-B17E-44CC-8D42-7C169F53497A}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{BE49AD0A-B17E-44CC-8D42-7C169F53497A}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{BE49AD0A-B17E-44CC-8D42-7C169F53497A}.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 = {D05BB9A2-07A3-492B-9CCD-0D832B64E629}\n\tEndGlobalSection\nEndGlobal\n", "lang": "MS C#", "bug_code_uid": "952c7d3df1b46825cf6ffa78f6bb49f7", "src_uid": "f838fae7c98bf51cfa0b9bd158650b10", "apr_id": "f78f8bd36b9658728e2dd80324221629", "difficulty": 1400, "tags": ["dp", "greedy"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.33512931034482757, "equal_cnt": 18, "replace_cnt": 6, "delete_cnt": 5, "insert_cnt": 7, "fix_ops_cnt": 18, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\n\nnamespace _940B\n{\n public class Program\n {\n static void Main(string[] args)\n {\n var n = ulong.Parse(Console.ReadLine());\n var k = ulong.Parse(Console.ReadLine());\n var a = ulong.Parse(Console.ReadLine());\n var b = ulong.Parse(Console.ReadLine());\n ulong totalPrice = 0;\n\n if (k == 1)\n {\n Console.WriteLine((n - 1) * a);\n return;\n }\n\n var multipliers = new List();\n uint index = 1;\n while (true)\n {\n var current = k * index;\n if (current > n)\n break;\n multipliers.Add((uint)current);\n index++;\n }\n\n if (!multipliers.Any())\n {\n Console.WriteLine((n - 1) * a);\n return;\n }\n\n var last = multipliers.Last();\n totalPrice += (n - last) * a;\n n = last;\n\n for (int i = multipliers.Count - 1; i >= 0; --i)\n {\n if (n < multipliers[i])\n {\n continue;\n }\n\n totalPrice += (n - multipliers[i]) * a;\n\n var divisionPrice = b;\n var minusPrice = (n - n / k) * a;\n if (divisionPrice < minusPrice)\n {\n totalPrice += divisionPrice;\n n = n / k;\n }\n\n else\n {\n totalPrice += (n - 1) * a;\n Console.WriteLine(totalPrice);\n return;\n }\n }\n\n if (n > 1)\n {\n totalPrice += (n - 1) * a;\n }\n\n Console.WriteLine(totalPrice);\n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "b648b633452eba3dbe8fdd568cca68f1", "src_uid": "f838fae7c98bf51cfa0b9bd158650b10", "apr_id": "f78f8bd36b9658728e2dd80324221629", "difficulty": 1400, "tags": ["dp", "greedy"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.6892366656020441, "equal_cnt": 19, "replace_cnt": 9, "delete_cnt": 2, "insert_cnt": 7, "fix_ops_cnt": 18, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\n\nnamespace _940B\n{\n public class Program\n {\n static void Main(string[] args)\n {\n var n = ulong.Parse(Console.ReadLine());\n var k = ulong.Parse(Console.ReadLine()); //გამყოფი\n var a = ulong.Parse(Console.ReadLine()); //გამოკლების ფასი\n var b = ulong.Parse(Console.ReadLine()); //გაყოფის ფასი\n ulong totalPrice = 0;\n\n if (n == 1845999546)\n Console.WriteLine(1044857680578777);\n\n if (k == 1)\n {\n Console.WriteLine((n - 1) * a);\n return;\n }\n\n while (n > 1)\n {\n if (n % k != 0)\n {\n ulong counter = 0;\n while (n % k != 0 && n > 1)\n {\n counter++;\n n--;\n }\n\n totalPrice += counter * a;\n }\n\n if (n == 1)\n break;\n\n if (b > (n - n / k) * a) //გაყოფა უფრო ძვირია\n totalPrice += (n - n / k) * a;\n\n else\n totalPrice += b;\n\n n = n / k;\n\n }\n\n Console.WriteLine(totalPrice);\n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "4793027b0cc8d7c482a555dbfa216a67", "src_uid": "f838fae7c98bf51cfa0b9bd158650b10", "apr_id": "f78f8bd36b9658728e2dd80324221629", "difficulty": 1400, "tags": ["dp", "greedy"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9980276134122288, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "using System;\n\nnamespace _940B\n{\n public class Program\n {\n static void Main(string[] args)\n {\n var n = ulong.Parse(Console.ReadLine());\n var k = ulong.Parse(Console.ReadLine()); //გამყოფი\n var a = ulong.Parse(Console.ReadLine()); //გამოკლების ფასი\n var b = ulong.Parse(Console.ReadLine()); //გაყოფის ფასი\n ulong totalPrice = 0;\n\n if (k == 1 || n / k < 1)\n {\n Console.WriteLine((n - 1) * a);\n return;\n }\n\n while (n > 1)\n {\n if (n % k != 0)\n {\n if (n / k > k && n > k)\n {\n var division = k;\n var i = 1;\n while (k * (ulong)i < n)\n {\n division = k * (ulong)i;\n i++;\n }\n\n totalPrice += (n - division) * a;\n n = division;\n }\n else\n {\n ulong counter = 0;\n while (n % k != 0 && n > 1)\n {\n counter++;\n n--;\n }\n\n totalPrice += counter * a;\n }\n }\n\n if (n == 1)\n break;\n\n if (b > (n - n / k) * a) //გაყოფა უფრო ძვირია\n totalPrice += (n - n / k) * a;\n\n else\n totalPrice += b;\n\n n = n / k;\n\n }\n\n Console.WriteLine(totalPrice);\n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "ad154bac2fce61dd6a150ac12af90af2", "src_uid": "f838fae7c98bf51cfa0b9bd158650b10", "apr_id": "f78f8bd36b9658728e2dd80324221629", "difficulty": 1400, "tags": ["dp", "greedy"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.7438625204582652, "equal_cnt": 9, "replace_cnt": 1, "delete_cnt": 3, "insert_cnt": 4, "fix_ops_cnt": 8, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace Tanja\n{\n class Program\n {\n static void Main(string[] args)\n {\n long n = long.Parse(Console.ReadLine());\n long k = long.Parse(Console.ReadLine());\n long a = long.Parse(Console.ReadLine());\n long b = long.Parse(Console.ReadLine());\n\n long cost = 0;\n if (b >= k * a || n k)\n {\n long rem = n % k;\n if (rem == 0)\n {\n cost += b;\n n /= k;\n }\n else\n {\n cost += rem * a;\n n -= rem;\n }\n }\n\n if (n == k)\n cost += Math.Min(b, (n - 1) * a);\n else\n cost += (n - 1) * a;\n }\n \n Console.Write(cost);\n \n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "58feae44ff8a3f746f83c0f1af6c3f03", "src_uid": "f838fae7c98bf51cfa0b9bd158650b10", "apr_id": "aab8a0b0f73abdaefa6f3972470f75c2", "difficulty": 1400, "tags": ["dp", "greedy"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.9464812473662031, "equal_cnt": 4, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 3, "fix_ops_cnt": 4, "bug_source_code": "using System;\nusing System.Collections.Generic;\n\nnamespace ConsoleApp1\n{\n class Program\n {\n static void Main(string[] args)\n {\n ulong n = ulong.Parse(Console.ReadLine());\n ulong k = ulong.Parse(Console.ReadLine());\n ulong a = ulong.Parse(Console.ReadLine());\n ulong b = ulong.Parse(Console.ReadLine());\n ulong sum = 0;\n while (n != 1)\n {\n if (n%k == 0)\n {\n ulong v1 = a * (n - n / k), v2 = b;\n sum += Math.Min(v1, v2);\n n /= k;\n }\n else\n {\n ulong n2 = n / k;\n n2 = n2 * k;\n if (n2 != 0)\n {\n sum += a * (n - n2);\n n = n2;\n }\n else\n {\n sum += a * (n - 1);\n break;\n }\n }\n }\n Console.WriteLine(sum);\n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "661d2886f4abd6b7b1a84c512c6aca42", "src_uid": "f838fae7c98bf51cfa0b9bd158650b10", "apr_id": "e8216ace042568ae87fac68fb534debb", "difficulty": 1400, "tags": ["dp", "greedy"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.8181818181818182, "equal_cnt": 22, "replace_cnt": 10, "delete_cnt": 1, "insert_cnt": 10, "fix_ops_cnt": 21, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace Acyclic\n{\n class Apop\n {\n public static void Main()\n {\n ulong n = UInt64.Parse(Console.ReadLine());\n ulong k = UInt64.Parse(Console.ReadLine());\n ulong A = UInt64.Parse(Console.ReadLine());\n ulong B = UInt64.Parse(Console.ReadLine());\n\n ulong koszt = 0;\n ulong Akoszt = 0;\n ulong Bkoszt = 0;\n if (n < k) koszt += A * (n - 1);\n else\n {\n ulong x = n % k;\n n -= x;\n Akoszt += x;\n while ((n % k) == 0 && n >= k)\n {\n ulong d = n / k;\n ulong a = A * (n - d);\n if (a < B) Akoszt+=n-d;\n else Bkoszt++;\n n = d;\n }\n while(n!=1)\n {\n n--;\n Akoszt++;\n }\n koszt = A * Akoszt + B * Bkoszt;\n }\n\n\n Console.WriteLine(koszt);\n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "21ba2f6d6d70ff409164d71fa528ac23", "src_uid": "f838fae7c98bf51cfa0b9bd158650b10", "apr_id": "57aa5270be104044185de3a92ad988e6", "difficulty": 1400, "tags": ["dp", "greedy"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.3928498048078899, "equal_cnt": 34, "replace_cnt": 16, "delete_cnt": 7, "insert_cnt": 10, "fix_ops_cnt": 33, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Security.Principal;\n\nnamespace Quserty2\n{\n public class Program\n {\n static ulong totalPrice = 0;\n\n static void AddToTotal(ulong a)\n {\n totalPrice += a;\n }\n\n static void Main(string[] args)\n {\n uint n, k, A, B;\n\n n = uint.Parse(Console.ReadLine());\n k = uint.Parse(Console.ReadLine());\n A = uint.Parse(Console.ReadLine());\n B = uint.Parse(Console.ReadLine());\n\n if (k == 1)\n {\n Console.WriteLine((ulong) (n - 1) * (ulong) A);\n return;\n }\n\n\n uint last = 0;\n var n2 = n;\n while (n2 % k != 0 && n2 > 1)\n {\n --n2;\n }\n\n last = n2;\n if (last == 0)\n {\n Console.WriteLine((ulong) (n - 1) * (ulong) A);\n return;\n }\n\n AddToTotal((ulong) (n - last) * (ulong) A);\n n = last;\n\n for (;;)\n {\n if (last <= 1)\n {\n break;\n }\n\n if (n < last)\n {\n last -= k;\n continue;\n }\n\n AddToTotal((ulong) (n - last) * (ulong) A);\n\n uint divisionPrice = B;\n var minusPrice = (ulong) (n - n / k) * (ulong) A;\n if (divisionPrice < minusPrice)\n {\n AddToTotal(divisionPrice);\n n = n / k;\n }\n\n else\n {\n AddToTotal((ulong) (n - 1) * (ulong) A);\n Console.WriteLine(totalPrice);\n return;\n }\n\n last -= k;\n }\n\n if (n > 1)\n {\n AddToTotal((ulong) (n - 1) * (ulong) A);\n }\n\n Console.WriteLine(totalPrice);\n }\n }\n}", "lang": "MS C#", "bug_code_uid": "84ed8b3b640074bc4c652f669f633d0f", "src_uid": "f838fae7c98bf51cfa0b9bd158650b10", "apr_id": "f5f31c5131e2cbba7bfc9278fadb095d", "difficulty": 1400, "tags": ["dp", "greedy"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.4597457627118644, "equal_cnt": 25, "replace_cnt": 12, "delete_cnt": 2, "insert_cnt": 10, "fix_ops_cnt": 24, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Security.Principal;\n\nnamespace Quserty2\n{\n public class Program\n {\n static void Main(string[] args)\n {\n ulong n, k, A, B;\n\n n = ulong.Parse(Console.ReadLine());\n k = ulong.Parse(Console.ReadLine());\n A = ulong.Parse(Console.ReadLine());\n B = ulong.Parse(Console.ReadLine());\n\n if (k == 1)\n {\n Console.WriteLine((n - 1) * A);\n return;\n }\n\n ulong totalPrice = 0;\n\n List multipliers = new List();\n\n\n uint index = 1;\n while (true)\n {\n var current = k * index;\n if (current > n)\n break;\n multipliers.Add(current);\n index++;\n }\n\n if (!multipliers.Any())\n {\n Console.WriteLine((n - 1) * A);\n return;\n }\n\n ulong last = multipliers.Last();\n totalPrice += (n - last) * A;\n n = last;\n\n for (int i = multipliers.Count - 1; i >= 0; --i)\n {\n if (n < multipliers[i])\n {\n continue;\n }\n\n totalPrice += (n - multipliers[i]) * A;\n\n ulong divisionPrice = B;\n ulong minusPrice = (n - n / k) * A;\n if (divisionPrice < minusPrice)\n {\n totalPrice += divisionPrice;\n n = n / k;\n }\n\n else\n {\n Console.WriteLine(totalPrice + (n - 1) * A);\n return;\n }\n }\n\n if (n > 1)\n totalPrice += (n - 1) * A;\n\n Console.WriteLine(totalPrice);\n }\n }\n}", "lang": "MS C#", "bug_code_uid": "14a89b32fbbc78f694a8d8328d827928", "src_uid": "f838fae7c98bf51cfa0b9bd158650b10", "apr_id": "f5f31c5131e2cbba7bfc9278fadb095d", "difficulty": 1400, "tags": ["dp", "greedy"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9272005294506949, "equal_cnt": 13, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 12, "fix_ops_cnt": 12, "bug_source_code": "//Rextester.Program.Main is the entry point for your code. Don't change it.\n//Compiler version 4.0.30319.17929 for Microsoft (R) .NET Framework 4.5\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text.RegularExpressions;\n\nnamespace Rextester\n{\n public class Program\n {\n public static void Main(string[] args)\n {\n Int64 n = Convert.ToInt64(Console.ReadLine());\n Int64 k = Convert.ToInt64(Console.ReadLine());\n Int64 A = Convert.ToInt64(Console.ReadLine());\n Int64 B = Convert.ToInt64(Console.ReadLine());\n \n Int64 cost = 0;\n \n while(n > 1) {\n if(n%k == 0) {\n if (B < (A * (n - n/k))) {\n cost += B;\n n /= k;\n }\n else {\n cost += (A * (n - n/k));\n n /= k;\n }\n }\n else {\n if(n - (n%k) == 0) {\n cost += (A * (n%k - 1));\n n -= (n%k + 1);\n }\n else {\n cost += (A * (n%k));\n n -= (n%k);\n }\n }\n }\n \n Console.WriteLine(cost);\n }\n }\n}", "lang": "MS C#", "bug_code_uid": "b5940391cb289e0d2f58087a24d310bc", "src_uid": "f838fae7c98bf51cfa0b9bd158650b10", "apr_id": "b5266468ab0acf4cea7644f48994b28d", "difficulty": 1400, "tags": ["dp", "greedy"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.8932355338223309, "equal_cnt": 17, "replace_cnt": 4, "delete_cnt": 1, "insert_cnt": 12, "fix_ops_cnt": 17, "bug_source_code": "using System;\n\nnamespace B\n{\n\tstruct Container\n\t{\n\t\tpublic int a;\n\t\tpublic int b;\n\t}\n\tclass MainClass\n\t{\n\t\tpublic static Container[] cont = new Container[20];\n\n\t\tpublic static void swap (int i, int j)\n\t\t{\n\t\t\tint c = cont[i].a;\n\t\t\tcont[i].a = cont[j].a;\n\t\t\tcont[j].a = c;\n\n\t\t\tc = cont[i].b;\n\t\t\tcont[i].b = cont[j].b;\n\t\t\tcont[j].b = c;\n\t\t}\n\n\t\tpublic static void sort (int m)\n\t\t{\n\t\t\tfor (int i = 1; i < m; i++)\n {\n int j = i;\n while (j > 0 && cont[j].b > cont[j - 1].b)\n {\n\t\t\t\t\tswap(j, j - 1);\n\t\t\t\t\tj--;\n }\n }\n\t\t}\n\n\t\tpublic static void Main (string[] args)\n\t\t{\n\t\t\tstring[] data1 = Console.ReadLine ().Split (' ');\n\t\t\tint n = int.Parse (data1 [0]);\n\t\t\tint m = int.Parse (data1 [1]);\n\t\t\tfor (int i = 0; i < m; i++) {\n\t\t\t\tstring[] data2 = Console.ReadLine ().Split (' ');\n\t\t\t\tcont [i].a = int.Parse (data2 [0]);\n\t\t\t\tcont [i].b = int.Parse (data2 [1]);\n\t\t\t}\n\t\t\tsort (m);\n\t\t\tint sum = 0;\n\t\t\tint j = 0;\n\t\t\twhile (n-cont[j].a > 0) \n\t\t\t{\n\t\t\t\tsum += cont[j].a*cont[j].b;\n\t\t\t\tn -= cont[j].a;\n\t\t\t\tj++;\n\t\t\t}\n\t\t\tsum += n*cont[j].b;\n\t\t\tConsole.WriteLine(sum);\n\t\t}\n\t}\n}\n", "lang": "Mono C#", "bug_code_uid": "42eb9ada60dc497b44b2e55c0f4a9cb3", "src_uid": "c052d85e402691b05e494b5283d62679", "apr_id": "7c9a53ec3e1f858d593a4f9faf388016", "difficulty": 900, "tags": ["greedy", "sortings", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.9996276991809382, "equal_cnt": 3, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "using System;\nusing System.Linq;\nusing System.Collections.Generic;\nusing Debug = System.Diagnostics.Debug;\nusing StringBuilder = System.Text.StringBuilder;\n//using System.Numerics;\nnamespace Program\n{\n public class Solver\n {\n public void Solve()\n {\n var n = sc.Integer();\n var k = sc.Long();\n var m = sc.Long();\n var dp = new long[1001, 101, 2];\n for (int i = 0; i < 1001; i++)\n for (int j = 0; j < 101; j++)\n for (int l = 0; l < 2; l++)\n dp[i, j, l] = -1;\n var pow1 = new long[1001];\n var pow2 = new long[1001];\n for (long i = 0, u = 1, v = 1; i < 1001; i++)\n {\n pow1[i] = u;\n pow2[i] = v;\n u = u * 10 % k;\n v = v * 10 % m;\n }\n Func dfs = null;\n dfs = (id, rem, f) =>\n {\n if (rem == 0 && f == 1)\n if (id != n) return (pow1[n - id - 1] * 9) % m;\n else return 1;\n if (id == n || (rem == 0 && f == 1)) return 0;\n if (dp[id, rem, f] >= 0) return dp[id, rem, f];\n long ret = 0;\n for (int i = 0; i < 10; i++)\n ret = (ret + dfs(id + 1,\n (int)((rem + i * pow2[id]) % k),\n ((f == 1 || i > 0) ? 1 : 0))) % m;\n return dp[id, rem, f] = ret;\n\n };\n IO.Printer.Out.WriteLine(dfs(0, 0, 0));\n }\n\n\n internal IO.StreamScanner sc = new IO.StreamScanner(Console.OpenStandardInput());\n static T[] Enumerate(int n, Func f) { var a = new T[n]; for (int i = 0; i < n; ++i) a[i] = f(); return a; }\n static T[] Enumerate(int n, Func f) { var a = new T[n]; for (int i = 0; i < n; ++i) a[i] = f(i); return a; }\n\n }\n\n}\n\n#region Ex\nnamespace Program.IO\n{\n using System.IO;\n using System.Linq;\n public class Printer : StreamWriter\n {\n static Printer()\n {\n Out = new Printer(Console.OpenStandardOutput()) { AutoFlush = false };\n }\n public static Printer Out { get; set; }\n public override IFormatProvider FormatProvider { get { return System.Globalization.CultureInfo.InvariantCulture; } }\n public Printer(System.IO.Stream stream) : base(stream, new System.Text.UTF8Encoding(false, true)) { }\n public void Write(string format, IEnumerable source) { base.Write(format, source.OfType().ToArray()); }\n public void WriteLine(string format, IEnumerable source) { base.WriteLine(format, source.OfType().ToArray()); }\n }\n public class StreamScanner\n {\n public StreamScanner(Stream stream) { str = stream; }\n private readonly Stream str;\n private readonly byte[] buf = new byte[1024];\n private int len, ptr;\n public bool isEof = false;\n public bool IsEndOfStream { get { return isEof; } }\n private byte read()\n {\n if (isEof) return 0;\n if (ptr >= len) { ptr = 0; if ((len = str.Read(buf, 0, 1024)) <= 0) { isEof = true; return 0; } }\n return buf[ptr++];\n }\n public char Char() { byte b = 0; do b = read(); while (b < 33 || 126 < b); return (char)b; }\n public char[] Char(int n) { var a = new char[n]; for (int i = 0; i < n; i++) a[i] = Char(); return a; }\n public string Scan()\n {\n var sb = new StringBuilder();\n for (var b = Char(); b >= 33 && b <= 126; b = (char)read())\n sb.Append(b);\n return sb.ToString();\n }\n public long Long()\n {\n if (isEof) return long.MinValue;\n long ret = 0; byte b = 0; var ng = false;\n do b = read();\n while (b != '-' && (b < '0' || '9' < b));\n if (b == '-') { ng = true; b = read(); }\n for (; true; b = read())\n {\n if (b < '0' || '9' < b)\n return ng ? -ret : ret;\n else ret = ret * 10 + b - '0';\n }\n }\n public int Integer() { return (isEof) ? int.MinValue : (int)Long(); }\n public double Double() { return double.Parse(Scan(), System.Globalization.CultureInfo.InvariantCulture); }\n private T[] enumerate(int n, Func f)\n {\n var a = new T[n];\n for (int i = 0; i < n; ++i) a[i] = f();\n return a;\n }\n\n public string[] Scan(int n) { return enumerate(n, Scan); }\n public double[] Double(int n) { return enumerate(n, Double); }\n public int[] Integer(int n) { return enumerate(n, Integer); }\n public long[] Long(int n) { return enumerate(n, Long); }\n public void Flush() { str.Flush(); }\n\n }\n}\nstatic class Ex\n{\n static public string AsString(this IEnumerable ie) { return new string(System.Linq.Enumerable.ToArray(ie)); }\n static public string AsJoinedString(this IEnumerable ie, string st = \" \") { return string.Join(st, ie); }\n static public void Main()\n {\n var solver = new Program.Solver();\n solver.Solve();\n Program.IO.Printer.Out.Flush();\n }\n}\n#endregion", "lang": "MS C#", "bug_code_uid": "3813b0b44eef76ec982a0c8ed40b8d45", "src_uid": "656bf8df1e79499aa2ab2c28712851f0", "apr_id": "2c41f0df3b5a4c56d823a0e1d0496558", "difficulty": 2200, "tags": ["dp", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9997852233676976, "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.Globalization;\nusing System.IO;\nusing System.Linq;\nusing System.Text;\nusing System.Threading;\n\n// (づ°ω°)づミ★゜・。。・゜゜・。。・゜☆゜・。。・゜゜・。。・゜\npublic class Solver\n{\n public void Solve()\n {\n int n = ReadInt();\n int k = ReadInt();\n long m = ReadInt();\n \n var a = new long[n + 1];\n a[0] = 1;\n a[1] = 9;\n for (int i = 2; i < n; i++)\n a[i] = a[i - 1] * 10 % m;\n\n long ans = 0;\n var dp = new long[k];\n long d = 1;\n for (int i = 0; i < n; i++)\n {\n var ndp = new long[k];\n for (int j = 0; j < k; j++)\n for (int r = 0; r < 10; r++)\n {\n if (j == 0 && r == 0)\n continue;\n long x = j > 0 ? dp[j] : 1;\n int y = (int) ((j + r * d) % k);\n ndp[y] += x;\n if (y == 0)\n ans = (ans + x * a[n - i - 1]) % m;\n }\n for (int j = 0; j < k; j++)\n ndp[j] %= m;\n dp = ndp;\n d = d * 10 % m;\n }\n Write(ans);\n }\n\n #region Main\n\n protected static TextReader reader;\n protected static TextWriter writer;\n\n static void Main()\n {\n#if DEBUG\n reader = new StreamReader(\"..\\\\..\\\\input.txt\");\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(\"game.in\");\n //writer = new StreamWriter(\"game.out\");\n#endif\n try\n {\n var thread = new Thread(new Solver().Solve, 1024 * 1024 * 256);\n thread.Start();\n thread.Join();\n// object result = new Solver().Solve();\n// if (result != null)\n// writer.WriteLine(result);\n }\n catch (Exception ex)\n {\n#if DEBUG\n Console.WriteLine(ex);\n#else\n Console.WriteLine(ex);\n throw;\n#endif\n }\n reader.Close();\n writer.Close();\n }\n\n #endregion\n\n #region Read / Write\n\n private static Queue currentLineTokens = new Queue();\n\n private static string[] ReadAndSplitLine()\n {\n return reader.ReadLine().Split(new[] { ' ', '\\t' }, StringSplitOptions.RemoveEmptyEntries);\n }\n\n public static string ReadToken()\n {\n while (currentLineTokens.Count == 0)\n currentLineTokens = new Queue(ReadAndSplitLine());\n return currentLineTokens.Dequeue();\n }\n\n public static int ReadInt()\n {\n return int.Parse(ReadToken());\n }\n\n public static long ReadLong()\n {\n return long.Parse(ReadToken());\n }\n\n public static double ReadDouble()\n {\n return double.Parse(ReadToken(), CultureInfo.InvariantCulture);\n }\n\n public static int[] ReadIntArray()\n {\n return ReadAndSplitLine().Select(int.Parse).ToArray();\n }\n\n public static long[] ReadLongArray()\n {\n return ReadAndSplitLine().Select(long.Parse).ToArray();\n }\n\n public static double[] ReadDoubleArray()\n {\n return ReadAndSplitLine().Select(s => double.Parse(s, CultureInfo.InvariantCulture)).ToArray();\n }\n\n public static int[][] ReadIntMatrix(int numberOfRows)\n {\n int[][] matrix = new int[numberOfRows][];\n for (int i = 0; i < numberOfRows; i++)\n matrix[i] = ReadIntArray();\n return matrix;\n }\n\n public static int[][] ReadAndTransposeIntMatrix(int numberOfRows)\n {\n int[][] matrix = ReadIntMatrix(numberOfRows);\n int[][] ret = new int[matrix[0].Length][];\n for (int i = 0; i < ret.Length; i++)\n {\n ret[i] = new int[numberOfRows];\n for (int j = 0; j < numberOfRows; j++)\n ret[i][j] = matrix[j][i];\n }\n return ret;\n }\n\n public static string[] ReadLines(int quantity)\n {\n string[] lines = new string[quantity];\n for (int i = 0; i < quantity; i++)\n lines[i] = reader.ReadLine().Trim();\n return lines;\n }\n\n public static void WriteArray(IEnumerable array)\n {\n writer.WriteLine(string.Join(\" \", array));\n }\n\n public static void Write(params object[] array)\n {\n WriteArray(array);\n }\n\n public static void WriteLines(IEnumerable array)\n {\n foreach (var a in array)\n writer.WriteLine(a);\n }\n\n #endregion\n}", "lang": "MS C#", "bug_code_uid": "06152fe63d22a152e907c8b4a7c0a579", "src_uid": "656bf8df1e79499aa2ab2c28712851f0", "apr_id": "7569d00aba67085e1f8276c9b0f8ae2a", "difficulty": 2200, "tags": ["dp", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.49675465166594546, "equal_cnt": 28, "replace_cnt": 12, "delete_cnt": 12, "insert_cnt": 4, "fix_ops_cnt": 28, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Globalization;\nusing System.Linq;\nusing System.Text;\nusing Algorithms;\n\nnamespace CodeForces\n{\n class Program\n {\n static void Main(string[] args)\n {\n int top = 0, bottom = 0;\n var n = Convert.ToInt32(Console.ReadLine());\n\n for (int i = 0; i < n; i++)\n {\n var ar = Console.ReadLine().Split(' ').Select(x => Convert.ToInt32(x)).ToArray();\n\n if ((ar[0]%2 != 0) && (ar[1]%2 == 0))\n {\n top++;\n }\n\n if ((ar[0] % 2 == 0) && (ar[1] % 2 != 0))\n {\n bottom++;\n }\n }\n\n if ((top%2 == 0) && (bottom%2 == 0))\n {\n Console.WriteLine(0);\n return; \n }\n\n if ((top % 2 != 0) && (bottom % 2 == 0))\n {\n Console.WriteLine(-1);\n return;\n }\n\n if ((top % 2 == 0) && (bottom % 2 != 0))\n {\n Console.WriteLine(-1);\n return;\n }\n\n if ((top % 2 != 0) && (bottom % 2 != 0))\n {\n Console.WriteLine(1);\n return;\n }\n }\n\n }\n}\n", "lang": "MS C#", "bug_code_uid": "4beae813f962cad1b1d9636a43a16c55", "src_uid": "f9bc04aed2b84c7dd288749ac264bb43", "apr_id": "fe120cd03adfb3d65b242d90d79e4195", "difficulty": 1200, "tags": ["math", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9920983318700615, "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.Text;\nusing System.Threading.Tasks;\n\nnamespace ConsoleApplication1\n{\n class A1271_Suits\n {\n public static void Main()\n {\n int a = int.Parse(Console.ReadLine());\n int b = int.Parse(Console.ReadLine());\n int c = int.Parse(Console.ReadLine());\n int d = int.Parse(Console.ReadLine());\n int e = int.Parse(Console.ReadLine());\n int f = int.Parse(Console.ReadLine());\n\n int[] array = new int[3];\n decimal totalSuit1 = 0;\n decimal totalSuit2 = 0;\n\n if (e > f)\n {\n if (a > d)\n {\n totalSuit1 = d * e;\n a -= d;\n }\n else\n {\n totalSuit1 = a * e;\n d -= a;\n } \n array[0] = b;\n array[1] = c;\n array[2] = d;\n Array.Sort(array);\n totalSuit2 = f * array[0];\n }\n else {\n array[0] = b;\n array[1] = c;\n array[2] = d;\n Array.Sort(array);\n totalSuit2 = f * array[0];\n\n d -= array[0];\n\n if (a > d)\n {\n totalSuit1 = d * e;\n a -= d;\n }\n else\n {\n totalSuit1 = a * e;\n d -= a;\n }\n }\n \n Console.WriteLine(totalSuit2+totalSuit1);\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "408701895bd2e2f549e2404f3a3430f2", "src_uid": "84d9e7e9c9541d997e6573edb421ae0a", "apr_id": "8e2a4098f793c1b44c317849c1e5326a", "difficulty": 800, "tags": ["math", "brute force", "greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.9979050279329609, "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.Text;\nusing System.Threading.Tasks;\n\nnamespace ConsoleApplication37\n{\n class Program\n {\n static void Main(string[] args)\n {\n int a = Convert.ToInt32(Console.ReadLine());\n int b = Convert.ToInt32(Console.ReadLine());\n int c = Convert.ToInt32(Console.ReadLine());\n int d = Convert.ToInt32(Console.ReadLine());\n int e = Convert.ToInt32(Console.ReadLine());\n int f = Convert.ToInt32(Console.ReadLine());\n\n if (f >= e)\n {\n int min = Math.Min(b, Math.Min(c, d));\n\n long ans = min * f;\n if (d > min)\n {\n d = d - min;\n\n int minn = Math.Min(a, d);\n ans = ans + minn * e;\n\n Console.WriteLine(ans);\n }\n else\n Console.WriteLine(ans);\n }\n else if (f < e)\n {\n int min = Math.Min(a, d);\n long ans = min * e;\n\n if (d == min)\n Console.WriteLine(ans);\n else\n {\n d = d - min;\n ans = Math.Min(b, Math.Min(c, d)) * f;\n Console.WriteLine(ans);\n }\n }\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "bf7d688939ca825463c4f52b6f0ca566", "src_uid": "84d9e7e9c9541d997e6573edb421ae0a", "apr_id": "b7b4d878db24ba52d60e479148246a0a", "difficulty": 800, "tags": ["math", "brute force", "greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.999412455934195, "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\nnamespace Task_C\n{\n class Program\n {\n private static int CardIndex(string card)\n {\n var num = card[1] - '0';\n int color = 0;\n if (card[0] == 'R')\n color = 0;\n if (card[0] == 'G')\n color = 1;\n if (card[0] == 'B')\n color = 2;\n if (card[0] == 'Y')\n color = 3;\n if (card[0] == 'W')\n color = 4;\n\n var index = (1 << num) | (1 << (color + 5));\n return index;\n }\n\n static void Main(string[] args)\n {\n int n = int.Parse(Console.ReadLine());\n var cards = Console.ReadLine().\n Split().\n Distinct().\n Select(x => CardIndex(x)).\n ToList();\n\n var minSuggest = int.MaxValue;\n\n var maxSuggest = 1 << 10;\n for (int suggest = 0; suggest < maxSuggest; suggest++)\n {\n var distinctCard = cards.Select(x => x & suggest).Distinct().Count();\n if (distinctCard == cards.Count)\n {\n var suggestSize = SparseBitcount(suggest);\n if (suggestSize < minSuggest)\n {\n minSuggest = suggestSize;\n }\n }\n }\n\n Console.WriteLine(minSuggest);\n }\n\n static int SparseBitcount(int n)\n {\n int count = 0;\n while (n != 0)\n {\n count++;\n n &= (n - 1);\n }\n return count;\n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "44cd3178a84bc0967f4c306b2fd69da6", "src_uid": "3b12863997b377b47bae43566ec1a63b", "apr_id": "1687f603967449c6502d330f880af96a", "difficulty": 1700, "tags": ["bitmasks", "brute force", "constructive algorithms", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9926273458445041, "equal_cnt": 8, "replace_cnt": 4, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 7, "bug_source_code": "using System;\nusing System.Collections;\nusing System.Collections.Generic;\nusing System.IO;\n\nnamespace codeforces\n{\n class rect\n {\n public Tuple leftbottom;\n public Tuple righttop;\n public rect(int x1, int y1, int x2, int y2)\n {\n leftbottom = new Tuple(x1, y1);\n righttop = new Tuple(x2, y2);\n }\n }\n public class A\n {\n static void main()\n {\n \n int n;\n\n n = int.Parse(System.Console.ReadLine());\n List rtlist = new List();\n SortedSet xs = new SortedSet();\n SortedSet ys = new SortedSet();\n for (int i = 0; i < n; i++)\n {\n string line= System.Console.ReadLine();\n string[] ints = line.Split(new char[1]{','});\n int[] x = new int[4];\n for (int j = 0; j < 4; j++)\n x[j] = int.Parse(ints[j]);\n rect rt = new rect(x[0], x[1], x[2], x[3]);\n xs.Add(x[0]);\n xs.Add(x[2]);\n ys.Add(x[1]);\n ys.Add(x[3]);\n rtlist.Add(rt);\n\n }\n if ((xs.Max - xs.Min) != (ys.Max - ys.Min))\n {\n System.Console.WriteLine(\"NO\");\n return;\n }\n Dictionary,int> dic = new Dictionary,int>();\n\n for (int i = 0; i < n; i++)\n {\n rect rt = rtlist[i];\n var valuex = xs.GetViewBetween(rt.leftbottom.Item1, rt.righttop.Item1);\n var valuey = xs.GetViewBetween(rt.leftbottom.Item2, rt.righttop.Item2);\n foreach(int x in valuex)\n {\n foreach (int y in valuex)\n {\n Tuple tu = new Tuple(x, y);\n int v = 4;\n if ((x == rt.leftbottom.Item1) || (x == rt.righttop.Item1))\n v /= 2;\n if ((y== rt.leftbottom.Item2) || (y == rt.righttop.Item2))\n v /= 2;\n if (dic.ContainsKey(tu))\n dic[tu] += v;\n else\n dic[tu] = v;\n\n }\n }\n }\n foreach(var x in dic)\n {\n var k = x.Key;\n var v = x.Value;\n if ((k.Item1 == xs.Max) || (k.Item1 == xs.Min))\n v *= 2;\n if ((k.Item2 == ys.Max) || (k.Item2 == ys.Min))\n v *= 2;\n if (v != 4)\n {\n System.Console.WriteLine(\"NO\");\n return;\n }\n }\n System.Console.WriteLine(\"YES\");\n return;\n\n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "511792e0259fe94bd87ef32a5a33958a", "src_uid": "f63fc2d97fd88273241fce206cc217f2", "apr_id": "b42c715cbb185d67468f2bece53bd593", "difficulty": 1500, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9989966555183947, "equal_cnt": 4, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 3, "bug_source_code": "using System;\nusing System.Collections;\nusing System.Collections.Generic;\nusing System.IO;\n\nnamespace codeforces\n{\n class rect\n {\n public Tuple leftbottom;\n public Tuple righttop;\n public rect(int x1, int y1, int x2, int y2)\n {\n leftbottom = new Tuple(x1, y1);\n righttop = new Tuple(x2, y2);\n }\n }\n public class A\n {\n public static int Main()\n {\n \n int n;\n\n n = int.Parse(System.Console.ReadLine());\n List rtlist = new List();\n SortedSet xs = new SortedSet();\n SortedSet ys = new SortedSet();\n for (int i = 0; i < n; i++)\n {\n string line= System.Console.ReadLine();\n string[] ints = line.Split(new char[1]{','});\n int[] x = new int[4];\n for (int j = 0; j < 4; j++)\n x[j] = int.Parse(ints[j]);\n rect rt = new rect(x[0], x[1], x[2], x[3]);\n xs.Add(x[0]);\n xs.Add(x[2]);\n ys.Add(x[1]);\n ys.Add(x[3]);\n rtlist.Add(rt);\n\n }\n if ((xs.Max - xs.Min) != (ys.Max - ys.Min))\n {\n System.Console.WriteLine(\"NO\");\n return 0;\n }\n Dictionary,int> dic = new Dictionary,int>();\n\n for (int i = 0; i < n; i++)\n {\n rect rt = rtlist[i];\n var valuex = xs.GetViewBetween(rt.leftbottom.Item1, rt.righttop.Item1);\n var valuey = xs.GetViewBetween(rt.leftbottom.Item2, rt.righttop.Item2);\n foreach(int x in valuex)\n {\n foreach (int y in valuex)\n {\n Tuple tu = new Tuple(x, y);\n int v = 4;\n if ((x == rt.leftbottom.Item1) || (x == rt.righttop.Item1))\n v /= 2;\n if ((y== rt.leftbottom.Item2) || (y == rt.righttop.Item2))\n v /= 2;\n if (dic.ContainsKey(tu))\n dic[tu] += v;\n else\n dic[tu] = v;\n\n }\n }\n }\n foreach(var x in dic)\n {\n var k = x.Key;\n var v = x.Value;\n if ((k.Item1 == xs.Max) || (k.Item1 == xs.Min))\n v *= 2;\n if ((k.Item2 == ys.Max) || (k.Item2 == ys.Min))\n v *= 2;\n if (v != 4)\n {\n System.Console.WriteLine(\"NO\");\n return 0;\n }\n }\n System.Console.WriteLine(\"YES\");\n return 0;\n\n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "534a9d0455259b3bc6b9edc1987b7972", "src_uid": "f63fc2d97fd88273241fce206cc217f2", "apr_id": "b42c715cbb185d67468f2bece53bd593", "difficulty": 1500, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9788065534345408, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 2, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "// ac 1970 мс\n\nusing System;\nusing System.Collections.Generic;\nusing System.Text;\nusing System.IO;\nusing System.Threading;\nusing System.Diagnostics;\nusing System.Globalization;\nusing System.Text.RegularExpressions;\nusing System.Linq;\n\nnamespace sar_cs\n{\n static class Helpers\n {\n // Mono lacks this override of string.Join()\n public static string Join(this IEnumerable objs, string sep)\n {\n var sb = new StringBuilder();\n foreach (var s in objs) { if (sb.Length != 0) sb.Append(sep); sb.Append(s); }\n return sb.ToString();\n }\n\n public static string AsString(this double a, int digits)\n {\n return a.ToString(\"F\" + digits, CultureInfo.InvariantCulture);\n }\n\n public static Stopwatch SW = Stopwatch.StartNew();\n }\n\n public class Program\n {\n #region Helpers\n\n public class Parser\n {\n const int BufSize = 8000;\n TextReader s;\n char[] buf = new char[BufSize];\n int bufPos;\n int bufDataSize;\n bool eos; // eos read to buffer\n int lastChar = -2;\n int nextChar = -2;\n StringBuilder sb = new StringBuilder();\n\n void FillBuf()\n {\n if (eos) return;\n bufDataSize = s.Read(buf, 0, BufSize);\n if (bufDataSize == 0) eos = true;\n bufPos = 0;\n }\n\n int Read()\n {\n if (nextChar != -2)\n {\n lastChar = nextChar;\n nextChar = -2;\n }\n else\n {\n if (bufPos == bufDataSize) FillBuf();\n if (eos) lastChar = -1;\n else lastChar = buf[bufPos++];\n }\n return lastChar;\n }\n\n void Back()\n {\n if (lastChar == -2) throw new Exception(); // no chars were ever read\n nextChar = lastChar;\n }\n\n public Parser()\n {\n s = Console.In;\n }\n\n public int ReadInt()\n {\n int res = 0;\n int sign = -1;\n int c;\n do { c = Read(); } while (c >= 0 && char.IsWhiteSpace((char)c));\n if (c == '-') { sign = 1; c = Read(); }\n int len = 0;\n while (c >= 0 && !char.IsWhiteSpace((char)c))\n {\n if ((uint)(c -= 48) >= 10) throw new FormatException();\n len++;\n res = checked(res * 10 - c);\n c = Read();\n }\n if (len == 0) throw new FormatException();\n Back();\n return checked(res * sign);\n }\n\n public long ReadLong()\n {\n long res = 0;\n int sign = -1;\n int c;\n do { c = Read(); } while (c >= 0 && char.IsWhiteSpace((char)c));\n if (c == '-')\n {\n sign = 1;\n c = Read();\n }\n int len = 0;\n\n while (c >= 0 && !char.IsWhiteSpace((char)c))\n {\n if ((uint)(c -= 48) >= 10) throw new FormatException();\n len++;\n res = checked(res * 10 - c);\n c = Read();\n }\n if (len == 0) throw new FormatException();\n Back();\n return checked(res * sign);\n }\n\n public int ReadLnInt()\n {\n int res = ReadInt(); ReadLine(); return res;\n }\n\n public long ReadLnLong()\n {\n long res = ReadLong(); ReadLine(); return res;\n }\n\n public double ReadDouble()\n {\n int c;\n do { c = Read(); } while (c >= 0 && char.IsWhiteSpace((char)c));\n\n int sign = 1;\n if (c == '-') { sign = -1; c = Read(); }\n\n sb.Length = 0;\n while (c >= 0 && !char.IsWhiteSpace((char)c))\n {\n sb.Append((char)c); c = Read();\n }\n\n Back();\n var res = double.Parse(sb.ToString(), CultureInfo.InvariantCulture);\n return res * sign;\n }\n\n public string ReadLine()\n {\n int c = Read();\n sb.Length = 0;\n while (c != -1 && c != 13 && c != 10)\n {\n sb.Append((char)c); c = Read();\n }\n if (c == 13) { c = Read(); if (c != 10) Back(); }\n return sb.ToString();\n }\n\n public bool SeekEOF\n {\n get\n {\n L0:\n int c = Read();\n if (c == -1) return true;\n if (char.IsWhiteSpace((char)c)) goto L0;\n Back();\n return false;\n }\n }\n\n public int[] ReadIntArr(int n)\n {\n var a = new int[n]; for (int i = 0; i < n; i++) a[i] = ReadInt(); return a;\n }\n\n public long[] ReadLongArr(int n)\n {\n var a = new long[n]; for (int i = 0; i < n; i++) a[i] = ReadLong(); return a;\n }\n }\n\n static void pe() { Console.WriteLine(\"???\"); Environment.Exit(0); }\n\n static void re() { Environment.Exit(55); }\n\n static void Swap(ref T a, ref T b)\n {\n T t = a; a = b; b = t;\n }\n\n #endregion Helpers\n\n static StringBuilder sb = new StringBuilder();\n static Random rand = new Random(5);\n\n static IEnumerable W(int p)\n {\n int b = MyStructs.BitTools.HighBit(p);\n for (int i = 0; i < b + 1; i++)\n {\n yield return p;\n p = p / 2 + ((p & 1) << b);\n }\n\n }\n\n static void Main(string[] args)\n {\n //sar_cs_structs.FenwickTree.Test(); return;\n //Console.SetIn(File.OpenText(\"_input\"));\n var parser = new Parser();\n while (!parser.SeekEOF)\n {\n long n = parser.ReadInt();\n long x = parser.ReadInt();\n long minp = parser.ReadInt();\n\n long res = 0;\n while (100 * (x + res) < n * minp)\n res++;\n \n Console.WriteLine(res);\n }\n }\n }\n}", "lang": "Mono C#", "bug_code_uid": "87b16b99dc08a64e1a523480f32803fb", "src_uid": "7038d7b31e1900588da8b61b325e4299", "apr_id": "966132ee705df3137923f44081bc0d7f", "difficulty": 900, "tags": ["math", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C#"} {"similarity_score": 0.6289308176100629, "equal_cnt": 13, "replace_cnt": 7, "delete_cnt": 2, "insert_cnt": 3, "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 Bear_and_Big_Brother\n{\n class Program\n {\n static void Main(string[] args)\n {\n int l = Int32.Parse(Console.Read());\n int b= Int32.Parse(Console.Read());\n int count=0;\n while (l <= b)\n {\n l = 3 * l;\n b=2*b;\n count++;\n }\n Console.WriteLine(count);\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "ca105d162fcf48cf0c36d58fee20018e", "src_uid": "a1583b07a9d093e887f73cc5c29e444a", "apr_id": "a49233a41d43dcd377620a27ce736a03", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.5484416525730853, "equal_cnt": 17, "replace_cnt": 1, "delete_cnt": 2, "insert_cnt": 14, "fix_ops_cnt": 17, "bug_source_code": "using System;\n\nnamespace ConsoleApplication10\n{\n class Program\n {\n static void Main(string[] args)\n {\n int childs;\n int candies;\n int fatchild;\n int fatchildAt;\n string input;\n int[] kidsline;\n int testCases = Convert.ToInt32(Console.ReadLine());\n for (int i = 0; i < testCases; i++)\n {\n fatchild = 0;\n fatchildAt = 0;\n input = Console.ReadLine();\n childs = Convert.ToInt32(input.Split(' ')[0]);\n candies = Convert.ToInt32(input.Split(' ')[1]);\n kidsline = new int[childs];\n input = Console.ReadLine();\n if(kidsline[0] > candies)\n fatchild = kidsline[0];\n else\n fatchild = 0;\n for (int a = 0; a < childs; a++)\n {\n kidsline[a] = Convert.ToInt32(input.Split(' ')[a]);\n if(!(kidsline[a] >= 1 && kidsline[a] <= 100))\n continue;\n if (kidsline[a] >= fatchild && kidsline[a] > candies)\n {\n fatchild = kidsline[a];\n fatchildAt = a + 1;\n }\n }\n if (fatchildAt == 0)\n fatchildAt = kidsline.Length;\n Console.WriteLine(fatchildAt);\n }\n }\n }\n}", "lang": "MS C#", "bug_code_uid": "a7aced2fe4b6d9f5b19f9ec30af07ac1", "src_uid": "c0ef1e4d7df360c5c1e52bc6f16ca87c", "apr_id": "79997e6db68752e6cdbda206cb732255", "difficulty": 1000, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.9875074360499703, "equal_cnt": 6, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 3, "fix_ops_cnt": 5, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\n\nnamespace CF\n{\n class Program\n {\n static void Main(string[] args)\n {\n\n String[] input = Console.ReadLine().Split(' ');\n long n = Int64.Parse(input[0]);\n long m = Int64.Parse(input[1]);\n input = Console.ReadLine().Split(' ');\n\n List longList = new List();\n long max = 0;\n long temp = 0;\n for (int i = 0; i < n; i++)\n {\n temp = Int64.Parse(input[i]);\n longList.Add(temp);\n if (temp > max) max = temp;\n }\n\n int j = longList.Count;\n while (longList.ElementAt(j) < max / m * m) ;\n\n Console.WriteLine(j+1);\n \n }\n }\n}", "lang": "MS C#", "bug_code_uid": "f91a7c28ccb7d00e75c60447124ef4b3", "src_uid": "c0ef1e4d7df360c5c1e52bc6f16ca87c", "apr_id": "11de5632e09780cb8a3dfb94b2177f52", "difficulty": 1000, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.9887106357694593, "equal_cnt": 5, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 4, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\n\nnamespace CF\n{\n class Program\n {\n static void Main(string[] args)\n {\n\n String[] input = Console.ReadLine().Split(' ');\n long n = Int64.Parse(input[0]);\n long m = Int64.Parse(input[1]);\n input = Console.ReadLine().Split(' ');\n\n List longList = new List();\n long max = 0;\n long temp = 0;\n for (int i = 0; i < n; i++)\n {\n temp = Int64.Parse(input[i]);\n longList.Add(temp);\n if (temp > max) max = temp;\n }\n\n int j = longList.Count;\n while (longList.ElementAt(j-1) < max / m * m) ;\n\n Console.WriteLine(j+1);\n \n }\n }\n}", "lang": "MS C#", "bug_code_uid": "d78c94053a2c5af8bcff4cbd63bb92d4", "src_uid": "c0ef1e4d7df360c5c1e52bc6f16ca87c", "apr_id": "11de5632e09780cb8a3dfb94b2177f52", "difficulty": 1000, "tags": ["implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.44147682639434405, "equal_cnt": 15, "replace_cnt": 9, "delete_cnt": 0, "insert_cnt": 7, "fix_ops_cnt": 16, "bug_source_code": "string [] tmp = Console.ReadLine().Split();\nint Parent = Int32.Parse(tmp[0]);\nint Childs = Int32.Parse(tmp[1]);\n\nif (Parent == 0)\n Console.Write(\"Impossible\");\nif (Parent > Childs || Parent == Childs)\n Console.Write(\"{0} {1}\", Parent, Parent);\nif (Childs > Parent)\n Console.Write(\"{0} {1}\", Childs, Parent + Childs - 1);", "lang": "Mono C#", "bug_code_uid": "636d221bdfec6038b3419657bcd71790", "src_uid": "1e865eda33afe09302bda9077d613763", "apr_id": "486f7e6210f687152b91c6af86dc06e1", "difficulty": 1100, "tags": ["math", "greedy"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.8287373004354136, "equal_cnt": 12, "replace_cnt": 7, "delete_cnt": 1, "insert_cnt": 3, "fix_ops_cnt": 11, "bug_source_code": "using System;\nusing System.Collections;\nusing System.Collections.Generic;\nusing System.Globalization;\nusing System.IO;\nusing System.Linq;\nusing System.Threading;\n\nnamespace CF317\n{\n\tinternal class Program\n\t{\n\t\tprivate static void Main(string[] args)\n\t\t{\n\t\t\tvar sr = new InputReader(Console.In);\n\t\t\t//var sr = new InputReader(new StreamReader(\"input.txt\"));\n\t\t\tvar task = new Task();\n\t\t\tusing (var sw = Console.Out)\n\t\t\t//using (var sw = new StreamWriter(\"output.txt\"))\n\t\t\t{\n\t\t\t\ttask.Solve(sr, sw);\n\n\t\t\t\t//Console.ReadKey();\n\t\t\t}\n\t\t}\n\t}\n\n\tinternal class Task\n\t{\n\t\tpublic void Solve(InputReader sr, TextWriter sw)\n\t\t{\n\t\t\tvar input = sr.ReadArray(Int64.Parse);\n\t\t\tvar n = input[0];\n\t\t\tvar m = input[1];\n\t\t\tvar k = input[2];\n\t\t\tvar start = 1L;\n\t\t\tvar end = m;\n\t\t\tvar maxVal = 0L;\n\t\t\twhile (start <= end) {\n\t\t\t\tvar mid = (start + end) / 2;\n\t\t\t\tvar curr = m - mid;\n\t\t\t\tvar prev = mid - 1;\n\t\t\t\tvar can = true;\n\t\t\t\tfor (var i = k - 1; i >= 1; i--) {\n\t\t\t\t\tif (prev <= 0) {\n\t\t\t\t\t\tprev = 1L;\n\t\t\t\t\t}\n\t\t\t\t\tcurr -= prev;\n\t\t\t\t\tprev--;\n\t\t\t\t}\n\t\t\t\tvar next = mid - 1;\n\t\t\t\tfor (var i = k + 1; i <= n; i++) {\n\t\t\t\t\tif (next <= 0) {\n\t\t\t\t\t\tnext = 1L;\n\t\t\t\t\t}\n\t\t\t\t\tcurr -= next;\n\t\t\t\t\tnext--;\n\t\t\t\t}\n\t\t\t\tif (curr < 0) {\n\t\t\t\t\tcan = false;\n\t\t\t\t}\n\t\t\t\tif (can) {\n\t\t\t\t\tstart = mid + 1L;\n\t\t\t\t\tmaxVal = Math.Max(maxVal, mid);\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tend = mid - 1L;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tsw.WriteLine(maxVal);\n\t\t}\n\t}\n}\n\ninternal class InputReader : IDisposable\n{\n\tprivate bool isDispose;\n\tprivate readonly TextReader sr;\n\n\tpublic InputReader(TextReader stream)\n\t{\n\t\tsr = stream;\n\t}\n\n\tpublic void Dispose()\n\t{\n\t\tDispose(true);\n\t\tGC.SuppressFinalize(this);\n\t}\n\n\tpublic string NextString()\n\t{\n\t\tvar result = sr.ReadLine();\n\t\treturn result;\n\t}\n\n\tpublic int NextInt32()\n\t{\n\t\treturn Int32.Parse(NextString());\n\t}\n\n\tpublic long NextInt64()\n\t{\n\t\treturn Int64.Parse(NextString());\n\t}\n\n\tpublic string[] NextSplitStrings()\n\t{\n\t\treturn NextString()\n\t\t\t\t.Split(new[] { ' ' }, StringSplitOptions.RemoveEmptyEntries);\n\t}\n\n\tpublic T[] ReadArray(Func func)\n\t{\n\t\treturn NextSplitStrings()\n\t\t\t\t.Select(s => func(s, CultureInfo.InvariantCulture))\n\t\t\t\t.ToArray();\n\t}\n\n\tpublic T[] ReadArrayFromString(Func func, string str)\n\t{\n\t\treturn\n\t\t\t\tstr.Split(new[] { ' ' }, StringSplitOptions.RemoveEmptyEntries)\n\t\t\t\t\t\t.Select(s => func(s, CultureInfo.InvariantCulture))\n\t\t\t\t\t\t.ToArray();\n\t}\n\n\tprotected void Dispose(bool dispose)\n\t{\n\t\tif (!isDispose)\n\t\t{\n\t\t\tif (dispose)\n\t\t\t\tsr.Close();\n\t\t\tisDispose = true;\n\t\t}\n\t}\n\n\t~InputReader()\n\t{\n\t\tDispose(false);\n\t}\n}", "lang": "MS C#", "bug_code_uid": "020bc8a78519ee15b402480c957edf11", "src_uid": "da9ddd00f46021e8ee9db4a8deed017c", "apr_id": "cc4fe80aa72d2d500836be54340705ea", "difficulty": 1500, "tags": ["greedy", "binary search"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9851485148514851, "equal_cnt": 4, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 3, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\n\nnamespace ConsoleApplication2\n{\n class Program\n {\n static void Main(string[] args)\n {\n string s = Console.ReadLine();\n string[] s1 =s.Split(' ');\n long n = long.Parse(s1[0]);\n long m = long.Parse(s1[1]);\n long k = long.Parse(s1[2]); \n long w = 0;\n for (int i = 0; i <= n; i++)\n w += i;\n long ww=Math.Max((m - n - w) / n, 0);\n long u = 1;\n long sum = 1 + ww*n;\n while (sum <= m - n)\n {\n if (u < k)\n sum += u + 1;\n else\n sum += k;\n if (u < n-k)\n sum += u;\n else\n sum += n-k;\n u++;\n } \n Console.WriteLine(u+ww);\n Console.ReadLine();\n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "f36a4abaff1b47ef6bf99a72cb5c8a09", "src_uid": "da9ddd00f46021e8ee9db4a8deed017c", "apr_id": "f78caa66aaa1b5f7bc92a37ada1c8ef9", "difficulty": 1500, "tags": ["greedy", "binary search"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.4745333755140778, "equal_cnt": 26, "replace_cnt": 12, "delete_cnt": 8, "insert_cnt": 6, "fix_ops_cnt": 26, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace ConsoleApplication3\n{\n class Program\n {\n static void Main(string[] args)\n {\n int[] c = Console.ReadLine().Split(' ').Select(int.Parse).ToArray();\n int n = c[0];\n int m = c[1];\n int k = c[2];\n if (n == m) {\n Console.WriteLine(1);\n return;\n }\n for (int i = 2; i < m; i++)\n {\n int step = i-1;\n int s1 = 0, s2 = 0;\n if (step <= (k - 1)) {\n s1 = (2 + (step - 1)) * step / 2;\n s1 += k - 1 - step;\n }else{\n int an = i - 1 + (k - 2) * (-1);\n s1 = (i - 1 + an) * (k - 1) / 2;\n }\n if (step <= (n-k)){\n s2 = (2 + (step - 1)) * step / 2;\n s2 += n - k - step;\n }\n else{\n int an = i - 1 + (n-k-1) * (-1);\n s2 = (i - 1 + an) * (n-k) / 2;\n }\n s1 = k == 1 ? 0 : s1;\n s2 = k == n ? 0 : s2;\n //Console.WriteLine(\"i=\" + i + \" s1=\" + s1 + \" s2=\" + s2);\n if ((s1 + s2 + i)>m){\n Console.WriteLine(i-1);\n return;\n }\n }\n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "ae233ad444457e20ca8458223e05c1ff", "src_uid": "da9ddd00f46021e8ee9db4a8deed017c", "apr_id": "c6a55dfc64c69d00c270e974bef6142b", "difficulty": 1500, "tags": ["greedy", "binary search"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.7420494699646644, "equal_cnt": 9, "replace_cnt": 5, "delete_cnt": 3, "insert_cnt": 1, "fix_ops_cnt": 9, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Diagnostics;\nusing System.IO;\nusing System.Linq;\n\nnamespace codeforces\n{\n class Program\n {\n\n static void Main(string[] args)\n {\n double n = Convert.ToDouble(Console.ReadLine());\n decimal value = 1;\n for (int i = 1; i <= n; i++)\n {\n value += 6 * i;\n }\n Console.WriteLine(value);\n }\n }\n}", "lang": "Mono C#", "bug_code_uid": "f385764ff61530795eb747955431d237", "src_uid": "c046895a90f2e1381a7c1867020453bd", "apr_id": "f18b0fb3367f6fd32518f378cf1f80af", "difficulty": 1100, "tags": ["math"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9517543859649122, "equal_cnt": 5, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 4, "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 holydays\n{\n class Program\n {\n static void Main(string[] args)\n {\n int n = Convert.ToInt32(Console.ReadLine());\n int min = n / 7 * 2+n%7/6;\n int max = (n > 1) ? 2 + (n - 2) / 7 * 2 : (n > 0) ? 1:0 +(n-2)%7/6 ;\n Console.WriteLine(\"\" + min + ' ' + max);\n }\n}\n", "lang": "MS C#", "bug_code_uid": "a4ce171422d338b7257a87f737afcd24", "src_uid": "8152daefb04dfa3e1a53f0a501544c35", "apr_id": "d0d1c67363b45fc3a3b11c456439af0b", "difficulty": 900, "tags": ["brute force", "math", "constructive algorithms", "greedy"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.6121883656509696, "equal_cnt": 13, "replace_cnt": 5, "delete_cnt": 2, "insert_cnt": 5, "fix_ops_cnt": 12, "bug_source_code": "using System;\nclass solution\n{\n static void Main(String []args)\n {\n string[] tokens=Console.ReadLine().Split();\n int n=int.Parse(tokens[0]);\n int k=int.Parse(tokens[1]);\n tokens=Console.ReadLine().Split();\n int length=0;\n for(int i=0;ik && int.Parse(tokens[tokens.Length-i-1])>0)\n {\n length=tokens.Length-i;\n break;\n }\n else if(int.Parse[tokens[0]==k])\n {\n k=k-1;\n }\n \n }\n Console.WriteLine(length);\n\n \n }\n}", "lang": "Mono C#", "bug_code_uid": "9aa24500cde28425820d67c9e7a14050", "src_uid": "193ec1226ffe07522caf63e84a7d007f", "apr_id": "2aeff09966b604029563d0c0cb6fcf6c", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.3709016393442623, "equal_cnt": 19, "replace_cnt": 14, "delete_cnt": 3, "insert_cnt": 2, "fix_ops_cnt": 19, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Runtime.InteropServices;\nusing System.Text.RegularExpressions;\n\ninternal class Program\n{\n\n private static int function(int mid, int index, int n)\n {\n var s = 0;\n if(mid-index>1)\n s -= Convert.ToInt32((mid - index - 1) * (mid - index)/2);\n if (mid - (n - index - 1) > 1)\n s -= Convert.ToInt32(mid - (n - index - 1) - 1 * (mid - (n - index - 1))/2);\n s += mid ^ 2;\n return s;\n }\n \n public static void Main(string[] args)\n {\n var input = Console.ReadLine().Split(' ').Select(x => Convert.ToInt32(x)).ToList();\n var n = input[0];\n var m = input[1];\n var index = input[2];\n index -= 1;\n m -= n;\n var l = 0;\n var r = m;\n while (l <= r)\n {\n var mid = Convert.ToInt32((r - l)/2)+1;\n if (function(mid, index, n) <= m)\n l = mid + 1;\n else\n r = mid - 1;\n }\n Console.WriteLine(r);\n }\n\n\n}", "lang": "Mono C#", "bug_code_uid": "994f4c1dcc5a1dbc0e97ae3d22a1a8cb", "src_uid": "da9ddd00f46021e8ee9db4a8deed017c", "apr_id": "8eb832afbab6a1360bfd8b4ec8af8345", "difficulty": 1500, "tags": ["greedy", "binary search"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.7230514096185738, "equal_cnt": 6, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 3, "fix_ops_cnt": 5, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\n\nnamespace TaskH\n{\n class Program\n {\n static void Main(string[] args)\n {\n var x = Array.ConvertAll(Console.ReadLine().Split(' '), t => Int64.Parse(t));\n if (x[0] == x[1])\n {\n Console.WriteLine(\"1\");\n return;\n }\n long tmp = 1;\n for (long i = x[0] + 1; i < x[1] + 1; i++)\n {\n tmp = tmp * i % 10;\n }\n Console.WriteLine(tmp.ToString());\n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "efa0fbcd49ea85f6887cdfc837f311b1", "src_uid": "2ed5a7a6176ed9b0bda1de21aad13d60", "apr_id": "97526560d3b2fa616a2bc9caa2ac6392", "difficulty": 1100, "tags": ["math"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.8304498269896193, "equal_cnt": 10, "replace_cnt": 4, "delete_cnt": 1, "insert_cnt": 5, "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 ConsoleApp80\n{\n class Program\n {\n static void Main(string[] args)\n {\n long[] inp0 = Console.ReadLine().Split().Select(long.Parse).ToArray();\n long k = inp0[0];\n long n = inp0[1];\n long diff = n - k;\n long ans = 1;\n for (int i = 0; i < diff; i++)\n {\n ans *= ((n - i)%10);\n }\n string s = ans.ToString();\n Console.WriteLine(s.Last());\n \n \n }\n\n }\n}", "lang": "MS C#", "bug_code_uid": "42c6e801e71de26479dddd0152d8aaca", "src_uid": "2ed5a7a6176ed9b0bda1de21aad13d60", "apr_id": "52f77d0a1fc2653c6a7d1dd6ca0ad876", "difficulty": 1100, "tags": ["math"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.6816050026055237, "equal_cnt": 6, "replace_cnt": 4, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 5, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\n\nnamespace B\n{\n class Program\n {\n static void Main(string[] args)\n {\n int a = 1000000007;\n\n int[] firsLinet = Array.ConvertAll(Console.ReadLine().Split(' '), r => int.Parse(r));\n int n = int.Parse(Console.ReadLine());\n\n int result = firsLinet[1];\n int reslt2 = firsLinet[0];\n\n if (n == 1)\n result = reslt2;\n\n for (int i = 2; i < n; i++)\n {\n int oldresult = result;\n result = result - reslt2;\n reslt2 = oldresult; \n }\n\n int b = result % a;\n if (b < 0)\n b = result % a + a;\n Console.WriteLine(b);\n Console.ReadLine();\n \n \n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "34b11779beb4cb032c85ab208f1fe4c0", "src_uid": "2ff85140e3f19c90e587ce459d64338b", "apr_id": "8a2746a159405e861a4057c9cd0d1217", "difficulty": 1300, "tags": ["math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.6062753036437247, "equal_cnt": 12, "replace_cnt": 6, "delete_cnt": 1, "insert_cnt": 4, "fix_ops_cnt": 11, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading;\nusing System.Globalization;\n\nnamespace Codeforces\n{\n class B\n {\n //*\n static void Main(string[] args)\n {\n\n string s = Console.ReadLine();\n string[] splitStr = s.Split(' ');\n int x = Convert.ToInt32(splitStr[0]);\n int y = Convert.ToInt32(splitStr[1]);\n int n = Convert.ToInt32(Console.ReadLine());\n\n int f1 = x;\n int f2 = y;\n int f = x;\n if (n == 1)\n {\n Console.WriteLine((f1 + 1000000007) % 1000000007);\n return;\n }\n if (n == 2)\n {\n Console.WriteLine((f2 + 1000000007) % 1000000007);\n return;\n }\n for (int i = 2; i < n; i++)\n {\n f = (f2 - f1 + 1000000007) % 1000000007;\n f1 = f2;\n f2 = f;\n }\n Console.WriteLine(f);\n }\n /**/\n }\n}\n", "lang": "MS C#", "bug_code_uid": "0df6c5f2139f762e9e5e5266dfae7162", "src_uid": "2ff85140e3f19c90e587ce459d64338b", "apr_id": "a844145dd06040da1737b4b9a5d41ab6", "difficulty": 1300, "tags": ["math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9395533092001912, "equal_cnt": 17, "replace_cnt": 11, "delete_cnt": 2, "insert_cnt": 3, "fix_ops_cnt": 16, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\n\nnamespace CodeForces\n{\n class Program\n {\n static void Main(string[] args)\n {\n long n1;\n long n2;\n int n;\n Input.Next(out n1, out n2);\n Input.Next(out n);\n // will overflow?\n checked\n {\n long current = n == 1 ? n1 : n2;\n for (int i = 2; i < n; i++)\n {\n current = n2 - n1;\n n1 = n2;\n n2 = current;\n }\n\n if (current < 0)\n {\n Console.WriteLine(current % 1000000007 + 1000000007);\n }\n else\n {\n Console.WriteLine(current % 1000000007);\n }\n \n }\n \n \n \n }\n\n public static int GetLastChildGoingHome(int[] inputs, int candies)\n {\n for (int i = 0; i < inputs.Length; i++)\n {\n inputs[i] = inputs[i] % candies == 0 ? inputs[i] / candies : ((inputs[i] / candies) + 1);\n }\n\n int last = 0;\n int lastIdx = 0;\n\n for (int i = 0; i < inputs.Length; i++)\n {\n if (inputs[i] >= last)\n {\n last = inputs[i];\n lastIdx = i;\n }\n }\n\n return lastIdx + 1;\n }\n }\n\n public class Input\n {\n private static string _line;\n\n public static bool Next()\n {\n _line = Console.ReadLine();\n return _line != null;\n }\n\n public static bool Next(out long a)\n {\n var ok = Next();\n a = ok ? long.Parse(_line) : 0;\n return ok;\n }\n\n public static bool Next(out long a, out long b)\n {\n var ok = Next();\n if (ok)\n {\n var array = _line.Split(' ').Select(long.Parse).ToArray();\n a = array[0];\n b = array[1];\n }\n else\n {\n a = b = 0;\n }\n\n return ok;\n }\n\n public static bool Next(out long a, out long b, out long c)\n {\n var ok = Next();\n if (ok)\n {\n var array = _line.Split(' ').Select(long.Parse).ToArray();\n a = array[0];\n b = array[1];\n c = array[2];\n }\n else\n {\n a = b = c = 0;\n }\n return ok;\n }\n\n public static bool Next(out long a, out long b, out long c, out long d)\n {\n var ok = Next();\n if (ok)\n {\n var array = _line.Split(' ').Select(long.Parse).ToArray();\n a = array[0];\n b = array[1];\n c = array[2];\n d = array[3];\n }\n else\n {\n a = b = c = d = 0;\n }\n return ok;\n }\n\n public static bool Next(out long a, out long b, out long c, out long d, out long e)\n {\n var ok = Next();\n if (ok)\n {\n var array = _line.Split(' ').Select(long.Parse).ToArray();\n a = array[0];\n b = array[1];\n c = array[2];\n d = array[3];\n e = array[4];\n }\n else\n {\n a = b = c = d = e = 0;\n }\n return ok;\n }\n\n public static bool Next(out int a)\n {\n var ok = Next();\n a = ok ? int.Parse(_line) : 0;\n return ok;\n }\n\n public static bool Next(out int a, out int b)\n {\n var ok = Next();\n if (ok)\n {\n var array = _line.Split(' ').Select(int.Parse).ToArray();\n a = array[0];\n b = array[1];\n }\n else\n {\n a = b = 0;\n }\n\n return ok;\n }\n\n public static bool Next(out int a, out int b, out int c)\n {\n var ok = Next();\n if (ok)\n {\n var array = _line.Split(' ').Select(int.Parse).ToArray();\n a = array[0];\n b = array[1];\n c = array[2];\n }\n else\n {\n a = b = c = 0;\n }\n return ok;\n }\n\n public static bool Next(out int a, out int b, out int c, out int d)\n {\n var ok = Next();\n if (ok)\n {\n var array = _line.Split(' ').Select(int.Parse).ToArray();\n a = array[0];\n b = array[1];\n c = array[2];\n d = array[3];\n }\n else\n {\n a = b = c = d = 0;\n }\n return ok;\n }\n\n public static bool Next(out int a, out int b, out int c, out int d, out int e)\n {\n var ok = Next();\n if (ok)\n {\n var array = _line.Split(' ').Select(int.Parse).ToArray();\n a = array[0];\n b = array[1];\n c = array[2];\n d = array[3];\n e = array[4];\n }\n else\n {\n a = b = c = d = e = 0;\n }\n return ok;\n }\n\n public static bool Next(out int a, out int b, out int c, out int d, out int e, out int f)\n {\n var ok = Next();\n if (ok)\n {\n var array = _line.Split(' ').Select(int.Parse).ToArray();\n a = array[0];\n b = array[1];\n c = array[2];\n d = array[3];\n e = array[4];\n f = array[5];\n }\n else\n {\n a = b = c = d = e = f = 0;\n }\n return ok;\n }\n\n public static IEnumerable ArrayLong()\n {\n return !Next() ? new List() : _line.Split().Select(long.Parse);\n }\n\n public static IEnumerable ArrayInt()\n {\n return !Next() ? new List() : _line.Split().Select(int.Parse);\n }\n\n public static int[,] GetMatrix(int rows, int cols)\n {\n int[,] matrix = new int[rows, cols];\n int row = 0;\n int col = 0;\n while (Next())\n {\n IEnumerable numbers = _line.Split().Select(int.Parse);\n IEnumerator iter = numbers.GetEnumerator();\n while (iter.MoveNext())\n {\n matrix[row, col++] = iter.Current;\n }\n row++;\n col = 0;\n }\n return matrix;\n }\n\n public static bool Next(out string value)\n {\n value = string.Empty;\n if (!Next()) return false;\n value = _line;\n return true;\n }\n }\n\n}\n", "lang": "MS C#", "bug_code_uid": "0b8dcfd61414691c0e276916e1938a08", "src_uid": "2ff85140e3f19c90e587ce459d64338b", "apr_id": "d4ca522fef52f44a9a41887ac928edba", "difficulty": 1300, "tags": ["math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.5291479820627802, "equal_cnt": 6, "replace_cnt": 1, "delete_cnt": 3, "insert_cnt": 2, "fix_ops_cnt": 6, "bug_source_code": "using System;\nusing System.Linq;\n\nnamespace JzzhuandSequences\n{\n class Program\n {\n static void Main(string[] args)\n {\n var ip = Console.ReadLine().Split(' ').ToList().Select(long.Parse).ToArray();\n long x = ip[0], y = ip[1], n = long.Parse(Console.ReadLine());\n\n Console.WriteLine(fun(x,y,n));\n }\n\n static long fun(long x, long y, long n)\n {\n switch (n)\n {\n case 1:\n return ((1000000007 + x) % 1000000007);\n case 2:\n return ((1000000007 + y) % 1000000007);\n default:\n return fun(x, y, n - 1) - fun(x, y, n - 2);\n }\n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "b7e1e4083c4d54379c655b6f43421058", "src_uid": "2ff85140e3f19c90e587ce459d64338b", "apr_id": "496b6c1091eec0b71d2f900ff864412b", "difficulty": 1300, "tags": ["math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "delete", "lang_cluster": "C#"} {"similarity_score": 0.5625, "equal_cnt": 8, "replace_cnt": 3, "delete_cnt": 4, "insert_cnt": 1, "fix_ops_cnt": 8, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\n\nnamespace JzzhuandSequences\n{\n class Program\n {\n static Dictionary dic = new Dictionary(); \n static void Main(string[] args)\n {\n var ip = Console.ReadLine().Split(' ').ToList().Select(long.Parse).ToArray();\n long x = ip[0], y = ip[1], n = long.Parse(Console.ReadLine());\n\n dic.Add(1, ((1000000007 + x) % 1000000007));\n dic.Add(2, ((1000000007 + y) % 1000000007));\n\n for (int i = 3; i <= n; i++)\n {\n dic.Add(i, ((1000000007 + (dic[i - 1] - dic[i - 2])) % 1000000007));\n }\n\n Console.WriteLine(dic.Last().Value);\n }\n }\n}", "lang": "MS C#", "bug_code_uid": "0c9b4dc1752e4bf8575d5fc6f5b901ac", "src_uid": "2ff85140e3f19c90e587ce459d64338b", "apr_id": "496b6c1091eec0b71d2f900ff864412b", "difficulty": 1300, "tags": ["math", "implementation"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "delete", "lang_cluster": "C#"} {"similarity_score": 0.5955188679245284, "equal_cnt": 9, "replace_cnt": 6, "delete_cnt": 2, "insert_cnt": 1, "fix_ops_cnt": 9, "bug_source_code": "using System;\nusing System.Linq;\nclass Program\n{\n const int modulus = 1000000007;\n static int Mod(int dividend)\n {\n if (dividend >= 0)\n {\n return dividend % modulus;\n }\n else\n {\n return (modulus + dividend) % modulus;\n }\n }\n static void Main()\n {\n var xy = Console.ReadLine().Split().Select(int.Parse).ToArray();\n if (xy[0] == 0 && xy[1] == 0)\n {\n Console.WriteLine(0);\n return;\n }\n var n = int.Parse(Console.ReadLine());\n if (n == 1)\n {\n Console.WriteLine(Mod(xy[0]));\n return;\n }\n if (n == 2)\n {\n Console.WriteLine(Mod(xy[1]));\n return;\n }\n int x = xy[0], y = xy[1], next = 0;\n int i;\n for (i = 3; i <= n; i++)\n {\n next = y - x;\n x = y;\n y = next;\n }\n Console.WriteLine(Mod(next));\n }\n}\n", "lang": "MS C#", "bug_code_uid": "3ab1e5906f5ac08ddfaa55b2cebb8bf8", "src_uid": "2ff85140e3f19c90e587ce459d64338b", "apr_id": "c07498431308a6a2ab549ebc99c7614e", "difficulty": 1300, "tags": ["math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.4455861746847268, "equal_cnt": 11, "replace_cnt": 4, "delete_cnt": 5, "insert_cnt": 2, "fix_ops_cnt": 11, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace Generic\n{\n class Program\n {\n static void Main(string[] args)\n {\n \n var input = Console.ReadLine().Split().Select(long.Parse).ToArray();\n var x = input[0];\n var y = input[1];\n\n var n = long.Parse(Console.ReadLine());\n\n long tmp1 = x, tmp2 = y, tmp = 0;\n if (n == 1)\n {\n Console.WriteLine((x + 1000000007) % 1000000007);\n } \n if (n == 2)\n {\n Console.WriteLine((y + 1000000007) % 1000000007);\n }\n else\n {\n for (int i = 3; i <= n; i++)\n {\n tmp = (tmp2 - tmp1 + 1000000007) % 1000000007;\n tmp1 = tmp2;\n tmp2 = tmp;\n }\n Console.WriteLine(tmp);\n }\n\n\n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "932b80d5d5111ed57e6c877a4de9d867", "src_uid": "2ff85140e3f19c90e587ce459d64338b", "apr_id": "cec44b4575fe2519f93479c18a9147f3", "difficulty": 1300, "tags": ["math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "delete", "lang_cluster": "C#"} {"similarity_score": 0.6784580498866213, "equal_cnt": 15, "replace_cnt": 3, "delete_cnt": 5, "insert_cnt": 7, "fix_ops_cnt": 15, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Security.Policy;\n\nnamespace CodeF1\n{\n class X\n {\n public int val { get; set; }\n public int I { get; set; }\n\n }\n class Program\n {\n private static void Main()\n {\n var a =\n Console.ReadLine()\n .Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries)\n .Select(Int32.Parse)\n .ToArray();\n long x = a[0];\n long y = a[1];\n long n = long.Parse(Console.ReadLine());\n long z = y;\n for (int i = 0; i < n-2; i++)\n {\n z = y - x;\n x = y;\n y = z;\n }\n z %= 1000000007;\n\n if (z > 0)\n {\n Console.WriteLine(z);\n }\n else\n {\n Console.WriteLine(1000000007 + z);\n }\n\n\n\n\n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "55f63d4e45ac84200aabd7d7fe91173c", "src_uid": "2ff85140e3f19c90e587ce459d64338b", "apr_id": "70cfdbe4034620519839ad081c4338d3", "difficulty": 1300, "tags": ["math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.9984329527647191, "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.Globalization;\nusing System.IO.Pipes;\nusing System.Linq;\nusing System.Numerics;\nusing System.Runtime.InteropServices;\nusing System.Text;\nusing System.Threading;\n\n\nclass Test\n{\n\n static int mod = (int)1000000007;\n static long[] fact = new long[500001];\n static long[] factinv = new long[500001];\n static Dictionary memo = new Dictionary();\n // Driver code \n public static void Main()\n {\n\n // var input = Console.ReadLine().Split(' ').Select(x => long.Parse(x)).ToArray();\n //var t = input[0];\n //while (t > 0)\n {\n // t--;\n var input1 = Console.ReadLine().Split(' ').Select(xx => int.Parse(xx)).ToArray();\n var l = input1[0];\n var r = input1[1];\n //var arr = Console.ReadLine().Split(' ').Select(xx => int.Parse(xx)).ToArray();\n long ans = 0;\n\n long ten = 1;\n for (int i = 1; i <= 18; i++)\n {\n for (int d = 1; d <= 9; d++)\n {\n long low = d * ten, high = (d + 1) * ten - 1;\n low = Math.Max(low, l);\n high = Math.Min(high, r);\n while (low % 10 != d) low++;\n while ((high % 10 + 10) % 10 != d) high--;\n if (low <= high) \n ans += (high - low) / 10 + 1;\n }\n ten *= 10;\n }\n Console.WriteLine(ans);\n }\n\n }\n\n\n\n\n\n public static void Run()\n {\n fact[0] = 1;\n factinv[0] = fast_pow(fact[0], mod - 2);\n for (int i = 1; i <= 500000; ++i)\n {\n fact[i] = fact[i - 1] * i % mod;\n factinv[i] = fast_pow(fact[i], mod - 2);\n }\n }\n public static long GetCom(int n, int r)\n {\n return fact[n] * factinv[r] % mod * factinv[n - r] % mod;\n }\n public static long fast_pow(long a, long b)\n {\n if (b == 0)\n return 1;\n long val = fast_pow(a, b / 2);\n if (b % 2 == 0)\n return val * val % mod;\n else\n return val * val % mod * a % mod;\n }\n\n}\n\n\n\n\n\n\n\n\n\n\n\n", "lang": "Mono C#", "bug_code_uid": "7b70e6c591dbf3ab25524c1bd5c11053", "src_uid": "9642368dc4ffe2fc6fe6438c7406c1bd", "apr_id": "bb1cf850cff4ce8a7c695c336246d93d", "difficulty": 1500, "tags": ["dp", "combinatorics", "binary search"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9985866972882255, "equal_cnt": 5, "replace_cnt": 4, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 4, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Diagnostics;\nusing System.Runtime.InteropServices;\nusing System.Text;\nusing System.Linq;\nusing System.IO;\nusing System.Globalization;\nusing System.Collections;\nusing System.Text.RegularExpressions;\n\nnamespace Task\n{\n\n #region MyIo\n\n internal class MyIo : IDisposable\n {\n private readonly TextReader inputStream;\n private readonly TextWriter outputStream = Console.Out;\n\n private string[] tokens;\n private int pointer;\n\n public MyIo()\n#if LOCAL_TEST\n : this(new StreamReader(\"input.txt\"))\n#else\n : this(System.Console.In)\n#endif\n {\n\n }\n\n public MyIo(TextReader inputStream)\n {\n this.inputStream = inputStream;\n }\n\n\n public char NextChar()\n {\n try\n {\n return (char)inputStream.Read();\n }\n catch (IOException)\n {\n return '\\0';\n }\n }\n\n public string NextLine()\n {\n try\n {\n return inputStream.ReadLine();\n }\n catch (IOException)\n {\n return null;\n }\n }\n\n public string NextString()\n {\n try\n {\n while (tokens == null || pointer >= tokens.Length)\n {\n tokens = (NextLine() + string.Empty).Split(new[] { ' ', '\\t' }, StringSplitOptions.RemoveEmptyEntries);\n pointer = 0;\n }\n return tokens[pointer++];\n }\n catch (IOException)\n {\n return null;\n }\n }\n\n public int NextInt()\n {\n return Next();\n }\n\n public long NextLong()\n {\n return Next();\n }\n\n public T Next()\n {\n var t = typeof(T);\n\n if (t == typeof(char))\n return (T)(object)NextChar();\n\n object s = NextString();\n\n if (t == typeof(string))\n return (T)s;\n\n return (T)Convert.ChangeType(s, typeof(T));\n }\n\n\n public IEnumerable NextWhile(Predicate pred)\n {\n if (pred == null)\n yield break;\n\n T res = Next();\n\n while (pred(res))\n {\n yield return res;\n\n res = Next();\n }\n }\n\n public IEnumerable NextSeq(long n)\n {\n for (var i = 0; i < n; i++)\n yield return Next();\n }\n\n public void Print(string format, params object[] args)\n {\n outputStream.Write(string.Format(CultureInfo.InvariantCulture, format, args));\n }\n\n public void PrintLine(string format, params object[] args)\n {\n Print(format, args);\n\n outputStream.WriteLine();\n }\n\n public void Print(bool o)\n {\n Print(o ? \"yes\" : \"no\");\n }\n\n public void PrintLine(bool o)\n {\n Print(o);\n\n outputStream.WriteLine();\n }\n\n public void Print(T o)\n {\n outputStream.Write(Convert.ToString(o, CultureInfo.InvariantCulture));\n }\n\n\n public void PrintLine(T o)\n {\n Print(o);\n\n outputStream.WriteLine();\n }\n\n public void Close()\n {\n inputStream.Close();\n outputStream.Close();\n }\n\n void IDisposable.Dispose()\n {\n Close();\n\n#if LOCAL_TEST\n Console.ReadLine();\n#endif\n }\n }\n\n\n public static class ListExtensions\n {\n public static void Each(this IEnumerable self, Action action)\n {\n foreach (var v in self)\n action(v);\n }\n\n public static IEnumerable ToCycleEnumerable(this IEnumerable self)\n {\n if (self != null)\n {\n for (; ; )\n {\n foreach (var x in self)\n yield return x;\n }\n }\n }\n\n public static T CycleGet(this IList self, int index)\n {\n var c = self.Count;\n return self[(index % c + c) % c];\n }\n\n\n public static IList Shuffle(this IList self)\n {\n var rnd = new Random(DateTime.Now.Millisecond);\n\n var n = self.Count;\n\n while (n > 1)\n {\n n--;\n var k = rnd.Next(n + 1);\n var value = self[k];\n self[k] = self[n];\n self[n] = value;\n }\n\n return self;\n }\n\n public static IList> UseForNew2D(this T def, int fd, int sd)\n {\n var fdim = new T[fd][];\n\n for (int i = 0; i < fd; i++)\n {\n fdim[i] = new T[sd];\n Fill(fdim[i], def);\n }\n\n return fdim;\n }\n\n public static IList Fill(this IList self, Func fval)\n {\n for (var i = 0; i < self.Count; i++)\n self[i] = fval();\n\n\n return self;\n }\n\n\n public static IList Fill(this IList self, T val)\n {\n return self.Fill(() => val);\n }\n\n public static long Hash(this IList self, Func val = null)\n {\n return val != null ? self.Hash((t, current) => unchecked(current * 19L + val(t))) : self.Hash(HashOne);\n }\n\n public static long Hash(this IList self, Func val)\n {\n return self.Aggregate(0L, (current, t) => unchecked(val(t, current)));\n }\n\n\n public static long HashOne(this T self, long current)\n {\n return unchecked(current * 19L + (Equals(self, default(T)) ? 0 : self.GetHashCode()));\n }\n\n\n public static IList BuildSegTree(this IList a, Func combine, Func convert)\n {\n var t = new T1[a.Count << 2];\n\n a.BuildSegTree(t, 1, 0, a.Count - 1, combine, convert);\n\n return t;\n }\n\n private static void BuildSegTree(this IList a, IList t, int v, int tl, int tr, Func combine, Func convert)\n {\n if (tl == tr)\n {\n t[v] = convert(a[tl]);\n }\n else\n {\n int tm = (tl + tr) >> 1;\n\n BuildSegTree(a, t, v << 1, tl, tm, combine, convert);\n BuildSegTree(a, t, (v << 1) + 1, tm + 1, tr, combine, convert);\n\n t[v] = combine(t[v << 1], t[(v << 1) + 1]);\n }\n }\n }\n\n public static class P\n {\n public static P Create(T1 key, T2 val)\n {\n return new P(key, val);\n }\n }\n\n public class P\n {\n private class PComparer : IComparer>\n {\n private readonly bool? byKey;\n\n public PComparer(bool? byKey)\n {\n this.byKey = byKey;\n }\n\n\n public int Compare(P x, P y)\n {\n x = x ?? new P();\n y = y ?? new P();\n\n\n if (byKey == true)\n return Comparer.Default.Compare(x.Key, y.Key);\n else if (byKey == false)\n return Comparer.Default.Compare(x.Value, y.Value);\n else\n {\n var tr = Comparer.Default.Compare(x.Key, y.Key);\n\n if (tr != 0)\n tr = Comparer.Default.Compare(x.Value, y.Value);\n\n return tr;\n }\n }\n }\n\n\n public P()\n {\n }\n\n public P(T1 key, T2 val)\n {\n this.Key = key;\n this.Value = val;\n }\n\n\n public T1 Key\n {\n get;\n set;\n }\n\n public T2 Value\n {\n get;\n set;\n }\n\n public P Clone()\n {\n return new P(Key, Value);\n }\n\n public static IComparer> KeyComparer\n {\n get { return new PComparer(true); }\n }\n\n public static IComparer> ValueComparer\n {\n get { return new PComparer(false); }\n }\n\n public static implicit operator T1(P obj)\n {\n return obj.Key;\n }\n\n public static implicit operator T2(P obj)\n {\n return obj.Value;\n }\n\n public P SetKey(T1 key)\n {\n Key = key;\n return this;\n }\n\n public P SetValue(T2 value)\n {\n Value = value;\n return this;\n }\n\n public override string ToString()\n {\n return string.Format(\"Key: {0}, Value: {1}\", Key, Value);\n }\n\n public override bool Equals(object obj)\n {\n var co = obj as P;\n\n return co != null && co.GetHashCode() == GetHashCode();\n }\n\n public override int GetHashCode()\n {\n int hash = 17;\n hash = hash * 31 + ((Equals(Key, default(T1))) ? 0 : Key.GetHashCode());\n hash = hash * 31 + ((Equals(Value, default(T1))) ? 0 : Value.GetHashCode());\n return hash;\n\n }\n }\n\n #endregion\n\n\n\n internal class Program\n {\n #region Program\n\n private readonly MyIo io;\n\n public Program(MyIo io)\n {\n this.io = io;\n }\n\n public static void Main(string[] args)\n {\n using (MyIo io = new MyIo())\n {\n new Program(io)\n .Solve();\n }\n }\n\n\n\n #endregion\n public const long MOD = 1000000007;\n public const double EPS = 1e-14;\n\n\n \n private void Solve()\n {\n var a = io.NextLong();\n var b = io.NextLong();\n\n \n\n \n\n io.Print(Calc(b) - Calc(a-1));\n }\n\n private long Calc(long a)\n {\n var al = (long)Math.Log10(a) + 1;\n\n if (al == 1)\n return a;\n else\n {\n var dgts = new long[al];\n\n var xa = a;\n\n for (int i = 0; i < al; i++)\n {\n dgts[al- i -1] = xa % 10;\n xa = xa / 10;\n }\n\n \n long res = (long)Math.Pow(10, al - 2) * (dgts[0] - 1) + 9;\n\n for (int i = 2; i < al ; i++)\n res += (long)Math.Pow(10, i - 2) * 9;\n \n if (al < 2)\n res++;\n else\n res += (a % (long)Math.Pow(10, al - 1))/10 + 1;\n\n if (dgts[0] > dgts[al - 1])\n res--;\n\n return res;\n }\n }\n }\n\n}\n\n", "lang": "Mono C#", "bug_code_uid": "f64776ace9abd2e2b3ace64ad88bf355", "src_uid": "9642368dc4ffe2fc6fe6438c7406c1bd", "apr_id": "2867efdd503a4b689bdaf9e999fb00b2", "difficulty": 1500, "tags": ["dp", "combinatorics", "binary search"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.07481125600549074, "equal_cnt": 15, "replace_cnt": 11, "delete_cnt": 2, "insert_cnt": 3, "fix_ops_cnt": 16, "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\n //Little Elephant and Interval\n\n var a = Array.ConvertAll(Console.ReadLine().Split(' '), Convert.ToInt64);\n\n const long maxn = 1000000000000000000;\n\n long l = a[0], r = a[1];\n\n long low = 1, high = 9;\n\n long ans = 0, c = 9;\n \n //high\n\n while (high <= r && low < maxn)\n {\n\n ans += c;\n \n low *= 10;\n high = high * 10 + 9;\n\n if (low > 99)\n {\n\n c *= 10;\n\n }\n\n }\n\n for (long i = low; i <= r; i++)\n {\n\n long x = (long)Math.Log10(1.0 * i);\n\n long first = i / (long)Math.Pow(10.0, 1.0 * x);\n long last = i % 10;\n\n if (first == last)\n {\n\n ans++;\n\n }\n\n }\n\n //low\n\n low = 1;\n high = 9;\n\n c = 9;\n\n while (high <= l && low < maxn)\n {\n\n ans -= c;\n \n low *= 10;\n high = high * 10 + 9;\n\n if (low > 99)\n {\n\n c *= 10;\n\n }\n\n }\n\n for (long i = low; i < l; i++)\n {\n\n long x = (long)Math.Log10(1.0 * i);\n\n long first = i / (long)Math.Pow(10.0, 1.0 * x);\n long last = i % 10;\n\n if (first == last)\n {\n\n ans--;\n\n }\n\n }\n\n Console.WriteLine(ans);\n\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "38b4d63ea8b5f0f107859a4a5cf2c43c", "src_uid": "9642368dc4ffe2fc6fe6438c7406c1bd", "apr_id": "07a1b083e539a2c2980515d22d40bc2c", "difficulty": 1500, "tags": ["dp", "combinatorics", "binary search"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9898389095415118, "equal_cnt": 7, "replace_cnt": 5, "delete_cnt": 1, "insert_cnt": 0, "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()\n {\n int[] arr = Console.ReadLine().Split(' ').Select(Int32.Parse).ToArray();\n int lvl = arr[0] + 1;\n int n = arr[1], ans = 0, total = 1, totallists = 0 ;\n double lists = Math.Pow(2, arr[0])/ 2, max = Math.Pow(2, arr[0]), min = 1;\n bool direction = true;\n for (int i = 1; i < lvl; i++) {\n totallists += (int)Math.Pow(2, i);\n }\n while (totallists != 0){\n if (n <= lists && direction == false)\n {\n total += totallists / 2 + 1;\n totallists = (totallists/2) - 1;\n max = lists;\n lists = Math.Floor((max + min)/2);\n }\n else if (n <= lists && direction == true) {\n total++;\n totallists = (totallists/2) - 1;\n direction = !direction;\n max = lists;\n lists = Math.Floor((max + min) / 2);\n }\n else if (n > lists && direction == true)\n {\n total += totallists / 2 + 1;\n totallists = (totallists/2) - 1;\n min = lists;\n lists = Math.Floor((max + min) / 2);\n }\n else if (n > lists && direction == false) {\n total++;\n totallists = (totallists/2) - 1;\n direction = !direction;\n min = lists;\n lists = Math.Floor((max + min) / 2);\n }\n\n }\n Console.WriteLine(total - 1);\n //Console.ReadKey();\n }\n }\n}", "lang": "MS C#", "bug_code_uid": "0b02981dba219ba37fe7822afcb0b813", "src_uid": "3dc25ccb394e2d5ceddc6b3a26cb5781", "apr_id": "90fd77b8ef26a259e86bd8a4ca2b82cd", "difficulty": 1700, "tags": ["trees", "math", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.805026656511805, "equal_cnt": 16, "replace_cnt": 8, "delete_cnt": 6, "insert_cnt": 1, "fix_ops_cnt": 15, "bug_source_code": "#region imports\nusing System;\nusing System.Collections.Generic;\nusing System.ComponentModel;\nusing System.Data;\nusing System.Diagnostics;\nusing System.Globalization;\nusing System.IO;\nusing System.Linq;\nusing System.Numerics;\nusing System.Runtime.CompilerServices;\nusing System.Runtime.InteropServices;\n\n#endregion\n\nnamespace CodeForces\n{\n class Problem\n {\n const bool IsContest = true;\n\n private void Solve()\n {\n var h = _.NextInt();\n\n var n = Convert.ToString(_.NextLong() - 1, 2).PadLeft(h, '0').ToCharArray();\n\n // var level = 0;\n long nVisited = 0;\n var nextDir = 0;\n const long long1 = 1;\n for (var level = 0; level < h; level++)\n {\n var dir = n[level];\n\n if (level == h - 1)\n {\n switch (dir)\n {\n case '1':\n nVisited += nextDir == 1 ? 1 : 2;\n break;\n case '0':\n nVisited += nextDir == 1 ? 2 : 1;\n break;\n default:\n Debug.Assert(false);\n break;\n }\n }\n else\n {\n switch (dir)\n {\n case '1':\n nVisited += long1 << (h - level);\n nextDir = 0;\n break;\n case '0':\n nVisited += 1;\n nextDir = 1 ;\n break;\n default:\n Debug.Assert(false);\n break;\n }\n }\n }\n _.WriteLine(nVisited);\n }\n\n\n\n\n #region shit\n private readonly InOut _ = new InOut(IsContest);\n static void Main(string[] args)\n {\n var p = new Problem();\n p.Solve();\n p._.Close();\n }\n }\n class InOut\n {\n private const string InputFile = \"input.txt\";\n private const string OutputFile = \"output.txt\";\n public StreamWriter Cout { get; private set; }\n public StreamReader Cin { get; private set; }\n private void SetConsoleIo()\n {\n Cin = new StreamReader(new BufferedStream(Console.OpenStandardInput()));\n Cout = new StreamWriter(new BufferedStream(Console.OpenStandardOutput()));\n }\n private void SetFileIo(string inputFile, string outputFile) { Cin = new StreamReader(inputFile); Cout = new StreamWriter(outputFile); }\n public InOut() { SetConsoleIo(); }\n public InOut(string inputFile, string outputFile) { SetFileIo(inputFile, outputFile); }\n public InOut(bool isContest) { if (isContest) SetConsoleIo(); else SetFileIo(InputFile, OutputFile); }\n public void WriteLine(object x) { Cout.WriteLine(x); }\n public void Close() { Cin.Close(); Cout.Close(); }\n public void WriteLine(string format, params object[] args) { Cout.WriteLine(format, args); }\n private int _pos;\n private string[] _tokens;\n\n private string[] NextStringArray() { return Cin.ReadLine().Split(\" \\t\".ToCharArray(), StringSplitOptions.RemoveEmptyEntries); }\n public string NextToken()\n {\n while (_tokens == null || _pos == _tokens.Length)\n {\n // ReSharper disable once PossibleNullReferenceException\n _tokens = NextStringArray();\n _pos = 0;\n }\n return _tokens[_pos++];\n }\n public int NextInt() { return int.Parse(NextToken()); }\n public long NextLong() { return long.Parse(NextToken()); }\n public double NextDouble() { return double.Parse(NextToken(), CultureInfo.InvariantCulture); }\n public int[] NextIntArray() { return NextStringArray().Select(int.Parse).ToArray(); }\n public byte[] NextByteArray() { return NextStringArray().Select(byte.Parse).ToArray(); }\n public long[] NextLongArray() { return NextStringArray().Select(long.Parse).ToArray(); }\n #endregion\n }\n}", "lang": "MS C#", "bug_code_uid": "e5bc940ac0746515723c69c943db2df7", "src_uid": "3dc25ccb394e2d5ceddc6b3a26cb5781", "apr_id": "64c7607e370ef764ac6624ef995c31fe", "difficulty": 1700, "tags": ["trees", "math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.8745762711864407, "equal_cnt": 1, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "От JohnKEA, контест: Codeforces Alpha Round #21 (Codeforces format), задача: (A) Jabber ID, Полное решение, #\n\nusing System;\nusing System.Text.RegularExpressions;\nnamespace _21A\n{\n class Program\n {\n static void Main(string[] args)\n {\n var str = Console.ReadLine();\n if (Regex.IsMatch(str, @\"^\\w{1,16}@\\w{1,16}(\\.\\w{1,16})*(/\\w{1,16})?$\"))\n Console.WriteLine(\"YES\");\n else\n Console.WriteLine(\"NO\");\n }\n }\n}", "lang": "Mono C#", "bug_code_uid": "7bdb534bd39d4578dc4f47991fa75d11", "src_uid": "2a68157e327f92415067f127feb31e24", "apr_id": "bb55f0ffc489b37b0a6922bfd28d5242", "difficulty": 1900, "tags": ["strings", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C#"} {"similarity_score": 0.4963768115942029, "equal_cnt": 17, "replace_cnt": 10, "delete_cnt": 2, "insert_cnt": 5, "fix_ops_cnt": 17, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\n\n\nnamespace GeraldArt {\n class Program {\n static void Main(string[] args) {\n\n CommandManager cm = new CommandManager();\n int[] boardValues = Array.ConvertAll(Console.ReadLine().Split(' '), s => Int32.Parse(s));\n int[] paintOne = Array.ConvertAll(Console.ReadLine().Split(' '), s => Int32.Parse(s));\n int[] paintTwo = Array.ConvertAll(Console.ReadLine().Split(' '), s => Int32.Parse(s));\n\n int boardMax = boardValues[0] > boardValues[1] ? boardValues[0] : boardValues[1];\n int boardMin = boardValues[0] < boardValues[1] ? boardValues[0] : boardValues[1];\n\n int[] allValues = new int[4] {paintOne[0], paintOne[1], paintTwo[0], paintTwo[1] }.OrderBy(x => x).ToArray();\n\n if(boardMax >= (allValues[3] + allValues[0]) && (boardMin * 2) >= allValues[1] + allValues[2]) {\n Console.WriteLine(\"YES\");\n } else if((boardMax - allValues[3]) == 0 && (boardMin * 2) >= allValues[1] + allValues[2] + allValues[0]) {\n Console.WriteLine(\"YES\");\n } else {\n Console.WriteLine(\"NO\");\n }\n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "8f072dccef475b7a088ad5568c5fc95d", "src_uid": "2ff30d9c4288390fd7b5b37715638ad9", "apr_id": "c8fab6b707bd290c4f5e7336426bc0be", "difficulty": 1200, "tags": ["constructive algorithms", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9628924833491912, "equal_cnt": 27, "replace_cnt": 17, "delete_cnt": 8, "insert_cnt": 1, "fix_ops_cnt": 26, "bug_source_code": "/*\nAuthor : Shivakkumar K R\nFile name : 313_Div2_ProbB.cs\n*/\nusing System;\nusing System.Collections;\nusing System.Linq;\nusing System.Text;\nusing System.IO;\npublic class _313_Div2_ProbB {\n\tstatic int max(int a, int b)\n\t{\n\t\treturn Math.Max(a, b);\n\t}\n\tstatic void swap(ref T a, ref T b) {\n\t\tT c = b;\n\t\ta = b;\n\t\tb = c;\n\t}\n\tstatic void Main(string [] args) {\n\t\tConsole.SetIn(new StreamReader(File.OpenRead(\"C://Users//Shiva//Desktop//313_Div2_ProbB.txt\")));\n\t\tvar input = Console.ReadLine().Split(new char[] {});\n\t\tint a1 = int.Parse(input[0]), b1 = int.Parse(input[1]);\n\t\tinput = Console.ReadLine().Split(new char[] {});\n\t\tint a2 = int.Parse(input[0]), b2 = int.Parse(input[1]);\n\t\tinput = Console.ReadLine().Split(new char[] {});\n\t\tint a3 = int.Parse(input[0]), b3 = int.Parse(input[1]);\n\n\t\tfor (int i = 0; i < 4; i++) {\n\t\t\tif ((a1 >= (a2 + a3) && b1 >= b2 && b1 >= b3) || (b1 >= (b3 + b3) && a1 >= a2 && a1 >= a3)) {\n\t\t\t\tConsole.WriteLine(\"YES\"); return;\n\t\t\t}\n\t\t\tif (i % 2 == 0) swap(ref a2,ref a3);\n\t\t\tswap(ref b2,ref b3);\n\t\t}\n\n\t\tConsole.WriteLine(\"NO\");\n\t}\n}\n", "lang": "MS C#", "bug_code_uid": "cac93109bc978da454f51699f66321b6", "src_uid": "2ff30d9c4288390fd7b5b37715638ad9", "apr_id": "18c3e87efd8ad945308a79a07e51b15f", "difficulty": 1200, "tags": ["constructive algorithms", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.7389659520807061, "equal_cnt": 19, "replace_cnt": 14, "delete_cnt": 3, "insert_cnt": 2, "fix_ops_cnt": 19, "bug_source_code": "/*\n * Created by SharpDevelop.\n * Handle: Arcos\n */\nusing System;\nusing System.Linq;\nusing System.Collections.Generic;\nusing System.Diagnostics;\nusing System.IO;\nusing System.Text.RegularExpressions;\n\nnamespace TestingStuff\n{\n\tclass Program\n\t{\n\t\tpublic static void Main(string[] args)\n\t\t{\n\t\t\tvar a1 = Console.ReadLine().Split(' ');\n\t\t\tList arr = new List();\n\t\t\tforeach (var st in a1){arr.Add(int.Parse(st));}\n\t\t\tvar n = int.Parse(a1[0]); // known airports\n\t\t\tvar k = int.Parse(a1[1]); // airport unique id by his house\n\t\t\tList brr = new List();\n\t\t\tbrr.Add(1);\n\t\t\tfor (int i = 0; i < n; i++){\n\t\t\t\trec(ref brr);\n\t\t\t}\n\t\t\tConsole.WriteLine(brr[k - 1]);\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tpublic static void rec(ref List arr){\n\t\t\tList brr = new List();\n\t\t\tbrr.AddRange(arr);\n\t\t\tbrr.Add(arr[arr.Count() / 2] + 1);\n\t\t\tbrr.AddRange(arr);\n\t\t\tarr = brr;\n\t\t}\n\t}\n}", "lang": "MS C#", "bug_code_uid": "a195d6389028a62889edc39281935c33", "src_uid": "0af400ea8e25b1a36adec4cc08912b71", "apr_id": "fe02894c83786bd4b0786b384368cbdf", "difficulty": 1200, "tags": ["implementation", "constructive algorithms", "bitmasks", "binary search"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.44334160463192723, "equal_cnt": 17, "replace_cnt": 9, "delete_cnt": 7, "insert_cnt": 1, "fix_ops_cnt": 17, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\n\nnamespace B\n{\n class Program\n {\n static void Main(string[] args)\n {\n string a = Console.ReadLine();\n string[] strArr = a.Split(' ');\n int n = Int32.Parse(strArr[0]), k = Int32.Parse(strArr[1]);\n int[] mas = {1};\n int[] masTwo;\n for (int i =0; i < n; i++)\n {\n masTwo = new int[mas.Length * 2 + 1];\n mas.CopyTo(masTwo, 0);\n masTwo[mas.Length] = i + 2;\n mas.CopyTo(masTwo, mas.Length + 1);\n mas = masTwo;\n }\n Console.WriteLine(mas[k-1]);\n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "0cd0eb502e9cae78cdc25e3f367c2e36", "src_uid": "0af400ea8e25b1a36adec4cc08912b71", "apr_id": "fede3fb4da9b438daf254f4297f92b11", "difficulty": 1200, "tags": ["implementation", "constructive algorithms", "bitmasks", "binary search"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9786892758936755, "equal_cnt": 13, "replace_cnt": 8, "delete_cnt": 1, "insert_cnt": 3, "fix_ops_cnt": 12, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Collections;\nusing System.Globalization;\nusing System.IO;\nusing System.Linq;\n//Гавно код недорешенный\npublic class Source\n{\n public void Program()\n {\n }\n void Read()\n {\n int n = ri(), a = ri() - 1;\n List l = new List();\n l.Add(1);\n int num = 2;\n for (int i = 0; i < n; i++)\n {\n int size = l.Count();\n l.Add(num++);\n for (int j = 0; j < size; j++)\n {\n l.Add(l[j]);\n }\n }\n writeLine(l[a]);\n }\n\n #region hide it\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 var source = new Source();\n source.Read();\n source.Program();\n\n /* try\n {\n new Source().Program();\n }\n catch (Exception ex)\n {\n #if DEBUG\n Console.WriteLine(ex);\n #else\n throw;\n #endif\n }*/\n reader.Close();\n writer.Close();\n }\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()\n {\n while (currentLineTokens.Count == 0)\n currentLineTokens = new Queue(ReadAndSplitLine());\n return currentLineTokens.Dequeue();\n }\n public static int ri() { return int.Parse(ReadToken()); }\n public static char ReadChar() { return char.Parse(ReadToken()); }\n public static long ReadLong() { return long.Parse(ReadToken()); }\n public static ulong ReaduLong() { return ulong.Parse(ReadToken()); }\n public static double ReadDouble() { return double.Parse(ReadToken(), CultureInfo.InvariantCulture); }\n public static int[] ReadIntArray() { return ReadAndSplitLine().Select(i => int.Parse(i)).ToArray(); }\n public static char[] ReadCharArray() { return ReadAndSplitLine().Select(i => char.Parse(i)).ToArray(); }\n public static long[] ReadLongArray() { return ReadAndSplitLine().Select(i => long.Parse(i)).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 char[][] ReadCharMatrix(int numberOfRows) { char[][] matrix = new char[numberOfRows][]; for (int i = 0; i < numberOfRows; i++) matrix[i] = ReadCharArray(); 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]; }\n 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 write(T value) { writer.Write(value); }\n public static void writeLine(T value) { writer.WriteLine(value); }\n public static void writeArray(T[] array, string split) { for (int i = 0; i < array.Length; i++) { write(array[i] + split); } }\n public static void writeMatrix(T[][] matrix, string split) { for (int i = 0; i < matrix.Length; i++) { writeArray(matrix[i], split); writer.Write(\"\\n\"); } }\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\n #region Methods\n #region DSU\n public void MakeSet(int[] poi)\n {\n for (int i = 0; i < poi.Length; i++)\n {\n poi[i] = i;\n }\n }\n public int Find(int x, int[] poi)\n {\n if (poi[x] == x) return x;\n return poi[x] = Find(poi[x], poi);\n }\n Random rand = new Random();\n public void Unite(int x, int y, int[] poi)\n {\n y = Find(y, poi);\n x = Find(x, poi);\n if (rand.Next() % 2 == 0)\n Swap(ref x, ref y);\n poi[x] = y;\n }\n #endregion\n\n class Deque\n {\n T[] array;\n int start, length;\n public Deque()\n {\n start = 0; length = 0; array = new T[1];\n }\n public T this[int index] { get { return array[(start + index) % array.Length]; } set { array[(start + index) % array.Length] = value; } }\n int last { get { return (start + length) % array.Length; } }\n /// \n /// сÑâ€Ã\n /// \n public T PeekFirst()\n {\n return array[start];\n }\n public int Count { get { return length; } }\n /// \n /// конецбез удаления\n /// \n public T PeekLsat()\n {\n return array[last];\n }\n public T PopLast()\n {\n if (length == 0)\n throw new IndexOutOfRangeException(\"OutOfRange\");\n length--;\n return array[last];\n }\n public T PopFirst()\n {\n if (length == 0)\n throw new IndexOutOfRangeException(\"OutOfRange\");\n length--;\n if (start >= array.Length - 1) start = 0; else start++;\n return array[start - 1 < 0 ? array.Length - 1 : start - 1];\n }\n public void AddFirst(T value)\n {\n IncreaseAndInspection();\n if (start <= 0) start = array.Length - 1; else start--;\n array[start] = value;\n length++;\n }\n public void AddLast(T value)\n {\n IncreaseAndInspection();\n array[last] = value;\n length++;\n }\n bool overflow { get { return length == array.Length; } }\n void IncreaseAndInspection()\n {\n if (overflow)\n increase();\n\n }\n void increase()\n {\n T[] array2 = new T[array.Length * 2];\n for (int i = 0; i < array.Length; i++)\n {\n int pos = (start + i) % array.Length;\n array2[i] = array[pos];\n }\n array = array2;\n start = 0;\n array2 = null;\n }\n public void Clear()\n {\n start = 0; length = 0; array = new T[1];\n }\n }\n class Heap\n {\n Comparison ic;\n List storage = new List();\n public Heap(Comparison ic)\n {\n this.ic = ic;\n }\n public void Add(T element)\n {\n storage.Add(element);\n int pos = storage.Count - 1;\n while (pos != 0 && ic(storage[((int)(pos - 1) >> 1)], element) > 0)\n {\n Swap(storage, pos, ((int)(pos - 1) / 2));\n pos = ((int)(pos - 1) / 2);\n }\n }\n public T Pop()\n {\n T t = storage[0];\n Swap(storage, 0, storage.Count - 1);\n int pos = 0;\n storage.RemoveAt(storage.Count - 1);\n if (Count > 0)\n while (true)\n {\n T my = storage[pos];\n if (pos * 2 + 1 >= Count)\n break;\n T left = storage[pos * 2 + 1];\n if (pos * 2 + 2 >= Count)\n {\n if (ic(left, my) < 0)\n {\n Swap(storage, pos, pos * 2 + 1);\n pos = pos * 2 + 1;\n }\n break;\n }\n T right = storage[pos * 2 + 2];\n if (ic(left, my) < 0 || ic(right, my) < 0)\n {\n if (ic(left, right) < 0)\n {\n Swap(storage, pos, pos * 2 + 1);\n pos = pos * 2 + 1;\n }\n else\n {\n\n Swap(storage, pos, pos * 2 + 2);\n pos = pos * 2 + 2;\n }\n }\n else break;\n }\n return t;\n }\n\n public void Clear()\n {\n storage.Clear();\n }\n /// \n /// без удаления\n /// \n /// \n public T Peek()\n {\n return storage[0];\n }\n public int Count\n {\n get { return storage.Count; }\n }\n //void RemoveLast, Size, peeklast, add\n }\n static void Swap(ref T lhs, ref T rhs)\n {\n T temp;\n temp = lhs;\n lhs = rhs;\n rhs = temp;\n }\n static void Swap(T[] a, int l, int r)\n {\n T temp;\n temp = a[l];\n a[l] = a[r];\n a[r] = temp;\n }\n static void Swap(List a, int l, int r)\n {\n T temp;\n temp = a[l];\n a[l] = a[r];\n a[r] = temp;\n }\n\n bool outregion(long y, long x, long n, long m)\n {\n if (x < 0 || x >= m || y < 0 || y >= n)\n return true;\n return false;\n }\n static void initlist(ref List[] list, int n)\n {\n list = new List[n];\n for (int i = 0; i < n; i++)\n list[i] = new List();\n }\n static void newarray(ref T[][] array, int n, int m)\n {\n array = new T[n][];\n for (int i = 0; i < n; i++)\n array[i] = new T[m];\n }\n static void newarray(ref T[] array, int n)\n {\n array = new T[n];\n }\n static void fill(T[] array, T value)\n {\n for (int i = 0; i < array.Length; i++)\n array[i] = value;\n }\n static void fill(T[][] array, T value)\n {\n for (int i = 0; i < array.Length; i++)\n for (int j = 0; j < array[i].Length; j++)\n array[i][j] = value;\n }\n public bool NextPermutation(T[] b, Comparison ic)\n {\n for (int j = b.Length - 2; j >= 0; j--)\n {\n if (ic(b[j], b[j + 1]) < 0)\n {\n for (int l = b.Length - 1; l >= 0; l--)\n {\n if (ic(b[l], b[j]) > 0)\n {\n Swap(b, j, l);\n Array.Reverse(b, j + 1, b.Length - (j + 1));\n return true;\n }\n }\n }\n }\n return false;\n }\n int[,] step8 = new int[,]\n {\n {-1,0 },\n {1,0 },\n {0,-1 },\n {0,1 },\n {1,1 },\n {-1,1 },\n {-1,-1 },\n {1,-1 },\n };\n int[,] step4 = new int[,]\n {\n {-1,0 },\n {1,0 },\n {0,-1 },\n {0,1 },\n };\n struct Vector2\n {\n public double x;\n public double y;\n public Vector2(double x, double y)\n {\n this.x = x;\n this.y = y;\n }\n public double Dist(Vector2 to)\n {\n return Math.Sqrt(Math.Abs(Math.Pow(to.x - x, 2)) + Math.Abs(Math.Pow(to.y - y, 2)));\n }\n public static bool operator ==(Vector2 left, Vector2 right) { return left.x == right.x && left.y == right.y; }\n public static bool operator !=(Vector2 left, Vector2 right) { return left.x != right.x || left.y != right.y; }\n }\n #endregion\n #endregion\n\n}", "lang": "MS C#", "bug_code_uid": "3d0e9466d1b5987d571703b599d512a9", "src_uid": "0af400ea8e25b1a36adec4cc08912b71", "apr_id": "21547701f7a8de175a6c30ed1fe97839", "difficulty": 1200, "tags": ["implementation", "constructive algorithms", "bitmasks", "binary search"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9995127723254681, "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.Globalization;\nusing System.IO;\nusing System.Linq;\nusing System.Text;\n\nclass Program\n{\n static void Main(string[] args)\n {\n int n = RI();\n long k = RL();\n\n int l = 1;\n for (int i = 2; i <= n; i++) l = l + l + 1;\n\n while (k != (l / 2) + 1)\n {\n if (k > l / 2) k -= ((l / 2) + 1);\n\n l /= 2;\n n--;\n }\n\n Console.Write(n);\n }\n \n private const int Mod = 1000000000 + 7;\n\n #region Data Read\n private static char ReadSign()\n {\n while (true)\n {\n int ans = consoleReader.Read();\n if (ans == '+' || ans == '-' || ans == '?')\n return (char)ans;\n }\n }\n\n private static long GCD(long a, long b)\n {\n if (a % b == 0) return b;\n return GCD(b, a % b);\n }\n\n private static List[] ReadGraph(int n, int m)\n {\n List[] g = new List[n];\n for (int i = 0; i < g.Length; i++) g[i] = new List();\n for (int i = 0; i < m; i++)\n {\n int a = RI() - 1;\n int b = RI() - 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 = RI();\n int b = RI();\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 RI()\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 RUL()\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 RL()\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[] RIA(int n)\n {\n int[] ans = new int[n];\n for (int i = 0; i < n; i++)\n ans[i] = RI();\n return ans;\n }\n\n private static long[] RLA(int n)\n {\n long[] ans = new long[n];\n for (int i = 0; i < n; i++)\n ans[i] = RL();\n return ans;\n }\n\n private static char[] ReadWord()\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[] ReadStringLine()\n {\n int ans;\n\n do\n {\n ans = consoleReader.Read();\n } while (ans == 10 || ans == 13);\n\n List s = new List();\n\n do\n {\n s.Add((char)ans);\n ans = consoleReader.Read();\n } while (ans != 10 && ans != 13 && ans != -1);\n\n return s.ToArray();\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 private static char ReadNonLetter()\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 ReadAnyOf(IEnumerable allowed)\n {\n while (true)\n {\n char ans = (char)consoleReader.Read();\n if (allowed.Contains(ans))\n return 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 private static double DoubleFromString(string x)\n {\n return double.Parse(x, 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(StringBuilder sb)\n {\n PushTestData(sb.ToString());\n }\n private static void PushTestData(string data)\n {\n#if TOLYAN_TEST\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 #endregion\n}", "lang": "MS C#", "bug_code_uid": "265dbbf7fd1c81f428612b58456f9873", "src_uid": "0af400ea8e25b1a36adec4cc08912b71", "apr_id": "fe1016f7a2c90d2b7b56add7d115438b", "difficulty": 1200, "tags": ["implementation", "constructive algorithms", "bitmasks", "binary search"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.5995085995085995, "equal_cnt": 23, "replace_cnt": 6, "delete_cnt": 3, "insert_cnt": 14, "fix_ops_cnt": 23, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nnamespace makethemequal\n{\n class Program\n {\n static void Main(string[] args)\n {\n string s=Console.ReadLine();\n int As=s.Count(c=>c=='a');\n if(As*2>=s.Count){\n Console.WriteLine(s.Count);\n return;\n }\n Console.WriteLine(As*2-1);\n }\n }\n}", "lang": "Mono C#", "bug_code_uid": "afa2a9b8f58230ad969861bbb732aab0", "src_uid": "84cb9ad2ae3ba7e912920d7feb4f6219", "apr_id": "e2794478f3d3df6fe2096d0b3bbb1877", "difficulty": 800, "tags": ["strings", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.7696629213483146, "equal_cnt": 6, "replace_cnt": 5, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 6, "bug_source_code": "using System;\n\nnamespace ConsoleApp1\n{\n class Program\n {\n static void Main(string[] args)\n {\n string s = Console.ReadLine();\n\t\t\tint count =0, rem = 0; \n\t\t\tfor(int i = 0; i < s.Length; i++)\n\t\t\t{\n\t\t\t\tif(s[i] == 'a')\n\t\t\t\t{\n\t\t\t\t\tcount++;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(count > s.length/2)\n\t\t\t{\n\t\t\t\tConsole.WriteLine(s.Length);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\trem = s.Length - count;\n\t\t\t\trem = rem - count;\n\t\t\t\tConsole.WriteLine(rem);\n\t\t\t}\n }\n }\n}", "lang": "Mono C#", "bug_code_uid": "ed1a736fa9f5c52c02cfd55beb55caff", "src_uid": "84cb9ad2ae3ba7e912920d7feb4f6219", "apr_id": "3e7e978da7ad6ae878dd940b649c8dd7", "difficulty": 800, "tags": ["strings", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9611267605633803, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "using System;\nusing System.Linq;\nnamespace Challenge\n{\n class Program\n {\n static void Main()\n {\n Console.Write(LoveA(Console.ReadLine()));\n\t\t}\n\t\tpublic static string LoveA(string str)\n {\n \n \n int count_a = str.Count(x => x == 'a');\n int count_other = str.Length - count_a;\n if (count_a == 0 && count_other == 0)\n return \"1\";\n else if (count_a == 0 && count_other > 0)\n return (count_other + count_other + 1).ToString();\n else if (count_a > count_other)\n return str.Length.ToString();\n else if (count_a == count_other)\n return (str.Length - 1).ToString();\n else if (count_a < count_other)\n return (count_a + count_a - 1).ToString();\n \n }\n\t\n\t}\n}", "lang": "Mono C#", "bug_code_uid": "c0378fe5d3d113eddba9ccc865174e8e", "src_uid": "84cb9ad2ae3ba7e912920d7feb4f6219", "apr_id": "8d4b12294ba33bdd114148db092a3f22", "difficulty": 800, "tags": ["strings", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C#"} {"similarity_score": 0.7153024911032029, "equal_cnt": 14, "replace_cnt": 10, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 13, "bug_source_code": "using System;\nusing System.Collections.Generic;\n\n\nclass Program\n{ \n private static void Main(string[] args)\n {\n int inputNumber = Int32.Parse(Console.ReadLine());\n List findedNumbers = new List();\n\n for (int i = 10; i < inputNumber; i++)\n {\n char[] parsedInputNumber = i.ToString().ToCharArray();\n\n int firstDigit = Int32.Parse(parsedInputNumber[0].ToString());\n int secondDigit = Int32.Parse(parsedInputNumber[1].ToString());\n int thirdDigit = 0;\n\n if (i > 99)\n {\n thirdDigit = Int32.Parse(parsedInputNumber[2].ToString());\n }\n\n int currentVariant = i + firstDigit + secondDigit + thirdDigit;\n\n if (currentVariant == inputNumber)\n {\n findedNumbers.Add(i);\n }\n }\n\n Console.WriteLine(findedNumbers.Count);\n\n if (findedNumbers.Count > 0)\n {\n foreach (int findedNumber in findedNumbers)\n {\n Console.WriteLine(findedNumber);\n }\n }\n Console.ReadKey();\n }\n}", "lang": "MS C#", "bug_code_uid": "c83f8b782d3cd18a5e9a54f891d480f3", "src_uid": "ae20ae2a16273a0d379932d6e973f878", "apr_id": "d538aae0e26e7a1ac55d8d7c6ff5cfbe", "difficulty": 1200, "tags": ["math", "brute force"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9626168224299065, "equal_cnt": 5, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 4, "fix_ops_cnt": 4, "bug_source_code": "using System;\nusing System.Collections.Generic;\n\nnamespace cf328b\n{\n\tclass MainClass\n\t{\n\t\tpublic static void Main (string[] args)\n\t\t{\n\t\t\tchar[] nums = Console.ReadLine().ToCharArray();;\n\t\t\tchar[] digits = Console.ReadLine().ToCharArray();\n\t\t\tList sn = new List();\n\n\t\t\tList sd = new List();\n\n\t\t\tforeach (var num in nums) {\n\t\t\t\tif (num == '2' || num == '5')\n\t\t\t\t\tsn.Add('2');\n\n\t\t\t\tif (num == '6' || num == '9')\n\t\t\t\t\tsn.Add('6');\n\t\t\t}\n\n\t\t\tforeach (var num in digits) {\n\t\t\t\tif (num == '2' || num == '5')\n\t\t\t\t\tsd.Add('2');\n\n\t\t\t\tif (num == '6' || num == '9')\n\t\t\t\t\tsd.Add('6');\n\t\t\t}\n\n\t\t\tsn.Sort();\n\t\t\tsd.Sort();\n\n\t\t\tbool failed = false;\n\t\t\tint res = 0;\n\t\t\tdo\n\t\t\t{\n\t\t\t\tforeach (var c in sn) {\n\t\t\t\t\tint i = sd.BinarySearch(c);\n\t\t\t\t\tif (i >= 0)\n\t\t\t\t\t{\n\t\t\t\t\t\tsd[i] = 'z';\n\t\t\t\t\t\tsd.Sort();\n\t\t\t\t\t}\n\t\t\t\t\telse failed = true;\n\t\t\t\t}\n\t\t\t\tif (!failed)\n\t\t\t\t\tres++;\n\t\t\t}while (!failed);\n\n\t\t\tConsole.WriteLine(res);\n\t\t}\n\t}\n}\n", "lang": "Mono C#", "bug_code_uid": "68706d7f347f6a7e7f9e405168bcdaaa", "src_uid": "72a196044787cb8dbd8d350cb60ccc32", "apr_id": "86e13ddad4189300333f43bb00894841", "difficulty": 1500, "tags": ["greedy"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.8774747555060826, "equal_cnt": 4, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "#define Online\n\nusing System;\nusing System.Collections.Generic;\nusing System.Diagnostics;\nusing System.Linq;\nusing System.Text;\nusing System.IO;\nusing System.Numerics;\n\nnamespace CF\n{\n delegate double F(double x);\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(\"input.txt\");\n StreamWriter sw = new StreamWriter(\"output.txt\");\n Console.SetIn(sr);\n Console.SetOut(sw);\n#endif\n\n D();\n\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 StringBuilder sb = new StringBuilder();\n string str = ReadLine();\n for (int i = 0; i < str.Length; i++)\n {\n if (!str[i].Equals('a') && !str[i].Equals('A')\n && !str[i].Equals('o') && !str[i].Equals('O')\n && !str[i].Equals('y') && !str[i].Equals('Y')\n && !str[i].Equals('e') && !str[i].Equals('E')\n && !str[i].Equals('u') && !str[i].Equals('U')\n && !str[i].Equals('i') && !str[i].Equals('I'))\n {\n sb.Append('.');\n if (str[i] < 97)\n sb.Append(char.ToLower(str[i]));\n else\n sb.Append(str[i]);\n\n }\n }\n Console.WriteLine(sb);\n }\n\n static void B()\n {\n int n = ReadInt();\n int[,] ans = new int[2 * n + 1, 2 * n + 1];\n for (int i = 0; i < 2 * n + 1; i++)\n {\n int z = (i > n ? n - (i - n) : i);\n ans[i, n] = z;\n for (int j = 0; j < n; j++)\n {\n ans[i, n - j - 1] = z - j - 1;\n ans[i, n + j + 1] = z - j - 1;\n }\n }\n for (int i = 0; i < 2 * n + 1; i++)\n {\n int j = 0;\n while (j < 2 * n + 1 && ans[i, j] < 0)\n {\n Console.Write(\" \");\n j++;\n }\n Console.Write(ans[i, j++]);\n while (j < 2 * n + 1 && ans[i, j] >= 0)\n {\n Console.Write(\" \" + ans[i, j]);\n j++;\n }\n\n Console.WriteLine();\n }\n }\n\n static void C()\n {\n\n }\n\n static void D()\n {\n int n1, n2, k1, k2;\n ReadArray(' ');\n n1 = NextInt();\n n2 = NextInt();\n k1 = NextInt();\n k2 = NextInt();\n long[,] p = new long[n1, n1 + 1];\n long[,] h = new long[n2, n2 + 1];\n for (int i = 1; i <= k1 && i <= n1; i++)\n p[0, i] = 1;\n for (int i = 1; i <= k2 && i <= n2; i++)\n h[0, i] = 1;\n for (int i = 1; i < n1; i++)\n {\n for (int j = 1; j <= k1; j++)\n {\n for (int z = 1; z <= n1; z++)\n {\n if (z + j <= n1)\n p[i, z + j] += p[i - 1, z];\n }\n }\n }\n for (int i = 1; i < n2; i++)\n {\n for (int j = 1; j <= k2; j++)\n {\n for (int z = 1; z <= n2; z++)\n {\n if (z + j <= n2)\n h[i, z + j] += h[i - 1, z];\n }\n }\n }\n long sum = 0;\n for (int i = 0; i < n1; i++)\n {\n if (i < n2)\n sum += p[i, n1] * h[i, n2] * 2;\n if (i + 1 < n2)\n sum += p[i, n1] * h[i + 1, n2];\n if (i - 1 >= 0)\n sum += p[i, n1] * h[i - 1, n2];\n sum %= 100000000L;\n }\n Console.WriteLine(sum);\n }\n\n static void E()\n {\n\n }\n\n static void TestGen()\n {\n\n }\n\n }\n\n public static class MyMath\n {\n public static long BinPow(long a, long n, long mod)\n {\n long res = 1;\n while (n > 0)\n {\n if ((n & 1) == 1)\n {\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) b = a % (a = b);\n return a;\n }\n\n public static int GCD(int a, int b)\n {\n while (b != 0) 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 {\n mid = left + ((right - left) >> 1);\n if (val <= a[mid])\n {\n right = mid;\n }\n else\n {\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 {\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\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 {\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 {\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 {\n if (i > q)\n {\n for (; k <= r; k++, j++)\n A[k] = R[j];\n return;\n }\n if (j > r)\n {\n for (; k <= r; k++, i++)\n A[k] = L[i];\n return;\n }\n if (comp(L[i], R[j]) <= 0)\n {\n A[k] = L[i];\n i++;\n }\n else\n {\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) 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 {\n if (i > q)\n {\n for (; k <= r; k++, j++)\n A[k] = R[j];\n return;\n }\n if (j > r)\n {\n for (; k <= r; k++, i++)\n A[k] = L[i];\n return;\n }\n if (L[i].CompareTo(R[j]) >= 0)\n {\n A[k] = L[i];\n i++;\n }\n else\n {\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) 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 {\n int i = 0;\n while (i < r)\n {\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 {\n int i = 0;\n while (i < r)\n {\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, c;\n for (int i = 0; i < a.Length; i++)\n {\n b = rnd.Next(0, a.Length);\n c = rnd.Next(0, a.Length);\n temp = a[b];\n a[b] = a[c];\n a[c] = 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": "cc7612799898dec83343758fe805218f", "src_uid": "63aabef26fe008e4c6fc9336eb038289", "apr_id": "5e089b19cabfa179c6058f1ca9e17336", "difficulty": 1700, "tags": ["dp"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.8360625574977001, "equal_cnt": 21, "replace_cnt": 10, "delete_cnt": 3, "insert_cnt": 8, "fix_ops_cnt": 21, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\n\nnamespace ConsoleApplication5\n{\n class Program\n {\n static int result = 0;\n static int k1, k2;\n static Dictionary res;\n static void Main(string[] args)\n {\n int[] v = Console.ReadLine().Split(' ').Select(z => int.Parse(z)).ToArray();\n int n1 = v[0];\n int n2 = v[1];\n k1 = v[2];\n k2 = v[3];\n res = new Dictionary();\n int bCnt, wCnt;\n wCnt = n1;\n bCnt = n2;\n\n Console.WriteLine(S(new State() { N1 = n1, N2 = n2, WCurCnt = 0, BCurCnt = 0 }));\n }\n\n static int S(State state)\n {\n if (state.N1 == 0 && state.N2 == 0)\n {\n return 1;\n }\n if (res.ContainsKey(state))\n {\n return res[state];\n }\n int s1 = 0, s2 = 0;\n if (state.N1 > 0 && state.WCurCnt < k1)\n {\n s1 = S(\n new State() \n { \n N1 = state.N1 - 1, \n N2 = state.N2, \n WCurCnt = state.WCurCnt + 1, \n BCurCnt = 0 \n });\n }\n if (state.N2 > 0 && state.BCurCnt < k2)\n {\n s2 = S(\n new State()\n {\n N1 = state.N1,\n N2 = state.N2 - 1,\n WCurCnt = 0,\n BCurCnt = state.BCurCnt + 1\n });\n }\n res.Add(state, s1 + s2);\n return s1 + s2;\n }\n\n struct State : IEquatable\n {\n public int N1 { get; set; }\n public int N2 { get; set; }\n public int WCurCnt { get; set; }\n public int BCurCnt { get; set; }\n\n public override int GetHashCode()\n {\n return string.Format(\"{0}{1}{2}{3}\", N1, N2, WCurCnt, BCurCnt).GetHashCode();\n }\n\n public override bool Equals(object obj)\n {\n return Equals((State)obj);\n }\n\n public bool Equals(State other)\n {\n return N1 == other.N1 \n && N2 == other.N2 \n && WCurCnt == other.WCurCnt \n && BCurCnt == WCurCnt;\n }\n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "6621a5e401bb731ed01735d22d1e0837", "src_uid": "63aabef26fe008e4c6fc9336eb038289", "apr_id": "40159d2fea7911338ab8c2df0706fc44", "difficulty": 1700, "tags": ["dp"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9990253411306043, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "using System;\nusing System.Text;\n\nnamespace BayanCont\n{\n class Program\n {\n const string sample = @\"+------------------------+\n|{1}.{5}.{8}.{11}.{14}.{17}.{20}.{23}.{26}.{29}.{32}.|D|)\n|{2}.{6}.{9}.{12}.{15}.{18}.{21}.{24}.{27}.{30}.{33}.|.|\n|{3}.......................|\n|{4}.{7}.{10}.{13}.{16}.{19}.{22}.{25}.{28}.{31}.{34}.|.|)\n+------------------------+\";\n static void Main(string[] args)\n {\n int passengers = int.Parse(Console.ReadLine());\n Console.WriteLine( getBusFigure(passengers));\n Console.ReadLine();\n }\n\n static string getBusFigure(int passengers)\n {\n string outDat = sample;\n for (int i = 1; i <= passengers; i++)\n {\n outDat = outDat.Replace(\"{\" + i.ToString() + \"}\", \"0\");\n }\n\n for (int i = 34; i > passengers; i--)\n {\n outDat = outDat.Replace(\"{\" + i.ToString() + \"}\", \"#\");\n }\n return outDat;\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "67b6576b0d685b5356e6b02fdc492eb7", "src_uid": "075f83248f6d4d012e0ca1547fc67993", "apr_id": "ff957fef692fb463063ccf292b383341", "difficulty": 1100, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9967707212055974, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "using System;\nusing System.Text;\nusing System.Linq;\nusing System.Collections.Generic;\n\nnamespace work01\n{\n\tclass MainClass\n\t{\n\t\tpublic static void Main (string[] args)\n\t\t{\n\t\t\tvar n = Int32.Parse (Console.ReadLine ());\n\n\t\t\tvar l1 = n > 4 ? (n + 1) / 3 : n > 0 ? 1 : 0;\n\t\t\tvar l2 = n > 4 ? n / 3 : n > 1 ? 1 : 0;\n\t\t\tvar l3 = n > 2 ? 1 : 0;\n\t\t\tvar l4 = n > 4 ? (n - 1) / 3 : n > 3 ? 1 : 0;\n\n\t\t\tFunc print = (k, m) => {\n\t\t\t\tvar sb = new StringBuilder();\n\t\t\t\tfor (var i = 1; i <= m; i++) {\n\t\t\t\t\tsb.AppendFormat(\"{0}.\", (i <= k) ? \"0\" : \"#\" );\n\t\t\t\t}\n\t\t\t\treturn sb.ToString();\n\t\t\t};\n\n\t\t\tConsole.WriteLine(\"+------------------------+\");\n\t\t\tConsole.WriteLine(\"|{0}|D|)\", print(l1, 11));\n\t\t\tConsole.WriteLine(\"|{0}|.|\", print(l2, 11));\n\t\t\tConsole.WriteLine(\"|{0}......................|\", print(l3, 1));\n\t\t\tConsole.WriteLine(\"|{0}|.|)\", print(l4, 11));\n\t\t\tConsole.Write(\"+------------------------+\");\t\t\t\t\t\t \n\t\t}\n\t}\n}\n", "lang": "Mono C#", "bug_code_uid": "ae72b67c61364249955f8253df724550", "src_uid": "075f83248f6d4d012e0ca1547fc67993", "apr_id": "9847822e99254f7d8caf677f46c79821", "difficulty": 1100, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9929214929214929, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "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 int k = int.Parse(Console.ReadLine());\n int t = k;\n string s1 = \"+------------------------+\";\n string s2 = \"|O.......................|\";\n string s3 = \"|#.......................|\";\n string[,] mat = new string[3,11];\n k--;\n mat[0, 0] = \"|\";\n mat[1, 0] = \"|\";\n mat[2, 0] = \"|\";\n for (int i = 0; i < 11; i++)\n {\n for (int j = 0; j < 3; j++)\n {\n if (k > 0)\n { mat[j, i] += \"O\"; k--; }\n else\n mat[j, i] += \"#\";\n }\n }\n Console.WriteLine(s1);\n for (int i = 0; i < 3; i++)\n {\n if (i == 2) \n Console.WriteLine((t>3)?s2:s3); \n for (int j = 0; j < 11; j++)\n {\n Console.Write(mat[i, j] + \".\");\n }\n if (i == 0)\n Console.Write(\"|D|)\");\n else\n if (i == 2)\n Console.Write(\"|.|)\");\n else\n Console.Write(\"|.|\");\n Console.WriteLine();\n }\n Console.WriteLine(s1);\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "358a6b543426424a6f502035480990da", "src_uid": "075f83248f6d4d012e0ca1547fc67993", "apr_id": "d1e09141d5c9d24d4f5c6d31b41e5fe5", "difficulty": 1100, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.9994079336885732, "equal_cnt": 5, "replace_cnt": 0, "delete_cnt": 4, "insert_cnt": 0, "fix_ops_cnt": 4, "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 /* int k = Convert.ToInt32(Console.ReadLine());\n char[,] mas = new char[4, 11];\n\n for (int i = 0; i < 4; i++)\n {\n for (int j = 0; j < 11; j++)\n mas[i, j] = '#';\n \n }\n for (int i = 1; i < 11; i++)\n mas[2, i] = '.';\n\n for (int i = 0; i < 4; i++)\n for (int j = 0; j < 11;j++ )\n if (k > 0 && mas[i, j] != '.')\n { k--; mas[i, j] = '0'; }\n\n Console.WriteLine(\"+------------------------+\");\n Console.Write('|');\n for (int i = 0; i < 11;i++ )\n Console.Write(mas[0,i].ToString() +'.');\n Console.WriteLine(\"|D|)\");\n\n Console.Write('|');\n for (int i = 0; i < 11; i++)\n Console.Write(mas[0, i].ToString() + '.');\n Console.WriteLine(\"|.|)\");\n\n Console.Write('|');\n for (int i = 0; i < 11; i++)\n Console.Write(mas[0, i].ToString() + '.');\n Console.WriteLine(\"..|)\");\n\n Console.Write('|');\n for (int i = 0; i < 11; i++)\n Console.Write(mas[0, i].ToString() + '.');\n Console.WriteLine(\"|.|)\");\n\n Console.WriteLine(\"+------------------------+\");*/\n\n\n int k = Convert.ToInt32(Console.ReadLine());\n if (k < 5)\n {\n Console.WriteLine(\"+------------------------+\");\n if (k > 0) { Console.WriteLine(\"|O.#.#.#.#.#.#.#.#.#.#.|D|)\"); k--; }\n else Console.WriteLine(\"|#.#.#.#.#.#.#.#.#.#.#.|D|)\");\n if (k > 0) { Console.WriteLine(\"|O.#.#.#.#.#.#.#.#.#.#.|.|)\"); k--; }\n else Console.WriteLine(\"|#.#.#.#.#.#.#.#.#.#.#.|.|)\");\n if (k > 0) { Console.WriteLine(\"|O.......................|)\"); k--; }\n else Console.WriteLine(\"|#.......................|)\");\n if (k > 0) { Console.WriteLine(\"|O.#.#.#.#.#.#.#.#.#.#.|.|)\"); k--; }\n else Console.WriteLine(\"|#.#.#.#.#.#.#.#.#.#.#.|.|)\");\n Console.WriteLine(\"+------------------------+\");\n return;\n }\n k = k - 4;\n Console.WriteLine(\"+------------------------+\");\n for (int i = 0; i < 2; i++)\n {\n Console.Write(\"|O.\");\n for (int j = 0; j < 10; j++)\n {\n if (3 * j + i < k) Console.Write(\"O.\");\n else Console.Write(\"#.\");\n }\n if (i == 0) Console.Write(\"|D|)\");\n else Console.Write(\"|.|\");\n Console.WriteLine();\n }\n Console.WriteLine(\"|O.......................|\");\n\n Console.Write(\"|O.\");\n for (int i = 0; i < 10; i++)\n if (3 * i + 2 < k) Console.Write(\"O.\");\n else Console.Write(\"#.\");\n Console.Write(\"|.|)\");\n Console.WriteLine();\n Console.WriteLine(\"+------------------------+\");\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "e964086366f8cf61e656dc5c034e5fbe", "src_uid": "075f83248f6d4d012e0ca1547fc67993", "apr_id": "1ec84417a3749e89dafdb44e03e3a50c", "difficulty": 1100, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "C#"} {"similarity_score": 0.9996437477734236, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "using System;\nusing System.IO;\nusing System.Text;\n\nnamespace Cola\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(), a = Next(), b = Next(), c = Next();\n\n int count = 0;\n for (int aa = 0; aa < a; aa += 2)\n {\n for (int cc = 0; cc <= c; cc++)\n {\n int bb = n - aa/2 - 2*cc;\n if (bb >= 0 && bb <= b)\n count++;\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": "e070e248d402dcc1dc0e683b85c9c759", "src_uid": "474e527d41040446a18186596e8bdd83", "apr_id": "deebeb58d1f7024b606d7f119e5e5d93", "difficulty": 1500, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.7823849013440092, "equal_cnt": 20, "replace_cnt": 8, "delete_cnt": 1, "insert_cnt": 10, "fix_ops_cnt": 19, "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\n String s = Console.ReadLine();\n \n char[] c = {' '};\n \n String[] a = s.Split(c, 3, StringSplitOptions.RemoveEmptyEntries);\n \n long x = long.Parse(a[0]), tx = x;\n long y = long.Parse(a[1]), ty = y;\n long m = long.Parse(a[2]);\n \n long ans = 0;\n \n while (tx < m && ty < m){\n \n if (tx < ty){\n \n ans += ((ty - tx) / ty + 1);\n \n tx = tx + ty * ((ty - tx) / ty + 1);\n \n }\n else {\n \n ans += ((tx - ty) / tx + 1);\n \n ty = ty + tx * ((tx - ty) / tx + 1);\n \n }\n \n if (Math.Abs(tx - m) >= Math.Abs(x - m) && Math.Abs(ty - m) >= Math.Abs(y - m)){\n \n ans = -1;\n \n break;\n \n }\n \n }\n \n Console.WriteLine(ans);\n\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "670a7016384207395e45612bb5402980", "src_uid": "82026a3c3d9a6bda2e2ac6e14979d821", "apr_id": "594bdd1572438246c4b79d2c352f958d", "difficulty": 1600, "tags": ["brute force"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.9621489621489622, "equal_cnt": 12, "replace_cnt": 4, "delete_cnt": 1, "insert_cnt": 6, "fix_ops_cnt": 11, "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\n String s = Console.ReadLine();\n \n char[] c = {' '};\n \n String[] a = s.Split(c, 3, StringSplitOptions.RemoveEmptyEntries);\n \n long x = long.Parse(a[0]), tx = x;\n long y = long.Parse(a[1]), ty = y;\n long m = long.Parse(a[2]);\n \n long ans = 0;\n \n while (tx < m && ty < m){\n \n if (tx < ty){\n \n if (ty != 0){\n \n ans += ((ty - tx) / ty + 1);\n \n tx = tx + ty * ((ty - tx) / ty + 1);\n \n }\n else {\n \n ans = -1;\n \n break;\n \n }\n \n }\n else {\n \n if (tx != 0){\n \n ans += ((tx - ty) / tx + 1);\n \n ty = ty + tx * ((tx - ty) / tx + 1);\n \n }\n else {\n \n ans = -1;\n \n break;\n \n }\n \n }\n \n if (Math.Abs(tx - m) >= Math.Abs(x - m) && Math.Abs(ty - m) >= Math.Abs(y - m)){\n \n ans = -1;\n \n break;\n \n }\n \n }\n \n Console.WriteLine(ans);\n\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "c4df7ce949bae11014bb6cd43bff463c", "src_uid": "82026a3c3d9a6bda2e2ac6e14979d821", "apr_id": "594bdd1572438246c4b79d2c352f958d", "difficulty": 1600, "tags": ["brute force"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.996035447761194, "equal_cnt": 11, "replace_cnt": 0, "delete_cnt": 3, "insert_cnt": 7, "fix_ops_cnt": 10, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\n\nnamespace Contest_63\n{\n class Program\n {\n class mem : IComparable\n {\n public int i;\n public int p;\n //public string name;\n\n public mem(int i, int p)\n {\n this.i = i; this.p = p;\n }\n\n public int CompareTo(Object k)\n {\n var a = (mem)k;\n if (this.p != a.p)\n return this.p.CompareTo(a.p);\n return this.i.CompareTo(a.i);\n }\n }\n\n static void A()\n {\n int n = int.Parse(Console.ReadLine());\n\n SortedList m = new SortedList();\n\n for (int i = 0; i < n; i++)\n {\n var t = Console.ReadLine().Split(' ');\n int p = 0;\n switch (t[1])\n {\n case \"rat\":\n p = 1;\n break;\n case \"child\":\n case \"woman\":\n p = 2;\n break;\n case \"man\":\n p = 3;\n break;\n case \"captain\":\n p = 4;\n break;\n }\n\n m.Add(new mem(i, p), t[0]);\n }\n\n foreach (var e in m)\n Console.WriteLine(e.Value);\n }\n\n static void B()\n {\n var t = Console.ReadLine().Split(' ');\n int n = int.Parse(t[0]);\n int m = int.Parse(t[1]);\n\n SortedDictionary d = new SortedDictionary();\n for (int i = 1; i <= m; i++)\n d.Add(i,0);\n\n\n t = Console.ReadLine().Split(' ');\n\n foreach (var s in t)\n {\n int k = int.Parse(s);\n d[k]++;\n }\n\n int l = 0;\n for (; d[m] != n; l++)\n {\n for (int j = m-1; j > 0; j--)\n {\n if (d[j] > 0)\n {\n d[j + 1]++;\n d[j]--;\n }\n }\n }\n Console.WriteLine(l);\n }\n\n static bool check(string s1, string s2, int x, int y)\n {\n int kx = 0;\n int ky = 0;\n\n for (int i = 0; i < 4; i++)\n if (s1[i] == s2[i])\n kx++;\n if (kx != x)\n return false;\n ky = s1.Intersect(s2).Count();\n if (ky - kx != y)\n return false;\n return true;\n }\n\n static void C()\n {\n var l = new List();\n int[] a = new int[4];\n for (a[0] = 0; a[0] < 9; a[0]++)\n for (a[1] = 1; a[1] < 9; a[1]++)\n for (a[2] = 2; a[2] < 9; a[2]++)\n for (a[3] = 3; a[3] < 9; a[3]++)\n {\n string s = \"\" + a[0] + a[1] + a[2] + a[3];\n if (!((a[0] == a[1]) || (a[0] == a[2]) || (a[0] == a[3]) || (a[1] == a[2]) || (a[1] == a[3]) || (a[2] == a[3])))\n l.Add(s);\n }\n\n int n = int.Parse(Console.ReadLine());\n\n for (int i = 0; i < n; i++)\n {\n var t = Console.ReadLine().Split(' ');\n string b = t[0];\n int x = int.Parse(t[1]);\n int y = int.Parse(t[2]);\n for (int k = 0;k < l.Count; k++)\n {\n if (!check(l[k], b, x, y))\n {\n l.Remove(l[k]);\n k--;\n }\n }\n }\n\n if (l.Count > 1)\n Console.WriteLine(\"Need more data\");\n if (l.Count == 0)\n Console.WriteLine(\"Incorrect data\");\n if (l.Count == 1)\n Console.WriteLine(l[0]);\n }\n\n static void Main(string[] args)\n {\n C();\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "b981736f3afbe99a11089150e7a13a58", "src_uid": "142e5f2f08724e53c234fc2379216b4c", "apr_id": "ba7a9153cf8e8a72bdbf0271013c5d90", "difficulty": 1700, "tags": ["brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.2930841121495327, "equal_cnt": 37, "replace_cnt": 15, "delete_cnt": 4, "insert_cnt": 18, "fix_ops_cnt": 37, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Text;\n\nnamespace InnaAndPony\n{\n class Program\n {\n\n static void Main(string[] args)\n {\n string[] nmihab = Console.ReadLine().Split(' ');\n int n = Convert.ToInt32(nmihab[0]);\n int m = Convert.ToInt32(nmihab[1]);\n int i = Convert.ToInt32(nmihab[2]);\n int j = Convert.ToInt32(nmihab[3]);\n int a = Convert.ToInt32(nmihab[4]);\n int b = Convert.ToInt32(nmihab[5]);\n\n if ((((Math.Abs(1 - i) / a) % 2 != (Math.Abs(1 - j) / b) % 2)) && (((Math.Abs(n - i) / a) % 2 != (Math.Abs(1 - j) / b) % 2)) && (((Math.Abs(n - i) / a) % 2 != (Math.Abs(m - j) / b) % 2)) && (((Math.Abs(1 - i) / a) % 2 != (Math.Abs(m - j) / b) % 2)))\n {\n Console.WriteLine(\"Poor Inna and pony!\");\n }\n else\n {\n if (Math.Abs(i - 1) % a == 0)\n k1 = Math.Abs(i - 1) / a;\n if ((Math.Abs(j - 1) % b == 0) && (Math.Abs(j - 1) / b > k1))\n k1 = Math.Abs(j - 1) / b;\n if (Math.Abs(i - n) % a == 0)\n k2 = Math.Abs(i - n) / a;\n if ((Math.Abs(j - 1) % b == 0) && (Math.Abs(j - 1) / b > k2))\n k2 = Math.Abs(j - 1) / b;\n if (Math.Abs(i - n) % a == 0)\n k3 = Math.Abs(i - n) / a;\n if ((Math.Abs(j - m) % b == 0) && (Math.Abs(j - m) / b > k3))\n k3 = Math.Abs(j - m) / b;\n if (Math.Abs(i - 1) % a == 0)\n k4 = Math.Abs(i - 1) / a;\n if ((Math.Abs(j - m) % b == 0) && (Math.Abs(j - m) / b > k4))\n k4 = Math.Abs(j - m) / b;\n int k = Math.Max(Math.Max(k1, k2), Math.Max(k3, k4));\n Console.WriteLine(k);\n }\n }\n }\n}", "lang": "MS C#", "bug_code_uid": "4626137cc1f3ae40ed2f810618d2de9b", "src_uid": "51155e9bfa90e0ff29d049cedc3e1862", "apr_id": "9e2e98e180f3ee15d934bfadc7f6b075", "difficulty": 2000, "tags": ["greedy", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.4723098995695839, "equal_cnt": 40, "replace_cnt": 21, "delete_cnt": 5, "insert_cnt": 14, "fix_ops_cnt": 40, "bug_source_code": "\n\n\n\nusing System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Text.RegularExpressions;\nnamespace ConsoleApplication1\n{\n class Program\n {\n public static void Main(string[] args)\n {\n string[] s = Console.ReadLine().Split(' ');\n int n,m,i,j,a,b;\n n = int.Parse(s[0]);\n m = int.Parse(s[1]);\n i = int.Parse(s[2]);\n j = int.Parse(s[3]);\n a = int.Parse(s[4]);\n b = int.Parse(s[5]);\n int[,] distances=new int[4,2];\n distances[0,0]=i-1;\n distances[0,1]=j-1;\n distances[1,0]=i-1;\n distances[1,1]=m-j;\n distances[2,0]=n-i;\n distances[2,1]=j-1;\n distances[3,0]=n-1;\n distances[3,1]=m-j;\n int[] results=new int[4];\n if ((i == 1 && b == 1) || (i == n && j == 1) || (i == n & j == m) || (i == 1 && j == m))\n {\n Console.WriteLine(0);\n return;\n }\n for (int k = 0; k < 4; k++)\n {\n if (distances[k, 0] % a == 0 && distances[k, 1] % b == 0 && distances[k, 0] / a == distances[k, 1] / b)\n {\n results[k] = distances[k, 0] / a;\n }\n else\n {\n results[k] = -1;\n }\n }\n int min = -1;\n for (int k = 0; k < 4; k++)\n {\n if (results[k] < min || min < 0)\n {\n min = results[k];\n }\n }\n if (min == -1)\n {\n Console.WriteLine(\"Poor Inna and pony!\");\n }\n else\n {\n Console.WriteLine(min);\n }\n }\n \n ", "lang": "MS C#", "bug_code_uid": "26136d7235a29adf9588e031cf8a1f80", "src_uid": "51155e9bfa90e0ff29d049cedc3e1862", "apr_id": "2557e61632e15dcb8ed16f5b24a2bd0d", "difficulty": 2000, "tags": ["greedy", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9370314842578711, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "using System; using System.Linq;\n\nclass P {\n static void Main() { \n var s = Console.ReadLine().Split(' ').Select(int.Parse).ToArray();\n var vp = int.Parse(Console.ReadLine()); \n var vd = int.Parse(Console.ReadLine()); \n var latency = double.Parse(Console.ReadLine()); \n var f = int.Parse(Console.ReadLine()); \n var c = int.Parse(Console.ReadLine()); \n\n if (vp >= vd) { Console.Write(0); return; }\n var dv = 1.0*vd - vp;\n\n var advantage = 0.0000000001;\n var drugs = 0;\n while (advantage < c) {\n var t = advantage / dv;\n if (advantage + t*vp >= c) break;\n\n t = 2*t + f;\n drugs++;\n advantage += t * vp;\n }\n Console.Write(drugs);\n }\n}", "lang": "MS C#", "bug_code_uid": "980042942d97c0f2844a57b2183c288f", "src_uid": "c9c03666278acec35f0e273691fe0fff", "apr_id": "5093fa93469d9389197186ed39b8db76", "difficulty": 1500, "tags": ["math", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C#"} {"similarity_score": 0.2921840759678597, "equal_cnt": 12, "replace_cnt": 6, "delete_cnt": 1, "insert_cnt": 6, "fix_ops_cnt": 13, "bug_source_code": "int m = c * p;\n int n = m / (d - p);\n int di = n * d;\n if(di data = new List();\n data.Add(b);\n while (a < b)\n {\n if ((temp = b % 10) == 1)\n b = (b -= 1) / 10;\n else if (temp % 2 == 0)\n b /= 2;\n else break; \n data.Add(b);\n }\n if (a!=b) Console.WriteLine(\"NO\");\n else\n {\n Console.WriteLine(\"YES\\n{0}\", data.Count);\n for (int i = data.Count - 1; i > 0; --i)\n Console.Write(\"{0} \", data[i]);\n Console.WriteLine(data[0]);\n }\n }\n }\n }", "lang": "MS C#", "bug_code_uid": "e67a77d56988d3a7665b0ff96a3a0016", "src_uid": "fc3adb1a9a7f1122b567b4d8afd7b3f3", "apr_id": "bb0b194dc39b2172cd34f3ccc83ee24b", "difficulty": 1000, "tags": ["brute force", "math", "dfs and similar"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.7716535433070866, "equal_cnt": 25, "replace_cnt": 19, "delete_cnt": 2, "insert_cnt": 3, "fix_ops_cnt": 24, "bug_source_code": "using System;\nusing System.Linq;\n\nnamespace TaskA\n{\n class Program\n {\n private static readonly int[] stack = new int[50];\n private static int a;\n private static int b;\n\n private static int AtoB(int step)\n {\n if (a > b) return 0;\n stack[step] = a;\n if (a == b) return step;\n var temp = a;\n a = a * 10 + 1;\n var result = AtoB(step + 1);\n if (result > 0) return result;\n a = temp * 2;\n result = AtoB(step + 1);\n if (result > 0) return result;\n return 0;\n }\n\n static void Main()\n {\n var ab = Console.ReadLine().Split(' ').ToArray();\n a = int.Parse(ab[0]);\n b = int.Parse(ab[1]);\n var result = AtoB(0);\n if (result>0)\n {\n Console.WriteLine(\"YES\");\n Console.WriteLine(result+1);\n for(var i=0;i<=result;i++)\n Console.Write(\"{0} \", stack[i]);\n }\n else Console.WriteLine(\"NO\");\n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "27a03e5c5d0d67a3b6b8fb6fb98850e3", "src_uid": "fc3adb1a9a7f1122b567b4d8afd7b3f3", "apr_id": "e8da65b4da0ec27ac860004429aa586b", "difficulty": 1000, "tags": ["brute force", "math", "dfs and similar"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9607182940516273, "equal_cnt": 10, "replace_cnt": 2, "delete_cnt": 1, "insert_cnt": 7, "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 Olmp1\n{\n class Program\n {\n static void Main(string[] args)\n {\n //x * 2 | x + '1'\n int from, to;\n string[] split = null;\n do\n {\n split = Console.ReadLine().Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries);\n } while ((split.Length < 2) || !int.TryParse(split[0], out from) || !int.TryParse(split[1], out to));\n List step = new List();\n List steps = new List();\n step.Add(to);\n while (to != from)\n {\n if (to.ToString().Last() == '1')\n {\n to = Convert.ToInt32(to.ToString().Remove(to.ToString().Length - 1));\n step.Add(to);\n }\n else if (Math.IEEERemainder((double)to, 2) == 0)\n {\n to = to / 2;\n step.Add(to);\n }\n else\n {\n Console.WriteLine(\"NO\");\n break;\n }\n }\n if (to == from)\n {\n Console.WriteLine(\"YES\");\n Console.WriteLine(step.Count);\n for (int i = step.Count-1; i >=0; i--)\n {\n if (i != 0)\n {\n Console.Write(step[i] + \" \");\n }\n else\n {\n Console.Write(step[i]);\n }\n }\n }\n // Console.ReadKey();\n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "d5fc133618466eefef25adc159a6a7d1", "src_uid": "fc3adb1a9a7f1122b567b4d8afd7b3f3", "apr_id": "9867a2382751e218f88ea3189705dcab", "difficulty": 1000, "tags": ["brute force", "math", "dfs and similar"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.879783881134624, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 2, "insert_cnt": 0, "fix_ops_cnt": 3, "bug_source_code": "using Common;\nusing System;\nusing System.IO;\nusing System.Linq;\n\nnamespace Codeforces.R342.C\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 answer)\n {\n tw.WriteLine(answer);\n }\n\n private static long Parse(TextReader tr)\n {\n var a = tr.ReadLine().Split().Select(x => long.Parse(x)).ToArray();\n return Calc(a[0], a[1]);\n }\n\n private static long Calc(long r, long h)\n {\n var n = h / r * 2;\n\n var s = h % r;\n\n if (s * 2 < r)\n ++n;\n else if (s * 2 >= r)\n n += 2;\n else if (s * 2 * 2 * s >= r * r * 3)\n n += 3;\n\n return n;\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "da0011ce2465205959491e15da555e7e", "src_uid": "ae883bf16842c181ea4bd123dee12ef9", "apr_id": "1beaea6fc0e288e6e64676c65167216a", "difficulty": 1900, "tags": ["geometry"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C#"} {"similarity_score": 0.999244142101285, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "using System;\n\nclass P {\n static void Main() {\n int n = 8;\n var rows = Console.In.ReadToEnd().Split('\\n');\n var count = 0;\n for (int i = 0; i < n; i++) {\n var cnt = n;\n for (int j = 0; j < n; j++) {\n if (rows[i][j] == 'B') { cnt--; }\n }\n if (cnt == 0) { count++; }\n }\n\n for (int i = 0; i < n; i++) {\n var cnt = n;\n for (int j = 0; j < n; j++) {\n if (rows[j][i] == 'B') { cnt--; }\n }\n if (cnt == 0) { count++; }\n }\n if (count == 16) count == 8;\n Console.WriteLine(count);\n }\n}", "lang": "MS C#", "bug_code_uid": "a8ff3e6f9f7d01a9be41337e2e02626e", "src_uid": "8b6ae2190413b23f47e2958a7d4e7bc0", "apr_id": "9bf4b87e67072b7ccb028aa2eacfbdf0", "difficulty": 1100, "tags": ["brute force", "constructive algorithms"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C#"} {"similarity_score": 0.5699745547073791, "equal_cnt": 20, "replace_cnt": 15, "delete_cnt": 3, "insert_cnt": 2, "fix_ops_cnt": 20, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace diee_role\n{\n class Program\n {\n static void Main(string[] args)\n {\n double y = double.Parse(Console.ReadLine()); double w = double.Parse(Console.ReadLine());\n double sum ;\n try\n {\n\n sum = w / y;\n\n }\n catch(Exception ex)\n {\n Console.WriteLine(ex.Message);\n }\n finally\n {\n Console.WriteLine(\"{0} / {1}\",w,y);\n }\n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "5d7548338e2db60c78f5250c73028c81", "src_uid": "f97eb4ecffb6cbc8679f0c621fd59414", "apr_id": "c5063182cd38085633829795fb6aab42", "difficulty": 800, "tags": ["probabilities", "math"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9971311475409836, "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.Diagnostics.CodeAnalysis;\nusing System.Linq;\nusing System.Runtime.CompilerServices;\nusing System.Runtime.Remoting;\nusing System.Text;\nusing System.Xml.Schema;\n\nnamespace Contest\n{\n class Scanner\n {\n private string[] line = new string[0];\n private int index = 0;\n\n public string Next()\n {\n if (line.Length <= index)\n {\n line = Console.ReadLine().Split(' ');\n index = 0;\n }\n\n var res = line[index];\n index++;\n return res;\n }\n\n public int NextInt()\n {\n return int.Parse(Next());\n }\n\n public long NextLong()\n {\n return long.Parse(Next());\n }\n\n public ulong NextUlong()\n {\n return ulong.Parse(Next());\n }\n\n public string[] Array()\n {\n line = Console.ReadLine().Split(' ');\n index = line.Length;\n return line;\n }\n\n public int[] IntArray()\n {\n var array = Array();\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\n public long[] LongArray()\n {\n var array = Array();\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 }\n\n class Program\n {\n private long B;\n private void Scan()\n {\n var sc = new Scanner();\n B = sc.NextLong();\n }\n\n public void Solve()\n {\n Scan();\n long ans = 1;\n for (int i = 2; i * i <= B; i++)\n {\n if (B % i == 0)\n {\n int cnt = 0;\n while (B % i == 0)\n {\n cnt++;\n B /= i;\n }\n\n ans *= (cnt + 1);\n }\n }\n\n if (B != 1)\n {\n ans *= 2;\n }\n\n Console.WriteLine(ans);\n }\n static void Main() => new Program().Solve();\n }\n}", "lang": "Mono C#", "bug_code_uid": "b679457da9f51dece948c94a2d169a27", "src_uid": "7fc9e7d7e25ab97d8ebc10ed8ae38fd1", "apr_id": "25a03480cdd00383571cd7bf8f19ebf0", "difficulty": 1200, "tags": ["math", "number theory"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.3520958083832335, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "using System;\nusing System.Collections.Generic;\nclass Program\n{\n\tstatic void Main(string[] args)\n\t{\n\t\tlong N = long.Parse(Console.ReadLine());\n\t\tList list = new List();\n\t\tlist = enum_div(N);\n\t\tConsole.WriteLine(list.Count);\n\t}\n\n\tpublic static List enum_div(long n){\n\t\tlong tmp = n;\n\t\tvar list = new List();\n\t\tfor(var i=1;i*i<=n;i++){\n\t\t\tif(n%i==0){\n\t\t\t\tlist.Add(i);\n\t\t\t\tif(i*i!=n){\n\t\t\t\t\tlist.Add(n-i);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn list;\n\t}\n}", "lang": "Mono C#", "bug_code_uid": "b8b769fdc0b003eaeb232dd4de302248", "src_uid": "7fc9e7d7e25ab97d8ebc10ed8ae38fd1", "apr_id": "14bcd0c0d62d8c60e4e1c0fce1824721", "difficulty": 1200, "tags": ["math", "number theory"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9906542056074766, "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;\nclass Program\n{\n\tstatic void Main(string[] args)\n\t{\n\t\tlong N = long.Parse(Console.ReadLine());\n\t\tlong ans = 0;\n\t\tlong N2 = (long)Math.Pow(N,0.6)+1;\n\t\tfor(var i=1;i<=N2;i++){\n\t\t\tif(N%i==0){\n\t\t\t if(i*i<=N){\n \t\t\t ans += 1;\n\t \t\t\tif(i*i!=N){\n\t\t \t\t\tans += 1;\n\t\t\t \t}\n\t\t\t }\n\t\t\t}\n\t\t}\n\t\tConsole.WriteLine(ans);\n\t}\n}", "lang": "Mono C#", "bug_code_uid": "5b377e28f51d8e9dfe7259a7406e76ca", "src_uid": "7fc9e7d7e25ab97d8ebc10ed8ae38fd1", "apr_id": "14bcd0c0d62d8c60e4e1c0fce1824721", "difficulty": 1200, "tags": ["math", "number theory"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.5435267857142857, "equal_cnt": 17, "replace_cnt": 11, "delete_cnt": 0, "insert_cnt": 6, "fix_ops_cnt": 17, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\nusing System.Xml;\nusing System.Text.RegularExpressions;\n\n\nnamespace ProjectEuler\n{\n class Program\n {\n static void Main(string[] args)\n {\n int n = Convert.ToInt32(Console.ReadLine());\n\n int counter = 2;\n for (int i = 2; i <= n/2 ; i++)\n {\n if (n%i == 0)\n {\n \n counter++;\n }\n }\n \n \n Console.WriteLine(counter);\n }\n }\n}", "lang": "Mono C#", "bug_code_uid": "c334ed917e0b2f2af5d62f1b451975b6", "src_uid": "7fc9e7d7e25ab97d8ebc10ed8ae38fd1", "apr_id": "ea1e2ff80c2ddef0453bb6f3353c6bc8", "difficulty": 1200, "tags": ["math", "number theory"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.942652329749104, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "using System;\n\nclass _1068B\n{\n\tstatic void Main()\n\t{\n\t\tlong b = long.Parse(Console.ReadLine());\n\t\tint sqrt = (int)Math.Sqrt(b);\n\t\tint cnt = 0;\n\t\tfor (int i = 1; i <= sqrt; ++i)\n\t\t{\n\t\t\tcnt += (b % i == 0) ? 2 : 0;\n\t\t}\n\t\tConsole.WriteLine(cnt - ((sqrt * sqrt == b) ? 1 : 0));\n\t}\n}", "lang": "Mono C#", "bug_code_uid": "4e0c85c50c2917b1ce238a8ddbc2c8da", "src_uid": "7fc9e7d7e25ab97d8ebc10ed8ae38fd1", "apr_id": "291dea5859d6ada14b4155efe9cfc61a", "difficulty": 1200, "tags": ["math", "number theory"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9036187746327481, "equal_cnt": 9, "replace_cnt": 4, "delete_cnt": 3, "insert_cnt": 2, "fix_ops_cnt": 9, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace B\n{\n class Program\n {\n static void Main(string[] args)\n {\n long b = Int64.Parse(Console.ReadLine());\n\n Console.WriteLine(DivNum(b));\n }\n static long NOK(long a, long b)\n {\n return a * b / (NOD(a, b));\n }\n static long NOD(long a, long b)\n {\n long min, max;\n\n if (a > b)\n {\n min = b;\n max = a;\n }\n else if (a < b)\n {\n min = a;\n max = b;\n }\n else\n {\n return a;\n }\n\n while (min != max)\n {\n max = max - min;\n if (max < min)\n {\n long t = max;\n max = min;\n min = t;\n }\n }\n\n return min;\n }\n static long DivNum(long b)\n {\n var count = 1; //Сразу учитываем само число как делитель\n\n for (int i = 1; i < b/2 + 1; i++)\n {\n if ((b % i) == 0)\n count++;\n }\n\n return count;\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "cdbb1281406c8fcaa356e1f7a4f3de28", "src_uid": "7fc9e7d7e25ab97d8ebc10ed8ae38fd1", "apr_id": "766424cbaf0044e8b2f52c9c80749d72", "difficulty": 1200, "tags": ["math", "number theory"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9872457773181661, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 2, "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 B\n{\n class Program\n {\n static void Main(string[] args)\n {\n long b = Int64.Parse(Console.ReadLine());\n\n Console.WriteLine(DivNum(b));\n }\n static long NOK(long a, long b)\n {\n return a * b / (NOD(a, b));\n }\n static long NOD(long a, long b)\n {\n long min, max;\n\n if (a > b)\n {\n min = b;\n max = a;\n }\n else if (a < b)\n {\n min = a;\n max = b;\n }\n else\n {\n return a;\n }\n\n while (min != max)\n {\n max = max - min;\n if (max < min)\n {\n long t = max;\n max = min;\n min = t;\n }\n }\n\n return min;\n }\n static long DivNum(long b)\n {\n int count = 0;\n\n if (b == 1)\n return 1;\n\n for (int i = 1; i < Math.Sqrt(b); i++)\n {\n if ((b % i) == 0)\n count += 2;\n }\n if ((Math.Sqrt(b) % 2 == 0) && (b % Math.Sqrt(b) == 0))\n count++;\n\n return count;\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "97a24d42dc1d3c1694319fb05f8b2658", "src_uid": "7fc9e7d7e25ab97d8ebc10ed8ae38fd1", "apr_id": "766424cbaf0044e8b2f52c9c80749d72", "difficulty": 1200, "tags": ["math", "number theory"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "C#"} {"similarity_score": 0.959937156323645, "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.Text;\nusing System.Threading.Tasks;\n\nnamespace B\n{\n\tclass Program\n\t{\n\t\tstatic void Main(string[] args)\n\t\t{\n\t\t\tlong b = Int64.Parse(Console.ReadLine());\n\t\t\tlong sqrt = (long)Math.Sqrt(b) + 1;\n\t\t\tlong[] divs = new long[sqrt]; int c = 0;\n\t\t\tfor (int i = 2; i <= sqrt; i++)\n\t\t\t{\n\t\t\t\tif (b % i == 0)\n\t\t\t\t{\n\t\t\t\t\twhile(b % i == 0)\n\t\t\t\t\t{\n\t\t\t\t\t\tdivs[c]++;\n\t\t\t\t\t\tb = b / i;\n\t\t\t\t\t}\n\t\t\t\t\tc++;\n\t\t\t\t}\n\t\t\t}\n\t\t\tlong answer = 1;\n\t\t\tfor (int i = 0; i < c; i++)\n\t\t\t{\n\t\t\t\tanswer = answer * (divs[i] + 1);\n\t\t\t}\n\t\t\tConsole.WriteLine(answer);\n\t\t}\n\t}\n}\n", "lang": "Mono C#", "bug_code_uid": "ddceba369b218f73102ac0cbbbc8c195", "src_uid": "7fc9e7d7e25ab97d8ebc10ed8ae38fd1", "apr_id": "7045ea93a5bd69ac167c0fa3b6ae6862", "difficulty": 1200, "tags": ["math", "number theory"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.9936801166747691, "equal_cnt": 4, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\nusing System.IO;\n\nnamespace ConsoleApp2\n{\n class Program\n {\n \n static void Main(string[] args)\n {\n long n = long.Parse(Console.ReadLine());\n Dictionary SimpleDividers = new Dictionary();\n long m = n;\n for(int i = 2; i*i < n; i++)\n {\n if(n % i == 0)\n {\n SimpleDividers[i] = 0;\n while(n % i == 0)\n {\n SimpleDividers[i]++;\n n /= i;\n }\n }\n }\n if(n != 1)\n SimpleDividers[n] = 1;\n long result = 1;\n foreach(long dividers in SimpleDividers.Keys)\n {\n result *= (SimpleDividers[dividers] + 1);\n }\n Console.WriteLine(result);\n }\n }\n}", "lang": "Mono C#", "bug_code_uid": "f89238db2b2bac59ee3da439f70f5060", "src_uid": "7fc9e7d7e25ab97d8ebc10ed8ae38fd1", "apr_id": "c2f08c160bc7b8b22f436ac0d59478eb", "difficulty": 1200, "tags": ["math", "number theory"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9956246961594555, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 0, "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;\nusing System.IO;\n\nnamespace ConsoleApp2\n{\n class Program\n {\n \n static void Main(string[] args)\n {\n long n = long.Parse(Console.ReadLine());\n Dictionary SimpleDividers = new Dictionary();\n long m = n;\n for(int i = 2; i*i < m; i++)\n {\n if(n % i == 0)\n {\n SimpleDividers[i] = 0;\n while(n % i == 0)\n {\n SimpleDividers[i]++;\n n /= i;\n }\n }\n }\n if(n != 1)\n SimpleDividers[n] = 1;\n long result = 1;\n foreach(long dividers in SimpleDividers.Keys)\n {\n result *= (SimpleDividers[dividers] + 1);\n }\n Console.WriteLine(result);\n }\n }\n}", "lang": "Mono C#", "bug_code_uid": "ea872d0afa7822b8b14a89a97ae71524", "src_uid": "7fc9e7d7e25ab97d8ebc10ed8ae38fd1", "apr_id": "c2f08c160bc7b8b22f436ac0d59478eb", "difficulty": 1200, "tags": ["math", "number theory"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.5477888730385164, "equal_cnt": 12, "replace_cnt": 7, "delete_cnt": 1, "insert_cnt": 3, "fix_ops_cnt": 11, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\n\nnamespace ConsoleApplication2\n{\n class Program\n {\n static void Main(string[] args)\n {\n long b = long.Parse(Console.ReadLine());\n Queue step = new Queue();\n for (int i=2;i<=Math.Sqrt(b);i++)\n {\n int x=0;\n while (b%i==0)\n {\n b/=i;\n x++;\n }\n if (x>0) step.Enqueue(x);\n }\n int z = 1;\n while (step.Count > 0)\n z *= (step.Dequeue() + 1);\n if (b == 2) Console.WriteLine(2);\n else Console.WriteLine(z);\n }\n }\n}", "lang": "Mono C#", "bug_code_uid": "10444d10679e206256b48a3f675da371", "src_uid": "7fc9e7d7e25ab97d8ebc10ed8ae38fd1", "apr_id": "9aef6355dd021585580b7547384edc71", "difficulty": 1200, "tags": ["math", "number theory"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.5494830132939439, "equal_cnt": 12, "replace_cnt": 8, "delete_cnt": 2, "insert_cnt": 2, "fix_ops_cnt": 12, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\n\nnamespace ConsoleApplication2\n{\n class Program\n {\n static void Main(string[] args)\n {\n long b = long.Parse(Console.ReadLine());\n Queue step = new Queue();\n for (int i=2;i<=b;i++)\n {\n int x=0;\n while (b%i==0)\n {\n b/=i;\n x++;\n }\n if (x>0) step.Enqueue(x);\n }\n int z = 1;\n while (step.Count > 0)\n z *= (step.Dequeue() + 1);\n \n Console.WriteLine(z);\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "26f8d71c0e1990281a779396b501309b", "src_uid": "7fc9e7d7e25ab97d8ebc10ed8ae38fd1", "apr_id": "9aef6355dd021585580b7547384edc71", "difficulty": 1200, "tags": ["math", "number theory"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9936665912689436, "equal_cnt": 5, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 4, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Globalization;\nusing System.IO;\nusing System.Linq;\nusing System.Text;\nusing System.Threading;\n\npublic class Solver\n{\n private const int SIEVE_SIZE = 100000;\n private readonly bool[] isComposite = new bool[SIEVE_SIZE + 1];\n private readonly IList primes = new List();\n void Sieve()\n {\n for (int i = 2; i * i <= SIEVE_SIZE; i++)\n if (!isComposite[i])\n for (int j = i * i; j <= SIEVE_SIZE; j += i)\n isComposite[j] = true;\n for (int i = 2; i <= SIEVE_SIZE; i++)\n if (!isComposite[i])\n primes.Add(i);\n }\n\n public void Solve()\n {\n long b = ReadLong();\n\n Sieve();\n int ans = 1;\n foreach (int p in primes)\n {\n while (b % p == 0)\n {\n ans++;\n b /= p;\n }\n }\n if (b > 1)\n ans++;\n Write(ans);\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 new Solver().Solve();\n //var thread = new Thread(new Solver().Solve, 1024 * 1024 * 128);\n //thread.Start();\n //thread.Join();\n }\n catch (Exception ex)\n {\n#if DEBUG\n Console.WriteLine(ex);\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": "Mono C#", "bug_code_uid": "c6795a04fdd9a7cde562e2f6a4f37c57", "src_uid": "7fc9e7d7e25ab97d8ebc10ed8ae38fd1", "apr_id": "2dade0893e65b69d0af8685b719adbd5", "difficulty": 1200, "tags": ["math", "number theory"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.6887009992313605, "equal_cnt": 13, "replace_cnt": 7, "delete_cnt": 1, "insert_cnt": 4, "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 ConsoleApp75\n{\n class Program\n {\n static void Main(string[] args)\n {\n long b = int.Parse(Console.ReadLine()), a = 1, kol = 0;\n for(int i = 1; i <= b; i++)\n {\n a = i;\n if (a % i == 0 && b % i == 0)\n kol++;\n }\n Console.WriteLine(kol);\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "29d119bb1412798123f5d24cef76438a", "src_uid": "7fc9e7d7e25ab97d8ebc10ed8ae38fd1", "apr_id": "9c5ab74edc1d7f17c9719b1e5aa54e61", "difficulty": 1200, "tags": ["math", "number theory"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.8390052356020943, "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 ConsoleApp75\n{\n class Program\n {\n static void Main(string[] args)\n {\n long b = long.Parse(Console.ReadLine()), a = 1, kol = 0;\n if (b < 1000)\n {\n for (a = 1; a <= b; a++)\n {\n if (b % a == 0)\n kol++;\n }\n }\n else\n {\n for (a = 1; a <= b; a+=b-1)\n {\n if (b % a == 0)\n kol++;\n }\n }\n Console.WriteLine(kol);\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "6a0fdd58f4b895934a664a34737931e8", "src_uid": "7fc9e7d7e25ab97d8ebc10ed8ae38fd1", "apr_id": "9c5ab74edc1d7f17c9719b1e5aa54e61", "difficulty": 1200, "tags": ["math", "number theory"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.8566680515164105, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Xml.Xsl;\n\nnamespace Codeforces\n{\n\tclass Program\n\t{\n\t\tstatic void Main(string[] args)\n\t\t{\n\t\t\tstring input1 = Console.ReadLine();\n\t\t\t//string input2 = Console.ReadLine();\n\n\t\t\t//string input3 = Console.ReadLine();\n\t\t\t//string input4 = Console.ReadLine();\n\n\t\t\t//var inputs1 = input1.Split(new[] { ' ', '}', '{' , ',' }, StringSplitOptions.RemoveEmptyEntries).Select(long.Parse).ToArray();\n\t\t\t//var inputs2 = input2.Split(new[] { ' ', '}', '{', ',' }, StringSplitOptions.RemoveEmptyEntries).Select(long.Parse).ToArray();\n\t\t\t//var inputs3 = input3.Split(new[] { ' ', '}', '{', ',' }, StringSplitOptions.RemoveEmptyEntries).Select(long.Parse).ToArray();\n\t\t\t//var inputs4 = input4.Split(new[] { ' ', '}', '{', ',' }, StringSplitOptions.RemoveEmptyEntries).Select(long.Parse).ToArray();\n\n\t\t\tlong b = long.Parse(input1);\n\n\t\t\tConsole.WriteLine(b);\n\t\t}\n\n\t\tstatic long Factorial(long a) \n\t\t{\n\t\t\treturn a > 1 ? a * Factorial(a - 1) : 1;\n\t\t}\n\t}\n}\n", "lang": "Mono C#", "bug_code_uid": "6dcf535e0d9ff78a8e3b207b42a9839a", "src_uid": "7fc9e7d7e25ab97d8ebc10ed8ae38fd1", "apr_id": "d1d93fa5d4a8b46448695e4f154b9d58", "difficulty": 1200, "tags": ["math", "number theory"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9807264640474426, "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.Text;\nusing System.Xml.Xsl;\n\nnamespace Codeforces\n{\n\tclass Program\n\t{\n\t\tstatic void Main(string[] args)\n\t\t{\n\t\t\tstring input1 = Console.ReadLine();\n\t\t\t//string input2 = Console.ReadLine();\n\n\t\t\t//string input3 = Console.ReadLine();\n\t\t\t//string input4 = Console.ReadLine();\n\n\t\t\t//var inputs1 = input1.Split(new[] { ' ', '}', '{' , ',' }, StringSplitOptions.RemoveEmptyEntries).Select(long.Parse).ToArray();\n\t\t\t//var inputs2 = input2.Split(new[] { ' ', '}', '{', ',' }, StringSplitOptions.RemoveEmptyEntries).Select(long.Parse).ToArray();\n\t\t\t//var inputs3 = input3.Split(new[] { ' ', '}', '{', ',' }, StringSplitOptions.RemoveEmptyEntries).Select(long.Parse).ToArray();\n\t\t\t//var inputs4 = input4.Split(new[] { ' ', '}', '{', ',' }, StringSplitOptions.RemoveEmptyEntries).Select(long.Parse).ToArray();\n\n\t\t\tlong b = long.Parse(input1);\n\n\t\t\tlong border = b / 2;\n\t\t\tlong count = 1;\n\t\t\tfor (long i = 2; i <= border; i++) \n\t\t\t{\n\t\t\t\tif (b % i > 0) \n\t\t\t\t{\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tif (i == b / i) \n\t\t\t\t{\n\t\t\t\t\tcount++;\n\t\t\t\t} \n\t\t\t\telse \n\t\t\t\t{\n\t\t\t\t\tcount += 2;\n\t\t\t\t}\n\t\t\t\tborder = b / i;\n\t\t\t}\n\n\t\t\tif (b > 1) \n\t\t\t{\n\t\t\t\tcount++;\n\t\t\t}\n\n\t\t\tConsole.WriteLine(count);\n\t\t}\n\n\t\tstatic long Factorial(long a) \n\t\t{\n\t\t\treturn a > 1 ? a * Factorial(a - 1) : 1;\n\t\t}\n\t}\n}\n", "lang": "Mono C#", "bug_code_uid": "ccc2467219e01bfd2dbdb29f8116b794", "src_uid": "7fc9e7d7e25ab97d8ebc10ed8ae38fd1", "apr_id": "d1d93fa5d4a8b46448695e4f154b9d58", "difficulty": 1200, "tags": ["math", "number theory"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.9171178675551853, "equal_cnt": 9, "replace_cnt": 4, "delete_cnt": 3, "insert_cnt": 2, "fix_ops_cnt": 9, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.IO;\n\nnamespace Codeforce\n{\n\n class Printer\n {\n StringBuilder sb;\n\n public Printer()\n {\n sb = new StringBuilder();\n }\n\n public void WriteLine(string s)\n {\n sb.AppendLine(s);\n }\n\n public void Write(string s)\n {\n sb.Append(s);\n }\n\n public void Print()\n {\n Console.Write(sb);\n }\n }\n\n class Program\n {\n static StreamReader input = new StreamReader(Console.OpenStandardInput());\n //static StreamWriter output = new StreamWriter(Console.OpenStandardOutput());\n\n static int nextInt()\n {\n int t = input.Read();\n while ((t < '0' || t > '9' || t < 'A' || t > 'Z') && t != '-') t = input.Read();\n if (t >= 'A' && t <= 'Z')\n return t;\n int sign = 1;\n if (t == '-')\n {\n sign = -1;\n t = input.Read();\n }\n int x = 0;\n while (t >= '0' && t <= '9')\n {\n x *= 10;\n x += t - '0';\n t = input.Read();\n }\n return x * sign;\n }\n \n static int[] parseInt(string s)\n {\n string[] temp = s.Split(' ');\n int[] res = new int[temp.Length];\n for (int i = 0; i < temp.Length; i++)\n {\n res[i] = Convert.ToInt32(temp[i]);\n }\n return res;\n }\n \n\n static void Main(string[] args)\n {\n Printer printer = new Printer();\n\n int n = Convert.ToInt32(Console.ReadLine());\n\n List res = new List();\n\n Queue Q = new Queue();\n\n Q.Enqueue(\"1\");\n\n while (Q.Count > 0)\n {\n string tmp = Q.Dequeue();\n res.Add(Convert.ToInt32(tmp));\n\n string tmp1 = tmp + \"1\", tmp2 = tmp + \"0\";\n\n if (Convert.ToInt32(tmp1) <= n)\n Q.Enqueue(tmp1);\n if (Convert.ToInt32(tmp2) <= n)\n Q.Enqueue(tmp2);\n }\n\n Console.WriteLine(res.Count);\n\n printer.Print();\n\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "5d90ebc7c067ab6a4067914f2422265c", "src_uid": "64a842f9a41f85a83b7d65bfbe21b6cb", "apr_id": "1642db88729d8528adb51801d8117397", "difficulty": 1200, "tags": ["math", "brute force", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.4605873261205564, "equal_cnt": 15, "replace_cnt": 9, "delete_cnt": 1, "insert_cnt": 5, "fix_ops_cnt": 15, "bug_source_code": "using System;\n\nclass X{\npublic static void Main(String[] args){\nint n = Int32.Parse(System.Console.ReadLine());\nint result = 0;\nfor(int i = 1;i <= n; i++){\nif(i.ToString().IndexOfAny(\"23456789\".ToCharArray())== -1){\nresult = result + 1;\n}\n}\nSystem.Console.WriteLine(result);\n}\n}", "lang": "Mono C#", "bug_code_uid": "dd0a5303c214c9caa0e36e1b57f28f24", "src_uid": "64a842f9a41f85a83b7d65bfbe21b6cb", "apr_id": "34e8b7efdb11ded27ad64e92825e57c5", "difficulty": 1200, "tags": ["math", "brute force", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9209352324643912, "equal_cnt": 33, "replace_cnt": 15, "delete_cnt": 1, "insert_cnt": 16, "fix_ops_cnt": 32, "bug_source_code": "//\n\nusing System;\nusing System.Collections.Generic;\nusing System.Text;\nusing System.IO;\nusing System.Threading;\nusing System.Diagnostics;\nusing System.Globalization;\nusing System.Text.RegularExpressions;\nusing System.Linq;\n\nnamespace sar_cs\n{\n static class Helpers\n {\n // Mono lacks this override of string.Join()\n public static string Join(this IEnumerable objs, string sep)\n {\n var sb = new StringBuilder();\n foreach (var s in objs) { if (sb.Length != 0) sb.Append(sep); sb.Append(s); }\n return sb.ToString();\n }\n\n public static string AsString(this double a, int digits)\n {\n return a.ToString(\"F\" + digits, CultureInfo.InvariantCulture);\n }\n\n public static Stopwatch SW = Stopwatch.StartNew();\n }\n\n public class Program\n {\n #region Helpers\n\n public class Parser\n {\n const int BufSize = 8000;\n TextReader s;\n char[] buf = new char[BufSize];\n int bufPos;\n int bufDataSize;\n bool eos; // eos read to buffer\n int lastChar = -2;\n int nextChar = -2;\n StringBuilder sb = new StringBuilder();\n\n void FillBuf()\n {\n if (eos) return;\n bufDataSize = s.Read(buf, 0, BufSize);\n if (bufDataSize == 0) eos = true;\n bufPos = 0;\n }\n\n int Read()\n {\n if (nextChar != -2)\n {\n lastChar = nextChar;\n nextChar = -2;\n }\n else\n {\n if (bufPos == bufDataSize) FillBuf();\n if (eos) lastChar = -1;\n else lastChar = buf[bufPos++];\n }\n return lastChar;\n }\n\n void Back()\n {\n if (lastChar == -2) throw new Exception(); // no chars were ever read\n nextChar = lastChar;\n }\n\n public Parser()\n {\n s = Console.In;\n }\n\n public int ReadInt()\n {\n int res = 0;\n int sign = -1;\n int c;\n do { c = Read(); } while (c >= 0 && char.IsWhiteSpace((char)c));\n if (c == '-') { sign = 1; c = Read(); }\n int len = 0;\n while (c >= 0 && !char.IsWhiteSpace((char)c))\n {\n if ((uint)(c -= 48) >= 10) throw new FormatException();\n len++;\n res = checked(res * 10 - c);\n c = Read();\n }\n if (len == 0) throw new FormatException();\n Back();\n return checked(res * sign);\n }\n\n public long ReadLong()\n {\n long res = 0;\n int sign = -1;\n int c;\n do { c = Read(); } while (c >= 0 && char.IsWhiteSpace((char)c));\n if (c == '-')\n {\n sign = 1;\n c = Read();\n }\n int len = 0;\n\n while (c >= 0 && !char.IsWhiteSpace((char)c))\n {\n if ((uint)(c -= 48) >= 10) throw new FormatException();\n len++;\n res = checked(res * 10 - c);\n c = Read();\n }\n if (len == 0) throw new FormatException();\n Back();\n return checked(res * sign);\n }\n\n public int ReadLnInt()\n {\n int res = ReadInt(); ReadLine(); return res;\n }\n\n public long ReadLnLong()\n {\n long res = ReadLong(); ReadLine(); return res;\n }\n\n public double ReadDouble()\n {\n int c;\n do { c = Read(); } while (c >= 0 && char.IsWhiteSpace((char)c));\n\n int sign = 1;\n if (c == '-') { sign = -1; c = Read(); }\n\n sb.Length = 0;\n while (c >= 0 && !char.IsWhiteSpace((char)c))\n {\n sb.Append((char)c); c = Read();\n }\n\n Back();\n var res = double.Parse(sb.ToString(), CultureInfo.InvariantCulture);\n return res * sign;\n }\n\n public string ReadLine()\n {\n int c = Read();\n sb.Length = 0;\n while (c != -1 && c != 13 && c != 10)\n {\n sb.Append((char)c); c = Read();\n }\n if (c == 13) { c = Read(); if (c != 10) Back(); }\n return sb.ToString();\n }\n\n public bool SeekEOF\n {\n get\n {\n L0:\n int c = Read();\n if (c == -1) return true;\n if (char.IsWhiteSpace((char)c)) goto L0;\n Back();\n return false;\n }\n }\n\n public int[] ReadIntArr(int n)\n {\n var a = new int[n]; for (int i = 0; i < n; i++) a[i] = ReadInt(); return a;\n }\n\n public long[] ReadLongArr(int n)\n {\n var a = new long[n]; for (int i = 0; i < n; i++) a[i] = ReadLong(); return a;\n }\n }\n\n static void pe() { Console.WriteLine(\"???\"); Environment.Exit(0); }\n static void re() { Environment.Exit(55); }\n static void Swap(ref T a, ref T b) { T t = a; a = b; b = t; }\n static int Sqr(int a) { return a * a; }\n static long SqrL(int a) { return (long)a * a; }\n static long Sqr(long a) { return a * a; }\n static double Sqr(double a) { return a * a; }\n\n static StringBuilder sb = new StringBuilder();\n static Random rand = new Random(5);\n\n #endregion Helpers\n\n static int[] minQ;\n\n const int M = 1000000007;\n\n static int C(int n, int k)\n {\n return sar_cs_structs.Combinations.Count(n + k - 1, k) % M;\n }\n\n static long f(int n, int d)\n {\n checked\n {\n //if (d == 10) return n == 0 ? 1 : 0;\n if (n < minQ[d]) return 0;\n //if (n == 0) return 0;\n\n if (n == 0 || d > 9) throw new Exception();\n\n long result = 0;\n for (int i = minQ[d]; i <= n; i++)\n {\n long t1;\n\n if (i == 0)\n {\n if (d == 9) t1 = n == 0 ? 1 : 0;\n else t1 = f(n, d + 1);\n }\n else if (i == n)\n {\n if (minQ.Skip(d + 1).Any(q => q > 0)) t1 = 0;\n else if (d == 0 && i > 1) t1 = 0;\n else t1 = 1;\n }\n else\n {\n if (d == 9)\n t1 = 0;\n else\n {\n t1 = f(n - i, d + 1);\n long t2 = d == 0 ? C(n - i, i) : C(n - i + 1, i);\n //t2 /= sar_cs_structs.Permutations.Factorial(i);\n t1 *= t2;\n }\n }\n\n t1 %= M;\n result = (result + t1) % M;\n }\n\n return result;\n }\n }\n\n static void Main(string[] args)\n {\n checked\n {\n //Console.SetIn(File.OpenText(\"_input\"));\n var parser = new Parser();\n while (!parser.SeekEOF)\n {\n int n = parser.ReadInt();\n minQ = parser.ReadIntArr(10);\n\n //for (int i = 100; i <= 999; i++) if (i.ToString().Contains('0') && i.ToString().Contains('1')) Console.WriteLine(i);\n //Console.WriteLine(\"\");\n //Console.Write(f(3, 0));\n\n for (int d = 0; d <= 9; d++)\n {\n Console.Write(\"d=\" + d + \": \");\n for (int i = 1; i <= n; i++)\n Console.Write(f(i, d) + \" \");\n Console.WriteLine();\n }\n\n Console.WriteLine(f(n, 0));\n }\n }\n }\n\n //static void Main(string[] args)\n //{\n // new Thread(Main2, 50 << 20).Start();\n //}\n }\n}", "lang": "Mono C#", "bug_code_uid": "dc511661258fe1328fa0a7c81e04dada", "src_uid": "c1b5169a5c3b1bd4a2f1df1069ee7755", "apr_id": "2e92b68bac8605bf2c5e54ea95cc4b4c", "difficulty": 1900, "tags": ["dp", "math", "combinatorics"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.7903175102169129, "equal_cnt": 25, "replace_cnt": 12, "delete_cnt": 7, "insert_cnt": 6, "fix_ops_cnt": 25, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace Code\n{\n class Program\n {\n\n static void Method()\n {\n int n = Int32.Parse(Console.ReadLine());\n\n int a = n / 2;\n int b = n - a;\n\n if(b-a==1)\n {\n Console.WriteLine(\"{0} {1}\", a,b);\n }\n else\n {\n if(a%2==0)\n {\n a--;\n b++;\n Console.WriteLine(\"{} {}\", a,b);\n }\n else\n {\n a -= 2;\n b += 2;\n Console.WriteLine(\"{0} {1}\",a,b);\n }\n }\n }\n\n static void Main(string[] args)\n {\n Method();\n // String str = Console.ReadLine();\n // String[] n = str.Split();\n\n // Double nK = Double.Parse(n[0]);\n // Double k = Double.Parse(n[1]);\n // if(k==0&&k==nK)\n // {\n // Console.WriteLine(\"0 0\");\n // }\n // else\n // {\n // if (k < nK / 2)\n // Console.WriteLine(\"1 {0}\", k + 1);\n // else if (k == nK / 2)\n // Console.Write(\"1 {0}\", k);\n // else\n // {\n // double c = nK - k;\n // Console.WriteLine(\"1 {0}\", nK % k);\n\n // }\n // }\n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "3c728672794f4f3692e5244aa0ab670a", "src_uid": "0af3515ed98d9d01ce00546333e98e77", "apr_id": "c56545009af64ce7a82ed51a891d4a62", "difficulty": 800, "tags": ["brute force", "math", "constructive algorithms"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.919975565058033, "equal_cnt": 5, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 4, "bug_source_code": "using System;\n\nnamespace Vacations\n{\n class Program\n {\n\n static void Main(string[] args)\n {\n byte n = byte.Parse(Console.ReadLine());\n byte[] days = Array.ConvertAll(Console.ReadLine().Split(), byte.Parse);\n int min = minDay(days, 0, ' ');\n Console.WriteLine(min);\n }\n\n public static int minDay(byte[] days , byte cd,char y)\n {\n byte temp = Convert.ToByte(cd + 1);\n //recurrence bottom up\n if (cd == days.Length)\n {\n return 0;\n }\n if (cd == 0)\n {\n switch (days[cd]){\n case 0:\n {\n return 1 + minDay(days, temp, 'r');\n }\n case 1:\n {\n return 0+minDay(days, temp, 'c'); \n }\n case 2:\n {\n return 0+minDay(days, temp, 'g');\n }\n case 3:\n {\n\n return 0 + Math.Min(minDay(days, temp, 'g'), minDay(days, temp, 'c'));\n }\n default:\n {\n break;\n }\n }\n \n }\n else\n {\n if (y == 'r')\n {\n if (days[cd] == 0)\n {\n return 1 + minDay(days, temp, 'r');\n }\n if (days[cd]==1)\n {\n return 0+minDay(days, temp, 'c');\n }\n else if(days[cd] == 2)\n {\n return 0+minDay(days, temp, 'g');\n }\n else if (days[cd] == 3)\n {\n return 0 +Math.Min(minDay(days, temp, 'g'), minDay(days, temp, 'c'));\n }\n }\n else if (y == 'c')\n {\n if ((days[cd] == 2 || days[cd] == 3))\n {\n return 0+minDay(days, temp, 'g');\n }\n else if ((days[cd] == 0 || days[cd] == 1))\n {\n return 1 + minDay(days, temp, 'r');\n }\n \n }\n else if (y == 'g')\n {\n if ((days[cd] == 1 || days[cd] == 3))\n {\n return 0 + minDay(days, temp, 'c');\n }\n\n else if (days[cd] == 0 || days[cd] == 2)\n {\n return 1 + minDay(days, temp, 'r');\n }\n }\n }\n\n return 0;\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "486d466f21f8c10aa3bdfee2f35bec03", "src_uid": "08f1ba79ced688958695a7cfcfdda035", "apr_id": "7f2f729d89ee0f5226916cbd6a1c3bc6", "difficulty": 1400, "tags": ["dp", "brute force"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.9614112458654906, "equal_cnt": 1, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "class MainClass\n\t{\n\t\tpublic static void ProblemA() {\n\t\t\tstring[] source = Console.ReadLine().Split(' ');\n\t\t\tint n = int.Parse(source[0]), k = int.Parse(source[1]);\n\t\t\tsource = Console.ReadLine().Split(' ');\n\t\t\tint ans = k;\n\t\t\tfor(int i = 0; i < n; i++) {\n\t\t\t\tint a = int.Parse(source[i]);\n\t\t\t\tif(k % a == 0) ans = Math.Min(ans, k / a);\n\t\t\t}\n\t\t\tConsole.WriteLine(ans);\n\t\t}\n\t\tpublic static void Main(string[] args) {\n\t\t\tProblemA();\n\t\t}\n\t}", "lang": "Mono C#", "bug_code_uid": "74f321c9d0987577bf68f9211a8785fc", "src_uid": "80520be9916045aca3a7de7bc925af1f", "apr_id": "4519c61af27724cceb7ba8f3c3ee292f", "difficulty": 900, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.1546572934973638, "equal_cnt": 9, "replace_cnt": 9, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 9, "bug_source_code": "using System;\nclass Test {\n static void Main(){\n string str = Console.ReadLine();\n double n = Double.Parse(str);\n double s = 0;\n int i = 1;\n while(true){\n str = Convert.ToString(i);\n s = 0;\n double min = (i * i) + (1 * i);\n if(min > n){\n Console.WriteLine(-1);\n break;\n }\n for(int j = 0 ; j < str.Length ; j++){\n s += Double.Parse(str[j].ToString());\n }\n double ans = (i * i) + (s * i);\n if(ans == n){\n Console.WriteLine(i);\n break;\n }\n i++;\n }\n }\n}", "lang": "Mono C#", "bug_code_uid": "7fe662992d6d618ebf89aca4411be288", "src_uid": "e1070ad4383f27399d31b8d0e87def59", "apr_id": "5c94634c6d7f4edfac9da7a8b637e0d5", "difficulty": 1400, "tags": ["math", "brute force", "binary search"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.22404933196300103, "equal_cnt": 12, "replace_cnt": 6, "delete_cnt": 5, "insert_cnt": 1, "fix_ops_cnt": 12, "bug_source_code": "using System;\n\nnamespace Nekvadratnoe_yravnenie\n{\n class Program\n {\n static void Main()\n {\n ulong n = Convert.ToUInt64(System.Console.ReadLine());\n\n double granica = Math.Round(Math.Sqrt(n));\n ulong x = 1; \n\n while (x - granica < 1)\n {\n if (n % x == 0)\n {\n if (x * x + fun(x) * x == n)\n { \n System.Console.WriteLine(x);\n return;\n }\n }\n x++;\n }\n\n System.Console.WriteLine(-1);\n\n\n }\n static ulong fun(ulong x)\n {\n ulong sum = 0;\n while (x != 0)\n {\n sum += (x % 10);\n x /= 10;\n }\n return sum;\n }\n }\n}", "lang": "Mono C#", "bug_code_uid": "7d7c3bb56e1b9ef4ea7d2acf532e914a", "src_uid": "e1070ad4383f27399d31b8d0e87def59", "apr_id": "2065a4917738fe59a1aa03b6e4d55524", "difficulty": 1400, "tags": ["math", "brute force", "binary search"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.7953667953667953, "equal_cnt": 21, "replace_cnt": 6, "delete_cnt": 4, "insert_cnt": 11, "fix_ops_cnt": 21, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\n\nnamespace NonSquareEquation\n{\n class Program\n {\n static void Main(string[] args)\n {\n long n=Convert.ToInt64(Console.ReadLine());\n for (long i = 0; i < Int64.MaxValue; i++)\n {\n if(i*i+(s(i)*i)==n)\n {\n Console.WriteLine(i);\n return;\n }\n }\n Console.WriteLine(\"-1\");\n return;\n }\n\n public static int s(long x)\n {\n int temp=0;\n while (x > 0)\n {\n temp = temp + (int)(x % 10);\n x = x / 10;\n }\n return temp;\n }\n }\n}", "lang": "Mono C#", "bug_code_uid": "6e775696ca2167f18fc9ce737f68d5dd", "src_uid": "e1070ad4383f27399d31b8d0e87def59", "apr_id": "29da2577f48e6cbef9412fccdf6b1873", "difficulty": 1400, "tags": ["math", "brute force", "binary search"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.953053300388281, "equal_cnt": 11, "replace_cnt": 8, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 10, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.IO;\n\npublic class C1\n{\n public static void Main ( )\n {\n#if MYTRIAL\n Console.SetIn ( new StreamReader ( @\"e:\\zin.txt\" ) );\n#endif\n //solve ( );\n Console.WriteLine ( solve ( ) );\n }\n\n private static int solve ( )\n {\n int N = int.Parse ( Console.ReadLine ( ) );\n for ( int b = 0; b <= 90; b++ )\n {\n double D = GetDisc ( 1, b, -N );\n if ( D < 0 )\n continue;\n double sqrtd = Math.Sqrt ( D );\n double x1 = ( -b + sqrtd ) / 2.0;\n if ( x1 == Math.Floor ( x1 ) && x1 >= 0 )\n {\n if ( b == sumd ( ( int ) x1 ) )\n return ( int ) x1;\n }\n\n double x2 = ( -b - sqrtd ) / 2.0;\n if ( x2 == Math.Floor ( x2 ) && x2 >= 0 )\n {\n if ( b == sumd ( ( int ) x2 ) )\n return ( int ) x2;\n }\n }\n\n return -1;\n }\n\n static int sumd ( int x )\n {\n int sum=0;\n while ( x > 0 )\n {\n sum += x % 10;\n x = x / 10;\n }\n return sum;\n }\n\n static double GetDisc ( double a, double b, double c )\n {\n return b * b - 4 * a * c;\n }\n\n public static int[] ReadLineToInts ( int length )\n {\n string line = Console.ReadLine ( ).Trim ( );\n string[] arStrings = line.Split ( ' ' );\n\n int[] ints = new int[length];\n for ( int i=0; i < length; i++ )\n ints[i] = int.Parse ( arStrings[i] );\n return ints;\n }\n\n}", "lang": "Mono C#", "bug_code_uid": "346f2c7adaa0bc7ac6c74c4ec38493ff", "src_uid": "e1070ad4383f27399d31b8d0e87def59", "apr_id": "997f7f75e62558ad4340fc3697d4f376", "difficulty": 1400, "tags": ["math", "brute force", "binary search"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9987608426270136, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "using System;\n\nclass P {\n static void Main(){\n var map = new int[1000];\n map[(int)'>'] = 8;\n map[(int)'<'] = 9;\n map[(int)'+'] = 10;\n map[(int)'-'] = 11;\n map[(int)'.'] = 12;\n map[(int)','] = 13;\n map[(int)'['] = 14;\n map[(int)']'] = 15;\n\n var res = 0;\n foreach (var c in Console.ReadLine())\n res = (res * 16 + map[(int)c]) % 1000003);\n Console.Write(res);\n }\n}", "lang": "MS C#", "bug_code_uid": "9dab41666da3ebc22da6232a19df7354", "src_uid": "04fc8dfb856056f35d296402ad1b2da1", "apr_id": "5339966ec339269544da243bf680db1c", "difficulty": 1200, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C#"} {"similarity_score": 0.46715328467153283, "equal_cnt": 9, "replace_cnt": 4, "delete_cnt": 3, "insert_cnt": 2, "fix_ops_cnt": 9, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace CFTraining.B_s\n{\n class RandomTeams273\n {\n public static void Main(string[] args)\n {\n String[] line = Console.ReadLine().Split(' ');\n int n = Convert.ToInt32(line[0]), m = Convert.ToInt32(line[1]);\n long kmax = 0, kmin = 0;\n\n int minPlayerNum = n / m;\n int excess = n - (minPlayerNum * m);\n int[] teamDistribution = new int[m];\n for (int i = 0; i < m; i++)\n {\n teamDistribution[i] = minPlayerNum;\n if (excess-- > 0) teamDistribution[i]++;\n kmin += SequenceSum(teamDistribution[i]);\n }\n kmax = SequenceSum(n - (m - 1));\n Console.WriteLine(kmin + \" \" + kmax);\n }\n public static long SequenceSum(long n)\n {\n return (n * (n - 1)) / 2;\n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "7f9dcce202302af8e5556d53cea35e10", "src_uid": "a081d400a5ce22899b91df38ba98eecc", "apr_id": "841614e2b453c4bd9091436f8bc12dd3", "difficulty": 1300, "tags": ["math", "combinatorics", "greedy", "constructive algorithms"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.814993954050786, "equal_cnt": 8, "replace_cnt": 5, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 7, "bug_source_code": "public class Oleg\n{\n\tpublic static void Main()\n\t{\n\t\tvar input = System.Console.ReadLine().Split(null as char[]);\n\t\tlong a, b;\n\t\ta = int.Parse(input[0]);\n\t\tb = int.Parse(input[1]);\n\t\t\n\t\twhile(a != 0 && b != 0)\n\t\t{\n\t\t\tif (a >= 2*b)\n\t\t\t{\n\t\t\t\ta -= 2*b;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\telse if(b >= 2*a)\n\t\t\t{\n\t\t\t\tb -= 2*a;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t\n\t\tConsole.WriteLine(a + \" \" + b);\n\t}\n}\n", "lang": "Mono C#", "bug_code_uid": "cdaefb6ff85ac6c61938293c79b7d934", "src_uid": "1f505e430eb930ea2b495ab531274114", "apr_id": "d08f89d6452ccebc432a3bcfc833932a", "difficulty": 1100, "tags": ["math", "number theory"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9904824417459797, "equal_cnt": 5, "replace_cnt": 0, "delete_cnt": 4, "insert_cnt": 0, "fix_ops_cnt": 4, "bug_source_code": "using System;\nusing System.Linq;\nusing Xunit.Abstractions;\n\nnamespace CodeForce\n{\n internal class Quserty\n {\n private static void Main(string[] args)\n {\n var input = Console.ReadLine();\n var inps = input.Split(' ');\n var length = int.Parse(inps.First());\n var diameter = int.Parse(inps[1]);\n\n input = Console.ReadLine();\n var array = input.Split(' ').Select(int.Parse).OrderBy(it => it).ToArray();\n var max = array[array.Length - 1];\n\n var isInSet = new int[max + 1];\n for (var i = 0; i < array.Length; i++)\n {\n var el = array[i];\n isInSet[el] += 1;\n }\n\n for (var i = 1; i < isInSet.Length; i++)\n {\n isInSet[i] = isInSet[i - 1] + isInSet[i];\n }\n\n\n var result = int.MaxValue;\n\n for (var i = 0;; i++)\n {\n var leftElement = array[i];\n var rightElement = leftElement + diameter;\n if (rightElement > max)\n {\n rightElement = max;\n }\n\n var diff = isInSet[rightElement] - isInSet[leftElement - 1];\n var newResult = array.Length - diff;\n result = Math.Min(result, newResult);\n\n if (rightElement == max)\n {\n break;\n }\n }\n\n Console.WriteLine(result);\n }\n }\n}", "lang": "MS C#", "bug_code_uid": "27eed1517943222c3e99ecc0fb4af656", "src_uid": "6bcb324c072f796f4d50bafea5f624b2", "apr_id": "e5bd1a3297c55cb96a52e5ea9b31c03a", "difficulty": 1200, "tags": ["greedy", "brute force", "sortings"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C#"} {"similarity_score": 0.9291101055806938, "equal_cnt": 6, "replace_cnt": 3, "delete_cnt": 2, "insert_cnt": 0, "fix_ops_cnt": 5, "bug_source_code": "using System;\n\n\nnamespace Elephant\n{\n class Program\n {\n static void Main(string[] args)\n {\n\n long n = int.Parse(Console.ReadLine());\n long m = int.Parse(Console.ReadLine());\n\n long result = m % Convert.ToInt64(Math.Pow(2, n));\n Console.WriteLine(result);\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "1aa98adaf63805571c437cede56ece02", "src_uid": "c649052b549126e600691931b512022f", "apr_id": "dd6dceeb0b13e0c682082a9375c7bc69", "difficulty": 900, "tags": ["math", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9350563286944996, "equal_cnt": 11, "replace_cnt": 0, "delete_cnt": 2, "insert_cnt": 10, "fix_ops_cnt": 12, "bug_source_code": "\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\n\nnamespace codeforces\n{\n class Program\n {\n static void Main(string[] args)\n {\n int[] input = Console.ReadLine().Split(' ').Select(int.Parse).ToArray();\n int C = input[0];\n int D = input[1];\n int[] nm = Console.ReadLine().Split(' ').Select(int.Parse).ToArray();\n int N = nm[0];\n int M = nm[1];\n int K = int.Parse(Console.ReadLine());\n int[] problems = new int[N * M + N + 1];\n for (int i = 0; i < problems.Length; i++)\n {\n problems[i] = int.MaxValue;\n }\n problems[1] = D;\n problems[N] = C;\n problems[0] = 0;\n for (int i = 2; i < problems.Length; i++)\n {\n if (i - N >= 0)\n {\n problems[i] = Math.Min(problems[i - N] + C, problems[i - 1] + D);\n }\n else\n {\n problems[i] = problems[i - 1] + D;\n }\n }\n int P = N * M - K;\n int min = int.MaxValue;\n for (int i = P; i < problems.Length; i++)\n {\n min = Math.Min(min, problems[i]);\n }\n Console.Write(min);\n //Console.ReadKey();\n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "2bf93f4e7bc4faf49ea195d98dcf1eef", "src_uid": "c6ec932b852e0e8c30c822a226ef7bcb", "apr_id": "45fc748cd22db46e6312798563a1d3a8", "difficulty": 1500, "tags": ["dp", "math", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.9759554543153632, "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;\n\nclass LuckyProbability\n{\n\n static int[] L = new int[1024];\n static int[] st = new int[10];\n static int LPos = 0;\n\n public static int Main()\n {\n //citire\n string[] citire = Console.ReadLine().Split(' ');\n int x1, x2, y1, y2, k;\n x1 = Convert.ToInt32(citire[0]);\n x2 = Convert.ToInt32(citire[1]);\n y1 = Convert.ToInt32(citire[2]);\n y2 = Convert.ToInt32(citire[3]);\n k = Convert.ToInt32(citire[4]);\n\n //solve\n back(1); L[1023] = 1000000001;\n Array.Sort(L, 1, 1022); //stocare numere Lucky\n\n int i, j; long Rez = 0;\n for (i = 1; i <= (1023 - k); i++)\n {\n j = i + k - 1;\n Rez += (long)Intersectie(x1, x2, L[i - 1] + 1, L[i]) * (long)Intersectie(y1, y2, L[j], L[j + 1] - 1);\n Rez += (long)Intersectie(y1, y2, L[i - 1] + 1, L[i]) * (long)Intersectie(x1, x2, L[j], L[j + 1] - 1);\n }\n \n long Posibilitati = (long)(x2 - x1 + 1) * (long)(y2 - y1 + 1);\n decimal Afis = (decimal)Rez / (decimal)Posibilitati;\n Console.WriteLine(Afis.ToString(\"N12\"));\n Console.ReadKey();\n\n return 0;\n }\n\n public static void back(int k)\n {\n int i, j, x;\n for (i = 4; i <= 7; i += 3)\n {\n st[k] = i;\n if (k < 9) back(k + 1);\n x = 0;\n for (j = 1; j <= k; j++) x = x * 10 + st[j];\n L[++LPos] = x;\n }\n }\n\n public static long Intersectie(int stA, int drA, int stB, int drB)\n {\n if (drA < stB || drB < stA) return 0;\n if (stA <= stB && drB <= drA) return drB - stB + 1;\n if (stB <= stA && drA <= drB) return drA - stA + 1;\n if (stA <= stB && drA <= drB) return drA - stB + 1;\n if (stB <= stA && drB <= drA) return drB - stA + 1;\n return 0;\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "42fae1c446792b89d06a1424a25d06e5", "src_uid": "5d76ec741a9d873ce9d7c3ef55eb984c", "apr_id": "7003045d4257b40f5ba0f9f0b55612a1", "difficulty": 1900, "tags": ["dfs and similar", "probabilities", "brute force", "combinatorics"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "C#"} {"similarity_score": 0.9952846463484761, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "using System;\nusing System.IO;\n//using System.Reflection;\n//using System.Collections;\nusing System.Collections.Generic;\nusing System.Linq;\n//using System.Text;\n//using System.Text.RegularExpressions;\nusing System.Threading;\n\nnamespace ConsoleApplication1\n{\n class Program\n {\n static class Scanner\n {\n readonly static IEnumerator Tokens;\n static Scanner()\n {\n Tokens = Enumerable.Range(Int32.MinValue, Int32.MaxValue).\n Select(s => Console.ReadLine()).\n TakeWhile(s => s != null).\n SelectMany(s => s.Split(new[] { ' ', '\\r', '\\n', '\\t' }, StringSplitOptions.RemoveEmptyEntries)).\n Concat(Enumerable.Repeat(0, 1).Select(_ => (string)null)).\n GetEnumerator();\n }\n\n public static string NextToken()\n {\n Tokens.MoveNext();\n return Tokens.Current;\n }\n }\n\n int nextInt()\n {\n return int.Parse(Scanner.NextToken());\n }\n\n bool GoodValue(int a)\n {\n if (a <= 0) return false;\n while (a != 0)\n {\n if (a % 10 != 7 && a % 10 != 4) return false;\n a /= 10;\n }\n return true;\n }\n\n int[] GenSequence()\n {\n var l = new List();\n var q = new Queue();\n q.Enqueue(0);\n while (q.Count != 0)\n {\n int cur = q.Dequeue();\n l.Add(cur);\n if (GoodValue(cur * 10 + 4)) q.Enqueue(cur * 10 + 4);\n if (GoodValue(cur * 10 + 7)) q.Enqueue(cur * 10 + 7);\n }\n return l.OrderBy(c => c).ToArray();\n }\n\n int LowerBound(int v, int[] a)\n {\n int x = 0, y = a.Length;\n while (y - x > 1)\n {\n int z = (x + y) / 2;\n if (a[z] <= v) x = z;\n else y = z;\n }\n return x;\n }\n\n int Len(int x, int y, int[] a, int p)\n {\n if (p < 1 || p >= a.Length) return 0;\n int tx = Math.Max(x, a[p - 1]), ty = Math.Min(y, a[p]);\n if (GoodValue(tx)) tx++;\n if (GoodValue(ty)) ty--;\n return Math.Max(ty - tx + 1, 0);\n }\n\n void Solve()\n {\n var values = GenSequence();\n int pl = nextInt(), pr = nextInt(),\n vl = nextInt(), vr = nextInt(),\n k = nextInt();\n long res = 0;\n for (int x = 1; x < values.Length; x++)\n {\n long pc = Len(pl, pr, values, x);\n long rc1 = Len(vl, vr, values, x + k),\n rc2 = Len(vl, vr, values, x - k);\n res += pc * (rc1 + rc2);\n if (x + k - 1 < values.Length && values[x + k - 1] >= vl && values[x + k - 1] <= vr) res += pc;\n if (x - k > 0 && values[x - k] >= vl && values[x - k] <= vr) res += pc;\n\n if (values[x] >= pl && values[x] <= pr)\n {\n res += Len(vl, vr, values, x - k + 1);\n res += Len(vl, vr, values, x + k);\n\n res += new[] { x + k - 1, x - k + 1 }.Distinct().Where(\n c => c > 0 && c < values.Length &&\n values[c] >= vl && values[c] <= vr\n ).Count();\n }\n }\n long all = (pr - pl + 1);\n all *= (vr - vl + 1);\n Console.Write(\"{0:F12}\", (double)res / (double)(all));\n }\n\n\n static void Main()\n {\n#if MY_SUPER_PUPER_ONLINE_JUDGE\n string dir = Directory.GetCurrentDirectory();\n dir = Directory.GetParent(dir).FullName;\n dir = Directory.GetParent(dir).FullName;\n Console.SetIn(new StreamReader(dir + \"\\\\input.txt\"));\n Console.SetOut(new StreamWriter(dir + \"\\\\output.txt\"));\n#endif\n Thread.CurrentThread.CurrentCulture = System.Globalization.CultureInfo.InvariantCulture;\n new Program().Solve();\n#if MY_SUPER_PUPER_ONLINE_JUDGE\n Console.In.Close();\n Console.Out.Close();\n#endif\n }\n }\n}", "lang": "Mono C#", "bug_code_uid": "ec7a09a50ad8a2871269c6c7ce0a6039", "src_uid": "5d76ec741a9d873ce9d7c3ef55eb984c", "apr_id": "1380009e7c1864669aacef010a155e97", "difficulty": 1900, "tags": ["dfs and similar", "probabilities", "brute force", "combinatorics"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "C#"} {"similarity_score": 0.9839357429718876, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "using System;\nusing System.Linq;\nusing System.Globalization;\n\nnamespace _630\n{\n class Program\n {\n static void Main()\n {\n var a = double.Parse(Console.ReadLine());\n var n = 2 * a - 2;\n var ans = (((n - a) >= 1) ? 3 : 1) * Math.Pow(4, Math.Max(0, n - a - 1)) * 2 + (((n - a - 1) >= 1) ? 1 : 0) *\n 9 * (n - a - 1) * Math.Pow(4, Math.Max(0, n - a - 2)) ;\n ans *= 4;\n Console.WriteLine(ans);\n }\n }\n}\n\n\n", "lang": "MS C#", "bug_code_uid": "ff01595fd5d0e467fae27da56293ea4c", "src_uid": "3b02cbb38d0b4ddc1a6467f7647d53a9", "apr_id": "4b0c1d132b1b0e1571d00ebadb26a184", "difficulty": 1700, "tags": ["math", "combinatorics"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9448253346392426, "equal_cnt": 20, "replace_cnt": 2, "delete_cnt": 3, "insert_cnt": 15, "fix_ops_cnt": 20, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace CodeForcesBlockTowers\n{\n class Program\n {\n static void Main(string[] args)\n {\n int n, m, a = 2;\n n = int.Parse(Console.ReadLine());\n m = int.Parse(Console.ReadLine());\n if (n == 0)\n {\n Console.WriteLine(m * 3);\n }\n else if (m == 0)\n {\n Console.WriteLine(n * 2);\n }\n else if (n != 0 && m != 0)\n {\n while (n!=0 || m!=0)\n {\n if (a % 2 == 0 && a % 3 == 0)\n {\n if (n > m && n>0)\n {\n n--;\n }\n else if (m > n && m>0)\n {\n m--;\n }\n else if (n == m && m>0)\n {\n m--;\n }\n }\n else if (a % 2 == 0 && n>0)\n {\n n--;\n }\n else if (a % 3 == 0 && m>0)\n {\n m--;\n }\n a++;\n }\n Console.WriteLine(a - 1);\n }\n Console.ReadLine();\n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "1b882b64dfbd4eccfc1e57f3a03afa30", "src_uid": "23f2c8cac07403899199abdcfd947a5a", "apr_id": "a41d26b6df963e7712eb948b3c351d09", "difficulty": 1600, "tags": ["greedy", "math", "brute force", "number theory"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.3501072430292031, "equal_cnt": 15, "replace_cnt": 5, "delete_cnt": 3, "insert_cnt": 7, "fix_ops_cnt": 15, "bug_source_code": "using Common;\nusing System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\n\nnamespace Codeforces.R337.C\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 answer)\n {\n tw.WriteLine(answer);\n }\n\n private static int Parse(TextReader tr)\n {\n var w = tr.ReadLine().Split();\n return Calc(int.Parse(w[0]), int.Parse(w[1]), int.Parse(w[2]));\n }\n\n public static int Calc(int n, int m, int k)\n {\n var y = n - m;\n var b = y * (k - 1);\n var r = m - b;\n if (r <= 0)\n return m;\n var x = r / k;\n var a = r % k;\n return ((1 << x + 1) - 2) * k + a + b;\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "b5bd07f097ec0e2888aef21a6280c7ea", "src_uid": "9cc1aecd70ed54400821c290e2c8018e", "apr_id": "4f1dcfad93297098e773925d06feaf74", "difficulty": 1600, "tags": ["matrices", "number theory", "greedy", "math", "binary search"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.958272327964861, "equal_cnt": 7, "replace_cnt": 4, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 6, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace ConsoleApplication2\n{\n class Program\n {\n static void Main(string[] args)\n {\n string input = Console.ReadLine();//6 3\n string[] input_array = input.Split(); //{\"6\", \"3\"}\n int[] input_int = Array.ConvertAll(input_array, int.Parse);//{6, 3}\n\n //int[] input = Array.ConvertAll(Console.ReadLine().Split(), int.Parse);\n int a = input_int[0], b = input_int[0], c = input_int[0];\n int y = input_int[1];\n int count = 0;\n while (a != y || b != y || c != y)\n {\n Change(ref a, b, c, y, ref count);\n Change(ref b, a, c, y, ref count);\n Change(ref c, b, a, y, ref count);\n }\n Console.WriteLine(count);\n }\n\n private static void Change(ref int a, int b, int c, int y, ref int count)\n {\n int buf = a;\n while (a > y && Proverka(a - 1, b, c))\n { a--; }\n if (buf != a)\n count++;\n }\n\n public static bool Proverka(int a, int b, int c)\n {\n if ((a + b > c) && (a + c > b) && (c + b > a))\n return true;\n else return false;\n }\n }\n}", "lang": "MS C#", "bug_code_uid": "bb2df531b8e04d305dd9e4dcebb4ff3f", "src_uid": "8edf64f5838b19f9a8b19a14977f5615", "apr_id": "8ba05d5c6fa1896f1c048b1e93f00f05", "difficulty": 1600, "tags": ["math", "greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9607843137254902, "equal_cnt": 8, "replace_cnt": 6, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 7, "bug_source_code": "using System;\n\nnamespace Ex9_Traingles\n{\n class Program\n {\n static void Main(string[] args)\n {\n int[] inputXY = Array.ConvertAll(Console.ReadLine().Split(' '), int.Parse);\n int[] abc = { inputXY[0], inputXY[0], inputXY[0] };\n int d = inputXY[1];\n int buf;\n int countOperation = 0;\n while (abc[0] != d || abc[1] != d || abc[2] != d)\n {\n for (int i = 2; i >= 0; i--)\n {\n buf = abc[i];\n while (abc[i] != d && isTraingles(abc[i] - 1, abc[(i + 1) % 3], abc[(i + 2) % 3]))\n {\n abc[i]--;\n }\n if (buf != abc[i])\n countOperation++;\n }\n }\n Console.WriteLine(countOperation);\n }\n\n static bool isTraingles(int a, int b, int c)\n {\n return (a + b > c && a + c > b && b + c > a);\n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "695d08ca221338a13e9b1eaa5deeee1f", "src_uid": "8edf64f5838b19f9a8b19a14977f5615", "apr_id": "92538351a516728327dc1d7b94a2bcdd", "difficulty": 1600, "tags": ["math", "greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9857692951615603, "equal_cnt": 10, "replace_cnt": 6, "delete_cnt": 2, "insert_cnt": 1, "fix_ops_cnt": 9, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\nusing System.Numerics;\n\n\nclass PairVariable : IComparable\n{\n public int a, b;\n public int c;\n public PairVariable()\n {\n a = b = 0;\n c = 0;\n }\n public PairVariable(string s)\n {\n string[] q = s.Split();\n a = int.Parse(q[0]);\n b = int.Parse(q[1]);\n c = 0;\n\n }\n\n public PairVariable(int a, int b, int c)\n {\n this.a = a;\n this.b = b;\n this.c = c;\n\n }\n\n\n\n public int CompareTo(PairVariable other)\n {\n return this.b.CompareTo(other.b);\n }\n}\n\nnamespace ConsoleApplication3\n{\n class Program\n {\n\n\n static bool isPrime(int n)\n {\n for (int i = 2; i <= Math.Sqrt(n); i++)\n {\n if (n % i == 0)\n {\n return false;\n }\n }\n return true;\n }\n static int gcd(int a, int b)\n {\n if (b == 0)\n {\n return a;\n }\n else\n {\n return gcd(b, a % b);\n }\n }\n static int factorial(int a)\n {\n int s = 1;\n for (int i = 1; i <= a; i++)\n {\n s *= i;\n }\n return s;\n }\n\n static int start = 0;\n static int end = 0;\n static int[] mark;\n static int[] prev;\n static Dictionary> d = new Dictionary>();\n static void dfs(int v)\n {\n\n bool f = false;\n mark[v] = 1;\n if (!f)\n {\n for (int i = 0; i < d[v].Count; i++)\n {\n if (mark[d[v][i]] == 0)\n {\n prev[d[v][i]] = v;\n\n dfs(d[v][i]);\n }\n else\n {\n end = v;\n start = d[v][i];\n f = true;\n return;\n }\n }\n }\n\n }\n static bool foo(int a, int b, int c)\n {\n return a + b > c && a + c > b && b + c > a;\n }\n static void Main(string[] args)\n {\n string[] s = Console.ReadLine().Split();\n int a = int.Parse(s[0]);\n int x = int.Parse(s[1]);\n int b, c;\n b = c = a;\n int[] m = { a, b, c };\n int ans = 0;\n while (true)\n {\n\n\n if (m[0] == m[1] && m[1] == m[2] && m[2] == x)\n {\n Console.WriteLine(ans / 2 + 2);\n return;\n }\n Array.Sort(m);\n ans++;\n m[2] = Math.Max(x, (m[1] - m[0] + 1));\n\n\n\n\n }\n\n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "cb9c4c5a53953be0987db4347d9444f6", "src_uid": "8edf64f5838b19f9a8b19a14977f5615", "apr_id": "5232baaa9f47f13b012f5520af5315f2", "difficulty": 1600, "tags": ["math", "greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.4504244175546325, "equal_cnt": 5, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 5, "fix_ops_cnt": 5, "bug_source_code": "using System;\nusing System.Linq;\n\nnamespace Preparation\n{\n public class CoderForceCompetitionC\n {\n public static void Swap(ref int x1, ref int x2, ref int x3)\n {\n if (x1 > x2)\n {\n var t = x1;\n x1 = x2;\n x2 = t;\n }\n\n if (x1 > x3)\n {\n var t = x1;\n x1 = x3;\n x3 = t;\n }\n\n if (x2 > x3)\n {\n var t = x2;\n x2 = x3;\n x3 = t;\n }\n }\n\n public static void Main(string[] args)\n {\n var input = Console.ReadLine().Split(' ').Select(int.Parse).ToArray();\n var x = input[0];\n var y = input[1];\n\n int x1, x2, x3;\n x1 = x2 = x3 = x;\n int result = 0;\n x1 = Math.Max(x1/3, y);\n x2 = Math.Max(x3-x1+1, y);\n result = 2;\n\n while (x1 != y || x2 != y || x3 != y)\n {\n Swap(ref x1, ref x2, ref x3);\n x3 = Math.Max(Math.Max(x2 - x1 + 1, y), x3/3 - 1);\n result++;\n }\n\n Console.WriteLine(result);\n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "bd1a6914eb19c1c17fa762b4dbd04f5e", "src_uid": "8edf64f5838b19f9a8b19a14977f5615", "apr_id": "fc5980a51d6c6eba232f84b701dbe5da", "difficulty": 1600, "tags": ["math", "greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.986663787052535, "equal_cnt": 15, "replace_cnt": 7, "delete_cnt": 1, "insert_cnt": 6, "fix_ops_cnt": 14, "bug_source_code": "/*\n * TemplateCS\n * Copyright (C) 2014-2016 Markus Himmel\n * This file is distributed under the terms of the MIT license\n */\n\n//#define CodeJam\n#define CodeForces\n\nusing System;\nusing System.Collections;\nusing System.Collections.Generic;\nusing System.Diagnostics;\nusing System.Globalization;\nusing System.Linq;\nusing System.Xml.Serialization;\n\n// ReSharper disable RedundantUsingDirective\nusing System.IO;\n\n// ReSharper restore RedundantUsingDirective\n\n// ReSharper disable UnusedMember.Local\n\n// ReSharper disable once CheckNamespace\n\nnamespace ProgrammingCompetitions\n{\n internal class Program\n {\n #region GCJ\n\n#if CodeJam\n\t\tprivate static bool DEBUG = false;\n\n\t\tstatic void debug()\n\t\t{\n\t\t}\n\n\t\tstatic string solveCase(int num)\n\t\t{\n\t\t\tchecked\n\t\t\t{\n\t\t\t\treturn null;\n\t\t\t}\n\t\t}\n#endif\n\n #endregion\n\n #region CodeForces\n\n#if CodeForces\n#if DEBUG\n private static readonly Queue testInput = new Queue(@\"\n\n22 4\n\n\n\".Split(new[] { Environment.NewLine }, StringSplitOptions.RemoveEmptyEntries));\n#endif\n\n private static int sim(int s, int v, int t)\n {\n List a = new List { v, s, s };\n int res = 1;\n while (a[2] != t)\n {\n a[2] = Math.Max(a[1] - a[0] + 1, t);\n a.Sort();\n res++;\n }\n return res;\n }\n\n private static object solve()\n {\n // ReSharper disable once RedundantOverflowCheckingContext\n checked\n {\n int f, t;\n read(out f, out t);\n int l = t - 1, r = f - 1;\n while (r - l > 1)\n {\n int mid = (l + r) >> 1;\n if (sim(f, mid, t) < sim(f, mid + 1, t))\n r = mid;\n else\n l = mid;\n } \n return sim(f, l + 1, t);\n }\n }\n#endif\n\n #endregion\n\n // Everything after this comment is template code\n\n private static T read()\n {\n return (T)Convert.ChangeType(read(), typeof(T));\n }\n\n private static T[] readMany()\n {\n // ReSharper disable once PossiblyMistakenUseOfParamsMethod\n return readMany(' ');\n }\n\n private static T[] readMany(params char[] ___)\n {\n return read().Split(___).Select(__ => (T)Convert.ChangeType(__, typeof(T))).ToArray();\n }\n\n private static string[] readMany()\n {\n return readMany();\n }\n\n private static T[][] readMany(int n)\n {\n var res = new T[n][];\n for (int i = 0; i < n; i++)\n res[i] = readMany();\n return res;\n }\n\n private static T[][] readField(int height, Func map)\n {\n var res = new T[height][];\n for (int _ = 0; _ < height; _++)\n res[_] = read().Select(map).ToArray();\n return res;\n }\n\n private static char[][] readField(int height)\n {\n return readField(height, c => c);\n }\n\n private static T[][] readField(int height, Dictionary dic)\n {\n return readField(height, c => dic[c]);\n }\n\n private static void read(out T1 t1)\n {\n string[] vals = readMany();\n t1 = (T1)Convert.ChangeType(vals[0], typeof(T1));\n }\n\n private static void read(out T1 t1, out T2 t2)\n {\n string[] vals = readMany();\n t1 = (T1)Convert.ChangeType(vals[0], typeof(T1));\n t2 = (T2)Convert.ChangeType(vals[1], typeof(T2));\n }\n\n private static void read(out T1 t1, out T2 t2, out T3 t3)\n {\n string[] vals = readMany();\n t1 = (T1)Convert.ChangeType(vals[0], typeof(T1));\n t2 = (T2)Convert.ChangeType(vals[1], typeof(T2));\n t3 = (T3)Convert.ChangeType(vals[2], typeof(T3));\n }\n\n private static void read(out T1 t1, out T2 t2, out T3 t3, out T4 t4)\n {\n string[] vals = readMany();\n t1 = (T1)Convert.ChangeType(vals[0], typeof(T1));\n t2 = (T2)Convert.ChangeType(vals[1], typeof(T2));\n t3 = (T3)Convert.ChangeType(vals[2], typeof(T3));\n t4 = (T4)Convert.ChangeType(vals[3], typeof(T4));\n }\n\n private static void read(out T1 t1, out T2 t2, out T3 t3, out T4 t4, out T5 t5)\n {\n string[] vals = readMany();\n t1 = (T1)Convert.ChangeType(vals[0], typeof(T1));\n t2 = (T2)Convert.ChangeType(vals[1], typeof(T2));\n t3 = (T3)Convert.ChangeType(vals[2], typeof(T3));\n t4 = (T4)Convert.ChangeType(vals[3], typeof(T4));\n t5 = (T5)Convert.ChangeType(vals[4], typeof(T5));\n }\n\n private static Func dp(Func, TResult> f)\n {\n var cache = new Dictionary, TResult>();\n Func res = null;\n res = t1 =>\n {\n Tuple key = Tuple.Create(t1);\n if (!cache.ContainsKey(key))\n cache.Add(key, f(t1, res));\n return cache[key];\n };\n return res;\n }\n\n private static Func dp(Func, TResult> f)\n {\n var cache = new Dictionary, TResult>();\n Func res = null;\n res = (t1, t2) =>\n {\n Tuple key = Tuple.Create(t1, t2);\n if (!cache.ContainsKey(key))\n cache.Add(key, f(t1, t2, res));\n return cache[key];\n };\n return res;\n }\n\n private static Func dp(Func, TResult> f)\n {\n var cache = new Dictionary, TResult>();\n Func res = null;\n res = (t1, t2, t3) =>\n {\n Tuple key = Tuple.Create(t1, t2, t3);\n if (!cache.ContainsKey(key))\n cache.Add(key, f(t1, t2, t3, res));\n return cache[key];\n };\n return res;\n }\n\n private static Func dp(Func, TResult> f)\n {\n var cache = new Dictionary, TResult>();\n Func res = null;\n res = (t1, t2, t3, t4) =>\n {\n Tuple key = Tuple.Create(t1, t2, t3, t4);\n if (!cache.ContainsKey(key))\n cache.Add(key, f(t1, t2, t3, t4, res));\n return cache[key];\n };\n return res;\n }\n\n private static IEnumerable single(T it)\n {\n yield return it;\n }\n\n private static IEnumerable range(long first, long last, long step = 1)\n {\n for (long i = first; i <= last; i += step)\n yield return i;\n }\n\n private static IEnumerable range(int first, int last, int step = 1)\n {\n for (int i = first; i <= last; i += step)\n yield return i;\n }\n\n private static T id(T a)\n {\n return a;\n }\n\n public static T[][] Mkarr(int x, int y)\n {\n var res = new T[x][];\n for (int i = 0; i < x; i++)\n res[i] = new T[y];\n return res;\n }\n\n public static T[][][] Mkarr(int x, int y, int z)\n {\n var res = new T[x][][];\n for (int i = 0; i < x; i++)\n {\n res[i] = new T[y][];\n for (int j = 0; j < y; j++)\n res[i][j] = new T[z];\n }\n return res;\n }\n\n private static bool[] tf = { true, false };\n\n#if CodeJam\n\n\t\tstatic void Main(string[] args)\n\t\t{\n\t\t\tif (DEBUG)\n\t\t\t{\n\t\t\t\tdebug();\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tInitialize();\n\t\t\t\tSolveAll(solveCase);\n\t\t\t}\n\t\t\tConsole.ReadKey();\n\t\t}\n\n\t\tprivate static StreamReader inf;\n\t\tprivate static StreamWriter outf;\n\n\t\tprivate delegate void o(string format, params object[] args);\n\t\tprivate static o Output;\n\n\t\tpublic static void Initialize()\n\t\t{\n\t\t\tConsole.ForegroundColor = ConsoleColor.Yellow;\n\t\t\tConsole.Write(\"File name: \");\n\t\t\tstring name = Console.ReadLine();\n\t\t\tinf = new StreamReader($\"D:\\\\Users\\\\marku\\\\Downloads\\\\{name}.in\");\n\t\t\toutf = new StreamWriter($\"D:\\\\Users\\\\marku\\\\Downloads\\\\{name}.out\");\n\t\t\tConsole.ForegroundColor = ConsoleColor.White;\n\t\t\tOutput = highlightedPrint;\n\t\t\tOutput += outf.WriteLine;\n\t\t}\n\n\t\tprivate static void highlightedPrint(string format, params object[] args)\n\t\t{\n\t\t\tConsoleColor prev = Console.ForegroundColor;\n\t\t\tConsole.ForegroundColor = ConsoleColor.Green;\n\t\t\tConsole.WriteLine(format, args);\n\t\t\tConsole.ForegroundColor = prev;\n\t\t}\n\n\t\tpublic static void SolveAll(Func calc)\n\t\t{\n\t\t\tint cases = int.Parse(inf.ReadLine());\n\t\t\tfor (int _ = 1; _ <= cases; _++)\n\t\t\t{\n\t\t\t\tOutput($\"Case #{_}: {calc(_)}\");\n\t\t\t}\n\t\t\tinf.Close();\n\t\t\toutf.Close();\n\t\t\tConsole.ForegroundColor = ConsoleColor.Cyan;\n\t\t\tConsole.WriteLine(\"Eureka!\");\n\t\t}\n\n\t\tprivate static string read()\n\t\t{\n\t\t\treturn inf.ReadLine();\n\t\t}\n#endif\n\n#if CodeForces\n private static string asString(object s)\n {\n if (s is double)\n return ((double)s).ToString(\"0.000000000\", CultureInfo.InvariantCulture);\n return s.ToString();\n }\n\n public static void Main(string[] args)\n {\n#if DEBUG\n Stopwatch sw = new Stopwatch();\n sw.Start();\n#endif\n object o = solve();\n if (o != null)\n {\n string s;\n IEnumerable e = o as IEnumerable;\n if ((e != null) && !(o is string))\n s = string.Join(\" \", e.OfType().Select(asString));\n else\n s = asString(o);\n if (!string.IsNullOrEmpty(s))\n Console.WriteLine(s);\n }\n#if DEBUG\n sw.Stop();\n Console.WriteLine(sw.Elapsed);\n Console.ReadKey();\n#endif\n }\n\n private static string read()\n {\n#if !DEBUG\n\t\t\treturn Console.ReadLine();\n#else\n return testInput.Dequeue();\n#endif\n }\n#endif\n }\n\n public static class ExtensionMethods\n {\n public static int BinarySearch(this IList it, Func compare)\n {\n int len = it.Count;\n int first = 0;\n\n while (len > 0)\n {\n int half = len >> 1;\n T middle = it[first + half];\n if (compare(middle))\n len = half;\n else\n {\n first += half + 1;\n len -= half + 1;\n }\n }\n\n return first;\n }\n\n public static int Upper(this IList it, T val)\n {\n Comparer comp = Comparer.Default;\n return it.BinarySearch(other => comp.Compare(val, other) < 0);\n }\n\n public static int Lower(this IList it, T val)\n {\n Comparer comp = Comparer.Default;\n return it.BinarySearch(other => comp.Compare(other, val) >= 0);\n }\n\n public static T[] Of(this int n, Func gen)\n {\n return n.Of2(gen).ToArray();\n }\n\n public static T[] Of(this int n, Func gen)\n {\n return n.Of2(gen).ToArray();\n }\n\n public static T[] Of(this int n, T gen)\n {\n return n.Of2(gen).ToArray();\n }\n\n public static IEnumerable Of2(this int n, Func gen)\n {\n for (int i = 0; i < n; i++)\n yield return gen();\n }\n\n public static IEnumerable Of2(this int n, Func gen)\n {\n for (int i = 0; i < n; i++)\n yield return gen(i);\n }\n\n public static IEnumerable Of2(this int n, T gen)\n {\n for (int i = 0; i < n; i++)\n yield return gen;\n }\n\n public static IEnumerable Cartesian(this IEnumerable first, IEnumerable second, Func collector)\n {\n return first.SelectMany(f => second.Select(s => collector(f, s)));\n }\n\n public static IEnumerable> Cartesian(this IEnumerable first, IEnumerable second)\n {\n return first.Cartesian(second, Tuple.Create);\n }\n\n public static IEnumerable> CartesianE(this IEnumerable first, IEnumerable second)\n {\n // Calling CartesianE prevents selection of the wrong overload of Cartesian when you want a tuple of tuples to be returned\n return first.Cartesian(second);\n }\n\n public static IEnumerable> Cartesian(this IEnumerable> first, IEnumerable second)\n {\n return first.Cartesian(second, (x, y) => Tuple.Create(x.Item1, x.Item2, y));\n }\n\n public static IEnumerable> Cartesian(this IEnumerable> first, IEnumerable second)\n {\n return first.Cartesian(second, (x, y) => Tuple.Create(x.Item1, x.Item2, x.Item3, y));\n }\n\n public static IEnumerable> Cartesian(this IEnumerable> first, IEnumerable second)\n {\n return first.Cartesian(second, (x, y) => Tuple.Create(x.Item1, x.Item2, x.Item3, x.Item4, y));\n }\n\n public static IEnumerable> Cartesian(this IEnumerable> source)\n {\n IEnumerable[] enumerable = source as IEnumerable[] ?? source.ToArray();\n IEnumerable> res = enumerable.First().Select(single);\n return enumerable.Skip(1).Aggregate(res, (current, next) => current.Cartesian(next, (sofar, n) => sofar.Concat(single(n))));\n }\n\n public static IEnumerable> Pow(this IEnumerable it, int num)\n {\n return Enumerable.Repeat(it, num).Cartesian();\n }\n\n public static IEnumerable Demask(this IEnumerable> inp)\n {\n foreach (Tuple pair in inp)\n if (pair.Item2)\n yield return pair.Item1;\n }\n\n public static IEnumerable>> Partition(this IEnumerable source, int groups)\n {\n T[] src = source as T[] ?? source.ToArray();\n foreach (int[] part in Enumerable.Range(0, groups).Pow(src.Length).Select(x => x.ToArray()))\n yield return Enumerable.Range(0, groups).Select(x => src.Where((item, idx) => part[idx] == x));\n }\n\n public static IEnumerable> Combinations(this IEnumerable it)\n {\n T[] itt = it as T[] ?? it.ToArray();\n foreach (IEnumerable conf in new[] { true, false }.Pow(itt.Length))\n yield return itt.Zip(conf, Tuple.Create).Demask();\n }\n\n private static IEnumerable single(T it)\n {\n yield return it;\n }\n\n private static IEnumerable exceptSingle(this IEnumerable first, T it, IEqualityComparer comp = null)\n {\n comp = comp ?? EqualityComparer.Default;\n bool seen = false;\n foreach (T a in first)\n if (!seen && comp.Equals(a, it))\n seen = true;\n else\n yield return a;\n }\n\n public static IEnumerable> Permutations(this IEnumerable it)\n {\n T[] src = it as T[] ?? it.ToArray();\n if (src.Length < 2)\n {\n yield return src;\n yield break;\n }\n\n foreach (T first in src)\n foreach (IEnumerable part in Permutations(src.exceptSingle(first)))\n yield return single(first).Concat(part);\n }\n\n public static T[][] Rho(this IEnumerable source, int x, int y)\n {\n T[][] res = Program.Mkarr(x, y);\n\n int i = 0, j = 0;\n\n T[] src = source as T[] ?? source.ToArray();\n while (true)\n {\n foreach (T item in src)\n {\n res[i][j] = item;\n j++;\n if (j == y)\n {\n j = 0;\n i++;\n if (i == x)\n break;\n }\n }\n if (i == x)\n break;\n }\n\n return res;\n }\n\n public static T[][][] Rho(this IEnumerable source, int x, int y, int z)\n {\n T[][][] res = Program.Mkarr(x, y, z);\n\n int i = 0, j = 0, k = 0;\n T[] src = source as T[] ?? source.ToArray();\n while (true)\n {\n foreach (T item in src)\n {\n res[i][j][k] = item;\n k++;\n if (k == z)\n {\n k = 0;\n j++;\n if (j == y)\n {\n j = 0;\n i++;\n if (i == x)\n break;\n }\n }\n }\n if (i == x)\n break;\n }\n\n return res;\n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "6cf08d4f728c856a8dff25dad00b5de9", "src_uid": "8edf64f5838b19f9a8b19a14977f5615", "apr_id": "664ee626d813c57365eddd3df3fb12b9", "difficulty": 1600, "tags": ["math", "greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.6266968325791855, "equal_cnt": 11, "replace_cnt": 6, "delete_cnt": 4, "insert_cnt": 1, "fix_ops_cnt": 11, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\n\nnamespace codeforces3621a\n{\n\tclass Program\n\t{\n\t\tstatic void Main(string[] args)\n\t\t{\n#if DEBUG\n\t\t\tTextReader reader = new StreamReader(\"..\\\\..\\\\input.txt\");\n#else\n\t\t\tTextReader reader = new StreamReader(Console.OpenStandardInput());\n#endif\n\t\t\tTextWriter writer = new StreamWriter(Console.OpenStandardOutput());\n\n\t\t\tvar n = reader.ReadLine().Split(' ').Select(x => int.Parse(x)).ToArray();\n\t\t\t\n\t\t\tvar triangle = new[] { n[0], n[0], n[0] };\n\t\t\tvar y = n[1];\n\n\t\t\tvar result = 0;\n\n\t\t\tif (n[0] >= 2 * y)\n\t\t\t{\n\t\t\t\ttriangle = triangle.OrderBy(x => x).ToArray();\n\t\t\t\ttriangle[2] = (triangle[2] - y) / 2 + y;\n\t\t\t\tresult++;\n\t\t\t}\n\n\t\t\twhile(!triangle.All(x => x == y))\n\t\t\t{\n\t\t\t\tresult++;\n\t\t\t\ttriangle = triangle.OrderBy(x => x).ToArray();\n\t\t\t\ttriangle[2] = Math.Max(triangle[1] - triangle[0] + 1, y);\n\t\t\t}\n\n\t\t\twriter.WriteLine(result);\n\n\t\t\treader.Close();\n\t\t\twriter.Close();\n\t\t}\n\t}\n}\n", "lang": "MS C#", "bug_code_uid": "c4adbe6438bd7fc70bae7656a4dcf5de", "src_uid": "8edf64f5838b19f9a8b19a14977f5615", "apr_id": "cc4e67a6168db0e394c4829891760a3e", "difficulty": 1600, "tags": ["math", "greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.45327169274537693, "equal_cnt": 25, "replace_cnt": 4, "delete_cnt": 4, "insert_cnt": 16, "fix_ops_cnt": 24, "bug_source_code": "using System;\nusing System.Linq;\nusing CompLib.Util;\nusing System.Threading;\nusing CompLib.Mathematics;\n\npublic class Program\n{\n int N;\n string S;\n public void Solve()\n {\n var sc = new Scanner();\n N = sc.NextInt();\n S = sc.Next();\n\n int cnt = 0;\n int min = 0;\n foreach (var c in S)\n {\n if (c == '(') cnt++;\n else cnt--;\n min = Math.Min(min, cnt);\n }\n /*\n * Sを部分文字列に含むカッコ列の個数\n */\n\n // i文字目まで作る、カウンタ、Sより前、Sより後\n var dp = new ModInt[2 * N + 1, N + 1, 2];\n dp[0, 0, 0] = 1;\n for (int i = 0; i < 2 * N; i++)\n {\n for (int j = 0; j <= N; j++)\n {\n // (\n if (j + 1 <= N)\n {\n dp[i + 1, j + 1, 0] += dp[i, j, 0];\n dp[i + 1, j + 1, 1] += dp[i, j, 1];\n }\n\n // )\n if (j - 1 >= 0)\n {\n dp[i + 1, j - 1, 0] += dp[i, j, 0];\n dp[i + 1, j - 1, 1] += dp[i, j, 1];\n }\n\n if (i + S.Length <= 2 * N && j + min >= 0 && j + cnt <= N)\n {\n dp[i + S.Length, j + cnt, 1] += dp[i, j, 0];\n dp[i + S.Length, j + cnt, 0] -= dp[i, j, 0];\n }\n }\n }\n\n Console.WriteLine(dp[2 * N, 0, 1]);\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\n// https://bitbucket.org/camypaper/complib\nnamespace CompLib.Mathematics\n{\n #region ModInt\n /// \n /// [0,) までの値を取るような数\n /// \n public struct ModInt\n {\n /// \n /// 剰余を取る値.\n /// \n public const long Mod = (int)1e9 + 7;\n // public const long Mod = 998244353;\n\n /// \n /// 実際の数値.\n /// \n public long num;\n /// \n /// 値が であるようなインスタンスを構築します.\n /// \n /// インスタンスが持つ値\n /// パフォーマンスの問題上,コンストラクタ内では剰余を取りません.そのため, ∈ [0,) を満たすような を渡してください.このコンストラクタは O(1) で実行されます.\n public ModInt(long n) { num = n; }\n /// \n /// このインスタンスの数値を文字列に変換します.\n /// \n /// [0,) の範囲内の整数を 10 進表記したもの.\n public override string ToString() { return num.ToString(); }\n public static ModInt operator +(ModInt l, ModInt r) { l.num += r.num; if (l.num >= Mod) l.num -= Mod; return l; }\n public static ModInt operator -(ModInt l, ModInt r) { l.num -= r.num; if (l.num < 0) l.num += Mod; return l; }\n public static ModInt operator *(ModInt l, ModInt r) { return new ModInt(l.num * r.num % Mod); }\n public static implicit operator ModInt(long n) { n %= Mod; if (n < 0) n += Mod; return new ModInt(n); }\n\n /// \n /// 与えられた 2 つの数値からべき剰余を計算します.\n /// \n /// べき乗の底\n /// べき指数\n /// 繰り返し二乗法により O(N log N) で実行されます.\n public static ModInt Pow(ModInt v, long k) { return Pow(v.num, k); }\n\n /// \n /// 与えられた 2 つの数値からべき剰余を計算します.\n /// \n /// べき乗の底\n /// べき指数\n /// 繰り返し二乗法により O(N log N) で実行されます.\n public static ModInt Pow(long v, long k)\n {\n long ret = 1;\n for (k %= Mod - 1; k > 0; k >>= 1, v = v * v % Mod)\n if ((k & 1) == 1) ret = ret * v % Mod;\n return new ModInt(ret);\n }\n /// \n /// 与えられた数の逆元を計算します.\n /// \n /// 逆元を取る対象となる数\n /// 逆元となるような値\n /// 法が素数であることを仮定して,フェルマーの小定理に従って逆元を O(log N) で計算します.\n public static ModInt Inverse(ModInt v) { return Pow(v, Mod - 2); }\n }\n #endregion\n #region Binomial Coefficient\n public class BinomialCoefficient\n {\n public ModInt[] fact, ifact;\n public BinomialCoefficient(int n)\n {\n fact = new ModInt[n + 1];\n ifact = new ModInt[n + 1];\n fact[0] = 1;\n for (int i = 1; i <= n; i++)\n fact[i] = fact[i - 1] * i;\n ifact[n] = ModInt.Inverse(fact[n]);\n for (int i = n - 1; i >= 0; i--)\n ifact[i] = ifact[i + 1] * (i + 1);\n ifact[0] = ifact[1];\n }\n public ModInt this[int n, int r]\n {\n get\n {\n if (n < 0 || n >= fact.Length || r < 0 || r > n) return 0;\n return fact[n] * ifact[n - r] * ifact[r];\n }\n }\n public ModInt RepeatedCombination(int n, int k)\n {\n if (k == 0) return 1;\n return this[n + k - 1, k];\n }\n }\n #endregion\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 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}\n", "lang": "Mono C#", "bug_code_uid": "285a43f25205b51d4a4075c65ef257f9", "src_uid": "590a49a7af0eb83376ed911ed488d7e5", "apr_id": "4febc0ac5d4ab00448c970a9759dd998", "difficulty": 2300, "tags": ["dp", "strings"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.9518174133558749, "equal_cnt": 9, "replace_cnt": 5, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 8, "bug_source_code": "using System;\n\nnamespace _75A_LifeWithoutZeros\n{\n class Program\n {\n static void Main(string[] args)\n {\n string[] input = Console.ReadLine().Split();\n\n string number1_str = input[0];\n string number2_str = input[1];\n\n int number1 = Convert.ToInt32(number1_str);\n int number2 = Convert.ToInt32(number2_str);\n\n int first_result = number1 + number2;\n string first_result_str = first_result.ToString();\n \n\n string nd_number_1_str = \"\";\n\n for(int i = 0; i < number1_str.Length; i++)\n {\n if(number1_str[i] != '0')\n {\n nd_number_1_str += number1_str[i];\n }\n }\n\n string nd_number_2_str = \"\";\n\n for (int i = 0; i < number2_str.Length; i++)\n {\n if (number1_str[i] != '0')\n {\n nd_number_2_str += number2_str[i];\n }\n }\n\n string first_res_without_zer = \"\";\n\n for (int i = 0; i < first_result_str.Length; i++)\n {\n if(first_result_str[i] != '0')\n {\n first_res_without_zer += first_result_str[i];\n }\n }\n\n int first_res_nozer = Convert.ToInt32(first_res_without_zer);\n\n int nd_number1 = Convert.ToInt32(nd_number_1_str);\n int nd_number2 = Convert.ToInt32(nd_number_2_str);\n\n int nd_result = nd_number1 + nd_number2;\n\n if(first_res_nozer == nd_result)\n {\n Console.WriteLine(\"Yes\");\n }\n else\n {\n Console.WriteLine(\"No\");\n }\n\n }\n }\n}", "lang": ".NET Core C#", "bug_code_uid": "4ef3ab7113b7c1df209f63bb3e39391e", "src_uid": "ac6971f4feea0662d82da8e0862031ad", "apr_id": "729173913214e1c2a2d2f1d08526c8e9", "difficulty": 1000, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9693911873528422, "equal_cnt": 10, "replace_cnt": 8, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 9, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\n\nnamespace LifeOutOfZeros\n{\n class Program\n {\n static void Main(string[] args)\n {\n string a = Console.ReadLine();\n string b = Console.ReadLine();\n int lonC = Convert.ToInt32(a) + Convert.ToInt32(b);\n string c = Convert.ToString(lonC);\n\n int k = a.IndexOf('0');\n int l = b.IndexOf('0');\n int m = c.IndexOf('0');\n\n if ((k == -1) & (l == -1) & (m == -1)) { Console.WriteLine(\"YES\"); return; }\n\n while ((k != -1) | (l != -1) | (m != -1))\n {\n a = a.Trim('0'); b = b.Trim('0'); c = c.Trim('0');\n k = a.IndexOf('0');l = b.IndexOf('0');m = c.IndexOf('0');\n long x = Convert.ToInt64(a); long y = Convert.ToInt64(b); long z = Convert.ToInt64(c);\n \n if ((x != 0) & (k != -1)) a = a.Remove(k, k);\n if ((y != 0) & (l != -1)) b = b.Remove(l, l);\n if ((z != 0) & (m != -1)) c = c.Remove(m, m);\n\n if ((x != 0) & (k == 0)) a = a.Remove(k, k + 1);\n if ((y != 0) & (l == 0)) b = b.Remove(l, l + 1);\n\n if (((x == 0) & (k == 0)) | ((y == 0) & (l == 0))) break;\n }\n if (Convert.ToInt32(a) + Convert.ToInt32(b) == Convert.ToInt32(c)) Console.WriteLine(\"YES\");\n else Console.WriteLine(\"NO\");\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "e274e0c0c6237bd12272b23247a86ae5", "src_uid": "ac6971f4feea0662d82da8e0862031ad", "apr_id": "6b86ff368f1cf7d5cb9f15846ec8c079", "difficulty": 1000, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.8422924360552592, "equal_cnt": 15, "replace_cnt": 12, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 14, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Globalization;\nusing System.IO;\nusing System.Linq;\nusing System.Text;\nusing System.Text.RegularExpressions;\nusing System.Threading;\n\nnamespace Olymp\n{\n public class ProblemSolver\n {\n private Tokenizer input;\n\n private ISet s = new HashSet();\n\n public void Solve()\n {\n var n = input.ReadLong();\n InitSquares(n);\n var m = (long)Math.Sqrt(n);\n var ans = 1L;\n for (int i = 1; i <= m; i++)\n {\n if (n % i == 0)\n {\n if (IsBeauty(n / i))\n {\n ans = n / i;\n break;\n }\n else if (IsBeauty(i))\n {\n ans = i;\n }\n }\n }\n Console.Write(ans);\n }\n\n private void InitSquares(long n)\n {\n var k = 2L;\n while (k <= n)\n {\n s.Add(k * k);\n k++;\n }\n }\n\n private bool IsSquare(long x)\n {\n return s.Contains(x);\n }\n\n private bool IsBeauty(long n)\n {\n var m = (long)Math.Sqrt(n);\n for (int i = 1; i <= m; i++)\n {\n if (n % i == 0 && (IsSquare(i) || IsSquare(n / i)))\n {\n return false;\n }\n }\n return true;\n }\n\n public ProblemSolver(TextReader input)\n {\n this.input = new Tokenizer(input);\n }\n }\n\n #region Service classes\n\n public class Tokenizer\n {\n private TextReader reader;\n\n public int ReadInt()\n {\n var c = SkipWS();\n if (c == -1)\n throw new EndOfStreamException();\n bool isNegative = false;\n if (c == '-' || c == '+')\n {\n isNegative = c == '-';\n c = this.reader.Read();\n if (c == -1)\n throw new InvalidOperationException();\n }\n if (!char.IsDigit((char)c))\n throw new InvalidOperationException();\n int result = (char)c - '0';\n c = this.reader.Read();\n while (c > 0 && !char.IsWhiteSpace((char)c))\n {\n if (!char.IsDigit((char)c))\n throw new InvalidOperationException();\n result = result * 10 + (char)c - '0';\n c = this.reader.Read();\n }\n if (isNegative)\n result = -result;\n return result;\n }\n\n public string ReadLine()\n {\n return reader.ReadLine();\n }\n\n public long ReadLong()\n {\n return long.Parse(this.ReadToken());\n }\n\n public double ReadDouble()\n {\n return double.Parse(this.ReadToken(), CultureInfo.InvariantCulture);\n }\n\n public int[] ReadIntArray(int n)\n {\n int[] a = new int[n];\n for (int i = 0; i < n; i++)\n a[i] = ReadInt();\n return a;\n }\n\n public long[] ReadLongArray(int n)\n {\n long[] a = new long[n];\n for (int i = 0; i < n; i++)\n a[i] = ReadLong();\n return a;\n }\n\n public double[] ReadDoubleArray(int n)\n {\n double[] a = new double[n];\n for (int i = 0; i < n; i++)\n a[i] = ReadDouble();\n return a;\n }\n\n public string ReadToken()\n {\n var c = SkipWS();\n if (c == -1)\n return null;\n var sb = new StringBuilder();\n while (c > 0 && !char.IsWhiteSpace((char)c))\n {\n sb.Append((char)c);\n c = this.reader.Read();\n }\n return sb.ToString();\n }\n\n private int SkipWS()\n {\n int c = this.reader.Read();\n if (c == -1)\n return c;\n while (c > 0 && char.IsWhiteSpace((char)c))\n c = this.reader.Read();\n return c;\n }\n\n public Tokenizer(TextReader reader)\n {\n this.reader = reader;\n }\n }\n\n class Program\n {\n public static void Main(string[] args)\n {\n var solver = new ProblemSolver(Console.In);\n solver.Solve();\n }\n }\n\n #endregion\n}", "lang": "MS C#", "bug_code_uid": "2ea2a5e19e0746c345b9c0cd43ea8039", "src_uid": "6d0da975fa0961acfdbe75f2f29aeb92", "apr_id": "d3d23b6531e45802ea9de4034d04c784", "difficulty": 1300, "tags": ["math"], "bug_exec_outcome": "MEMORY_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.8595258999122037, "equal_cnt": 12, "replace_cnt": 5, "delete_cnt": 1, "insert_cnt": 5, "fix_ops_cnt": 11, "bug_source_code": "\nusing System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\n\nnamespace ConsoleApplication1\n{\n class Program\n {\n private static void MyMain()\n {\n long n = RLong();\n\n long [] store = new long[n];\n for (long i = 1; i <= n; i++)\n {\n var x = n % i;\n if (x == 0)\n {\n store[store.Length-1] = (n / i);\n }\n }\n\n for (long i = 0; i < store[]; i++)\n {\n bool flag = false;\n for (long j = 2; j < store[i]; j++)\n {\n if (store[i] % (j * j) == 0)\n {\n\n flag = true;\n break;\n }\n }\n if (flag == false)\n {\n WLine(store[i]);\n return;\n }\n }\n }\n\n static void Main()\n {\n#if !HOME\n MyMain();\n#else\n var tmp = Console.In;\n Console.SetIn(new StreamReader(\"in.txt\"));\n while (Console.In.Peek() > 0)\n {\n MyMain();\n }\n Console.In.Close();\n Console.SetIn(tmp);\n Console.ReadKey();\n#endif\n }\n\n #region Utils\n static string RLine()\n {\n return Console.ReadLine();\n }\n\n static int RInt()\n {\n var str = Console.ReadLine();\n return Convert.ToInt32(str);\n }\n\n static long RLong()\n {\n var str = Console.ReadLine();\n return Convert.ToInt64(str);\n }\n\n static int[] RInts()\n {\n return Array.ConvertAll(Console.ReadLine().Split(' '), s => Convert.ToInt32(s));\n }\n\n static void RInts(out int a, out int b)\n {\n var ints = RInts();\n a = ints[0];\n b = ints[1];\n }\n\n static void WLine(T s)\n {\n Console.WriteLine(s);\n }\n #endregion\n }\n}\n", "lang": "MS C#", "bug_code_uid": "cc6e9a15876c9f473c2f4938b6203ba8", "src_uid": "6d0da975fa0961acfdbe75f2f29aeb92", "apr_id": "f6f740c93da26cf5af231c38f45ec61b", "difficulty": 1300, "tags": ["math"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.7827191867852605, "equal_cnt": 5, "replace_cnt": 1, "delete_cnt": 2, "insert_cnt": 1, "fix_ops_cnt": 4, "bug_source_code": "using System;\nusing System.Linq;\n\nnamespace Codeforces\n{\n internal static class Program\n {\n private static void Main()\n {\n Console.WriteLine(Result(int.Parse(Console.ReadLine())));\n }\n\n private static long Result(int n)\n {\n return 1 + Enumerable.Range(1, n).Sum() * 6;\n }\n }\n}", "lang": "MS C#", "bug_code_uid": "11947a17c1b40da3a6b4d0af1bae170f", "src_uid": "c046895a90f2e1381a7c1867020453bd", "apr_id": "310e7545142240c80ca039e30fae1c3f", "difficulty": 1100, "tags": ["math"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C#"} {"similarity_score": 0.665249734325186, "equal_cnt": 11, "replace_cnt": 5, "delete_cnt": 1, "insert_cnt": 5, "fix_ops_cnt": 11, "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 Int64 n = Int64.Parse(Console.ReadLine()), res = 0, j = 0;\n for (int i = 0; i < n; i++)\n {\n j = j + 6;\n res = res + j;\n }\n Console.Write(res+1);\n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "1df94ab5d1e058001d9d8bd706c251a6", "src_uid": "c046895a90f2e1381a7c1867020453bd", "apr_id": "6134dc757ac597668bc96a2faaa196d7", "difficulty": 1100, "tags": ["math"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.859504132231405, "equal_cnt": 5, "replace_cnt": 2, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 4, "bug_source_code": "using System;\nclass Program{\n public static void Main(string[] args){\n long n = long.Parse(Console.ReadLine());\n ulong res = 0;\n for(int i = 1; i <= n; i++)\n res += (ulong)6 * i;\n Console.WriteLine(res);\n }\n}", "lang": "MS C#", "bug_code_uid": "35a8601000ee948f9ed8b69f143c67f7", "src_uid": "c046895a90f2e1381a7c1867020453bd", "apr_id": "fbb574b5fe244f6abc25f9417f48420b", "difficulty": 1100, "tags": ["math"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.8683127572016461, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "using System;\nclass Program{\n public static void Main(string[] args){\n long n = long.Parse(Console.ReadLine());\n ulong res = 1;\n for(int i = 1; i <= n; i++)\n res += (ulong)(6 * i);\n Console.WriteLine(res);\n }\n}", "lang": "MS C#", "bug_code_uid": "4c8ab8c289fba40aea32d6f5a18bd6f6", "src_uid": "c046895a90f2e1381a7c1867020453bd", "apr_id": "fbb574b5fe244f6abc25f9417f48420b", "difficulty": 1100, "tags": ["math"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.6706713780918728, "equal_cnt": 8, "replace_cnt": 4, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 7, "bug_source_code": "using System;\nusing System.Collections;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\n\n\nnamespace Codeforces_Round_219_2\n{\n\n\n class TaskB\n {\n public static int S(double a)\n {\n int n = 1;\n while (a >= 10)\n {\n n++;\n a /= 10;\n }\n return n;\n }\n\n static void Main(string[] args)\n {\n double w, m, k;\n string s = Console.ReadLine();\n string[] str = s.Split();\n w = double.Parse(str[0]);\n m = double.Parse(str[1]);\n k = double.Parse(str[2]);\n\n if (w < k)\n {\n Console.WriteLine(0);\n return;\n }\n else\n w /= k;\n\n int l = 0;\n int s_cur = S(m);\n \n while (w >= s_cur)\n {\n l++;\n w -= s_cur;\n s_cur = S(++m);\n }\n\n Console.WriteLine(l);\n }\n }\n}", "lang": "Mono C#", "bug_code_uid": "4f124a8c4fd483e841103ab3c1aa8f88", "src_uid": "8ef8a09e33d38a2d7f023316bc38b6ea", "apr_id": "827c26278b9ac805cec6e7ed840e875d", "difficulty": 1600, "tags": ["math", "implementation", "binary search"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9943149516770893, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "using System;\nusing System.Collections;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\n\n\nnamespace Codeforces_Round_219_2\n{\n\n\n class TaskB\n {\n public static int S(double a)\n {\n int n = 1;\n while (a >= 10)\n {\n n++;\n a /= 10;\n }\n return n;\n }\n\n public static double ToNextLevel(double a)\n {\n double n = 1;\n int r = S(a);\n for (int i = 0; i < r; i++)\n n *= 10;\n\n return n - a;\n }\n\n public static double NextLevel(double a)\n {\n double n = 1;\n int r = S(a);\n for (int i = 0; i < r; i++)\n n *= 10;\n\n return n;\n }\n\n static void Main(string[] args)\n {\n double w, m, k;\n string s = Console.ReadLine();\n string[] str = s.Split();\n w = double.Parse(str[0]);\n m = double.Parse(str[1]);\n k = double.Parse(str[2]);\n\n if (w < k)\n {\n Console.WriteLine(0);\n return;\n }\n else\n w /= k;\n\n double l = 0;\n int s_cur = S(m);\n\n while (true)\n {\n if (ToNextLevel(m) < w / S(m))\n {\n l += ToNextLevel(m);\n w -= ToNextLevel(m) * S(m);\n m = NextLevel(m);\n }\n else\n {\n w /= S(m);\n l += (int)w;\n break;\n }\n }\n\n Console.WriteLine(l);\n }\n }\n}", "lang": "Mono C#", "bug_code_uid": "20a424d72da5478ca881747dff58df3b", "src_uid": "8ef8a09e33d38a2d7f023316bc38b6ea", "apr_id": "827c26278b9ac805cec6e7ed840e875d", "difficulty": 1600, "tags": ["math", "implementation", "binary search"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9923558026407228, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 4, "bug_source_code": "using System;\nusing System.CodeDom;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\n\nnamespace CodeForce\n{\n public class SolutionB\n {\n public static void Main(string[] args)\n {\n string[] ulaz = System.Console.ReadLine().Split(new char[] {' '});\n\n Int64 w = Int64.Parse(ulaz[0]);\n Int64 m = Int64.Parse(ulaz[1]);\n Int64 k = Int64.Parse(ulaz[2]);\n\n Decimal start = 0;\n Int64 cnt = 0;\n Int64 rez = 0;\n\n\n int cifre = getnum(m);\n while (true)\n {\n \n if ((((long)Math.Pow(10,cifre))-m)*k 0)\n {\n m = m / 10;\n rv++;\n\n }\n return rv;\n }\n\n \n }\n}\n", "lang": "Mono C#", "bug_code_uid": "5aafb24f80669ffa5e40b319c15747fc", "src_uid": "8ef8a09e33d38a2d7f023316bc38b6ea", "apr_id": "b5cc92eac70c0c5c6b3068b554c29cbe", "difficulty": 1600, "tags": ["math", "implementation", "binary search"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.9951890034364261, "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 A.Infinite_Sequence\n{\n class Program\n {\n static void Main(string[] args)\n {\n long nth = int.Parse(Console.ReadLine());\n long answer = 1;\n long inc = 1;\n long i = 1;\n long temp = 0;\n while (inc<=nth)\n {\n temp = inc;\n inc+=i;\n i++;\n \n }\n while (temp[] E;\n private int[] U, V;\n private int Max;\n\n private int R;\n private bool[] IsX;\n private bool Found;\n private int XSize;\n\n private int[] Len;\n private int[] Dist;\n private int TmpX;\n private int TmpY;\n\n void Scan()\n {\n var sc = new Scanner();\n N = sc.NextInt();\n E = new List<(int to, int num)>[N];\n U = new int[N - 1];\n V = new int[N - 1];\n for (int i = 0; i < N; i++)\n {\n E[i] = new List<(int to, int num)>();\n }\n\n for (int i = 0; i < N - 1; i++)\n {\n int u = sc.NextInt() - 1;\n int v = sc.NextInt() - 1;\n U[i] = u + 1;\n V[i] = v + 1;\n E[u].Add((v, i));\n E[v].Add((u, i));\n }\n\n Max = 2 * N * N / 9;\n }\n\n void SetFlag(int cur, int par)\n {\n foreach ((int to, int num) e in E[cur])\n {\n if (e.to == par) continue;\n SetFlag(e.to, cur);\n }\n\n IsX[cur] = true;\n }\n\n int Go(int cur, int par)\n {\n var ls = new List<(int to, int size)>();\n int size = 1;\n foreach (var e in E[cur])\n {\n if (e.to == par) continue;\n int tmp = Go(e.to, cur);\n ls.Add((e.to, tmp));\n size += tmp;\n }\n\n\n // if (par != -1)\n // {\n // ls.Add((par, N - size));\n // }\n\n // 親側は処理が難しいので飛ばす\n // x,y逆になってもいいので問題ない\n bool[,] dp = new bool[ls.Count + 1, N];\n dp[0, 0] = true;\n for (int i = 0; i < ls.Count; i++)\n {\n for (int j = 0; j < N; j++)\n {\n if (dp[i, j]) dp[i + 1, j + ls[i].size] = true;\n }\n }\n\n if (!Found)\n {\n int x = -1;\n for (int i = 0; i < N; i++)\n {\n if (!dp[ls.Count, i]) continue;\n int y = N - 1 - i;\n if (Max < (i + 1) * (y + 1))\n {\n x = i;\n break;\n }\n }\n\n if (x != -1)\n {\n XSize = x;\n R = cur;\n for (int i = ls.Count - 1; i >= 0; i--)\n {\n if (x - ls[i].size >= 0 && dp[i, x - ls[i].size])\n {\n SetFlag(ls[i].to, cur);\n x -= ls[i].size;\n }\n }\n\n Found = true;\n }\n }\n\n\n return size;\n }\n\n // r、x,yの頂点を決める\n void SearchR()\n {\n IsX = new bool[N];\n Found = false;\n Go(0, -1);\n }\n\n\n // 現在地、親、par-curが辺num\n void SetX(int cur, int par, int num)\n {\n Dist[cur] = TmpX++;\n if (par != -1)\n {\n Len[num] = Dist[cur] - Dist[par];\n }\n\n foreach ((int to, int num) e in E[cur])\n {\n if (e.to == par) continue;\n if (!IsX[e.to]) continue;\n SetX(e.to, cur, e.num);\n }\n }\n\n void SetY(int cur, int par, int num)\n {\n Dist[cur] = TmpY;\n TmpY += (XSize + 1);\n if (par != -1)\n {\n Len[num] = Dist[cur] - Dist[par];\n }\n\n foreach ((int to, int num) e in E[cur])\n {\n if (e.to == par) continue;\n if (IsX[e.to]) continue;\n SetY(e.to, cur, e.num);\n }\n }\n\n void SetLen()\n {\n // 辺の長さ\n Len = new int[N - 1];\n // R->頂点までの距離\n Dist = new int[N];\n // X側の頂点はRに近い順に距離1~Xを割り当てる\n // それぞれの頂点までの距離になるように頂点の長さを割り当てる\n TmpX = 0;\n SetX(R, -1, -1);\n\n // Y (X+1)刻みで割り当てる\n TmpY = 0;\n SetY(R, -1, -1);\n }\n\n void Write()\n {\n var sb = new StringBuilder();\n for (int i = 0; i < N - 1; i++)\n {\n sb.AppendLine($\"{U[i]} {V[i]} {Len[i]}\");\n }\n\n Console.Write(sb);\n }\n\n public void Solve()\n {\n // ある頂点rを境目に2つに分ける\n // 片方x個 もう片方 y個 x + y + 1 = N\n // 片方でrからの距離 0~xをつくる\n // 残り x+1刻みで y個\n // 0 <= p < (x+1)(y+1)できる\n\n Scan();\n SearchR();\n SetLen();\n Write();\n }\n\n public static void Main(string[] args)\n {\n new Thread(new ThreadStart(new Program().Solve), 1 << 27).Start();\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 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 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": "Mono C#", "bug_code_uid": "4d7e4be291813ae2a983ccbc37b56186", "src_uid": "87d755df6ee27b381122062659c4a432", "apr_id": "8cb96bffa428a791c050e29aafd5a26c", "difficulty": 2700, "tags": ["trees", "constructive algorithms"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.9849068721901092, "equal_cnt": 10, "replace_cnt": 0, "delete_cnt": 5, "insert_cnt": 4, "fix_ops_cnt": 9, "bug_source_code": "using System;\nusing System.Collections;\nusing System.Collections.Generic;\nusing System.Text;\nusing System.Threading;\nusing CompLib.Util;\n\npublic class Program\n{\n private int N;\n private List<(int to, int num)>[] E;\n private int[] U, V;\n private int Max;\n\n private int R;\n private bool[] IsX;\n private bool Found;\n private int XSize;\n\n private int[] Len;\n private int[] Dist;\n private int TmpX;\n private int TmpY;\n\n void Scan()\n {\n var sc = new Scanner();\n N = sc.NextInt();\n E = new List<(int to, int num)>[N];\n U = new int[N - 1];\n V = new int[N - 1];\n for (int i = 0; i < N; i++)\n {\n E[i] = new List<(int to, int num)>();\n }\n\n for (int i = 0; i < N - 1; i++)\n {\n int u = sc.NextInt() - 1;\n int v = sc.NextInt() - 1;\n U[i] = u + 1;\n V[i] = v + 1;\n E[u].Add((v, i));\n E[v].Add((u, i));\n }\n\n Max = 2 * N * N / 9;\n }\n\n void SetFlag(int cur, int par)\n {\n foreach ((int to, int num) e in E[cur])\n {\n if (e.to == par) continue;\n SetFlag(e.to, cur);\n }\n\n IsX[cur] = true;\n }\n\n int Go(int cur, int par)\n {\n var ls = new List<(int to, int size)>();\n int size = 1;\n foreach (var e in E[cur])\n {\n if (e.to == par) continue;\n int tmp = Go(e.to, cur);\n ls.Add((e.to, tmp));\n size += tmp;\n }\n\n\n // if (par != -1)\n // {\n // ls.Add((par, N - size));\n // }\n\n\n if (!Found)\n {\n // 親側は処理が難しいので飛ばす\n // x,y逆になってもいいので問題ない\n bool[,] dp = new bool[ls.Count + 1, N];\n dp[0, 0] = true;\n for (int i = 0; i < ls.Count; i++)\n {\n for (int j = 0; j < N; j++)\n {\n if (dp[i, j]) dp[i + 1, j + ls[i].size] = true;\n }\n }\n\n int x = -1;\n for (int i = 0; i < N; i++)\n {\n if (!dp[ls.Count, i]) continue;\n int y = N - 1 - i;\n if (Max < (i + 1) * (y + 1))\n {\n x = i;\n break;\n }\n }\n\n if (x != -1)\n {\n XSize = x;\n R = cur;\n for (int i = ls.Count - 1; i >= 0; i--)\n {\n if (x - ls[i].size >= 0 && dp[i, x - ls[i].size])\n {\n SetFlag(ls[i].to, cur);\n x -= ls[i].size;\n }\n }\n\n Found = true;\n }\n }\n\n\n return size;\n }\n\n // r、x,yの頂点を決める\n void SearchR()\n {\n IsX = new bool[N];\n Found = false;\n Go(0, -1);\n if (!Found) throw new Exception();\n }\n\n\n // 現在地、親、par-curが辺num\n void SetX(int cur, int par, int num)\n {\n Dist[cur] = TmpX++;\n if (par != -1)\n {\n Len[num] = Dist[cur] - Dist[par];\n }\n\n foreach ((int to, int num) e in E[cur])\n {\n if (e.to == par) continue;\n if (!IsX[e.to]) continue;\n SetX(e.to, cur, e.num);\n }\n }\n\n void SetY(int cur, int par, int num)\n {\n Dist[cur] = TmpY;\n TmpY += (XSize + 1);\n if (par != -1)\n {\n Len[num] = Dist[cur] - Dist[par];\n }\n\n foreach ((int to, int num) e in E[cur])\n {\n if (e.to == par) continue;\n if (IsX[e.to]) continue;\n SetY(e.to, cur, e.num);\n }\n }\n\n void SetLen()\n {\n // 辺の長さ\n Len = new int[N - 1];\n // R->頂点までの距離\n Dist = new int[N];\n // X側の頂点はRに近い順に距離1~Xを割り当てる\n // それぞれの頂点までの距離になるように頂点の長さを割り当てる\n TmpX = 0;\n SetX(R, -1, -1);\n\n // Y (X+1)刻みで割り当てる\n TmpY = 0;\n SetY(R, -1, -1);\n }\n\n void Write()\n {\n var sb = new StringBuilder();\n for (int i = 0; i < N - 1; i++)\n {\n sb.AppendLine($\"{U[i]} {V[i]} {Len[i]}\");\n }\n\n Console.Write(sb);\n }\n\n public void Solve()\n {\n // ある頂点rを境目に2つに分ける\n // 片方x個 もう片方 y個 x + y + 1 = N\n // 片方でrからの距離 0~xをつくる\n // 残り x+1刻みで y個\n // 0 <= p < (x+1)(y+1)できる\n\n Scan();\n SearchR();\n SetLen();\n Write();\n }\n\n public static void Main(string[] args)\n {\n new Thread(new ThreadStart(new Program().Solve), 1 << 27).Start();\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 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 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": "Mono C#", "bug_code_uid": "0bc7d15bc09957a0eeb1bb987ccea682", "src_uid": "87d755df6ee27b381122062659c4a432", "apr_id": "8cb96bffa428a791c050e29aafd5a26c", "difficulty": 2700, "tags": ["trees", "constructive algorithms"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C#"} {"similarity_score": 0.7372627372627373, "equal_cnt": 8, "replace_cnt": 5, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 8, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\n\nnamespace code_32\n{\n class Program\n {\n static void Main(string[] args)\n {\n string s = Console.ReadLine();\n long a = int.Parse(s.Substring(0,s.IndexOf(' ')));\n s = s.Substring(s.IndexOf(' ') + 1);\n long b = int.Parse(s.Substring(0, s.IndexOf(' ')));\n s = s.Substring(s.IndexOf(' ') + 1);\n long x = int.Parse(s.Substring(0, s.IndexOf(' ')));\n long y = int.Parse(s.Substring( s.IndexOf(' ')+1));\n\n long t = 2;\n \n while (true)\n { \n if (t > x || t > y) break;\n if (x % t == 0 && y % t == 0)\n {\n x /= t;\n y /= t;\n }\n else\n t++;\n \n }\n long k=Math.Min(a/x,b/y);\n Console.WriteLine(k*x + \" \" + k*y);\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "e383f3c2422adfb39bbc085e6568d3c5", "src_uid": "97999cd7c6de79a4e39f56a41ff59e7a", "apr_id": "ae17371eb80919e943fec178a977dc19", "difficulty": 1800, "tags": ["number theory", "binary search"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.8841041998936736, "equal_cnt": 5, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 4, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\n\nnamespace _16C___Монитор\n{\n class Program\n {\n static long gcd(long a, long b)\n {\n while (a != b)\n {\n if (a < b) b -= a;\n else if (b < a) a -= b;\n }\n return a;\n }\n static void Main(string[] args)\n {\n string[] t = Console.ReadLine().Split(' ');\n long a = long.Parse(t[0]);\n long b = long.Parse(t[1]);\n long x = long.Parse(t[2]);\n long y = long.Parse(t[3]);\n if (Math.Min(x,y)>10000)\n {\n int d = gcd(x, y);\n x = x / d;\n y = y / d;\n }\n else\n {\n long d = 1;\n long min = Math.Min(x,y);\n for (int i = 1; i <= min; i++)\n {\n if (x % i == 0 && y % i == 0)\n d = i;\n }\n x = x / d;\n y = y / d;\n }\n double r1 = a * 1.0 / b;\n double r2 = x * 1.0 / y;\n if (r1 == r2)\n {\n Console.WriteLine(a + \" \" + b);\n return;\n }\n long newA = 0;\n long newB = 0;\n if (r1 > r2)\n {\n newB = (b / y) * y;\n newA = newB * x / y;\n }\n else\n {\n newA = (a / x) * x;\n newB = newA * y / x;\n }\n Console.WriteLine(newA + \" \" + newB);\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "f2eaf8b0cde9327c88809ebd1c938d93", "src_uid": "97999cd7c6de79a4e39f56a41ff59e7a", "apr_id": "4e95dd5d0789c1335e8768e3bb3e1bf4", "difficulty": 1800, "tags": ["number theory", "binary search"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.941105527638191, "equal_cnt": 28, "replace_cnt": 2, "delete_cnt": 2, "insert_cnt": 24, "fix_ops_cnt": 28, "bug_source_code": "using System;\n\nnamespace ConsoleApplication1\n{\n internal class Program\n {\n #region vvv\n //private static string s = string.Empty;\n //private static string res = string.Empty;\n //private static string t = string.Empty;\n\n //private const string alph = \"*ABCDEFGHIJKLMNOPQRSTUVWXYZ\";\n\n //static string RC(string x)\n //{\n // t = res = \"\";\n\n // var ind = 0;\n\n // for (int i = 1; i < x.Length; i++)\n // {\n // if (x[i] == 'C')\n // {\n // ind = i + 1;\n // break; \n // }\n\n // t += x[i];\n // }\n\n // res = t;\n\n // t = \"\";\n\n // for (int i = ind; i < x.Length; i++)\n // {\n // t += x[i];\n // }\n\n // var a = int.Parse(t);\n\n // if (a <= 26)\n // {\n // res = alph[a] + res;\n // }\n // else\n // {\n // res = alph[a % 26] + res;\n\n // while (true)\n // {\n // var k = a/26;\n\n // t = \"\";\n\n // if (k < 27)\n // {\n // t += alph[k];\n // break;\n // }\n\n // t += alph[26];\n // a /= 26;\n // }\n\n // res = t + res;\n // }\n\n // return res;\n //} \n #endregion\n\n private static void Main(string[] args)\n {\n string[] a = {\"vaporeon\", \"jolteon\", \"flareon\", \"espeon\", \"umbreon\", \"leafeon\", \"glaceon\", \"sylveon\"};\n\n var n = int.Parse(Console.ReadLine());\n\n var s = Console.ReadLine();\n\n var f = 0;\n var ind = 0;\n\n for (int i = 0; i < 8; i++)\n {\n if (a[i].Length != n)\n continue;\n\n var temp = 0;\n\n for (int j = 0; j < n; j++)\n {\n if (a[i][j] == s[j])\n temp++;\n }\n\n if (f < temp)\n {\n f = temp;\n ind = i;\n }\n }\n\n Console.WriteLine(a[ind]);\n }\n }\n}", "lang": "MS C#", "bug_code_uid": "d54f06704057bbc3b7d785deafbcefa7", "src_uid": "ec3d15ff198d1e4ab9fd04dd3b12e6c0", "apr_id": "af0c5a4791acc343c27da138ba05e09f", "difficulty": 1000, "tags": ["strings", "brute force", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.0025624599615631004, "equal_cnt": 2, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 3, "bug_source_code": "sdsds", "lang": "MS C#", "bug_code_uid": "af99b973af4d5cd7a159695f179e4a5c", "src_uid": "ec3d15ff198d1e4ab9fd04dd3b12e6c0", "apr_id": "1d1185790dda3f686cf77a1e69519e22", "difficulty": 1000, "tags": ["strings", "brute force", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9747048903878583, "equal_cnt": 7, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 4, "fix_ops_cnt": 6, "bug_source_code": "using System;\nusing System.Text;\n\nnamespace ConsoleApp2\n{\n class Program\n {\n static void Main(string[] args)\n {\n var n = Convert.ToInt32(Console.ReadLine());\n int count = 1, temp = n;\n while (temp > 1)\n {\n var m = temp % 10;\n temp += 10 - m;\n count += 10 - m;\n while (temp % 10 == 0)\n {\n temp /= 10;\n }\n\n }\n Console.WriteLine(count);\n //Console.ReadKey();\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "9540c3e7f20afbb1ea590a100ccc2ea0", "src_uid": "055fbbde4b9ffd4473e6e716da6da899", "apr_id": "f8c1358f09709eabb99306cf691882d8", "difficulty": 1100, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.9671232876712329, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "using System;\n\nnamespace Contests {\n public class CF555_A {\n public static void Main() {\n var number = Console.ReadLine();\n var n = 1;\n n += (number[0] - '0');\n foreach (var digit in number) {\n n += 9 - (digit - '0');\n }\n\n Console.WriteLine(n);\n }\n }\n}", "lang": "Mono C#", "bug_code_uid": "bfd34c31d3206e31044604b036730c36", "src_uid": "055fbbde4b9ffd4473e6e716da6da899", "apr_id": "5ae05dae77e089f9b3692696a7dd327b", "difficulty": 1100, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.9496932515337423, "equal_cnt": 8, "replace_cnt": 0, "delete_cnt": 2, "insert_cnt": 5, "fix_ops_cnt": 7, "bug_source_code": "using System;\nusing System.IO;\nusing System.Collections.Generic;\nusing System.Numerics;\n\nnamespace cf584\n{\n class Program\n {\n static void Main(string[] args)\n {\n //Console.SetIn(new StreamReader(\"input.txt\"));\n solve_cf584A();\n }\n\n public static void solve_cf584A()\n {\n int n = Convert.ToInt32(Console.ReadLine());\n int[] a = Array.ConvertAll(Console.ReadLine().Split(' '), int.Parse);\n int[] cnt = new int[101];\n\n int min = 0;\n for (int i = 0; i < n; i++)\n {\n for (int j = 0; j < n; j++)\n {\n if (i != j && a[j] % a[i] == 0)\n {\n if (cnt[a[i]] == 0)\n {\n min++;\n }\n cnt[a[j]]++;\n cnt[a[i]]++;\n }\n }\n }\n\n for (int i = 0; i < n; i++)\n {\n if (cnt[a[i]] == 0)\n {\n min++;\n }\n }\n\n Console.WriteLine(min);\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "8a168c92fb26696cbc40eba5ab5eba81", "src_uid": "63d9b7416aa96129c57d20ec6145e0cd", "apr_id": "4ca08174a47218098ba1ce7a08f2c885", "difficulty": 800, "tags": ["greedy", "math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.744299674267101, "equal_cnt": 14, "replace_cnt": 12, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 13, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing static System.Console;\nclass Solution\n{\n static void Main(string[] args)\n {\n ReadLine();\n int []b = Array.ConvertAll(ReadLine().Split(), int.Parse);\n Array.Sort(b);\n HashSeta=new HashSet();\n for (int i = 0; i < b.Length; i++)\n {\n for (int j = 2; j <= b[i]; j++)\n {\n if (b[i] % j == 0)\n {\n a.Add(j);\n break;\n }\n }\n }\n WriteLine(a.Count>0?a.Count:1);\n \n\n\n }\n}", "lang": "Mono C#", "bug_code_uid": "7ef0a6a7d05449f356d53eff8d0ad4db", "src_uid": "63d9b7416aa96129c57d20ec6145e0cd", "apr_id": "a0eca6a796b18209fbe01079b0bd8b25", "difficulty": 800, "tags": ["greedy", "math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9992737835875091, "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.Text;\nusing System.Threading.Tasks;\n\nnamespace ConsoleApp6\n{\n class Program\n {\n\n static void Main(string[] args)\n {\n Console.ReadLine();\n string[] input = Console.ReadLine().Split(' ');\n List c = new List();\n foreach (string i in input)\n c.Add(Int32.Parse(i));\n c = c.Distinct().ToList();\n c.Sort();\n List cc = c.ToArray().ToList();\n cc.Reverse();\n int res = 0;\n List bad = new List();\n List combo = new List();\n foreach (int g in c)\n {\n if (bad.Contains(g))\n continue;\n foreach (int h in cc)\n {\n if (h % g == 0)\n {\n combo.Add(h);\n }\n }\n Console.WriteLine(\"COMBO! {0}\", string.Join(\" \", combo));\n if (combo.Count() > 0)\n res += 1;\n foreach (int i in combo)\n {\n bad.Add(i);\n }\n }\n \n \n Console.WriteLine(res);\n Console.ReadLine();\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "dc1fb0f8973669206f51462d039463f3", "src_uid": "63d9b7416aa96129c57d20ec6145e0cd", "apr_id": "2854dd1483be8ee3b8329e70fd1768ef", "difficulty": 800, "tags": ["greedy", "math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.05666156202143951, "equal_cnt": 14, "replace_cnt": 13, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 15, "bug_source_code": "#include\n#include\n#include\n#include\n//#include\nint coso2 (std::string s);\nint main ()\n{\n\tint t;\n\tstd::cin >> t;\n\twhile(t-->0)\n\t{\n\t\tstd::string s; std::cin >> s;\n\t\tint kq { 0 },sos0 { 0 };\n\t\tfor(int i = 0; i < s.length (); i++)\n\t\t{\n\t\t\tif(s[i] == '1')\n\t\t\t{\n\t\t\t\tfor(int j = i; j < s.length (); j++)\n\t\t\t\t{\n\t\t\t\t\tint now = coso2 (s.substr (i,j - i + 1));\n\t\t\t\t\tif(now > pow (2,18)) break;\n\t\t\t\t\telse if(now <= j - i + 1 + sos0)kq++;\n\t\t\t\t}\n\t\t\t\tsos0 = 0;\n\t\t\t}\n\t\t\telse sos0++;\n\t\t}\n\t\tstd::cout << kq;\n\t}\n}\nint coso2 (std::string s)\n{\n\tint kq { 0 };\n\tfor(int i = 0; i < s.length(); i++)\n\t\tkq = 2 * kq + s[i] == '1';\n\treturn kq;\n}", "lang": "Mono C#", "bug_code_uid": "1adbf753aa14f87a16d70836618a169f", "src_uid": "63d9b7416aa96129c57d20ec6145e0cd", "apr_id": "c6ff7c855f715b3d32136b090dd4ea68", "difficulty": 800, "tags": ["greedy", "math", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.642, "equal_cnt": 8, "replace_cnt": 5, "delete_cnt": 2, "insert_cnt": 1, "fix_ops_cnt": 8, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\nusing System.Text;\n\nclass Solution\n{\n\tpublic static void Main (string[] args)\n\t{ \n\t\tConsole.ReadLine ();\n\t\tList nums = Console.ReadLine ().Split (' ').Select (int.Parse).ToList ();\n\t\tint result = 0;\n\t\tfor (int i = 2; nums.Count > 0 && i <= nums.Max (); i++) {\n\t\t\tList div = nums.Where (x => x % i == 0).ToList ();\n\t\t\tif (div.Count > 0) {\n\t\t\t\tnums = nums.Where (x => x % i != 0).ToList ();\n\t\t\t\tresult++;\n\t\t\t}\n\t\t}\n\t\tConsole.WriteLine (result);\n\t}\n} ", "lang": "Mono C#", "bug_code_uid": "b2d2dea7abddfe7385d26d043f923ca6", "src_uid": "63d9b7416aa96129c57d20ec6145e0cd", "apr_id": "b9a146e525f72c0feda140f2013b46d7", "difficulty": 800, "tags": ["greedy", "math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.3392568659127625, "equal_cnt": 10, "replace_cnt": 5, "delete_cnt": 5, "insert_cnt": 0, "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 Problem\n{\n class Program\n {\n static void Main(string[] args)\n {\n int loop = int.Parse(Console.ReadLine());\n int[] arr = new int[loop];\n var res = 0;\n var input = Console.ReadLine().Split(' ');\n for (int i = 0; i < loop; i++)\n {\n arr[i] = int.Parse(input[i]);\n }\n var distinctArr = arr.Distinct().ToArray();\n Array.Sort(arr);\n Array.Sort(distinctArr);\n \n for (int i = 0; i < distinctArr.Length; i++)\n {\n if (!arr.Contains(distinctArr[i]))\n continue;\n for (int j = 0; j < arr.Length; j++)\n {\n if (arr[j] % distinctArr[i] == 0)\n {\n arr = arr.Where(val => val != arr[j]).ToArray();\n }\n }\n\n \n res++;\n if (arr.Length == 0)\n break;\n \n }\n Console.WriteLine(res);\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "ae659af3cd04e64439c4bb698dc94d9c", "src_uid": "63d9b7416aa96129c57d20ec6145e0cd", "apr_id": "5a4b694c25b253a2a14ad7544c081e3b", "difficulty": 800, "tags": ["greedy", "math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.8352223190932868, "equal_cnt": 17, "replace_cnt": 9, "delete_cnt": 6, "insert_cnt": 2, "fix_ops_cnt": 17, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace Problem\n{\n class Program\n {\n static void Main(string[] args)\n {\n Console.ReadLine ();\n\t\tList nums = Console.ReadLine ().Split (' ').Select (long.Parse).Distinct ().ToList ();\n\t\tint result = 0;\n\t\twhile (nums.Count > 0) {\n\t\t\tlong min = nums.Min ();\n\t\t\tnums = nums.Where (n => n % min != 0).ToList ();\n\t\t\tresult++;\n\t\t}\n \n\t\tConsole.WriteLine (result);\n }\n }\n\n", "lang": "Mono C#", "bug_code_uid": "89793dc36181def15347b40e97b0fc95", "src_uid": "63d9b7416aa96129c57d20ec6145e0cd", "apr_id": "5a4b694c25b253a2a14ad7544c081e3b", "difficulty": 800, "tags": ["greedy", "math", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.4026742093083055, "equal_cnt": 53, "replace_cnt": 20, "delete_cnt": 30, "insert_cnt": 3, "fix_ops_cnt": 53, "bug_source_code": "using System;\nusing System.IO;\nusing System.Collections;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\n\nnamespace A {\n\tclass Program {\n\t\tstatic void Main() {\n\t\t\tstring[] arr = {Console.ReadLine(), Console.ReadLine(), Console.ReadLine(), Console.ReadLine()};\n\t\t\tstring ret = \"NO\";\n\t\t\t\n\t\t\tfor (int i = 0; i < 4; i++)\n\t\t\t{\n\t\t\t\tfor (int j = 0; j < 4; j++)\n\t\t\t\t{\n\t\t\t\t\tif (arr[i][j] == 'x') {\n\t\t\t\t\t\tif (i > 0) {\n\t\t\t\t\t\t\tif (j > 0) {\n\t\t\t\t\t\t\t\tif (arr[i - 1][j - 1] == 'x') {\n\t\t\t\t\t\t\t\t\tif (i < 4 && j < 4) {\n\t\t\t\t\t\t\t\t\t\tif (arr[i + 1][j + 1] == '.') {\n\t\t\t\t\t\t\t\t\t\t\tret = \"YES\";\n\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (arr[i - 1][j] == 'x') {\n\t\t\t\t\t\t\t\tif (i < 4) {\n\t\t\t\t\t\t\t\t\tif (arr[i + 1][j] == '.') {\n\t\t\t\t\t\t\t\t\t\tret = \"YES\";\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (j < 4) {\n\t\t\t\t\t\t\t\tif (arr[i - 1][j + 1] == 'x') {\n\t\t\t\t\t\t\t\t\tif (i < 4 && j > 0) {\n\t\t\t\t\t\t\t\t\t\tif (arr[i + 1][j - 1] == '.') {\n\t\t\t\t\t\t\t\t\t\t\tret = \"YES\";\n\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (j > 0) {\n\t\t\t\t\t\t\tif (arr[i][j - 1] == 'x') {\n\t\t\t\t\t\t\t\tif (j < 4) {\n\t\t\t\t\t\t\t\t\tif (arr[i][j + 1] == '.') {\n\t\t\t\t\t\t\t\t\t\tret = \"YES\";\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (j < 4) {\n\t\t\t\t\t\t\tif (arr[i][j + 1] == 'x') {\n\t\t\t\t\t\t\t\tif (j > 0) {\n\t\t\t\t\t\t\t\t\tif (arr[i][j - 1] == '.') {\n\t\t\t\t\t\t\t\t\t\tret = \"YES\";\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (i < 4) {\n\t\t\t\t\t\t\tif (j > 0) {\n\t\t\t\t\t\t\t\tif (arr[i + 1][j - 1] == 'x') {\n\t\t\t\t\t\t\t\t\tif (i > 0 && j < 4) {\n\t\t\t\t\t\t\t\t\t\tif (arr[i - 1][j + 1] == '.') {\n\t\t\t\t\t\t\t\t\t\t\tret = \"YES\";\n\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (arr[i + 1][j] == 'x') {\n\t\t\t\t\t\t\t\tif (i > 0) {\n\t\t\t\t\t\t\t\t\tif (arr[i - 1][j] == '.') {\n\t\t\t\t\t\t\t\t\t\tret = \"YES\";\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (j < 4) {\n\t\t\t\t\t\t\t\tif (arr[i + 1][j + 1] == 'x') {\n\t\t\t\t\t\t\t\t\tif (i > 0 && j > 0) {\n\t\t\t\t\t\t\t\t\t\tif (arr[i - 1][j - 1] == '.') {\n\t\t\t\t\t\t\t\t\t\t\tret = \"YES\";\n\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tConsole.WriteLine(ret);\n\t\t}\n\t}\n} ", "lang": "MS C#", "bug_code_uid": "7023c405481b32a6c2433fc2eeef7e67", "src_uid": "ca4a77fe9718b8bd0b3cc3d956e22917", "apr_id": "c6df6ad4f8c6daa7ebcd6bfad7f0816c", "difficulty": 1100, "tags": ["brute force", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C#"} {"similarity_score": 0.8603832616347282, "equal_cnt": 7, "replace_cnt": 2, "delete_cnt": 2, "insert_cnt": 2, "fix_ops_cnt": 6, "bug_source_code": "using 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[] dx = new int[4] { 0, -1, -1, -1 };\n int[] dy = new int[4] { -1, -1, 0, 1 };\n int[,] a = new int[233,233];\n Array.Clear(a, -1, 233 * 233);\n for (int i=1; i<=4; i++) {\n for (int j=1; j<=4;j++) {\n char c;\n c = Convert.ToChar(Console.Read());\n if (c == 'x') a[i, j] = 1;\n if (c == '.') a[i, j] = 0;\n }\n Console.ReadLine();\n }\n for (int i=1;i<=4;i++) {\n for (int j=1;j<=4;j++) {\n for (int k=0;k<=3;k++)\n if ((a[i,j]+a[i+dx[k],j+dy[k]]+a[i-dx[k],j-dy[k]])>=2){\n Console.Write(\"YES\");\n Console.ReadKey();\n return;\n }\n }\n }\n Console.WriteLine(\"NO\");\n return;\n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "d664292da55353b014256f88c6a388df", "src_uid": "ca4a77fe9718b8bd0b3cc3d956e22917", "apr_id": "98aa476bd3c943c5e08dde80a4b0fd69", "difficulty": 1100, "tags": ["brute force", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.02481121898597627, "equal_cnt": 14, "replace_cnt": 14, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 15, "bug_source_code": "\nMicrosoft Visual Studio Solution File, Format Version 12.00\n# Visual Studio 15\nVisualStudioVersion = 15.0.28307.438\nMinimumVisualStudioVersion = 10.0.40219.1\nProject(\"{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}\") = \"ConsoleApp2\", \"ConsoleApp2\\ConsoleApp2.csproj\", \"{8A072859-3DA3-41B0-B955-9F07898E9750}\"\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{8A072859-3DA3-41B0-B955-9F07898E9750}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{8A072859-3DA3-41B0-B955-9F07898E9750}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{8A072859-3DA3-41B0-B955-9F07898E9750}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{8A072859-3DA3-41B0-B955-9F07898E9750}.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 = {1B2E71C2-A7F2-48DF-9D5C-3DE7E7295B71}\n\tEndGlobalSection\nEndGlobal\n", "lang": "Mono C#", "bug_code_uid": "28cb4191494be5f25262d8db2e1312a8", "src_uid": "84cb9ad2ae3ba7e912920d7feb4f6219", "apr_id": "d93804148f9cdb373a24ead5e4dbe296", "difficulty": 800, "tags": ["strings", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.5974643423137876, "equal_cnt": 15, "replace_cnt": 9, "delete_cnt": 1, "insert_cnt": 6, "fix_ops_cnt": 16, "bug_source_code": "Console.Write(\"Enter Your String: \");\n string myString = Console.ReadLine();\n\n int i = 0;\n int count = 0;\n while(i < myString.Length)\n {\n if (myString[i] == 'a')\n {\n count++;\n }\n i++;\n }\n\n int result = (count * 2) - 1;\n if (result > myString.Length)\n {\n result = myString.Length;\n }\n Console.WriteLine(\"The Answer is: \" + result);", "lang": "Mono C#", "bug_code_uid": "8bd04d302d4d2711949d43ea81a4686d", "src_uid": "84cb9ad2ae3ba7e912920d7feb4f6219", "apr_id": "fabf42ae8c33eed1b70a32c5054b5ff4", "difficulty": 800, "tags": ["strings", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.8984263233190272, "equal_cnt": 6, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 6, "bug_source_code": "namespace CodeforcesProject001\n{\n class Program\n {\n private static int Main(string[] args)\n {\n string s;\n string a = \"\";\n int Lenght=0;\n for (int i = 0; i < s.Length; i++)\n {\n if (s[i] == 'a')\n {\n a += 'a';\n }\n }\n for (int i = 0; i < s.Length; i++)\n {\n if (a.Length > (s.Length - i) / 2)\n {\n Lenght= s.Length - i;\n break;\n }\n }\n return Lenght;\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "c80aa3a8d4658cbc0ee533d692af1fdc", "src_uid": "84cb9ad2ae3ba7e912920d7feb4f6219", "apr_id": "45bf75c733997dcf83c7388acba654ad", "difficulty": 800, "tags": ["strings", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9627263045793397, "equal_cnt": 6, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 5, "fix_ops_cnt": 5, "bug_source_code": "using System;\nusing System.Linq;\nclass Program\n{\n static void Main(string[] args)\n {\n Problem1154C();\n }\n\n static void Problem1154C()\n {\n string s = Console.ReadLine();\n var arr = s.Split(' ').Select(x => Convert.ToInt32(x)).ToArray();\n Console.WriteLine(Problem1154C(arr[0], arr[1], arr[2]));\n }\n static int Problem1154C(int a, int b, int c)\n {\n int[] result = new int[7];\n for (int i = 0; i < 7; i++)\n {\n result[i] = Problem1154C(i, a, b, c);\n }\n return result.Max();\n }\n static int Problem1154C(int i, int a, int b, int c)\n {\n int count = 0;\n for (int j = i; ; j++)\n {\n var r = Problem1154C(j, ref a, ref b, ref c, ref count);\n if (r == true)\n return count;\n }\n\n throw new Exception();\n }\n\n static bool Problem1154C(int i, ref int a, ref int b, ref int c, ref int count)\n {\n switch (i % 7 + 1)\n {\n case 1:\n case 4:\n case 7:\n if (a == 0)\n return true;\n else\n {\n a--;\n count++;\n return false;\n }\n case 2:\n case 6:\n if (b == 0)\n return true;\n else\n {\n b--;\n count++;\n return false;\n }\n case 3:\n case 5:\n if (c == 0)\n return true;\n else\n {\n c--;\n count++;\n return false;\n }\n }\n throw new Exception();\n }\n}", "lang": ".NET Core C#", "bug_code_uid": "eb739fca4de6f7856b2fc0651d7e804c", "src_uid": "e17df52cc0615585e4f8f2d31d2daafb", "apr_id": "e713c01f81037f462a8c3755a457a374", "difficulty": 1400, "tags": ["math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.9984817115251898, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "using System;\nusing System.Linq;\nusing CompLib.Util;\n\npublic class Program\n{\n\n public void Solve()\n {\n var sc = new Scanner();\n int a = sc.NextInt();\n int b = sc.NextInt();\n int c = sc.NextInt();\n\n int w = Math.Min(a / 3, Math.Min(b / 2, c / 2));\n\n a -= w * 3;\n b -= w * 2;\n c -= w * 2;\n int max = int.MinValue;\n for (int be = 0; be < 7; be++)\n {\n int ta = a;\n int tb = b;\n int tc = c;\n int cnt = 0;\n bool f = true;\n for (int i = 0; f && i < 7; i++)\n {\n switch ((i + be) % 7)\n {\n case 0:\n case 3:\n case 6:\n if (ta == 0)\n {\n f = false;\n break;\n }\n ta--;\n cnt++;\n break;\n case 1:\n case 5:\n if (tb == 0)\n {\n f = false;\n return;\n }\n tb--;\n cnt++;\n break;\n case 2:\n case 4:\n if (tc == 0)\n {\n f = false;\n break;\n }\n tc--;\n cnt++;\n break;\n }\n }\n\n\n max = Math.Max(max, cnt);\n }\n\n Console.WriteLine(w * 7 + max);\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}\n", "lang": "Mono C#", "bug_code_uid": "9fb69082def90beced7dc7e608e9edf2", "src_uid": "e17df52cc0615585e4f8f2d31d2daafb", "apr_id": "b63bf2c506959ca9a41ce85dd2e73cf5", "difficulty": 1400, "tags": ["math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.996033494931688, "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.IO;\nusing System.Linq;\n\nclass Program\n{\n const string inputPath = \"input.txt\";\n const string outPath = \"output.txt\";\n static void Main(string[] args)\n {\n var stringNums = Console.ReadLine().Split(' ');\n List a = new List();\n foreach (var num in stringNums)\n {\n a.Add(int.Parse(num));\n }\n\n List idx = new List{\n 0, 1, 2, 0, 2, 1, 0\n };\n\n int full = new[] \n { \n a[0] / 3,\n a[1] / 2,\n a[2] / 2 \n }.Min();\n \n a[0] -= full * 3;\n a[1] -= full * 2;\n a[2] -= full * 2;\n\n int ans = 0;\n for (int start = 0; start < 7; ++start)\n {\n int day = start;\n List b = a;\n int cur = 0;\n while (b[idx[day]] > 0)\n {\n --b[idx[day]];\n day = (day + 1) % 7;\n ++cur;\n }\n ans = Math.Max(ans, full * 7 + cur);\n }\n System.Console.WriteLine(ans);\n }\n}", "lang": "Mono C#", "bug_code_uid": "3864789fc9ca976acb24b58458b27a69", "src_uid": "e17df52cc0615585e4f8f2d31d2daafb", "apr_id": "7d60af6d9f2249d33549332805300b86", "difficulty": 1400, "tags": ["math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.9655526992287917, "equal_cnt": 15, "replace_cnt": 6, "delete_cnt": 1, "insert_cnt": 7, "fix_ops_cnt": 14, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace KotikGurman\n{\n class Program\n {\n static int CountDaysTillMonday(ref int a, ref int b, ref int c,int startDay)\n {\n var count = 0;\n var canContinue = true;\n for (var i = startDay; i <= 7 && canContinue; i++)\n {\n if (i == 1 || i == 4 || i == 7)\n {\n if (a > 0) a--; else canContinue = false;\n }\n else\n {\n if (i == 2 || i == 6)\n {\n if (b > 0) b--; else canContinue = false;\n }\n else\n {\n if (c > 0) c--; else canContinue = false;\n }\n }\n\n if (canContinue) count++;\n }\n\n return count;\n\n }\n\n static int CountDaysFromMonday(int a, int b, int c)\n {\n return Math.Min(a / 3, Math.Min(b / 2, c / 2))*7;\n }\n\n static void Main(string[] args)\n {\n var s = Console.ReadLine().Split();\n var a = int.Parse(s[0]);\n var b = int.Parse(s[1]);\n var c = int.Parse(s[2]);\n\n var max = 0;\n for (var i = 1; i <= 7; i++)\n {\n var x = a;\n var y = b;\n var z = c;\n\n var count = CountDaysTillMonday(ref x, ref y, ref z, i);\n\n count += CountDaysFromMonday(x, y, z);\n x = x % 3;\n y = y % 2;\n z = z % 2;\n\n count += CountDaysTillMonday(ref x, ref y, ref z,1);\n\n max = Math.Max(max, count);\n }\n\n Console.WriteLine(max);\n \n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "cd14259c95ccb8cb54c86561a541dc87", "src_uid": "e17df52cc0615585e4f8f2d31d2daafb", "apr_id": "e56fb4253f9bb41e6f9d817a1bd69586", "difficulty": 1400, "tags": ["math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.9961720333258275, "equal_cnt": 6, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 5, "bug_source_code": "using System;\nusing System.IO;\nusing System.Text;\n\nnamespace Gourmet_Cat\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 int a = Next();\n int b = Next();\n int c = Next();\n\n int max = 0;\n\n var aa = new[] {1, 4, 7};\n var bb = new[] {2, 6};\n var cc = new[] {3, 5};\n\n for (int i = 0; i < 7; i++)\n {\n max = Math.Max(max,\n Math.Min(7*(a/3) + (a%3 == 0 ? aa[0] : (a%3 == 1 ? aa[1] : aa[2])),\n Math.Min(7*(b/2) + (b%2 == 0 ? bb[0] : bb[1]),\n 7*(c/2) + (c%2 == 0 ? cc[0] : cc[1]))) - 1);\n\n Process(aa);\n Process(bb);\n Process(cc);\n }\n\n return max;\n }\n\n private static void Process(int[] aa)\n {\n for (int i = 0; i < aa.Length; i++)\n {\n aa[i]--;\n }\n if (aa[0] == 0)\n {\n for (int i = 1; i < aa.Length; i++)\n {\n aa[i - 1] = aa[i];\n }\n aa[aa.Length - 1] = 7;\n }\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": "Mono C#", "bug_code_uid": "7e6635f23cfe8f6012f7e8fe876f0fb9", "src_uid": "e17df52cc0615585e4f8f2d31d2daafb", "apr_id": "502e24da28ccae9a8083867987754b15", "difficulty": 1400, "tags": ["math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.9814651368049426, "equal_cnt": 5, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 4, "bug_source_code": "using System;\nusing System.Linq;\nusing System.Collections.Generic;\n\npublic class Test\n{\n\tpublic static void Main()\n\t{\n\t\tvar x = Console.ReadLine().Split().Select(t => int.Parse(t)).ToList();\n\t\t\n\t\tvar minWeeks = int.MaxValue;\n\t\t\n\t\tminWeeks = Math.Min(minWeeks, x[0]/3);\n\t\tminWeeks = Math.Min(minWeeks, x[1]/2);\n\t\tminWeeks = Math.Min(minWeeks, x[2]/2);\n\t\t\n\t\tx[0] -= minWeeks*3;\n\t\tx[1] -= minWeeks*2;\n\t\tx[2] -= minWeeks*2;\n\t\t\n\t\tint[] weekEat = new int[] {0, 1, 2, 0, 2, 1, 0};\n\t\t\n\t\tvar maxCount = 0; \n\t\tfor(int i = 0; i < weekEat.Count(); i++)\n\t\t{\n var curCount = 0;\n var j = i;\n\t\t\twhile(curCount < 7)\n {\n if (x[weekEat[j]] > 0)\n {\n x[weekEat[j]]--;\n curCount++;\n }\n else\n {\n maxCount = Math.Max(maxCount, curCount);\n break;\n }\n\n j++;\n if (j == 7)\n {\n j = 0;\n }\n }\n\t\t}\n\n Console.WriteLine(minWeeks*7+maxCount);\n\t}\n}", "lang": "Mono C#", "bug_code_uid": "e41f74d6af674d78780df6140630b77e", "src_uid": "e17df52cc0615585e4f8f2d31d2daafb", "apr_id": "1d0c662c16d56dcf5ddf34ee14aa974b", "difficulty": 1400, "tags": ["math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.9991977537103891, "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.Text;\n\nnamespace ConsoleApp1\n{\n class Program\n {\n static void Main(string[] args)\n {\n\n var abc = Console.ReadLine().Split(' ').Select(int.Parse).ToArray();\n\n var a = abc[0];\n var b = abc[1];\n var c = abc[2];\n\n var fullWeeks = Math.Min(Math.Min(a / 3, b / 2), c / 2);\n\n a = a - fullWeeks * 3;\n b = b - fullWeeks * 2;\n c = c - fullWeeks * 2;\n\n var dayStart = 1;\n var maxTotalDays = 0;\n for(var i=1; i <= 7; i++)\n {\n var currA = a;\n var currB = b;\n var currC = c;\n var currDay = i;\n var totalDays = 0;\n while (true)\n {\n currDay = (currDay - 1)%7+1;\n if(currDay==1 || currDay==4 || currDay == 7)\n {\n if(currA > 0)\n {\n currA--;\n currDay++;\n totalDays++;\n continue;\n }\n }\n else if (currDay == 2 || currDay == 6)\n {\n if (currB > 0)\n {\n currB--;\n currDay++;\n totalDays++;\n continue;\n }\n }\n else\n {\n if (currC > 0)\n {\n currC--;\n currDay++;\n totalDays++;\n continue;\n }\n }\n break;\n }\n if (totalDays > maxTotalDays) {\n if (fullWeeks == 0)\n {\n dayStart = i;\n maxTotalDays = totalDays;\n }\n else if (fullWeeks != 0 && totalDays >= 8 - i)\n {\n dayStart = i;\n maxTotalDays = totalDays;\n }\n }\n }\n\n Console.WriteLine(maxTotalDays+fullWeeks*7);\n }\n }\n}", "lang": "Mono C#", "bug_code_uid": "36c781d10996d66ae486f57dbb31cf69", "src_uid": "e17df52cc0615585e4f8f2d31d2daafb", "apr_id": "7be88bd953886c3938ab8a76d2b2f408", "difficulty": 1400, "tags": ["math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.1813573641227823, "equal_cnt": 32, "replace_cnt": 24, "delete_cnt": 2, "insert_cnt": 6, "fix_ops_cnt": 32, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\n\nnamespace ConsoleApp1\n{\n class Program\n {\n static void Main(string[] args)\n {\n string[] food = Console.ReadLine().Split(' ');\n\n int[] week = new int[7];\n\n int fish = int.Parse(food[0]);\n int rabbit = int.Parse(food[1]);\n int chicken = int.Parse(food[2]);\n\n int resultCount = -1;\n int maxres = -5;\n\n for (int j = 0; j < 7; j++)\n {\n if (maxres < resultCount)\n maxres = resultCount;\n resultCount = -1;\n fish = int.Parse(food[0]);\n rabbit = int.Parse(food[1]);\n chicken = int.Parse(food[2]);\n for (int i = j; i < week.Length; i++)\n {\n resultCount++;\n\n if ((i == 0) || (i == 3) || (i == 6))\n if (--fish < 0)\n break;\n if ((i == 1) || (i == 5))\n if (--rabbit < 0)\n break;\n if ((i == 2) || (i == 4))\n if (--chicken < 0)\n break;\n\n if (i == 6)\n i = -1;\n }\n }\n\n Console.WriteLine(maxres);\n\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "623feb4fc8d4eebc9cb1bda901ee52a2", "src_uid": "e17df52cc0615585e4f8f2d31d2daafb", "apr_id": "343089121cacdef134b4ac3487f4beb1", "difficulty": 1400, "tags": ["math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9881169039717375, "equal_cnt": 6, "replace_cnt": 5, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 5, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Globalization;\nusing System.IO;\nusing System.Linq;\nusing static System.Math;\n\n// https://codeforces.com/contest/1154/problem/C\npublic class GourmetCat\n{\n private static void Solve()\n {\n int[] a = ReadIntArray();\n int[] week = new int[14] { 0, 1, 2, 0, 2, 1, 0, 0, 1, 2, 0, 2, 1, 0, };\n \n // Get maximum common weeks\n int @base = Min(a[0] / 3, Min(a[1] / 2, a[2] / 2));\n int total = @base * 7;\n\n // Add extra days that conform less than a week\n int max = 0;\n for (int i = 0; i < 7; i++)\n {\n int[] aClone = (int[])a.Clone();\n int j;\n for (j = i; j < i + 7; j++)\n {\n if (aClone[week[j]] == 0)\n break;\n aClone[week[j]]--;\n }\n\n if (j - i > max)\n max = j - i;\n }\n\n Write(total + max);\n }\n\n #region Main\n\n private static TextReader reader;\n private static TextWriter writer;\n\n public static void Main()\n {\n#if DEBUG\n\n //reader = new StreamReader(\"C:\\\\Users\\\\Axel\\\\Desktop\\\\input.txt\");\n reader = new StreamReader(Console.OpenStandardInput());\n writer = Console.Out;\n\n //writer = new StreamWriter(\"..\\\\..\\\\output.txt\");\n#else\n reader = new StreamReader(Console.OpenStandardInput());\n writer = new StreamWriter(Console.OpenStandardOutput());\n\n //reader = new StreamReader(\"input.txt\");\n //writer = new StreamWriter(\"output.txt\");\n#endif\n try\n {\n Solve();\n\n //var thread = new Thread(new String_Task().Solve, 1024 * 1024 * 128);\n //thread.Start();\n //thread.Join();\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 Main\n\n #region Read / Write\n\n private static Queue currentLineTokens = new Queue();\n\n private static string[] ReadAndSplitLine()\n {\n return reader.ReadLine().Split(new[] { ' ', '\\t', }, StringSplitOptions.RemoveEmptyEntries);\n }\n\n public static string Read()\n {\n while (currentLineTokens.Count == 0) currentLineTokens = new Queue(ReadAndSplitLine()); return currentLineTokens.Dequeue();\n }\n\n public static int ReadInt()\n {\n return int.Parse(Read());\n }\n\n public static long ReadLong()\n {\n return long.Parse(Read());\n }\n\n public static double ReadDouble()\n {\n return double.Parse(Read(), CultureInfo.InvariantCulture);\n }\n\n public static int[] ReadIntArray()\n {\n return ReadAndSplitLine().Select(int.Parse).ToArray();\n }\n\n public static long[] ReadLongArray()\n {\n return ReadAndSplitLine().Select(long.Parse).ToArray();\n }\n\n public static double[] ReadDoubleArray()\n {\n return ReadAndSplitLine().Select(s => double.Parse(s, CultureInfo.InvariantCulture)).ToArray();\n }\n\n public static int[][] ReadIntMatrix(int numberOfRows)\n {\n int[][] matrix = new int[numberOfRows][]; for (int i = 0; i < numberOfRows; i++) matrix[i] = ReadIntArray(); return matrix;\n }\n\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]; }\n return ret;\n }\n\n public static string[] ReadLines(int quantity)\n {\n string[] lines = new string[quantity]; for (int i = 0; i < quantity; i++) lines[i] = reader.ReadLine().Trim(); return lines;\n }\n\n public static void WriteArray(IEnumerable array)\n {\n writer.WriteLine(string.Join(\" \", array));\n }\n\n public static void Write(params object[] array)\n {\n WriteArray(array);\n }\n\n public static void WriteLines(IEnumerable array)\n {\n foreach (var a in array) writer.WriteLine(a);\n }\n\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\n private static T[] Init(int size) where T : new()\n {\n var ret = new T[size]; for (int i = 0; i < size; i++) ret[i] = new T(); return ret;\n }\n\n #endregion Read / Write\n}\n", "lang": "Mono C#", "bug_code_uid": "b3b723c9ef37306cad787979367c148a", "src_uid": "e17df52cc0615585e4f8f2d31d2daafb", "apr_id": "ccc541d8d957d4f4743ad96147fbc257", "difficulty": 1400, "tags": ["math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9971249068256842, "equal_cnt": 7, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 6, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Globalization;\nusing System.IO;\nusing System.Linq;\nusing static System.Math;\n\n// https://codeforces.com/contest/1154/problem/C\npublic class GourmetCat\n{\n private static void Solve()\n {\n int[] a = ReadIntArray();\n int[] week = new int[14] { 0, 1, 2, 0, 2, 1, 0, 0, 1, 2, 0, 2, 1, 0, };\n \n // Get maximum common weeks\n int nWeeks = Min(a[0] / 3, Min(a[1] / 2, a[2] / 2));\n eat[0] -= n * 3;\n eat[1] -= n * 2;\n eat[2] -= n * 2;\n\n // Add extra days that conform less than a week\n int max = 0;\n for (int i = 0; i < 7; i++)\n {\n int[] aClone = (int[])a.Clone();\n int j;\n for (j = i; j < i + 7; j++)\n {\n if (aClone[week[j]] == 0)\n break;\n aClone[week[j]]--;\n }\n\n if (j - i > max)\n max = j - i;\n }\n\n Write(nWeeks * 7 + max);\n }\n\n #region Main\n\n private static TextReader reader;\n private static TextWriter writer;\n\n public static void Main()\n {\n#if DEBUG\n\n //reader = new StreamReader(\"C:\\\\Users\\\\Axel\\\\Desktop\\\\input.txt\");\n reader = new StreamReader(Console.OpenStandardInput());\n writer = Console.Out;\n\n //writer = new StreamWriter(\"..\\\\..\\\\output.txt\");\n#else\n reader = new StreamReader(Console.OpenStandardInput());\n writer = new StreamWriter(Console.OpenStandardOutput());\n\n //reader = new StreamReader(\"input.txt\");\n //writer = new StreamWriter(\"output.txt\");\n#endif\n try\n {\n Solve();\n\n //var thread = new Thread(new String_Task().Solve, 1024 * 1024 * 128);\n //thread.Start();\n //thread.Join();\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 Main\n\n #region Read / Write\n\n private static Queue currentLineTokens = new Queue();\n\n private static string[] ReadAndSplitLine()\n {\n return reader.ReadLine().Split(new[] { ' ', '\\t', }, StringSplitOptions.RemoveEmptyEntries);\n }\n\n public static string Read()\n {\n while (currentLineTokens.Count == 0) currentLineTokens = new Queue(ReadAndSplitLine()); return currentLineTokens.Dequeue();\n }\n\n public static int ReadInt()\n {\n return int.Parse(Read());\n }\n\n public static long ReadLong()\n {\n return long.Parse(Read());\n }\n\n public static double ReadDouble()\n {\n return double.Parse(Read(), CultureInfo.InvariantCulture);\n }\n\n public static int[] ReadIntArray()\n {\n return ReadAndSplitLine().Select(int.Parse).ToArray();\n }\n\n public static long[] ReadLongArray()\n {\n return ReadAndSplitLine().Select(long.Parse).ToArray();\n }\n\n public static double[] ReadDoubleArray()\n {\n return ReadAndSplitLine().Select(s => double.Parse(s, CultureInfo.InvariantCulture)).ToArray();\n }\n\n public static int[][] ReadIntMatrix(int numberOfRows)\n {\n int[][] matrix = new int[numberOfRows][]; for (int i = 0; i < numberOfRows; i++) matrix[i] = ReadIntArray(); return matrix;\n }\n\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]; }\n return ret;\n }\n\n public static string[] ReadLines(int quantity)\n {\n string[] lines = new string[quantity]; for (int i = 0; i < quantity; i++) lines[i] = reader.ReadLine().Trim(); return lines;\n }\n\n public static void WriteArray(IEnumerable array)\n {\n writer.WriteLine(string.Join(\" \", array));\n }\n\n public static void Write(params object[] array)\n {\n WriteArray(array);\n }\n\n public static void WriteLines(IEnumerable array)\n {\n foreach (var a in array) writer.WriteLine(a);\n }\n\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\n private static T[] Init(int size) where T : new()\n {\n var ret = new T[size]; for (int i = 0; i < size; i++) ret[i] = new T(); return ret;\n }\n\n #endregion Read / Write\n}\n", "lang": "Mono C#", "bug_code_uid": "49bab039ff8d7ca1fbb0df131607c23e", "src_uid": "e17df52cc0615585e4f8f2d31d2daafb", "apr_id": "ccc541d8d957d4f4743ad96147fbc257", "difficulty": 1400, "tags": ["math", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9998010741993236, "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.ComponentModel;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace ConsoleApplication1\n{\n class Program\n {\n static void Main(string[] args)\n {\n var data = Console.ReadLine().Split().Select(long.Parse).ToArray();\n var a = data[0];//0 3 6\n var b = data[1];// 1 5\n var c = data[2];// 2 4\n\n var res = GetMax(0, a, b, c);\n for (int i = 1; i < 7; i++) \n res = Math.Max(res, GetMax(i, a, b, c)); \n\n Console.WriteLine(res);\n }\n\n static long GetMax(long startingDay, long a, long b, long c)\n {\n if (startingDay == 0)\n {\n var maxA = GetMaxA(a);\n var maxB = GetMaxB(b);\n var maxC = GetMaxC(c);\n return Math.Min(Math.Min(maxA, maxB), maxC);\n }\n\n if (startingDay == 1)\n {\n var maxA = 2L;\n if (a == 1)\n maxA = 5L;\n if (a >= 2) \n maxA = 6 + GetMaxB(a - 2); \n \n var maxB = 0L;\n if (b == 1)\n maxB = 4L;\n if (b >= 2)\n maxB = 6 + GetMaxB(b - 2);\n\n var maxC = 1L;\n if (c == 1) \n maxC = 3L;\n if (c >= 2) \n maxC = 6 + GetMaxC(c - 2); \n\n return Math.Min(Math.Min(maxA, maxB), maxC);\n }\n\n if (startingDay == 2)\n {\n var maxA = 1L;\n if (a == 1)\n maxA = 4L;\n if (a >= 2) \n maxA = 5 + GetMaxA(a - 2);\n\n var maxB = 3L;\n if (b >= 1) \n maxB = 5 + GetMaxB(b - 1); \n\n var maxC = 0L;\n if (c == 1) \n maxC = 2L;\n if (c >= 2) \n maxC = 5 + GetMaxC(c - 2); \n return Math.Min(Math.Min(maxA, maxB), maxC);\n }\n\n if (startingDay == 3)\n {\n var maxA = 0L;\n if (a == 1)\n maxA = 3L;\n if (a >= 2) \n maxA = 4 + GetMaxA(a - 2); \n\n var maxB = 2L;\n if (b >= 1) \n maxB = 4 + GetMaxB(b - 1); \n\n var maxC = 1L;\n if (c >= 1)\n maxC = 4 + GetMaxC(c - 1);\n\n return Math.Min(Math.Min(maxA, maxB), maxC);\n }\n\n if (startingDay == 4)\n {\n var maxA = 2L;\n if (a >= 1) \n maxA = 3 + GetMaxA(a - 1); \n\n var maxB = 1L;\n if (b >= 1) \n maxB = 3 + GetMaxB(b - 1); \n\n var maxC = 0L;\n if (c >= 1) \n maxC = 3 + GetMaxC(c - 1); \n\n return Math.Min(Math.Min(maxA, maxB), maxC);\n }\n\n if (startingDay == 5)\n {\n var maxA = 1L;\n if (a >= 1) \n maxA = 2 + GetMaxA(a - 1);\n\n var maxB = 0L;\n if (b >= 1) \n maxB = 2 + GetMaxB(b - 1); \n\n var maxC = 2 + GetMaxC(c);\n return Math.Min(Math.Min(maxA, maxB), maxC);\n }\n\n\n var maxA1 = 0L;\n if (a >= 1)\n maxA1 = 1 + GetMaxA(a - 1);\n var maxB1 = 1 + GetMaxB(b);\n var maxC1 = 1 + GetMaxC(c); \n\n return Math.Min(Math.Min(maxA1, maxB1), maxC1);\n }\n\n static long GetMaxA(long a)\n {\n if (a == 0)\n return 0;\n var maxA = 7 * (a / 3);\n if (a % 3 == 1)\n maxA += 3;\n if (a % 3 == 2)\n maxA += 6;\n return maxA;\n }\n\n static long GetMaxB(long b)\n {\n if (b == 0)\n return 1;\n var maxB = 7 * (b / 2);\n if (b % 2 == 0)\n maxB += 1;\n if (b % 2 == 1)\n maxB += 5;\n return maxB;\n }\n\n static long GetMaxC(long c)\n {\n if (c == 0)\n return 2;\n var maxC = 7 * (c / 2);\n if (c % 2 == 0)\n maxC += 2;\n if (c % 2 == 1)\n maxC += 4;\n return maxC;\n }\n\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "79e681b55fb8760c99cd9a49f003bc1c", "src_uid": "e17df52cc0615585e4f8f2d31d2daafb", "apr_id": "00c51b0e39e350ba4023c4a04e78de15", "difficulty": 1400, "tags": ["math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.834068544282321, "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.Threading.Tasks;\nusing System.Text;\nusing System.Collections.Generic;\nusing System.Threading;\n\nnamespace HelloApp\n{\n class Program\n {\n static void Main(string[] args)\n {\n int[] arr = new int[3];\n int[] a = new int[3];\n string[] s = Console.ReadLine().Split();\n for (int i = 0; i < 3; i++)\n arr[i] = Convert.ToInt32(s[i]);\n int ans = 0, buffer = 0, max = 0;\n if (arr[0] >= 3 && arr[1] >= 2 && arr[2] >= 2)\n {\n int min = (arr[2] / 2 > arr[1] / 2) ? arr[1] / 2 : arr[2] / 2;\n min = (min > arr[0] / 3) ? (arr[0] / 3) : min;\n ans = min * 2 + min * 3 + min * 2;\n arr[0] = arr[0] - min * 3;\n arr[1] = arr[1] - min * 2;\n arr[2] = arr[2] - min * 2;\n }\n for (int j = 0; j < 7; j++)\n {\n a[0] = arr[0];\n a[1] = arr[1];\n a[2] = arr[2];\n Parallel.For(j, j+7,\n () => { return 0; },\n (i, loopState, taskValue) =>\n {\n if (a[0] == 0 || a[1] == 0 || a[2] == 0) loopState.Break();\n if (i % 7 == 0 || i % 7 == 3 || i % 7 == 6 && a[0]>0) { a[0]--; taskValue++; }\n if (i % 7 == 1 || i % 7 == 5 && a[1] > 0) { a[1]--; taskValue++; }\n if (i % 7 == 2 || i % 7 == 4 && a[2] > 0) { a[2]--; taskValue++; }\n return taskValue;\n },\n (taskValue) => { Interlocked.Add(ref buffer, taskValue); }\n );\n max = (max > buffer) ? max : buffer;\n buffer = 0;\n }\n Console.WriteLine(ans+max);\n //Parallel.For(0, 3, () => { return 0; }, (i, loopState, index) => { Console.WriteLine(index+i + \" \"); return index; }, index => { });\n //Parallel.ForEach(arr, () => { return 0; }, (i, loopState, index, taskLocal) => { Console.WriteLine(index); return Convert.ToInt32(index); }, index => { });\n Console.ReadLine();\n }\n\n static int Sum(int k)\n {\n int sum = 0;\n for (; k > -1; k--)\n checked { sum += k; }\n return sum;\n }\n static void Foo()\n {\n Console.WriteLine(\"CallBack\");\n }\n }\n}", "lang": "Mono C#", "bug_code_uid": "eae4b679b36f99d28cc61fcbb98cd911", "src_uid": "e17df52cc0615585e4f8f2d31d2daafb", "apr_id": "2de6c0455cabb7409014bd6974c3ec02", "difficulty": 1400, "tags": ["math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.15456811849244756, "equal_cnt": 33, "replace_cnt": 19, "delete_cnt": 8, "insert_cnt": 6, "fix_ops_cnt": 33, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Diagnostics;\nusing System.Globalization;\nusing System.Linq;\nusing System.Net;\n\nnamespace CodeForces\n{\n public class Program\n {\n private static void Main(string[] args)\n {\n var data = Console.ReadLine().Split(' ').Select(long.Parse).ToArray();\n var a = data[0];\n var b = data[1];\n var k = data[2];\n var t = data[3];\n\n if (a == 1 && b == 100 && k == 1000 && t == 100)\n {\n Console.WriteLine(542673827);\n return;\n }\n\n Ari.Precompute(Math.Max(a,b)+t*k*2+10);\n var cache = new Queue();\n long minValueForDequeue = -1;\n\n long maxValA = a + 2*t*k;\n long maxValB = b + 2*t*k;\n long prevTotB = 0;\n long prevMaxB = b-1;\n long result = 0;\n for (long valA = a; valA <= maxValA; ++valA)\n {\n for (long valB = prevMaxB + 1; valB <= Math.Min(maxValB, valA - 1); ++valB)\n {\n if ((valB - b >= minValueForDequeue) && cache.Any())\n {\n prevTotB = prevTotB.Add(cache.Dequeue());\n }\n else\n {\n prevTotB = prevTotB.Add(Ari.ChooseWithConstraints(valB - b, t, 2 * k));\n }\n prevMaxB = valB;\n }\n if (prevTotB != 0)\n {\n var nbWay = Ari.ChooseWithConstraints(valA - a, t, 2 * k);\n if (minValueForDequeue == -1)\n {\n minValueForDequeue = valA - a;\n }\n cache.Enqueue(nbWay);\n result = result.Add(prevTotB.Times(nbWay));\n }\n }\n Console.WriteLine(result);\n }\n }\n\n public static class Ari\n {\n private static Int64 mod = 1000000007;\n\n public static Int64[] Facts;\n public static Int64[] InvFacts;\n\n public static void Precompute(long size)\n {\n Facts = new long[size];\n InvFacts = new long[size];\n Facts[0] = 1;\n InvFacts[0] = 1;\n for (long i = 1; i < size; ++i)\n {\n Facts[i] = i.Times(Facts[i - 1]);\n InvFacts[i] = GetInv(Facts[i], mod);\n }\n }\n\n public static long ChooseWithConstraints(long k, long n, long p)\n {\n long result = 0;\n for (long i = 0; i <= n; ++i)\n {\n if (k < i * (p + 1))\n {\n continue;\n }\n long coef = i % 2 == 0 ? 1 : -1;\n result = result.Add(coef * (n.Choose(i)).Times((n + k - i * (p + 1) - 1).Choose(n - 1)));\n }\n return result;\n }\n\n public static long Choose(this long n, long k)\n {\n if (n == k || k == 0)\n {\n return 1;\n }\n if (k < 0)\n {\n return 0;\n }\n return Facts[n].Times(InvFacts[k]).Times(InvFacts[n - k]);\n }\n\n public static long Add(this long a, long b)\n {\n var result = (a + b) % mod;\n return result < 0 ? result + mod : result;\n }\n\n public static long Times(this long a, long b)\n {\n var result = (a*b) % mod;\n return result < 0 ? result + mod : result;\n }\n\n public static Int64 GetInv(Int64 a, Int64 mod)\n {\n var res = GetExtendedGcd(a, mod);\n var result = res.S%mod;\n return result < 0 ? result + mod : result;\n }\n\n public static SeqResult GetExtendedGcd(Int64 a, Int64 b)\n {\n var old = new SeqResult(a, 1, 0);\n var current = new SeqResult(b, 0, 1);\n Func next = (q, prev, curr) => prev - q * curr;\n\n while (current.R != 0)\n {\n Int64 q = old.R / current.R;\n\n Int64 temp = current.R;\n current.R = next(q, old.R, current.R);\n old.R = temp;\n\n temp = current.S;\n current.S = next(q, old.S, current.S);\n old.S = temp;\n\n temp = current.T;\n current.T = next(q, old.T, current.T);\n old.T = temp;\n }\n return old;\n }\n\n public class SeqResult\n {\n public SeqResult(Int64 r, Int64 s, Int64 t)\n {\n R = r;\n S = s;\n T = t;\n }\n public Int64 R { get; set; }\n public Int64 S { get; set; }\n public Int64 T { get; set; }\n }\n }\n\n}", "lang": "MS C#", "bug_code_uid": "2a04bb35adbbdde37094c044916c08d2", "src_uid": "8b8327512a318a5b5afd531ff7223bd0", "apr_id": "0a5c01805ceb4821c2d4b80b87cfa763", "difficulty": 2200, "tags": ["dp", "math", "combinatorics"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.16356877323420074, "equal_cnt": 33, "replace_cnt": 20, "delete_cnt": 7, "insert_cnt": 6, "fix_ops_cnt": 33, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Diagnostics;\nusing System.Globalization;\nusing System.Linq;\nusing System.Net;\n\nnamespace CodeForces\n{\n public class Program\n {\n private static void Main(string[] args)\n {\n var data = Console.ReadLine().Split(' ').Select(long.Parse).ToArray();\n var a = data[0];\n var b = data[1];\n var k = data[2];\n var t = data[3];\n\n Ari.Precompute(Math.Max(a,b)+t*k*2+10);\n var cache = new Queue();\n\n long maxValA = a + 2*t*k;\n long maxValB = b + 2*t*k;\n long prevTotB = 0;\n long prevMaxB = b-1;\n long result = 0;\n for (long valA = a; valA <= maxValA; ++valA)\n {\n for (long valB = prevMaxB + 1; valB <= Math.Min(maxValB, valA - 1); ++valB)\n {\n if (prevMaxB + 1 == valA && cache.Any())\n {\n prevTotB = prevTotB.Add(cache.Dequeue());\n }\n else\n {\n prevTotB = prevTotB.Add(Ari.ChooseWithConstraints(valB - b, t, 2 * k));\n }\n prevMaxB = valB;\n }\n if (prevTotB != 0)\n {\n var nbWay = Ari.ChooseWithConstraints(valA - a, t, 2 * k);\n cache.Enqueue(nbWay);\n result = result.Add(prevTotB.Times(nbWay));\n }\n }\n Console.WriteLine(result);\n }\n }\n\n public static class Ari\n {\n private static Int64 mod = 1000000007;\n\n public static Int64[] Facts;\n public static Int64[] InvFacts;\n\n public static void Precompute(long size)\n {\n Facts = new long[size];\n InvFacts = new long[size];\n Facts[0] = 1;\n InvFacts[0] = 1;\n for (long i = 1; i < size; ++i)\n {\n Facts[i] = i.Times(Facts[i - 1]);\n InvFacts[i] = GetInv(Facts[i], mod);\n }\n }\n\n public static long ChooseWithConstraints(long k, long n, long p)\n {\n long result = 0;\n for (long i = 0; i <= n; ++i)\n {\n if (k < i * (p + 1))\n {\n continue;\n }\n long coef = i % 2 == 0 ? 1 : -1;\n result = result.Add(coef * (n.Choose(i)).Times((n + k - i * (p + 1) - 1).Choose(n - 1)));\n }\n return result;\n }\n\n public static long Choose(this long n, long k)\n {\n if (n == k || k == 0)\n {\n return 1;\n }\n if (k < 0)\n {\n return 0;\n }\n return Facts[n].Times(InvFacts[k]).Times(InvFacts[n - k]);\n }\n\n public static long Add(this long a, long b)\n {\n var result = (a + b) % mod;\n return result < 0 ? result + mod : result;\n }\n\n public static long Times(this long a, long b)\n {\n var result = (a*b) % mod;\n return result < 0 ? result + mod : result;\n }\n\n public static Int64 GetInv(Int64 a, Int64 mod)\n {\n var res = GetExtendedGcd(a, mod);\n var result = res.S%mod;\n return result < 0 ? result + mod : result;\n }\n\n public static SeqResult GetExtendedGcd(Int64 a, Int64 b)\n {\n var old = new SeqResult(a, 1, 0);\n var current = new SeqResult(b, 0, 1);\n Func next = (q, prev, curr) => prev - q * curr;\n\n while (current.R != 0)\n {\n Int64 q = old.R / current.R;\n\n Int64 temp = current.R;\n current.R = next(q, old.R, current.R);\n old.R = temp;\n\n temp = current.S;\n current.S = next(q, old.S, current.S);\n old.S = temp;\n\n temp = current.T;\n current.T = next(q, old.T, current.T);\n old.T = temp;\n }\n return old;\n }\n\n public class SeqResult\n {\n public SeqResult(Int64 r, Int64 s, Int64 t)\n {\n R = r;\n S = s;\n T = t;\n }\n public Int64 R { get; set; }\n public Int64 S { get; set; }\n public Int64 T { get; set; }\n }\n }\n\n}", "lang": "MS C#", "bug_code_uid": "1f191f457ddbbedfc6a2ead9a5c71ddc", "src_uid": "8b8327512a318a5b5afd531ff7223bd0", "apr_id": "0a5c01805ceb4821c2d4b80b87cfa763", "difficulty": 2200, "tags": ["dp", "math", "combinatorics"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.982546864899806, "equal_cnt": 3, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "\nusing System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace AlgoTraining.Codeforces.D_s\n{\n public class FastScanner : StreamReader\n {\n private string[] _line;\n private int _iterator;\n\n public FastScanner(Stream stream) : base(stream)\n {\n _line = null;\n _iterator = 0;\n }\n public string NextToken()\n {\n if (_line == null || _iterator >= _line.Length)\n {\n _line = base.ReadLine().Split(' ');\n _iterator = 0;\n }\n if (_line.Count() == 0) throw new IndexOutOfRangeException(\"Input string is empty\");\n return _line[_iterator++];\n }\n public int NextInt()\n {\n return Convert.ToInt32(NextToken());\n }\n public long NextLong()\n {\n return Convert.ToInt64(NextToken());\n }\n public float NextFloat()\n {\n return float.Parse(NextToken());\n }\n public double NextDouble()\n {\n return Convert.ToDouble(NextToken());\n }\n }\n class MemoryAndScores370\n {\n private static int a, b, k, t;\n private static long[] comb, combSum;\n private static long mod;\n public static void Main(string[] args)\n {\n using (FastScanner fs = new FastScanner(new BufferedStream(Console.OpenStandardInput())))\n using (StreamWriter writer = new StreamWriter(new BufferedStream(Console.OpenStandardOutput())))\n {\n a = fs.NextInt();\n b = fs.NextInt();\n k = fs.NextInt();\n t = fs.NextInt();\n comb = new long[2 * k * t + 1];\n combSum = new long[2 * k * t + 1];\n mod = (int)1e9 + 7;\n for (int i = 0; i <= 2 * k; i++)\n {\n comb[i] = 1;\n }\n for (int i = 1; i < t; i++)\n {\n long sum = 0;\n long[] tcomb = new long[2 * k * t + 1];\n for (int j = 0; j < comb.Length; j++)\n {\n sum = (sum + comb[j]) % mod;\n if (j > 2 * k) sum = (sum - comb[j - 2 * k - 1]) % mod;\n tcomb[j] = sum;\n }\n comb = tcomb;\n }\n combSum[0] = comb[0];\n for (int i = 1; i < comb.Length; i++)\n {\n combSum[i] = (comb[i] + combSum[i - 1]) % mod;\n }\n\n long ans = 0;\n for (int i = 0; i < comb.Length; i++)\n {\n int index = Math.Min(i + a - b - 1, combSum.Length - 1);\n if (index >= 0) ans = (ans + (comb[i] * combSum[index]) % mod) % mod;\n }\n writer.WriteLine(ans);\n }\n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "71f988ca7bc19177c0a065af3ba5d7fd", "src_uid": "8b8327512a318a5b5afd531ff7223bd0", "apr_id": "149137adc0d230f719789afaa10bd4c9", "difficulty": 2200, "tags": ["dp", "math", "combinatorics"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9941729099774052, "equal_cnt": 6, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 3, "fix_ops_cnt": 5, "bug_source_code": "using Boilerplate.IO;\nusing System;\nusing System.Collections.Generic;\nusing System.Diagnostics;\nusing System.Globalization;\nusing System.IO;\nusing System.Linq;\nusing System.Text;\nusing System.Threading;\nusing System.Threading.Tasks;\n\npublic class Solver\n{\n private readonly StreamReader reader;\n private readonly StreamWriter writer;\n\n public Solver(StreamReader reader, StreamWriter writer)\n {\n this.reader = reader;\n this.writer = writer;\n }\n\n public void Generate()\n {}\n\n public void Do()\n {\n var a = reader.ReadInt();\n var b = reader.ReadInt();\n var k = reader.ReadInt();\n var t = reader.ReadInt();\n\n const int MOD = (int)(1e9 + 7);\n var dim = new int[2][];\n var MED = 2 * k * t;\n dim[0] = new int[MED * 2 + 1];\n dim[1] = new int[MED * 2 + 1];\n var tmp = new int[MED * 2 + 1];\n int h = 0;\n dim[h][MED] = 1;\n for (int i = 1; i <= t; ++i)\n {\n tmp[0] = dim[h][0];\n for (int j = 1; j < tmp.Length; ++j)\n tmp[j] = (dim[h][j] + tmp[j - 1]) % MOD;\n h ^= 1;\n Array.Clear(dim[h], 0, dim[h].Length);\n for (int j = 0; j < dim[h].Length; ++j)\n {\n var acc = 0L;\n if (j > 0)\n acc += dim[h][j - 1];\n acc += tmp[Math.Min(j + 2 * k, tmp.Length - 1)] - 2 * tmp[Math.Max(j - 1, 0)] + tmp[Math.Max(j - 2 - 2 * k, 0)];\n dim[h][j] = (int)(acc % MOD);\n }\n }\n int res = 0;\n int st = b - a + 1 + MED;\n st = Math.Max(st, 0);\n for (int i = st; i < dim[h].Length; ++i)\n res = (res + dim[h][i]) % MOD;\n writer.WriteLine(res);\n }\n}\n\n#region launch\nclass Program\n{\n static void Main(string[] args)\n {\n using (var writer = new FormattedStreamWriter(\n#if SOLVER_RUN_LOCAL\n\"output.txt\"\n#else \n Console.OpenStandardOutput()\n#endif\n))\n {\n using (var reader = new StreamReader(\n#if SOLVER_RUN_LOCAL\n\"input.txt\"\n#else \n Console.OpenStandardInput() \n#endif\n))\n {\n#if SOLVER_RUN_LOCAL\n var stopw = new Stopwatch();\n stopw.Start();\n#endif\n new Solver(reader, writer).Do();\n#if SOLVER_RUN_LOCAL\n stopw.Stop();\n writer.WriteLine(\"> {0}ms\", stopw.ElapsedMilliseconds);\n#endif\n }\n }\n }\n}\n#endregion\n\nnamespace Boilerplate.IO\n{\n #region helpers\n class FormattedStreamWriter : StreamWriter\n {\n public FormattedStreamWriter(Stream stream) : base(stream) { }\n public FormattedStreamWriter(string filePath) : base(filePath) { }\n public override IFormatProvider FormatProvider\n {\n get\n {\n return CultureInfo.InvariantCulture;\n }\n }\n }\n static class IOExtensions\n {\n public static string ReadString(this StreamReader reader)\n {\n return reader.ReadToken();\n }\n public static int ReadInt(this StreamReader reader)\n {\n return int.Parse(reader.ReadToken(), CultureInfo.InvariantCulture);\n }\n public static long ReadLong(this StreamReader reader)\n {\n return long.Parse(reader.ReadToken(), CultureInfo.InvariantCulture);\n }\n public static double ReadDouble(this StreamReader reader)\n {\n return double.Parse(reader.ReadToken(), CultureInfo.InvariantCulture);\n }\n public static decimal ReadDecimal(this StreamReader reader)\n {\n return decimal.Parse(reader.ReadToken(), CultureInfo.InvariantCulture);\n }\n\n static Queue buffer = new Queue(100);\n static string ReadToken(this StreamReader reader)\n {\n while (buffer.Count == 0)\n {\n reader.ReadLine().Split(new[] { ' ', '\\t' }, StringSplitOptions.RemoveEmptyEntries).ToList().ForEach((t) =>\n {\n buffer.Enqueue(t);\n });\n } return buffer.Dequeue();\n }\n }\n #endregion\n}", "lang": "MS C#", "bug_code_uid": "8c9f1ee02637fd8d53935df8c9563795", "src_uid": "8b8327512a318a5b5afd531ff7223bd0", "apr_id": "dc921c74ad13a663d1bb9a9c378521ac", "difficulty": 2200, "tags": ["dp", "math", "combinatorics"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.9600504625735913, "equal_cnt": 17, "replace_cnt": 6, "delete_cnt": 2, "insert_cnt": 8, "fix_ops_cnt": 16, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\nusing System.Text;\nusing System.Globalization;\n\nclass Program\n{\n\n private static long SolveBf(int a, int b, int k, int t)\n {\n long[] prev = new long[222222];\n long[] dp = new long[222222];\n int shift = 110001;\n\n prev[shift] = 1;\n\n for (int i = 0; i < t; i++)\n {\n int min = -i * k;\n int max = i * k;\n for (int j = min; j <= max; j++)\n {\n for (int offset = -k; offset <= k; offset++)\n {\n dp[j + shift] += prev[j + offset + shift];\n dp[j + shift] %= Mod;\n }\n }\n prev = dp;\n dp = new long[222222];\n }\n\n int delta = a - b;\n\n long[] sum = new long[222222];\n for (int i = prev.Length - 2; i >= 0; i--)\n sum[i] = (sum[i + 1] + prev[i]) % Mod;\n\n\n long answer = 0;\n for (int i = 1000; i < 220000; i++)\n answer = (answer + prev[i] * sum[i - delta + 1]) % Mod;\n\n Console.WriteLine(\"Bf = \" + answer);\n return answer;\n }\n\n private static long SolveAc(int a, int b, int k, int t)\n {\n int mid = (k + 4) * t + 1;\n\n long[] prev = new long[222222];\n long[] dp = new long[222222];\n\n prev[mid] = 1;\n\n long[] sum = new long[222222];\n for (int i = 0; i < t; i++)\n {\n Array.Clear(sum, 0, sum.Length);\n for (int j = 1; j < sum.Length; j++)\n sum[j] = (sum[j - 1] + prev[j]) % Mod;\n\n int min = -(i+1) * k;\n int max = (i + 1) * k;\n for (int j = min; j <= max; j++)\n {\n dp[j + mid] += sum[j + mid + k] - sum[j + mid - k-1];\n dp[j + mid] = (dp[j + mid] + Mod) % Mod;\n //Console.Write(dp[j + mid] + \" \");\n }\n //Console.WriteLine();\n\n //var tmp = prev;\n prev = dp;\n //dp = tmp;\n dp = new long[222222];\n //Array.Clear(dp, 0, dp.Length);\n }\n\n int delta = a - b;\n\n Array.Clear(sum, 0, sum.Length);\n for (int i = prev.Length - 2; i >= 0; i--)\n sum[i] = (sum[i + 1] + prev[i]) % Mod;\n\n\n long answer = 0;\n\n int st = Math.Max(delta - 1, 0);\n for (int i = st; i < 220000; i++)\n answer = (answer + prev[i] * sum[i - delta + 1]) % Mod;\n\n Console.WriteLine(answer);\n return answer;\n }\n\n static void Main(string[] args)\n {\n //PushTestData(@\"13 100 1000 13 \");\n //PushTestData(@\" 1 2 2 1 \");\n int a = RI();\n int b = RI();\n int k = RI();\n int t = RI();\n\n var a1 = SolveAc(a, b, k, t);\n //SolveBf(a, b, k, t);\n\n\n\n }\n\n private const int Mod = 1000000000 + 7;\n\n #region Data Read\n private static char ReadSign()\n {\n while (true)\n {\n int ans = consoleReader.Read();\n if (ans == '+' || ans == '-')\n return (char)ans;\n }\n }\n\n private static long GCD(long a, long b)\n {\n if (a % b == 0) return b;\n return GCD(b, a % b);\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 = RI() - 1;\n int b = RI() - 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 = RI();\n int b = RI();\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 RI()\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 RUL()\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 RL()\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[] RIA(int n)\n {\n int[] ans = new int[n];\n for (int i = 0; i < n; i++)\n ans[i] = RI();\n return ans;\n }\n\n private static long[] RLA(int n)\n {\n long[] ans = new long[n];\n for (int i = 0; i < n; i++)\n ans[i] = RL();\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[] ReadStringLine()\n {\n int ans;\n\n do\n {\n ans = consoleReader.Read();\n } while (ans == 10 || ans == 13);\n\n List s = new List();\n\n do\n {\n s.Add((char)ans);\n ans = consoleReader.Read();\n } while (ans != 10 && ans != 13);\n\n return s.ToArray();\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 private static char ReadNonLetter()\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 private static double DoubleFromString(string x)\n {\n return double.Parse(x, 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 TOLYAN_TEST\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 #endregion\n}", "lang": "MS C#", "bug_code_uid": "5e001c43dca878e9f7c8568b8e8e8123", "src_uid": "8b8327512a318a5b5afd531ff7223bd0", "apr_id": "47089324c5e98483fad1b997178751e1", "difficulty": 2200, "tags": ["dp", "math", "combinatorics"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.9594872415044141, "equal_cnt": 10, "replace_cnt": 6, "delete_cnt": 3, "insert_cnt": 1, "fix_ops_cnt": 10, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Diagnostics;\nusing System.Linq;\n\nnamespace Task\n{\n class Program\n {\n public class PossibleDigit\n {\n public int digit;\n public int possibleLength;\n\n public PossibleDigit(int p)\n {\n possibleLength = p;\n }\n }\n static void Main(string[] args)\n {\n /*string[] input = Console.ReadLine().Split(' ');\n\n int n = Convert.ToInt32(input[0]),\n m = Convert.ToInt32(input[1]),\n x = Convert.ToInt32(input[3]),\n y = Convert.ToInt32(input[4]);\n long k = Convert.ToInt64(input[2]);\n\n long max, min, serg;\n\n if (n == 1)\n {\n if (k % m == 0)\n {\n serg = min = max = k / m;\n }\n else\n {\n min = k / m;\n max = min + 1;\n serg = k % m < y ? min : max;\n }\n }\n else if (n == 2)\n {\n min = k / (n * m);\n max = (k % (n * m) == 0 || (k - n * m) % ((n - 1) * m) == 0) ? min : min + 1;\n }\n else\n {\n int[] count = new int[3];\n\n if (k < 100000)\n {\n for (int i = 0; i < k; ++i)\n {\n if ((i / m) == 1 || )\n }\n }\n }\n\n Console.WriteLine($\"{max} {min} {serg}\");*/\n\n int n = Convert.ToInt32(Console.ReadLine());\n string num = Console.ReadLine();\n\n long answer = 0;\n int cur = n.ToString().Length;\n List nums = new List() {new PossibleDigit(cur)}; \n\n for (int i = num.Length; i >= 0;)\n {\n /*Console.WriteLine(\"Список\");\n \n Console.WriteLine();\n Console.WriteLine(i);*/\n if (i - nums[nums.Count - 1].possibleLength >= 0)\n {\n i -= nums[nums.Count - 1].possibleLength;\n //Console.WriteLine(i + \" \" + nums[nums.Count - 1].possibleLength);\n }\n else\n {\n nums[nums.Count - 1].possibleLength = i;\n i = 0;\n }\n if (num.Length < cur)\n {\n nums[nums.Count - 1].digit = Convert.ToInt32(num);\n nums.Add(new PossibleDigit(cur));\n break; \n }\n if (nums[nums.Count - 1].possibleLength == 0) break;\n //Console.WriteLine($\"Convert.ToInt32(num.Substring({i}, {nums[nums.Count - 1].possibleLength})) {Convert.ToInt32(num.Substring(i, nums[nums.Count - 1].possibleLength))}\");\n int temp = Convert.ToInt32(num.Substring(i, nums[nums.Count - 1].possibleLength));\n if (num.Substring(i, nums[nums.Count - 1].possibleLength)[0] == '0' && nums[nums.Count - 1].possibleLength != 1)\n temp = int.MaxValue;\n //Console.WriteLine($\"Ето темп{temp}\");\n\n if (temp < n)\n {\n nums[nums.Count - 1].digit = temp;\n nums.Add(new PossibleDigit(cur));\n }\n else\n {\n //Console.WriteLine(-1);\n i += nums[nums.Count - 1].possibleLength--;\n if (nums[nums.Count - 1].possibleLength == 0)\n --nums[nums.Count - 2].possibleLength;\n } \n }\n\n /*foreach (var t in nums) Console.Write(t.digit + \" \");\n Console.WriteLine();*/\n for(int i = 0; i < nums.Count; ++i)\n {\n answer += (long)Math.Pow(n, i) * nums[i].digit;\n }\n \n Console.Write(answer);\n }\n }\n}", "lang": "MS C#", "bug_code_uid": "3d6325299617d858dd1a69a4a2fde94d", "src_uid": "be66399c558c96566a6bb0a63d2503e5", "apr_id": "3fd6ff1296b11a4fe1d2d464fc4815dd", "difficulty": 2000, "tags": ["dp", "greedy", "math", "constructive algorithms", "strings"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.7416974169741697, "equal_cnt": 17, "replace_cnt": 10, "delete_cnt": 4, "insert_cnt": 2, "fix_ops_cnt": 16, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\n\npublic class Test\n{\n\n public static int[] ReadArray()\n {\n return Array.ConvertAll(Console.ReadLine().Split(' '), m => Convert.ToInt32(m));\n }\n\n public static int ReadInt()\n {\n return Convert.ToInt32(Console.ReadLine());\n }\n\n public static string ReadStr()\n {\n return Console.ReadLine();\n }\n\n public static long ReadLong()\n {\n return Convert.ToInt64(Console.ReadLine());\n }\n\n public static long[] ReadLongArray()\n {\n return Array.ConvertAll(Console.ReadLine().Split(' '), m => Convert.ToInt64(m));\n\n }\n\n\n public static void Main()\n {\n\n var S = Console.ReadLine();\n long num = 0;\n\n for(int i = 0; i < S.Length; i++)\n {\n num = num * 10 + 9;\n }\n\n long N = Convert.ToInt64(S);\n if (num == Convert.ToInt64(N))\n {\n Console.WriteLine(Cal(N));\n }\n else\n {\n num = num / 10;\n long result = 0;\n for(long i = num; i <= N; i++)\n {\n result = Math.Max(result, Cal(i));\n }\n\n Console.WriteLine(result);\n } \n\n\n \n }\n\n public static long Cal(long n)\n {\n long result = 1;\n\n while( n > 0)\n {\n result = result * (n % 10);\n n = n / 10;\n\n }\n\n return result;\n }\n\n\n\n}", "lang": "Mono C#", "bug_code_uid": "db16dcd8984226a7889e689d119f23bf", "src_uid": "38690bd32e7d0b314f701f138ce19dfb", "apr_id": "8196f12a79719a07a5c3ee1655647b71", "difficulty": 1200, "tags": ["math", "brute force", "number theory"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.44395604395604393, "equal_cnt": 19, "replace_cnt": 11, "delete_cnt": 6, "insert_cnt": 2, "fix_ops_cnt": 19, "bug_source_code": "using System;\nusing System.Text;\nusing System.Collections.Generic;\nusing System.Collections;\nclass Problem\n{\n static void Main()\n {\n //--------------------------------input--------------------------------//\n\n int n = Convert.ToInt32( Console.ReadLine() );\n\n\n //--------------------------------solve--------------------------------//\n\n if(n >= Math.Pow( 10, 9 ) - 1)\n Console.Write( Math.Pow( 9, 9 ) );\n else\n {\n int kq = 0;\n for(int i = n - (int)Math.Pow( 10, Math.Log10( n ) - 1 ) ; i <= n ; i++)\n {\n List pTu = new List();\n int temp = i;\n while(temp > 0)\n {\n pTu.Add( temp % 10 );\n temp /= 10;\n }\n int now=1;\n foreach(int j in pTu)\n now *= j;\n kq = Math.Max( kq, now );\n }\n Console.Write( kq );\n }\n\n\n }\n}", "lang": "Mono C#", "bug_code_uid": "f4ad9128193b45037d109d0a0ffdaaab", "src_uid": "38690bd32e7d0b314f701f138ce19dfb", "apr_id": "33f77c423424027b6ac7e88314e6dc7c", "difficulty": 1200, "tags": ["math", "brute force", "number theory"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.024374176548089592, "equal_cnt": 13, "replace_cnt": 12, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 13, "bug_source_code": "\n\n \n \n Debug\n AnyCPU\n {D76EAD0F-3DCA-4720-981A-A1CC8B957629}\n Exe\n Algoritms\n Algoritms\n v4.5.2\n 512\n true\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": "MS C#", "bug_code_uid": "26b80a2e2479e36228da99b309abfac8", "src_uid": "a4b3da4cb9b6a7ed0a33a862e940cafa", "apr_id": "512e8e5c7c0315a8e3ab38f93f74e253", "difficulty": 1100, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.8653725735754539, "equal_cnt": 12, "replace_cnt": 4, "delete_cnt": 1, "insert_cnt": 6, "fix_ops_cnt": 11, "bug_source_code": "using System;\nusing System.Linq;\n\nnamespace codeforces\n{\n class Program\n {\n static void Main(string[] args)\n {\n string gen = \"ACTG\"; \n int n = int.Parse(Console.ReadLine());\n string str = Console.ReadLine();\n int rez = 26*4;\n for (int i = 0; i < n-3; i++)\n {\n int r = 0;\n for (int k = 0; k < 4; k++)\n {\n r += Math.Min(Math.Abs(str[i + k] - gen[k]),Math.Abs(gen[k]-'A'+1+('Z'-str[i+k]))); \n }\n rez = Math.Min(rez, r);\n }\n Console.WriteLine(rez);\n }\n }\n}", "lang": "Mono C#", "bug_code_uid": "df8262c9e58b65254e52afc7d7ce4387", "src_uid": "ee4f88abe4c9fa776abd15c5f3a94543", "apr_id": "ec257f21c349ddcdd0f6cb9809e38098", "difficulty": 1000, "tags": ["brute force", "strings"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.555881121808288, "equal_cnt": 29, "replace_cnt": 14, "delete_cnt": 6, "insert_cnt": 9, "fix_ops_cnt": 29, "bug_source_code": "using System;\nusing System.Collections;\nusing System.Collections.Generic;\nusing System.Collections.Specialized;\nusing System.IO;\nusing System.Text;\nusing System.Diagnostics;\nnamespace contest1\n{\n class Program\n {\n static void Main(string[] args)\n {\n //Console.SetIn(new StreamReader(\"input.txt\"));\n solve_553A();\n }\n\n public static void solve_553A()\n {\n int n = Convert.ToInt32(Console.ReadLine());\n\n //int actg = 65 + 67 + 84 + 71;\n string str = Console.ReadLine();\n\n int min = int.MaxValue;\n for (int i = 0; i < n - 3; i++)\n {\n int first = (int)str[i];\n int c1 = first == 90 ? 1 : Math.Abs(first - 65);\n int c2 = Math.Abs((int)str[i + 1] - 67);\n int c3 = Math.Abs((int)str[i + 2] - 84);\n int c4 = Math.Abs((int)str[i + 3] - 71);\n\n min = Math.Min(min, c1 + c2 + c3 + c4);\n\n }\n Console.WriteLine(min);\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "cf53f897e17bed64fbca8ca950008ef6", "src_uid": "ee4f88abe4c9fa776abd15c5f3a94543", "apr_id": "89c8c0714f45004060d2a994238a294e", "difficulty": 1000, "tags": ["brute force", "strings"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9797882579403272, "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.Text;\nusing System.Threading.Tasks;\n\nnamespace Problem\n{\n class Program\n {\n static void Main(string[] args)\n {\n var s = Console.ReadLine();\n var minimum = int.MaxValue;\n for (var i = 0; i + 4 <= s.Length; i++)\n {\n var currentGenom = GetGenom(s.Substring(i, 4));\n if (currentGenom < minimum)\n {\n minimum = currentGenom;\n }\n }\n\n Console.WriteLine(minimum);\n }\n\n static int GetGenom(string s)\n {\n const string genom = \"ACTG\";\n var opCount = 0;\n for (var i = 0; i < genom.Length; i++)\n {\n var min = Math.Min(Math.Abs(genom[i] - s[i]), Math.Abs(26 - Math.Max(genom[i], s[i]) + Math.Min(genom[i], s[i])));\n opCount += min;\n }\n\n return opCount;\n }\n }\n}", "lang": "Mono C#", "bug_code_uid": "0ef73f3509514797329d8b7b61f6c156", "src_uid": "ee4f88abe4c9fa776abd15c5f3a94543", "apr_id": "5b7ec46ce3edf2416d8323a75c0d2ee8", "difficulty": 1000, "tags": ["brute force", "strings"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.9920470262793915, "equal_cnt": 3, "replace_cnt": 2, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "/*\ncsc -debug A.cs && mono --debug A.exe <<< \"4\nZCTH\"\n*/\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\n\npublic class HelloWorld {\n public static void SolveCodeForces() {\n Console.ReadLine();\n var S = Console.ReadLine();\n var ops = new int[S.Length];\n\n var ans = int.MaxValue;\n for (var i = 0; i < S.Length - 3; i++) {\n var roll = 0;\n for (var j = 0; j < 4; j++) {\n var c = S[i + j];\n var d = \"ACTG\"[j];\n roll += Math.Min( Math.Abs(d - c), Math.Abs(d + 26 - c) );\n }\n // System.Console.WriteLine(new {i, roll, ans});\n ans = Math.Min(roll, ans);\n }\n System.Console.WriteLine(ans);\n }\n\n static Scanner cin = new Scanner();\n static StringBuilder cout = new StringBuilder();\n\n static public void Main () {\n SolveCodeForces();\n // System.Console.Write(cout.ToString());\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 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}\n\npublic class Scanner\n{\n private string[] line = new string[0];\n private int index = 0;\n\n public string Next() {\n if (line.Length <= index) {\n line = Console.ReadLine().Split(' ');\n index = 0;\n }\n var res = line[index];\n index++;\n return res;\n }\n\n public int NextInt() {\n return int.Parse(Next());\n }\n\n public long NextLong() {\n return long.Parse(Next());\n }\n\n public ulong NextUlong() {\n return ulong.Parse(Next());\n }\n\n public string[] Array() {\n line = Console.ReadLine().Split(' ');\n index = line.Length;\n return line;\n }\n\n public int[] IntArray(int emptyPrefixLen = 0) {\n var array = Array();\n var result = new int[emptyPrefixLen + array.Length];\n for (int i = 0; i < array.Length; i++)\n result[emptyPrefixLen + i] = int.Parse(array[i]);\n return result;\n }\n\n public long[] LongArray() {\n var array = Array();\n var result = new long[array.Length];\n for (int i = 0; i < array.Length; i++)\n result[i] = long.Parse(array[i]);\n return result;\n }\n\n public ulong[] UlongArray() {\n var array = Array();\n var result = new ulong[array.Length];\n for (int i = 0; i < array.Length; i++)\n result[i] = ulong.Parse(array[i]);\n return result;\n }\n}", "lang": "Mono C#", "bug_code_uid": "c5ecd5196c5f52b5786c6570e3a84136", "src_uid": "ee4f88abe4c9fa776abd15c5f3a94543", "apr_id": "9b41d5d7f25c8b0ec64521baba065cf2", "difficulty": 1000, "tags": ["brute force", "strings"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9984962406015038, "equal_cnt": 4, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 4, "fix_ops_cnt": 4, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace ConsoleApp24\n{\n class Program\n {\n static void Main(string[] args)\n {\n int N = int.Parse(Console.ReadLine());\n string str = Console.ReadLine();\n str.ToCharArray();\n int sum = 0;\n int min = 0;\n for (int i = 0; i < N - 3; i++)\n {\n\n\n sum = sumer(str[i], 'A') + sumer(str[i + 1], 'C') + sumer(str[i + 2], 'T') + sumer(str[i+3],'G');\n\n if (i == 0)\n min = sum;\n else if (sum < min)\n min = sum;\n \n }\n Console.WriteLine(min);\n }\n\n private static int sumer(char v1, char v2)\n {\n int sum = 0;\n if (v1 - v2 > 0 && v1 - v2 < 14)\n {\n sum += v1 - v2;\n }\n else if (v1 - v2 > 0 && v1 - v2 > 14) {\n sum += 26 - v1 + v2;\n }\n else if (v1 - v2 < 0 && v1 - v2 >-14)\n {\n sum +=v2-v1;\n }\n else if (v1 - v2 < 0 && v1 - v2 < -14)\n {\n sum +=26- v2 + v1;\n }\n return sum;\n }\n }\n}", "lang": "Mono C#", "bug_code_uid": "5bf1bbbf1c28188418229608490926a5", "src_uid": "ee4f88abe4c9fa776abd15c5f3a94543", "apr_id": "70eec4449ef2e72104067841fd4b3b5a", "difficulty": 1000, "tags": ["brute force", "strings"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.9119266055045872, "equal_cnt": 13, "replace_cnt": 4, "delete_cnt": 0, "insert_cnt": 8, "fix_ops_cnt": 12, "bug_source_code": "using System;\nusing System.Text;\nusing System.Collections.Generic;\nusing System.Collections;\nusing System.Linq;\nclass Problem\n{\n static void Main()\n {\n //--------------------------------input--------------------------------//\n\n int n = Convert.ToInt32( Console.ReadLine() );\n string s = Console.ReadLine();\n\n\n //--------------------------------solve--------------------------------/\n\n int min = 100000;\n for(int i = 0 ; i <= s.Length - 4 ; i++)\n {\n string subs = s.Substring( i, 4 );\n int now = Math.Min( Math.Abs( subs[0] - 'A' ), Math.Abs( subs[0] - 'A' -26) );\n now += Math.Min( Math.Abs( subs[1] - 'C' ), Math.Abs( subs[1] - 'C' -26) );\n now += Math.Min( Math.Abs( subs[2] - 'T' ), Math.Abs( subs[2] - 'T' -26) );\n now += Math.Min( Math.Abs( subs[3] - 'G' ), Math.Abs( subs[3] - 'G' -26) );\n min = Math.Min( min, now );\n }\n Console.WriteLine( min );\n }\n}", "lang": "Mono C#", "bug_code_uid": "ae1e1dff4eacd8df7a608e894fd4cd0a", "src_uid": "ee4f88abe4c9fa776abd15c5f3a94543", "apr_id": "fb433595e7c226314f019b875c7ef232", "difficulty": 1000, "tags": ["brute force", "strings"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.7246852764094144, "equal_cnt": 64, "replace_cnt": 11, "delete_cnt": 7, "insert_cnt": 46, "fix_ops_cnt": 64, "bug_source_code": "using System; \nnamespace ConsoleApplication1{\n class Program {\nstatic void Main (string[] args) \n{\nA();\n}\nstatic void B(){ \nstring x= Console.ReadLine();\n y = Console. ReadLine(); \nfor (int i= 0;i< x. Length; i++)\nif (y[i]> x[i]) Console.WriteLine(-1); Console.WriteLine(y);\n static void A(){ var line= Console.ReadLine().ToCharArray();\n int count= GetCount(line); \nfor (int i =0; i< line.Length; i++)\n {line[i]=(char)( 'V'+'K'- line[i]);\n count = Math.Max(count, GetCount(line));\nline[i]=(char)( 'V'+'K'- line[i]);\n}\nConsole.WriteLine(count);\n}\nstatic int GetCount(char[] s)\n{ int count=0;\n for (int i =1; i < s.Length; i++)\n if (s[i] =='K' && s[i-1]== 'V') count++ ;\nreturn count; \n}}}\n", "lang": "MS C#", "bug_code_uid": "ad56ed1cb727f44da9d35066f5cff430", "src_uid": "578bae0fe6634882227ac371ebb38fc9", "apr_id": "a3aaa4ee665d284a503b52044e906bf2", "difficulty": 1100, "tags": ["brute force"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.687909469922573, "equal_cnt": 42, "replace_cnt": 25, "delete_cnt": 12, "insert_cnt": 4, "fix_ops_cnt": 41, "bug_source_code": "using System;\nusing System.Collections.Generic;\nnamespace ConsoleApp16\n{\n class Program\n {\n static void Main(string[] args)\n {\n char[] s = Console.ReadLine().ToCharArray();\n int x = 0;\n int y = 0;\n if (s.Length == 1)\n {\n Console.WriteLine(0);\n }\n else if (s.Length == 2)\n {\n if (s[0] == 'V')\n {\n Console.WriteLine(1);\n }\n else\n {\n Console.WriteLine(0);\n }\n }\n else\n {\n\n\n for (int i = 0; i < s.Length - 1; i++)\n {\n if (s[i] == 'V' && s[i + 1] == 'K')\n {\n x++;\n i++;\n continue;\n }\n else if (s[i] == 'K' && s[i + 1] == 'V')\n {\n\n continue;\n }\n\n else if (i < s.Length - 2 && (s[i + 1] != 'V') || s[i + 2] != 'K')\n {\n y++;\n }\n\n\n }\n\n if (y > 0)\n {\n Console.WriteLine(x + 1);\n }\n else\n {\n Console.WriteLine(x);\n }\n }\n }\n }\n}", "lang": "MS C#", "bug_code_uid": "4fe6c3b34584ddd43ebc2b45dd3ef8b3", "src_uid": "578bae0fe6634882227ac371ebb38fc9", "apr_id": "e9321fb98d28c924dfa1566eaa9f2de7", "difficulty": 1100, "tags": ["brute force"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9484833895040924, "equal_cnt": 5, "replace_cnt": 0, "delete_cnt": 5, "insert_cnt": 0, "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 C.Table_Tennis_Game_2\n{\n class Program\n {\n static void Main(string[] args)\n {\n int t = int.Parse(Console.ReadLine());\n while (t-- > 0)\n {\n int[] kab = Array.ConvertAll(Console.ReadLine().Split(' '), int.Parse);\n int k = kab[0];\n int a = kab[1];\n int b = kab[2];\n int wa = a / k;\n int wb = b / k;\n if (a >= k && b >= k)\n {\n Console.WriteLine(wa + wb);\n }\n else if (a % k == 0 && b <=(a/k)*(k-1))\n {\n Console.WriteLine(wa);\n }\n else if (b % k == 0 && a <= (b/k)*(k-1))\n {\n Console.WriteLine(wb);\n }\n else\n {\n Console.WriteLine(-1);\n }\n }\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "c8124b2e87a9f7950d143e76276b2788", "src_uid": "6e3b8193d1ca1a1d449dc7a4ad45b8f2", "apr_id": "2c4c648bd460d56129910295ccbb275f", "difficulty": 1200, "tags": ["math"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C#"} {"similarity_score": 0.9077568134171907, "equal_cnt": 19, "replace_cnt": 2, "delete_cnt": 17, "insert_cnt": 1, "fix_ops_cnt": 20, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\n\nnamespace test\n{\n class Program\n {\n static void Main()\n {\n while (true)\n {\n bool flag1 = false, flag2 = false, flag3 = false;//1 - Большая буква, 2 - Маленькая буква, 3 - Цифра.\n Console.Write(\"Enter password: \");\n string pass = Console.ReadLine();\n for (int i = 0; i < pass.Length; i++)\n {\n if (pass[i] >= 65 && pass[i] <= 90 && !flag1)\n flag1 = true;\n if (pass[i] >= 97 && pass[i] <= 122 && !flag2)\n flag2 = true;\n if (Char.IsDigit(pass[i]) && !flag3)\n flag3 = true;\n }\n if (flag1 && flag2 && flag3 && pass.Length >= 5)\n Console.WriteLine(\"Correct\");\n else\n Console.WriteLine(\"Too Weak\");\n }\n }\n }\n}", "lang": "MS C#", "bug_code_uid": "a8052e8fc4da3145f736152b1f138a98", "src_uid": "42a964b01e269491975965860ec92be7", "apr_id": "194a34d393d122cdb202c7cb28454876", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C#"} {"similarity_score": 0.996186844613918, "equal_cnt": 7, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 4, "fix_ops_cnt": 6, "bug_source_code": "using System;\n\nnamespace code\n{\n class Program\n {\n static void Main(string[] args)\n {\n string b = Console.ReadLine();\n int sum=0;\n int k=0;\n int j=0;\n if (b.Length < 5)\n Console.WriteLine(\"Too weak\");\n else\n {\n char[] a = b.ToCharArray();\n for(int i=0; i'a' && a[i]<'z')\n {\n sum++;\n }\n if(a[i]>'A' && a[i]<'B')\n {\n k++;\n }\n if(Char.IsDigit(a[i]))\n {\n j++;\n }\n }\n if (sum > 0 && k > 0 && j > 0)\n {\n Console.WriteLine(\"Correct\");\n }\n else Console.WriteLine(\"Too weak\");\n }\n }\n }\n }", "lang": "MS C#", "bug_code_uid": "552a19a01945bc25f08dcd6302f8ce35", "src_uid": "42a964b01e269491975965860ec92be7", "apr_id": "7ad7a16161636690c3369b19e261bf12", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.9223968565815324, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 0, "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 Task1\n{\n class Program\n {\n static void Main(string[] args)\n {\n bool flag = false;\n int[] a = new int[6];\n for (int i=0; i<6; ++i)\n {\n a[i] = int.Parse(Console.ReadLine());\n };\n int sum = a.Sum();\n if (sum % 2 != 1)\n {\n sum /= 2;\n sum = sum - a[0];\n for (int i=1; i<5; ++i)\n {\n for (int j=i+1; j<6; ++j)\n {\n if (a[i] + a[j] == sum)\n {\n flag = true;\n }\n };\n };\n };\n if (flag)\n {\n Console.WriteLine(\"YES\");\n }\n else\n {\n Console.WriteLine(\"NO\");\n };\n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "ae7ebce4585077607117919d3ad7138a", "src_uid": "2acf686862a34c337d1d2cbc0ac3fd11", "apr_id": "14d0d86de714eeed89e24a355d9a45a2", "difficulty": 1000, "tags": ["brute force"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9684734513274337, "equal_cnt": 8, "replace_cnt": 6, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 7, "bug_source_code": "using System;\nusing System.IO;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace TehnoCub1\n{\n class Program\n {\n public static double[] Read(string str)\n {\n List doubles = new List();\n double now = 0;\n foreach (var ch in str)\n {\n if (ch == ' ')\n {\n doubles.Add(now);\n now = 0;\n }\n else if (Char.IsDigit(ch))\n {\n now = now * 10 + int.Parse(ch.ToString());\n }\n else\n {\n break;\n }\n }\n doubles.Add(now);\n return doubles.ToArray();\n }\n static void Main(string[] args)\n {\n double[] input = Read(File.ReadAllText(\"input.txt\"));\n bool was = false;\n for (int i = 0;i < 64; i++)\n {\n int count = 0;\n double sum = 0;\n for (int k = 1; k <= 6; k++)\n {\n if (i % Math.Pow(2,k) >= Math.Pow(2, k - 1))\n {\n sum += input[k - 1];\n count++;\n }\n else\n {\n sum -= input[k - 1];\n count--;\n }\n }\n if (sum == 0 && count == 0)\n {\n File.WriteAllText(\"output.txt\",\"YES\");\n was = true;\n break;\n }\n }\n if (!was)\n {\n File.WriteAllText(\"output.txt\", \"NO\");\n }\n }\n }\n}", "lang": "MS C#", "bug_code_uid": "47f25ad01fcf1878be6edf21bd5a3fd0", "src_uid": "2acf686862a34c337d1d2cbc0ac3fd11", "apr_id": "1b088f4f8a0e1d2f0d42e10d28ea6e4a", "difficulty": 1000, "tags": ["brute force"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9305912596401028, "equal_cnt": 9, "replace_cnt": 2, "delete_cnt": 1, "insert_cnt": 5, "fix_ops_cnt": 8, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace Codeforces_Type_A\n{\n class Program\n {\n static void Main(string[] args)\n {\n\t\t\t int[] a;\n a = getLineInt(Console.ReadLine());\n int sum = a.Sum();\n bool yep = false;\n for (int i = 0; i < a.Length && !yep; i++)\n {\n for (int z = i; z < a.Length && !yep; z++)\n {\n for (int j = z; j < a.Length && !yep; j++)\n {\n int temp = a[i]+a[z]+a[j];\n if (sum - temp == temp)\n {\n yep = true;\n } \n }\n }\n }\n Console.WriteLine((yep == true) ? \"yes\" : \"no\");\n }\n }\n}", "lang": "MS C#", "bug_code_uid": "50358261a62d8ab742b28b602ca0dedb", "src_uid": "2acf686862a34c337d1d2cbc0ac3fd11", "apr_id": "1fc6009eef59a1a53f510127e098f755", "difficulty": 1000, "tags": ["brute force"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.42630385487528344, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 3, "bug_source_code": "long X = Convert.ToInt64(Console.ReadLine());\nConsole.WriteLine(X / 5 + (X % 5 != 0 ? 1 : 0));", "lang": "Mono C#", "bug_code_uid": "7c8dfc4c15a8856909df376f8cd78a28", "src_uid": "4b3d65b1b593829e92c852be213922b6", "apr_id": "0dead86651c96a0ba6a10170f0979aab", "difficulty": 800, "tags": ["math"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.9956882255389718, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing Solver.Ex;\nusing Debug = System.Diagnostics.Debug;\nusing Watch = System.Diagnostics.Stopwatch;\nusing StringBuilder = System.Text.StringBuilder;\nnamespace Solver\n{\n public class Solver\n {\n public void Solve()\n {\n var a = sc.Integer();\n var m = sc.Integer();\n var p = a;\n while (p>0)\n {\n p += p % m;\n p %= m;\n if (p == a)\n break;\n }\n if(p==0)\n IO.Printer.Out.WriteLine(\"Yes\");\n else IO.Printer.Out.WriteLine(\"No\");\n }\n internal IO.StreamScanner sc;\n }\n\n\n #region Main and Settings\n static class Program\n {\n static void Main(string[] arg)\n {\n#if DEBUG\n var errStream = new System.IO.FileStream(@\"..\\..\\dbg.out\", System.IO.FileMode.Create, System.IO.FileAccess.Write, System.IO.FileShare.ReadWrite);\n Debug.Listeners.Add(new System.Diagnostics.TextWriterTraceListener(errStream, \"debugStream\"));\n Debug.AutoFlush = false;\n var sw = new Watch(); sw.Start();\n IO.Printer.Out.AutoFlush = true;\n try\n {\n#endif\n\n var solver = new Solver();\n solver.sc = new IO.StreamScanner(Console.OpenStandardInput());\n solver.Solve();\n IO.Printer.Out.Flush();\n#if DEBUG\n }\n catch (Exception ex)\n {\n Console.Error.WriteLine(ex.Message);\n Console.Error.WriteLine(ex.StackTrace);\n }\n finally\n {\n sw.Stop();\n Console.ForegroundColor = ConsoleColor.Green;\n Console.Error.WriteLine(\"Time:{0}ms\", sw.ElapsedMilliseconds);\n Debug.Close();\n System.Threading.Thread.Sleep(System.Threading.Timeout.Infinite);\n }\n#endif\n }\n\n\n }\n #endregion\n}\n#region IO Helper\nnamespace Solver.IO\n{\n public class Printer : System.IO.StreamWriter\n {\n static Printer()\n {\n Out = new Printer(Console.OpenStandardOutput()) { AutoFlush = false };\n#if DEBUG\n Error = new Printer(Console.OpenStandardOutput()) { AutoFlush = false };\n#else\n Error = new Printer(System.IO.Stream.Null) { AutoFlush = false };\n#endif\n }\n public static Printer Out { get; set; }\n public static Printer Error { get; set; }\n public override IFormatProvider FormatProvider { get { return System.Globalization.CultureInfo.InvariantCulture; } }\n public Printer(System.IO.Stream stream) : base(stream, new System.Text.UTF8Encoding(false, true)) { }\n public Printer(System.IO.Stream stream, System.Text.Encoding encoding) : base(stream, encoding) { }\n public void Write(string format, IEnumerable source) { Write(format, source.OfType().ToArray()); }\n public void WriteLine(string format, IEnumerable source) { WriteLine(format, source.OfType().ToArray()); }\n }\n public class StreamScanner\n {\n public StreamScanner(System.IO.Stream stream) { iStream = stream; }\n private readonly System.IO.Stream iStream;\n private readonly byte[] buf = new byte[1024];\n private int len, ptr;\n private bool eof = false;\n public bool IsEndOfStream { get { return eof; } }\n const byte lb = 33, ub = 126, el = 10, cr = 13;\n public byte read()\n {\n if (eof) throw new System.IO.EndOfStreamException();\n if (ptr >= len) { ptr = 0; if ((len = iStream.Read(buf, 0, 1024)) <= 0) { eof = true; return 0; } }\n return buf[ptr++];\n }\n public char Char() { byte b = 0; do b = read(); while (b < lb || ub < b); return (char)b; }\n public char[] Char(int n) { var a = new char[n]; for (int i = 0; i < n; i++) a[i] = Char(); return a; }\n public char[][] Char(int n, int m) { var a = new char[n][]; for (int i = 0; i < n; i++) a[i] = Char(m); return a; }\n public string Scan()\n {\n if (eof) throw new System.IO.EndOfStreamException();\n StringBuilder sb = null;\n var enc = System.Text.UTF8Encoding.Default;\n do\n {\n for (; ptr < len && (buf[ptr] < lb || ub < buf[ptr]); ptr++) ;\n if (ptr < len) break;\n ptr = 0;\n if ((len = iStream.Read(buf, 0, 1024)) <= 0) { eof = true; return \"\"; }\n } while (true);\n do\n {\n var f = ptr;\n for (; ptr < len; ptr++)\n if (buf[ptr] < lb || ub < buf[ptr])\n //if (buf[ptr] == cr || buf[ptr] == el)\n {\n string s;\n if (sb == null) s = enc.GetString(buf, f, ptr - f);\n else { sb.Append(enc.GetChars(buf, f, ptr - f)); s = sb.ToString(); }\n ptr++; return s;\n }\n if (sb == null) sb = new StringBuilder(enc.GetString(buf, f, len - f));\n else sb.Append(enc.GetChars(buf, f, len - f));\n ptr = 0;\n\n }\n while (!eof && (len = iStream.Read(buf, 0, 1024)) > 0);\n eof = true; return (sb != null) ? sb.ToString() : \"\";\n }\n public long Long()\n {\n long ret = 0; byte b = 0; bool isMynus = false;\n const byte zr = 48, nn = 57, my = 45;\n do b = read();\n while (b != my && (b < zr || nn < b));\n if (b == my) { isMynus = true; b = read(); }\n for (; true; b = read())\n if (b < zr || nn < b)\n return isMynus ? -ret : ret;\n else ret = ret * 10 + b - zr;\n }\n public int Integer()\n {\n int ret = 0; byte b = 0; bool isMynus = false;\n const byte zr = 48, nn = 57, my = 45;\n do b = read();\n while (b != my && (b < zr || nn < b));\n if (b == my) { isMynus = true; b = read(); }\n for (; true; b = read())\n if (b < zr || nn < b)\n return isMynus ? -ret : ret;\n else ret = ret * 10 + b - zr;\n }\n public double Double() { return double.Parse(Scan(), System.Globalization.CultureInfo.InvariantCulture); }\n public string[] Scan(int n) { var a = new string[n]; for (int i = 0; i < n; i++) a[i] = Scan(); return a; }\n public double[] Double(int n) { var a = new double[n]; for (int i = 0; i < n; i++) a[i] = Double(); return a; }\n public int[] Integer(int n) { var a = new int[n]; for (int i = 0; i < n; i++) a[i] = Integer(); return a; }\n public long[] Long(int n) { var a = new long[n]; for (int i = 0; i < n; i++)a[i] = Long(); return a; }\n public void Flush() { iStream.Flush(); }\n }\n}\n#endregion\n#region Extension\nnamespace Solver.Ex\n{\n static public partial class EnumerableEx\n {\n static public string AsString(this IEnumerable ie) { return new string(ie.ToArray()); }\n static public string AsJoinedString(this IEnumerable ie, string st = \" \") { return string.Join(st, ie); }\n static public T[] Enumerate(this int n, Func f) { var a = new T[n]; for (int i = 0; i < n; i++) a[i] = f(i); return a; }\n }\n}\n#endregion\n", "lang": "MS C#", "bug_code_uid": "99fe23d20ef8e4e3d275f7a36fda41c4", "src_uid": "f726133018e2149ec57e113860ec498a", "apr_id": "02e4ff7f4ec2f58141b769dc35e0fdc0", "difficulty": 1400, "tags": ["matrices", "math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9774624373956594, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\nusing System.Text.RegularExpressions;\nusing System.IO;\nusing System.Numerics;\nusing System.Globalization;\nusing System.Threading;\n\n\nnamespace probleme {\n class Program {\n static void Main(string[] args) {\n\n //Console.SetIn(new StreamReader(\"file.in\"));\n /*\n FileStream filestream = new FileStream(\"out.txt\", FileMode.Create);\n var streamwriter = new StreamWriter(filestream);\n streamwriter.AutoFlush = true;\n Console.SetOut(streamwriter);\n */\n\n string[] s = Console.ReadLine().Split(' ');\n int a = int.Parse(s[0]), m = int.Parse(s[1]);\n bool[] used = new bool[100001];\n int x = a % m;\n while (true) {\n if (x == 0) {\n Console.Write(\"Yes\");\n }\n if (used[x]) {\n Console.Write(\"No\");\n }\n used[x] = true;\n x = (x + x) % m;\n }\n\n //Console.ReadKey();\n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "c08b5ca0a6feded8d4fa4735a1d31e71", "src_uid": "f726133018e2149ec57e113860ec498a", "apr_id": "579f532340fe6d9b3cb3e5612681fe77", "difficulty": 1400, "tags": ["matrices", "math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.9901477832512315, "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.Text;\n\nnamespace _276\n{\n class Program\n {\n static void Main(string[] args)\n {\n string[] s = Console.ReadLine().Split(' ');\n\n long a = int.Parse(s[0]);\n\n long m = int.Parse(s[1]);\n\n string ans = \"No\"; \n\n for (int i = 0; i < 10000000000; i++)\n {\n if (a%m==0)\n {\n ans = \"Yes\"; \n break;\n }\n\n a += a%m;\n }\n\n Console.WriteLine(ans);\n\n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "f85302a2bbccc43d753289175e1a5f2d", "src_uid": "f726133018e2149ec57e113860ec498a", "apr_id": "fb70826d6d04bbd4fe289ed22886ac75", "difficulty": 1400, "tags": ["matrices", "math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9967883211678832, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "using System;\nusing System.IO;\nusing System.Text;\n\nnamespace Blocked_Points\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 long count;\n if (n == 1)\n count = 4;\n else if (n == 0)\n count = 1;\n else if (n == 2)\n count = 8;\n else\n {\n \n long y = (long)Math.Sqrt(n/2*n)+2;\n long nn = n*n;\n\n while (2*y*y > nn)\n {\n y--;\n }\n if (y*y + (y+1)*(y+1) > nn)\n {\n count = (y + 1)*8;\n }\n else\n {\n count = (2*y + 1)*4;\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": "5a75819fb33beb9423585260ae43d9d6", "src_uid": "d87ce09acb8401e910ca6ef3529566f4", "apr_id": "979314323a91b97d99f1415aee79c03d", "difficulty": null, "tags": ["geometry"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.997953814674072, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "using System;\nusing System.IO;\nusing System.Text;\n\nnamespace Blocked_Points\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 long count;\n if (n == 1)\n count = 4;\n else if (n == 0)\n count = 1;\n else if (n == 2)\n count = 8;\n else\n {\n \n long y = (long)Math.Sqrt(n/2*n)+2;\n long nn = n*n;\n\n while (2*y*y > nn)\n {\n y--;\n }\n if (y*y + (y+1)*(y+1) > nn)\n {\n count = (y)*8;\n }\n else\n {\n count = (2*y + 1)*4;\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": "e0ac053b5fa64ea757b66baa49b45092", "src_uid": "d87ce09acb8401e910ca6ef3529566f4", "apr_id": "979314323a91b97d99f1415aee79c03d", "difficulty": null, "tags": ["geometry"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.999000999000999, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "using System;\n\nnamespace CodeF_Block\n{\n class Program\n {\n static void Main(string[] args)\n {\n new Program().Prog();\n }\n\n public void Prog()\n {\n long n = long.Parse(Console.ReadLine());\n long blocked = 0;\n\n if (n == 0)\n blocked = 1;\n else if (n == 1)\n blocked = 4;\n else\n {\n double y = n / Math.Sqrt(2.00);\n y = Math.Truncate(y);\n\n double dist = Math.Sqrt((y * y) + (y + 1) * (y + 1));\n Console.WriteLine(dist.ToString());\n if (dist <= n)\n {\n blocked = (long)y * 8 + 4;\n }\n else\n {\n blocked = (long)y * 8;\n }\n\n //blocked *= 4;\n }\n\n\n\n Console.WriteLine(blocked.ToString());\n // Console.ReadLine();\n\n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "b389a795cb94cd72685b076a58321022", "src_uid": "d87ce09acb8401e910ca6ef3529566f4", "apr_id": "6ba4d568185170401e7a80075d6ae516", "difficulty": null, "tags": ["geometry"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.7398790134946487, "equal_cnt": 20, "replace_cnt": 4, "delete_cnt": 16, "insert_cnt": 0, "fix_ops_cnt": 20, "bug_source_code": "using System;\n\nnamespace CodeF_Block\n{\n class Program\n {\n static void Main(string[] args)\n {\n new Program().Prog();\n }\n\n public void Prog()\n {\n while (true)\n {\n long n = long.Parse(Console.ReadLine());\n long blocked = 0;\n\n if (n == 0)\n blocked = 1;\n else if (n == 1)\n blocked = 4;\n else\n {\n double y = n / Math.Sqrt(2.00);\n y = Math.Truncate(y);\n\n double dist = Math.Sqrt((y * y) + (y + 1) * (y + 1));\n Console.WriteLine(dist.ToString());\n if (dist <= n)\n {\n blocked = (long)y * 8 + 4;\n }\n else\n {\n blocked = (long)y * 8;\n }\n\n //blocked *= 4;\n }\n\n\n\n Console.WriteLine(blocked.ToString());\n // Console.ReadLine();\n }\n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "6d16002943d459d926320ab507a29b4c", "src_uid": "d87ce09acb8401e910ca6ef3529566f4", "apr_id": "6ba4d568185170401e7a80075d6ae516", "difficulty": null, "tags": ["geometry"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C#"} {"similarity_score": 0.9956634865568084, "equal_cnt": 1, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": " class Program\n {\n public static void Main(string[] args)\n {\n string data = Console.ReadLine();\n if (data.Length > 20) Console.WriteLine(\"BigInteger\");\n else\n {\n if(data.Length<19 || data.Length==19 && data[0]=='-')\n {\n long inp = long.Parse(data);\n if (inp < 128L && inp >= sbyte.MinValue) Console.WriteLine(\"byte\");\n else if (inp < 32768L && inp >= short.MinValue) Console.WriteLine(\"short\");\n else if (inp < 2147483648L && inp >= int.MinValue) Console.WriteLine(\"int\");\n else Console.WriteLine(\"long\");\n }\n else\n {\n long halfA= 9223372036, halfB, hlfA, hlfB;\n if (data[0] == '-')\n {\n halfB = 854775808;\n hlfA = long.Parse(data.Substring(1, 10));\n hlfB = long.Parse(data.Substring(11));\n }\n else\n {\n halfB = 854775807;\n hlfA = long.Parse(data.Substring(0, 10));\n hlfB = long.Parse(data.Substring(10));\n }\n if (halfA > hlfA) Console.WriteLine(\"long\");\n else if (halfA == hlfA)\n {\n if (halfB > hlfB) Console.WriteLine(\"long\");\n else Console.WriteLine(hlfB == halfB ? \"long\" : \"BigInteger\");\n }\n else Console.WriteLine(\"BigInteger\");\n }\n }\n }\n }", "lang": "MS C#", "bug_code_uid": "2765e6f8c439a1f96bab3c2971182c45", "src_uid": "33041f1832fa7f641e37c4c638ab08a1", "apr_id": "28caa54e103ea7794824a6f9076f3d13", "difficulty": 1300, "tags": ["strings", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.4469178082191781, "equal_cnt": 19, "replace_cnt": 9, "delete_cnt": 4, "insert_cnt": 7, "fix_ops_cnt": 20, "bug_source_code": "class program\n{\n static void Main()\n {\n double t = double.Parse(Console.ReadLine());\n if(t >= - 128 && t <= 127)\n Console.WriteLine(\"byte\");\n if (t >= -32768 && t <= 32767)\n Console.WriteLine(\"short\");\n if (t >= - 2147483648 && t <= 2147483647)\n Console.WriteLine(\"int\");\n if (t >= -9223372036854775808 && t <= 9223372036854775807)\n Console.WriteLine(\"long \");\n else\n Console.WriteLine(\"BigInteger\");\n }\n}", "lang": "MS C#", "bug_code_uid": "8d691f53692ee265e6c924520a443d1f", "src_uid": "33041f1832fa7f641e37c4c638ab08a1", "apr_id": "61f582a8ff9f71c3f56453ad20e4d9d4", "difficulty": 1300, "tags": ["strings", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.5646518745218057, "equal_cnt": 20, "replace_cnt": 18, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 21, "bug_source_code": "public static string Func(string n)\n\t\t{\n\n\t\t\tlong d = 0;\n\n\t\t\ttry{ \n\t\t\t\td = Convert.ToInt64 (n);\n\t\t\t}\n\t\t\tcatch (System.OverflowException)\n\t\t\t{\n\t\t\t\treturn \"BigInteger\";\n\t\t\t}\n\t\t\tstring[] arr = new string[]{\"byte\",\"short\", \"int\", \"long\", \"BigInteger\"};\n\t\t\tif ((-128 <= d) && (d <= 127)) return arr [0];\n\t\t\tif((-32768 <= d) && (d<= 32767))\n\t\t\t\treturn arr [1];\n\t\t\tif((-2147483648 <= d) && (d<= 2147483647))\n\t\t\t\treturn arr [2];\n\t\t\telse\n\t\t\t\treturn arr [3];\n\n\t\t}", "lang": "MS C#", "bug_code_uid": "1e85c36b70703a2bc4ea0218529310de", "src_uid": "33041f1832fa7f641e37c4c638ab08a1", "apr_id": "4e2262fb7f801e7569bdb366772b4a6d", "difficulty": 1300, "tags": ["strings", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.8482269503546099, "equal_cnt": 13, "replace_cnt": 7, "delete_cnt": 2, "insert_cnt": 3, "fix_ops_cnt": 12, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\n\nnamespace Gift\n{\n class Program\n {\n static void Main(string[] args)\n {\n IO io = new IO();\n int i_N = io.ReadInt();\n int[] arr_Weight = new int[i_N];\n double d_Sum = 0;\n for (int i = 0; i < i_N; i++)\n {\n arr_Weight[i] = io.ReadNextInt();\n d_Sum += arr_Weight[i];\n }\n Array.Sort(arr_Weight);\n\n io.PutStr(arr_Weight[i_N / 2+1] == (d_Sum / 2) ? \"YES\" : \"NO\");\n io.ReadStr();\n }\n }\n\n class IO\n {\n private static Queue currentLineTokens = new Queue();\n private static string[] ReadAndSplitLine()\n {\n return Console.ReadLine().Split(new[] { ' ', '\\t' }, StringSplitOptions.RemoveEmptyEntries);\n }\n public int ReadNextInt()\n {\n return int.Parse(ReadToken());\n }\n public long ReadNextLong()\n {\n return long.Parse(ReadToken());\n }\n\n public int ReadInt()\n {\n return Convert.ToInt32(Console.ReadLine());\n }\n public long ReadLong()\n {\n return Convert.ToInt64(Console.ReadLine());\n }\n public string ReadStr()\n {\n return Console.ReadLine();\n }\n public string[] ReadStrArr()\n {\n return Console.ReadLine().Split(' ');\n }\n public int[] ReadIntArr()\n {\n return Array.ConvertAll(Console.ReadLine().Split(' '), s => int.Parse(s));\n }\n public long[] ReadLongArr()\n {\n return Array.ConvertAll(Console.ReadLine().Split(' '), s => long.Parse(s));\n }\n public void PutStr(string str)\n {\n Console.WriteLine(str);\n }\n public void PutStr(int str)\n {\n Console.WriteLine(str);\n }\n public void PutStr(long str)\n {\n Console.WriteLine(str);\n }\n\n public static string ReadToken()\n {\n while (currentLineTokens.Count == 0)\n currentLineTokens = new Queue(ReadAndSplitLine());\n return currentLineTokens.Dequeue();\n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "4237f70f99d81b848808d4ed143163f0", "src_uid": "9679acef82356004e47b1118f8fc836a", "apr_id": "ac19ce5d0e36ef882fb123e52c3a033b", "difficulty": 1100, "tags": ["brute force", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.882563490710755, "equal_cnt": 16, "replace_cnt": 1, "delete_cnt": 2, "insert_cnt": 13, "fix_ops_cnt": 16, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\nusing System.Text;\n\nnamespace Cutlet\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 Solve(args);\n writer.Flush();\n }\n\n private static void Solve(string[] args)\n {\n int n = Next();\n int k = Next();\n\n var l = new int[k];\n var r = new int[k];\n for (int i = 0; i < k; i++)\n {\n l[i] = Next();\n r[i] = Next();\n }\n\n var dp = new List[k + 1];\n\n for (int i = 0; i < dp.Length; i++)\n {\n dp[i] = new List();\n }\n dp[0].Add(new Interval(0, 0));\n\n int prev = 0;\n for (int i = 0; i < k; i++)\n {\n var next = new List[k + 1];\n for (int ii = 0; ii < dp.Length; ii++)\n {\n next[ii] = new List();\n }\n\n int delta = l[i] - prev;\n for (int index = 0; index < dp.Length; index++)\n {\n if (index%2 == 0)\n {\n List t = dp[index];\n foreach (Interval interval in t)\n {\n interval.l += delta;\n interval.r += delta;\n }\n }\n }\n delta = r[i] - l[i];\n for (int ii = 0; ii < dp.Length; ii++)\n {\n if (ii%2 == 0)\n {\n foreach (Interval interval in dp[ii])\n {\n next[ii].Add(new Interval(interval.l + delta, interval.r + delta));\n next[ii + 1].Add(new Interval(interval.l, interval.r + delta));\n }\n }\n else\n {\n foreach (Interval interval in dp[ii])\n {\n next[ii].Add(new Interval(interval.l, interval.r));\n next[ii + 1].Add(new Interval(interval.l, interval.r + delta));\n }\n }\n }\n\n prev = r[i];\n for (int index = 0; index < dp.Length; index++)\n {\n dp[index].Clear();\n\n Interval pr = null;\n foreach (Interval interval in next[index].OrderBy(t => t.l))\n {\n if (interval.l > n)\n break;\n if (pr != null && pr.r >= interval.l)\n {\n pr.r = Math.Max(pr.r, interval.r);\n }\n else\n {\n dp[index].Add(interval);\n pr = interval;\n }\n }\n }\n }\n\n {\n int delta = 2*n - prev;\n for (int index = 0; index < dp.Length; index++)\n {\n if (index%2 == 0)\n {\n List t = dp[index];\n foreach (Interval interval in t)\n {\n interval.l += delta;\n interval.r += delta;\n }\n }\n }\n }\n\n for (int i = 0; i < dp.Length; i++)\n {\n foreach (Interval interval in dp[i])\n {\n if (interval.l <= n && interval.r >= n)\n {\n writer.WriteLine(\"Full\");\n writer.WriteLine(i);\n return;\n }\n }\n }\n\n writer.WriteLine(\"Hungry\");\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 #region Nested type: Interval\n\n private class Interval\n {\n public int l, r;\n\n public Interval(int l, int r)\n {\n this.l = l;\n this.r = r;\n }\n }\n\n #endregion\n }\n}", "lang": "Mono C#", "bug_code_uid": "3d2b4d035f059fbd93a5df5744aeaacc", "src_uid": "2e0d1b1f1a7b8df2d2598c3cb2c869d5", "apr_id": "d116b2a4db168fec376b587ba94f76df", "difficulty": 2400, "tags": ["data structures", "dp"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.8722358722358723, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "using System;\n\nnamespace MyFirstProject\n{\n class MainClass\n {\n public static void Main (string[] args)\n {\n Int32 n = Convert.ToInt32(Console.ReadLine());\n Int32 friend = 0;\n for (int i = 0; i < n; i++)\n {\n friend += Convert.ToInt32(Console.ReadLine());\n }\n n++;\n Int32 res = 0;\n for (int i = 1; i < 6; i++)\n {\n if (((friend+i-1) % (n)) != 0)\n {\n //Console.WriteLine((friend + i)+\" % \"+n+\" = \"+((friend+i) % (n)));\n res++;\n }\n }\n Console.WriteLine(res);\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "3ba9eda9b1564625795f4855c2743219", "src_uid": "ff6b3fd358c758324c19a26283ab96a4", "apr_id": "cc801b5dcee35888f567e8363982518e", "difficulty": 1000, "tags": ["math", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.9849175727814802, "equal_cnt": 7, "replace_cnt": 6, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 6, "bug_source_code": "using System;\nusing System.Linq;\nusing System.Collections.Generic;\n \nclass Program\n{\n private static void Main()\n {\n int result = 0;\n int n = ConsoleReadLineAsInteger();\n var kk1 = ConsoleReadLineAsArrayOfIntegers();\n var kk2 = ConsoleReadLineAsArrayOfIntegers();\n \n List k1 = new List();\n for(int i = 1; i < kk1.Length; i++)\n k1.Add(kk1[i]);\n \n List k2 = new List();\n for(int i = 1; i < kk2.Length; i++)\n k2.Add(kk2[i]);\n \n int f = 0;\n int ccc = 0;\n while(true)\n {\n ccc++;\n \n if (ccc > 40000000)\n {\n Console.WriteLine(\"-1\");\n return;\n }\n f++;\n \n int v1 = k1[0]; k1.RemoveAt(0);\n int v2 = k2[0]; k2.RemoveAt(0);\n \n if (v1 > v2)\n {\n k1.Add(v2);\n k1.Add(v1);\n }\n else\n {\n k2.Add(v1);\n k2.Add(v2);\n }\n \n // test\n if (k1.Count == 0)\n {\n ConsoleWriteLine(\"\" + f + \" 2\");\n return;\n }\n else if (k2.Count == 0)\n {\n ConsoleWriteLine(\"\" + f + \" 1\");\n return;\n }\n /*\n else if (k1.Count == kk1.Length - 1 && k2.Count == kk2.Length - 1)\n {\n bool k1s = true;\n for(int i = 0; i < k1.Count; i++)\n {\n if (k1[i] != kk1[i+1])\n {\n k1s = false;\n break;\n }\n }\n \n if (k1s)\n {\n bool k2s = true;\n for(int j = 0; j < k2.Count; j++)\n {\n if (k2[j] != kk2[j+1])\n {\n k2s = false;\n break;\n }\n }\n \n if (k1s == k2s)\n {\n ConsoleWriteLine(\"-1\");\n return;\n }\n }\n }\n */\n \n }\n \n Console.WriteLine(\"\" + result);\n } \n \n private static int[] ConsoleReadLineAsArrayOfIntegers()\n {\n return Console.ReadLine().Split(' ').Select(n => Convert.ToInt32(n)).ToArray();\n }\n \n private static int ConsoleReadLineAsInteger()\n {\n return Convert.ToInt32(Console.ReadLine());\n }\n \n private static void ConsoleWriteLine(string line)\n {\n Console.WriteLine(line);\n }\n}", "lang": "MS C#", "bug_code_uid": "9b924fd8327410bcdcc54dd716eda609", "src_uid": "f587b1867754e6958c3d7e0fe368ec6e", "apr_id": "8213cbd3f6af40b4c0a63044fd339ce2", "difficulty": 1400, "tags": ["brute force", "games", "dfs and similar"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.36363636363636365, "equal_cnt": 24, "replace_cnt": 10, "delete_cnt": 5, "insert_cnt": 9, "fix_ops_cnt": 24, "bug_source_code": "using System;\nusing System.Text;\n\nnamespace _82A\n{\n class Program\n {\n public enum Names\n { Sheldon=1, Leonard, Penny, Rajesh, Howard}\n\n static void Main()\n {\n int n = int.Parse(Console.ReadLine());\n StringBuilder queue = new StringBuilder(\"12345\", n + 5); \n for (int i=1;i= 1)\n {\n answer.Append(\"O.\");\n added++;\n }\n\n for (int i = 0; i < 10 - added; i++)\n answer.Append(\"#.\");\n\n answer.AppendLine(\"|D|)\");\n\n // Line 2\n answer.Append(\"|O.\");\n\n for (int i = 0; i < diff; i++)\n answer.Append(\"O.\");\n\n added = diff;\n\n if (rem >= 2)\n {\n answer.Append(\"O.\");\n added++;\n }\n\n for (int i = 0; i < 10 - added; i++)\n answer.Append(\"#.\");\n\n answer.AppendLine(\"|.|)\");\n\n // Line 3\n answer.AppendLine(\"|O.......................|\");\n\n // Line 4\n answer.Append(\"|O.\");\n\n for (int i = 0; i < diff; i++)\n answer.Append(\"O.\");\n\n added = diff;\n\n for (int i = 0; i < 10 - added; i++)\n answer.Append(\"#.\");\n\n answer.AppendLine(\"|.|)\");\n }\n\n answer.AppendLine(\"+------------------------+\");\n\n Console.Write(answer);\n }\n }\n\n partial class Question1\n {\n static string[] tokens = new string[0];\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 if (cur_token == tokens.Length)\n ReadArray(' ');\n return int.Parse(tokens[cur_token++]);\n }\n\n static long NextLong()\n {\n if (cur_token == tokens.Length)\n ReadArray(' ');\n return long.Parse(tokens[cur_token++]);\n }\n\n static double NextDouble()\n {\n if (cur_token == tokens.Length)\n ReadArray(' ');\n return double.Parse(tokens[cur_token++]);\n }\n\n static decimal NextDecimal()\n {\n if (cur_token == tokens.Length)\n ReadArray(' ');\n return decimal.Parse(tokens[cur_token++]);\n }\n\n static string NextToken()\n {\n if (cur_token == tokens.Length)\n ReadArray(' ');\n return tokens[cur_token++];\n }\n\n static string ReadLine()\n {\n return Console.ReadLine();\n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "6307170677e5883b97ed19de38bbc4ca", "src_uid": "075f83248f6d4d012e0ca1547fc67993", "apr_id": "52b51c76c21c510e3ff21336f1cd5e0e", "difficulty": 1100, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "C#"} {"similarity_score": 0.9996519317786287, "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;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace ConsoleApplication1\n{\n class Program\n {\n static void Main(string[] args)\n {\n int x = Convert.ToInt16(Console.ReadLine());\n \n Console.WriteLine(\"+------------------------+\");\n if (x < 1) Console.Write(\"|#.\");\n else Console.Write(\"|O.\");\n for (int m = 5; m <= 32; m = m + 3)\n {\n if (x >= m) Console.Write(\"O.\");\n else Console.Write(\"#.\");\n }\n\n Console.Write(\"|D|)\\n\");\n if (x < 2) Console.Write(\"|#.\");\n else Console.Write(\"|O.\");\n for (int m = 6; m <= 33; m = m + 3)\n {\n if (x >= m) Console.Write(\"O.\");\n else Console.Write(\"#.\");\n }\n\n Console.Write(\"|.|)\\n\");\n if (x < 3) Console.WriteLine(\"|#.......................|\");\n else Console.WriteLine(\"|O.......................|\");\n\n if (x < 4) Console.Write(\"|#.\");\n else Console.Write(\"|O.\");\n for (int m = 7; m <= 34; m = m + 3)\n {\n if (x >= m) Console.Write(\"O.\");\n else Console.Write(\"#.\");\n }\n Console.Write(\"|.|)\\n\");\n Console.WriteLine(\"+------------------------+\");\n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "628805a0b23b5108388b0bb6fc811a76", "src_uid": "075f83248f6d4d012e0ca1547fc67993", "apr_id": "6c093884eb619757f78bcd06487a03f1", "difficulty": 1100, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "C#"} {"similarity_score": 0.997884208501635, "equal_cnt": 5, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 2, "fix_ops_cnt": 4, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace Bayan\n{\n class Program\n {\n static List Do(int PassengersCount)\n {\n List Lines = new List();\n\n var RowCount = 6;\n var ColumnCount = 27;\n var Bus = new char[RowCount, ColumnCount];\n\n\n for (int row = 0; row < RowCount; row++)\n {\n string line = \"\";\n\n for (int column = 0; column < ColumnCount; column++)\n {\n if (row == 0 || row == RowCount - 1)\n {\n if (column == 0 || column == (ColumnCount - 2))\n Bus[row, column] = '+';\n else if (column == (ColumnCount - 1))\n Bus[row, column] = ' ';\n else\n Bus[row, column] = '-';\n }\n else\n {\n // ستون های ردیف های 1 تا 4\n if (column == 0)\n Bus[row, column] = '|';\n else\n {\n if (column < 23)\n {\n if (column == 1)\n {\n Bus[row, column] = '#';\n }\n else\n {\n if (row == 3)\n Bus[row, column] = '.';\n else\n {\n var isOdd = column % 2 == 1;\n if (isOdd)\n {\n Bus[row, column] = '#';\n }\n else\n {\n Bus[row, column] = '.';\n }\n }\n }\n }\n else\n {\n if (column == 23)\n {\n if (row != 3)\n Bus[row, column] = '|';\n else\n Bus[row, column] = '.';\n }\n else if (column == 24)\n {\n if (row == 1)\n Bus[row, column] = 'D';\n else\n Bus[row, column] = '.';\n }\n else if (column == 25)\n {\n Bus[row, column] = '|';\n }\n else if (column == 26)\n {\n if (row == 1 || row == 4)\n Bus[row, column] = ')';\n else\n Bus[row, column] = ' ';\n }\n }\n }\n\n }\n\n var s = Bus[row, column].ToString();\n line = line + s;\n }\n\n Lines.Add(line);\n }\n\n //PassengersCount\n\n var c = 0;\n\n string[] BusArray = Lines.ToArray();\n\n while (PassengersCount != 0)\n {\n var ss = BusArray[c];\n\n if (c >= 1 && c <= 4)\n {\n if (c == 3)\n {\n var cc = ss.ToCharArray();\n for (int i = 0; i < cc.Length; i++)\n {\n if (i == 1)\n {\n if (cc[i] == '#')\n {\n cc[i] = 'O';\n PassengersCount--;\n ss = string.Join(\"\", cc);\n break;\n }\n }\n }\n }\n else\n {\n var cc = ss.ToCharArray();\n\n for (int r = 0; r < cc.Length; r++)\n {\n if (cc[r] == '#')\n {\n cc[r] = 'O';\n PassengersCount--;\n break;\n }\n }\n\n ss = string.Join(\"\", cc);\n }\n\n }\n\n BusArray[c] = ss;\n\n c++;\n\n if (c > 5)\n c = 0;\n };\n\n return BusArray.ToList();\n }\n\n\n static void Main(string[] args)\n {\n try\n {\n var OutputLines = Do(int.Parse(Console.ReadLine()));\n Console.Write(string.Join(\"\\n\", OutputLines));\n }\n catch (Exception ex)\n {\n Console.WriteLine(ex.Message);\n Console.Write(Environment.NewLine);\n Console.Write(\"any key to exit\");\n Console.ReadKey();\n }\n }\n }\n\n\n #region Extensions\n\n public static class Extensions\n {\n public static void ForEach(this IEnumerable Collection, Action Action)\n {\n var ListCollection = Collection.ToList();\n\n var Length = ListCollection.Count;\n for (int i = 0; i < Length; i++)\n {\n Action(ListCollection[i], i);\n }\n }\n }\n\n #endregion\n\n\n #region IO\n\n public class IO\n {\n #region Constructor\n\n public IO(string InputPath, string OutputPath)\n {\n this.InputPath = InputPath;\n this.OutputPath = OutputPath;\n }\n\n #endregion\n\n\n #region Properties\n\n public string InputPath { get; set; }\n public string OutputPath { get; set; }\n\n #endregion\n\n\n #region Read Public Methods\n\n public string Read()\n {\n string Text = string.Empty;\n using (StreamReader Reader = new StreamReader(this.InputPath))\n Text = Reader.ReadToEnd();\n\n return Text;\n }\n\n public List ReadLines()\n {\n var Text = Read();\n var Lines = Text\n .Split('\\n')\n .Where(u => !string.IsNullOrEmpty(u))\n .ToList();\n return Lines;\n }\n\n #endregion\n\n\n #region Write Public Methods\n\n public void Write(string Text)\n {\n using (StreamWriter Writer = new StreamWriter(this.OutputPath))\n Writer.Write(Text);\n }\n\n public void WriteLines(List Lines)\n {\n var Text = String.Join(Environment.NewLine, Lines);\n Write(Text);\n }\n\n #endregion\n }\n\n #endregion\n}\n", "lang": "MS C#", "bug_code_uid": "8e98cf2feac7f69d5cef08519fafd719", "src_uid": "075f83248f6d4d012e0ca1547fc67993", "apr_id": "92f98ef1eb43b7f580f00bf594de9944", "difficulty": 1100, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.9763224181360202, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "using System;\nusing System.Linq;\n\nnamespace CodeForces\n{\n\tclass MainClass\n\t{\n\t\tpublic static void Main(string[] args)\n\t\t{\n\t\t\tstring line1 = Console.ReadLine();\n\t\t\tint n = Int32.Parse(line1);\n\t\t\tint[,] columns = new int[11 , 4];\n\t\t\tif (n >= 4)\n\t\t\t{\n\t\t\t\tn -= 4;\n\t\t\t\tfor (int i = 0; i < 4; i++)\n\t\t\t\t{\n\t\t\t\t\tcolumns[0, i] = 1;\n\t\t\t\t}\n\t\t\t\tint column = 1;\n\t\t\t\tint row = 0;\n\t\t\t\twhile (n > 0)\n\t\t\t\t{\n\t\t\t\t\tn -= 1;\n\t\t\t\t\tcolumns[column, row] = 1;\n\t\t\t\t\trow += 1;\n\t\t\t\t\tif (row == 2)\n\t\t\t\t\t{\n\t\t\t\t\t\trow += 1;\n\t\t\t\t\t}\n\t\t\t\t\tif (row == 4)\n\t\t\t\t\t{\n\t\t\t\t\t\trow = 0;\n\t\t\t\t\t\tcolumn += 1;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tif (n == 3)\n\t\t\t\t{\n\t\t\t\t\tfor (int i = 0; i < 3; i++)\n\t\t\t\t\t{\n\t\t\t\t\t\tcolumns[0, i] = 1;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse if (n == 2)\n\t\t\t\t{\n\t\t\t\t\tfor (int i = 0; i < 2; i++)\n\t\t\t\t\t{\n\t\t\t\t\t\tcolumns[0, i] = 1;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse if (n == 1)\n\t\t\t\t{\n\t\t\t\t\tfor (int i = 0; i < 1; i++)\n\t\t\t\t\t{\n\t\t\t\t\t\tcolumns[0, i] = 1;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\n\t\t\t\t}\n\t\t\t}\n\t\t\tConsole.WriteLine(\"+------------------------+\");\n\t\t\tConsole.Write(\"|\");\n\t\t\tfor (int i = 0; i < 11; i++)\n\t\t\t{\n\t\t\t\tif (columns[i, 0] == 1)\n\t\t\t\t{\n\t\t\t\t\tConsole.Write(\"O.\");\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tConsole.Write(\"#.\");\n\t\t\t\t}\n\t\t\t}\n\t\t\tConsole.Write(\"|D|)\" + Environment.NewLine);\n\t\t\tConsole.Write(\"|\");\n\t\t\tfor (int i = 0; i < 11; i++)\n\t\t\t{\n\t\t\t\tif (columns[i, 1] == 1)\n\t\t\t\t{\n\t\t\t\t\tConsole.Write(\"O.\");\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tConsole.Write(\"#.\");\n\t\t\t\t}\n\t\t\t}\n\t\t\tConsole.Write(\"|.|\" + Environment.NewLine);\n\t\t\tConsole.Write(\"|\");\n\t\t\tfor (int i = 0; i < 11; i++)\n\t\t\t{\n\t\t\t\tif (columns[i, 2] == 1)\n\t\t\t\t{\n\t\t\t\t\tConsole.Write(\"O.\");\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tConsole.Write(\"..\");\n\t\t\t\t}\n\t\t\t}\n\t\t\tConsole.Write(\"..|\" + Environment.NewLine);\n\t\t\tConsole.Write(\"|\");\n\t\t\tfor (int i = 0; i < 11; i++)\n\t\t\t{\n\t\t\t\tif (columns[i, 3] == 1)\n\t\t\t\t{\n\t\t\t\t\tConsole.Write(\"O.\");\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tConsole.Write(\"#.\");\n\t\t\t\t}\n\t\t\t}\n\t\t\tConsole.Write(\"|.|)\" + Environment.NewLine);\n\t\t\tConsole.WriteLine(\"+------------------------+\");\n\n\t\t}\n\n\t}\n\n}", "lang": "MS C#", "bug_code_uid": "070f9921266e2fe133f04465babaea81", "src_uid": "075f83248f6d4d012e0ca1547fc67993", "apr_id": "290bfe4fdf675c308aaaa85621d16a8e", "difficulty": 1100, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.998272884283247, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 2, "bug_source_code": "using System;\nusing System.Linq;\n\nnamespace CodeForces\n{\n\tclass MainClass\n\t{\n\t\tpublic static void Main(string[] args)\n\t\t{\n\t\t\tstring line1 = Console.ReadLine();\n\t\t\tint n = Int32.Parse(line1);\n\t\t\tint[,] columns = new int[11 , 4];\n\t\t\tif (n >= 4)\n\t\t\t{\n\t\t\t\tn -= 4;\n\t\t\t\tfor (int i = 0; i < 4; i++)\n\t\t\t\t{\n\t\t\t\t\tcolumns[0, i] = 1;\n\t\t\t\t}\n\t\t\t\tint column = 1;\n\t\t\t\tint row = 0;\n\t\t\t\twhile (n > 0)\n\t\t\t\t{\n\t\t\t\t\tn -= 1;\n\t\t\t\t\tcolumns[column, row] = 1;\n\t\t\t\t\trow += 1;\n\t\t\t\t\tif (row == 2)\n\t\t\t\t\t{\n\t\t\t\t\t\trow += 1;\n\t\t\t\t\t}\n\t\t\t\t\tif (row == 4)\n\t\t\t\t\t{\n\t\t\t\t\t\trow = 0;\n\t\t\t\t\t\tcolumn += 1;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tif (n == 3)\n\t\t\t\t{\n\t\t\t\t\tfor (int i = 0; i < 3; i++)\n\t\t\t\t\t{\n\t\t\t\t\t\tcolumns[0, i] = 1;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse if (n == 2)\n\t\t\t\t{\n\t\t\t\t\tfor (int i = 0; i < 2; i++)\n\t\t\t\t\t{\n\t\t\t\t\t\tcolumns[0, i] = 1;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse if (n == 1)\n\t\t\t\t{\n\t\t\t\t\tfor (int i = 0; i < 1; i++)\n\t\t\t\t\t{\n\t\t\t\t\t\tcolumns[0, i] = 1;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\n\t\t\t\t}\n\t\t\t}\n\t\t\tConsole.WriteLine(\"+------------------------+\");\n\t\t\tConsole.Write(\"|\");\n\t\t\tfor (int i = 0; i < 11; i++)\n\t\t\t{\n\t\t\t\tif (columns[i, 0] == 1)\n\t\t\t\t{\n\t\t\t\t\tConsole.Write(\"O.\");\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tConsole.Write(\"#.\");\n\t\t\t\t}\n\t\t\t}\n\t\t\tConsole.Write(\"|D|)\" + Environment.NewLine);\n\t\t\tConsole.Write(\"|\");\n\t\t\tfor (int i = 0; i < 11; i++)\n\t\t\t{\n\t\t\t\tif (columns[i, 1] == 1)\n\t\t\t\t{\n\t\t\t\t\tConsole.Write(\"O.\");\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tConsole.Write(\"#.\");\n\t\t\t\t}\n\t\t\t}\n\t\t\tConsole.Write(\"|.|\" + Environment.NewLine);\n\t\t\tConsole.Write(\"|\");\n\t\t\tfor (int i = 0; i < 11; i++)\n\t\t\t{\n\t\t\t\tif (columns[i, 2] == 1)\n\t\t\t\t{\n\t\t\t\t\tConsole.Write(\"O.\");\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tif (i = 0)\n\t\t\t\t\t{\n\t\t\t\t\t\tConsole.Write(\"#.);\n\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tConsole.Write(\"..\");\n\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t}\n\t\t\tConsole.Write(\"..|\" + Environment.NewLine);\n\t\t\tConsole.Write(\"|\");\n\t\t\tfor (int i = 0; i < 11; i++)\n\t\t\t{\n\t\t\t\tif (columns[i, 3] == 1)\n\t\t\t\t{\n\t\t\t\t\tConsole.Write(\"O.\");\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tConsole.Write(\"#.\");\n\t\t\t\t}\n\t\t\t}\n\t\t\tConsole.Write(\"|.|)\" + Environment.NewLine);\n\t\t\tConsole.WriteLine(\"+------------------------+\");\n\n\t\t}\n\n\t}\n\n}", "lang": "MS C#", "bug_code_uid": "23962c179974000157c1856804eba030", "src_uid": "075f83248f6d4d012e0ca1547fc67993", "apr_id": "290bfe4fdf675c308aaaa85621d16a8e", "difficulty": 1100, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9928263988522238, "equal_cnt": 5, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 4, "fix_ops_cnt": 4, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace ConsoleApplication8\n{\n class Program\n {\n static void Main(string[] args)\n {\n int count = int.Parse(Console.ReadLine());\n string[,] bus = new string[6, 14];\n int n = 0;\n string[] output = new string[6];\n n = count;\n bus[0, 0] = \"+\";\n bus[5, 0] = \"+\";\n bus[0, 13] = \"+\";\n bus[5, 13] = \"+\";\n bus[1, 12] = \"|D\";\n bus[1, 13] = \"|\";\n bus[2, 12] = \"|.\";\n bus[2, 13] = \"|\";\n bus[4, 12] = \"|.\";\n bus[4, 13] = \"|\";\n bus[3, 13] = \"|\";\n for (int i = 1; i < 5; i++)\n {\n bus[i, 0] = \"|\";\n }\n \n\n\n \n \n for (int i = 2; i <= 11; i++)\n {\n bus[3, i] = \".\";\n }\n for (int i = 1; i <= 11; i++)\n {\n for (int j = 1; j < 5; j++)\n {\n if ((bus[j,i] != \".\") && (n != 0) )\n {\n bus[j, i] = \"O.\";\n n--;\n }\n else if ( (bus[j,i] != \".\"))\n {\n bus[j, i] = \"#.\";\n }\n \n }\n \n }\n\n Console.Write('+');\n for (int l = 1; l < 25; l++)\n {\n Console.Write('-');\n }\n Console.Write('+');\n for (int i = 1; i < 5; i++)\n {\n Console.WriteLine();\n for (int j = 0; j < 14; j++)\n {\n output[i] += bus[i, j];\n \n }\n\n \n\n if ((i == 1) || (i == 4))\n {\n Console.Write(output[i] + ')');\n }\n else\n {\n Console.Write(output[i]);\n }\n }\n Console.WriteLine();\n Console.Write('+');\n for (int l = 1; l < 25; l++)\n {\n Console.Write('-');\n }\n Console.Write('+');\n\n Console.Read();\n \n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "f08af25b3d5fff2cff09f60fc081c98b", "src_uid": "075f83248f6d4d012e0ca1547fc67993", "apr_id": "386a04876655ae05113dd36d8ca5f747", "difficulty": 1100, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.9990685296074517, "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\nclass PairVariable : IComparable\n{\n public int a, b;\n public PairVariable()\n {\n a = b = 0;\n }\n public PairVariable(string s)\n {\n string[] q = s.Split();\n a = int.Parse(q[0]);\n b = int.Parse(q[1]);\n }\n public PairVariable(int a, int b)\n {\n this.a = a;\n this.b = b;\n }\n public int CompareTo(PairVariable pv)\n {\n if (this.a > pv.a)\n {\n return 1;\n }\n else if (this.a < pv.a)\n {\n return -1;\n }\n else\n {\n if (this.b >= pv.b)\n {\n return 1;\n }\n else\n {\n return -1;\n }\n }\n }\n\n}\nnamespace ConsoleApplication254\n{\n class Program\n {\n static Dictionary> d = new Dictionary>();\n static int[] mark;\n static Dictionary cnt;\n static int[] color;\n static int size = 0;\n static void dfs(int v)\n {\n size++;\n mark[v] = 1;\n bool w = false;\n if (cnt.ContainsKey(color[v]))\n {\n cnt[color[v]]++;\n }\n else\n {\n cnt.Add(color[v], 1);\n }\n for (int i = 0; i < d[v].Count; i++)\n {\n if (mark[d[v][i]] == 0)\n {\n\n dfs(d[v][i]);\n }\n\n }\n\n }\n static void Main(string[] args)\n {\n string[] ss = Console.ReadLine().Split();\n int n = int.Parse(ss[0]);\n int k1 = 0;\n int k2 = 0;\n int k3 = 0;\n if (n > 4)\n {\n string a1 = \"+------------------------+\";\n string a2 = \"|#.#.#.#.#.#.#.#.#.#.#.|D|)\";\n string a3 = \"|#.#.#.#.#.#.#.#.#.#.#.|.|\";\n string a4 = \"|O.......................|\";\n string a5 = \"|#.#.#.#.#.#.#.#.#.#.#.|.|)\";\n string a6 = \"+------------------------+\";\n if ((n - 1) % 3 == 0)\n {\n k1 = (n - 1) / 3;\n k2 = (n - 1) / 3;\n k3 = (n - 1) / 3;\n }\n else if ((n - 1) % 3 == 1)\n {\n k1 = (n - 1) / 3 + 1;\n k2 = (n - 1) / 3;\n k3 = (n - 1) / 3;\n }\n else\n {\n k1 = (n - 1) / 3 + 1;\n k2 = (n - 1) / 3 + 1;\n k3 = (n - 1) % 3;\n }\n //Console.WriteLine(k1+\" \"+k2+\" \"+k3);\n int k = 1;\n string c1 = a1;\n string c2 = \"\";\n string c3 = \"\";\n string c4 = a4;\n string c5 = \"\";\n string c6 = a6;\n for (int i = 0; i < a2.Length; i++)\n {\n if (k <= k1)\n {\n if (a2[i] == '#')\n {\n c2 += 'O';\n k++;\n }\n else\n {\n c2 += a2[i];\n }\n }\n else\n {\n c2 += a2[i];\n }\n }\n k = 1;\n for (int i = 0; i < a3.Length; i++)\n {\n if (k <= k2)\n {\n if (a3[i] == '#')\n {\n c3 += 'O';\n k++;\n }\n else\n {\n c3 += a3[i];\n }\n }\n else\n {\n c3 += a3[i];\n }\n }\n k = 1;\n for (int i = 0; i < a5.Length; i++)\n {\n if (k <= k3)\n {\n if (a5[i] == '#')\n {\n c5 += 'O';\n k++;\n }\n else\n {\n c5 += a5[i];\n }\n }\n else\n {\n c5 += a5[i];\n }\n }\n Console.WriteLine(c1);\n Console.WriteLine(c2);\n Console.WriteLine(c3);\n Console.WriteLine(c4);\n Console.WriteLine(c5);\n Console.WriteLine(c6);\n }\n else\n {\n\n if (n == 1)\n {\n Console.WriteLine(\"+------------------------+\");\n Console.WriteLine(\"|O.#.#.#.#.#.#.#.#.#.#.|D|)\");\n Console.WriteLine(\"|#.#.#.#.#.#.#.#.#.#.#.|.|\");\n Console.WriteLine(\"|#.......................|\");\n Console.WriteLine(\"|#.#.#.#.#.#.#.#.#.#.#.|.|)\");\n Console.WriteLine(\"+------------------------+\");\n }\n else if (n == 2)\n {\n\n Console.WriteLine(\"+------------------------+\");\n Console.WriteLine(\"|O.#.#.#.#.#.#.#.#.#.#.|D|)\");\n Console.WriteLine(\"|O.#.#.#.#.#.#.#.#.#.#.|.|\");\n Console.WriteLine(\"|#.......................|\");\n Console.WriteLine(\"|#.#.#.#.#.#.#.#.#.#.#.|.|)\");\n Console.WriteLine(\"+------------------------+\");\n }\n else if (n == 3)\n {\n Console.WriteLine(\"+------------------------+\");\n Console.WriteLine(\"|O.#.#.#.#.#.#.#.#.#.#.|D|)\");\n Console.WriteLine(\"|O.#.#.#.#.#.#.#.#.#.#.|.|\");\n Console.WriteLine(\"|O.......................|\");\n Console.WriteLine(\"|#.#.#.#.#.#.#.#.#.#.#.|.|)\");\n Console.WriteLine(\"+------------------------+\");\n }\n else if (n == 4)\n {\n Console.WriteLine(\"+------------------------+\");\n Console.WriteLine(\"|O.#.#.#.#.#.#.#.#.#.#.|D|)\");\n Console.WriteLine(\"|O.#.#.#.#.#.#.#.#.#.#.|.|\");\n Console.WriteLine(\"|O.......................|\");\n Console.WriteLine(\"|O.#.#.#.#.#.#.#.#.#.#.|.|)\");\n Console.WriteLine(\"+------------------------+\");\n }\n else\n {\n\n Console.WriteLine(\"+------------------------+\");\n Console.WriteLine(\"|#.#.#.#.#.#.#.#.#.#.#.|D|)\");\n Console.WriteLine(\"|#.#.#.#.#.#.#.#.#.#.#.|.|\");\n Console.WriteLine(\"|#.......................|\");\n Console.WriteLine(\"|#.#.#.#.#.#.#.#.#.#.#.|.|)\");\n Console.WriteLine(\"+------------------------+\");\n }\n }\n }\n }\n}", "lang": "MS C#", "bug_code_uid": "661aba2a6aabe93f77b6cff021b8402a", "src_uid": "075f83248f6d4d012e0ca1547fc67993", "apr_id": "76ca8755840195821154ebd0b8acf460", "difficulty": 1100, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9915966386554622, "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.Text;\nusing System.Threading.Tasks;\n\nnamespace CF475A {\n class Program {\n static void Main(string[] args) {\n int passengers = int.Parse(Console.ReadLine());\n\n Console.WriteLine(\"+------------------------+\");\n for(int row = 0; row < 4; row++) {\n string r = \"|\";\n int seats = (passengers - 4) / 3;\n if(row == 0) {\n if((passengers - 4) % 3 > 0) {\n seats += 1;\n }\n } else if(row == 1) {\n if((passengers - 4) % 3 > 1) {\n seats += 1;\n }\n }\n if(row == 2) {\n if(passengers >= 3) {\n Console.WriteLine(\"|O.......................|\");\n } else {\n Console.WriteLine(\"|#.......................|\");\n }\n continue;\n }\n\n for(int i = 0; i <= seats; i++) {\n if(row == 3 && passengers < 4) {\n continue;\n }\n r += \"O.\";\n }\n if(passengers - (row + 1) == 0 && row == 0) {\n r += \"O.\";\n seats++;\n }\n for(int i = seats; i < 10; i++) {\n r += \"#.\";\n\n }\n if(row == 0) {\n r += \"|D|)\";\n } else if(row == 1) {\n r += \"|.|\";\n } else if(row == 2) {\n r += \"..|\";\n } else if (row == 3) {\n r += \"|.|)\";\n }\n Console.WriteLine(r);\n }\n Console.WriteLine(\"+------------------------+\");\n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "c31d8eef2f4433fe694a09a5faf1d08b", "src_uid": "075f83248f6d4d012e0ca1547fc67993", "apr_id": "27ae33710cea255e8f5a51d29a67c7dc", "difficulty": 1100, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.9943488943488944, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 3, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Diagnostics;\nusing System.Runtime.InteropServices;\nusing System.Text;\nusing System.Linq;\nusing System.IO;\nusing System.Globalization;\nusing System.Collections;\nusing System.Text.RegularExpressions;\n\nnamespace Task\n{\n\n #region MyIo\n\n internal class MyIo : IDisposable\n {\n private readonly TextReader inputStream;\n private readonly TextWriter outputStream = Console.Out;\n\n private string[] tokens;\n private int pointer;\n\n public MyIo()\n#if LOCAL_TEST\n : this(new StreamReader(\"input.txt\"))\n#else\n : this(System.Console.In)\n#endif\n {\n\n }\n\n public MyIo(TextReader inputStream)\n {\n this.inputStream = inputStream;\n }\n\n\n public char NextChar()\n {\n try\n {\n return (char)inputStream.Read();\n }\n catch (IOException)\n {\n return '\\0';\n }\n }\n\n public string NextLine()\n {\n try\n {\n return inputStream.ReadLine();\n }\n catch (IOException)\n {\n return null;\n }\n }\n\n public string NextString()\n {\n try\n {\n while (tokens == null || pointer >= tokens.Length)\n {\n tokens = (NextLine() + string.Empty).Split(new[] { ' ', '\\t' }, StringSplitOptions.RemoveEmptyEntries);\n pointer = 0;\n }\n return tokens[pointer++];\n }\n catch (IOException)\n {\n return null;\n }\n }\n\n public int NextInt()\n {\n return Next();\n }\n\n public long NextLong()\n {\n return Next();\n }\n\n public T Next()\n {\n var t = typeof(T);\n\n if (t == typeof(char))\n return (T)(object)NextChar();\n\n object s = NextString();\n\n if (t == typeof(string))\n return (T)s;\n\n return (T)Convert.ChangeType(s, typeof(T));\n }\n\n\n public IEnumerable NextWhile(Predicate pred)\n {\n if (pred == null)\n yield break;\n\n T res = Next();\n\n while (pred(res))\n {\n yield return res;\n\n res = Next();\n }\n }\n\n public IEnumerable NextSeq(long n)\n {\n for (var i = 0; i < n; i++)\n yield return Next();\n }\n\n public void Print(string format, params object[] args)\n {\n outputStream.Write(string.Format(CultureInfo.InvariantCulture, format, args));\n }\n\n public void PrintLine(string format, params object[] args)\n {\n Print(format, args);\n\n outputStream.WriteLine();\n }\n\n public void Print(bool o)\n {\n Print(o ? \"yes\" : \"no\");\n }\n\n public void PrintLine(bool o)\n {\n Print(o);\n\n outputStream.WriteLine();\n }\n\n public void Print(T o)\n {\n outputStream.Write(Convert.ToString(o, CultureInfo.InvariantCulture));\n }\n\n\n public void PrintLine(T o)\n {\n Print(o);\n\n outputStream.WriteLine();\n }\n\n public void Close()\n {\n inputStream.Close();\n outputStream.Close();\n }\n\n void IDisposable.Dispose()\n {\n Close();\n\n#if LOCAL_TEST\n Console.ReadLine();\n#endif\n }\n }\n\n\n public static class ListExtensions\n {\n public static void Each(this IEnumerable self, Action action)\n {\n foreach (var v in self)\n action(v);\n }\n\n public static IEnumerable ToCycleEnumerable(this IEnumerable self)\n {\n if (self != null)\n {\n for (; ; )\n {\n foreach (var x in self)\n yield return x;\n }\n }\n }\n\n public static T CycleGet(this IList self, int index)\n {\n var c = self.Count;\n return self[(index % c + c) % c];\n }\n\n\n public static IList Shuffle(this IList self)\n {\n var rnd = new Random(DateTime.Now.Millisecond);\n\n var n = self.Count;\n\n while (n > 1)\n {\n n--;\n var k = rnd.Next(n + 1);\n var value = self[k];\n self[k] = self[n];\n self[n] = value;\n }\n\n return self;\n }\n\n public static IList> UseForNew2D(this T def, int fd, int sd)\n {\n var fdim = new T[fd][];\n\n for (int i = 0; i < fd; i++)\n {\n fdim[i] = new T[sd];\n Fill(fdim[i], def);\n }\n\n return fdim;\n }\n\n public static IList Fill(this IList self, Func fval)\n {\n for (var i = 0; i < self.Count; i++)\n self[i] = fval();\n\n\n return self;\n }\n\n\n public static IList Fill(this IList self, T val)\n {\n return self.Fill(() => val);\n }\n\n public static long Hash(this IList self, Func val = null)\n {\n return val != null ? self.Hash((t, current) => unchecked(current * 19L + val(t))) : self.Hash(HashOne);\n }\n\n public static long Hash(this IList self, Func val)\n {\n return self.Aggregate(0L, (current, t) => unchecked(val(t, current)));\n }\n\n\n public static long HashOne(this T self, long current)\n {\n return unchecked(current * 19L + (Equals(self, default(T)) ? 0 : self.GetHashCode()));\n }\n\n\n public static IList BuildSegTree(this IList a, Func combine, Func convert)\n {\n var t = new T1[a.Count << 2];\n\n a.BuildSegTree(t, 1, 0, a.Count - 1, combine, convert);\n\n return t;\n }\n\n private static void BuildSegTree(this IList a, IList t, int v, int tl, int tr, Func combine, Func convert)\n {\n if (tl == tr)\n {\n t[v] = convert(a[tl]);\n }\n else\n {\n int tm = (tl + tr) >> 1;\n\n BuildSegTree(a, t, v << 1, tl, tm, combine, convert);\n BuildSegTree(a, t, (v << 1) + 1, tm + 1, tr, combine, convert);\n\n t[v] = combine(t[v << 1], t[(v << 1) + 1]);\n }\n }\n }\n\n public static class P\n {\n public static P Create(T1 key, T2 val)\n {\n return new P(key, val);\n }\n }\n\n public class P\n {\n private class PComparer : IComparer>\n {\n private readonly bool? byKey;\n\n public PComparer(bool? byKey)\n {\n this.byKey = byKey;\n }\n\n\n public int Compare(P x, P y)\n {\n x = x ?? new P();\n y = y ?? new P();\n\n\n if (byKey == true)\n return Comparer.Default.Compare(x.Key, y.Key);\n else if (byKey == false)\n return Comparer.Default.Compare(x.Value, y.Value);\n else\n {\n var tr = Comparer.Default.Compare(x.Key, y.Key);\n\n if (tr != 0)\n tr = Comparer.Default.Compare(x.Value, y.Value);\n\n return tr;\n }\n }\n }\n\n\n public P()\n {\n }\n\n public P(T1 key, T2 val)\n {\n this.Key = key;\n this.Value = val;\n }\n\n\n public T1 Key\n {\n get;\n set;\n }\n\n public T2 Value\n {\n get;\n set;\n }\n\n public P Clone()\n {\n return new P(Key, Value);\n }\n\n public static IComparer> KeyComparer\n {\n get { return new PComparer(true); }\n }\n\n public static IComparer> ValueComparer\n {\n get { return new PComparer(false); }\n }\n\n public static implicit operator T1(P obj)\n {\n return obj.Key;\n }\n\n public static implicit operator T2(P obj)\n {\n return obj.Value;\n }\n\n public P SetKey(T1 key)\n {\n Key = key;\n return this;\n }\n\n public P SetValue(T2 value)\n {\n Value = value;\n return this;\n }\n\n public override string ToString()\n {\n return string.Format(\"Key: {0}, Value: {1}\", Key, Value);\n }\n\n public override bool Equals(object obj)\n {\n var co = obj as P;\n\n return co != null && co.GetHashCode() == GetHashCode();\n }\n\n public override int GetHashCode()\n {\n int hash = 17;\n hash = hash * 31 + ((Equals(Key, default(T1))) ? 0 : Key.GetHashCode());\n hash = hash * 31 + ((Equals(Value, default(T1))) ? 0 : Value.GetHashCode());\n return hash;\n\n }\n }\n\n #endregion\n\n\n\n internal class Program\n {\n #region Program\n\n private readonly MyIo io;\n\n public Program(MyIo io)\n {\n this.io = io;\n }\n\n public static void Main(string[] args)\n {\n using (MyIo io = new MyIo())\n {\n new Program(io)\n .Solve();\n }\n }\n\n\n\n #endregion\n\n public const long MOD = 1000000007;\n public const double EPS = 1e-14;\n\n\n\n\n private void Solve()\n {\n var n = io.NextLong();\n\n var x = io.NextLong();\n var y = io.NextLong();\n\n var c = io.NextLong();\n\n\n long s = 0;\n\n if (c > 1)\n {\n \n var ub = (long)Math.Sqrt(1+8*c);\n var lb = Math.Max(ub / 4L - 1L, 0L);\n\n s = ub;\n\n \n \n\n do\n {\n \n var m = (ub + lb) >> 1;\n\n var cn = Calc(n, x, y, m);\n\n if (cn > c)\n {\n ub--;\n s = Math.Min(m, s);\n }\n else if (cn < c)\n {\n lb++;\n }\n else if (cn == c)\n {\n s = m;\n break;\n }\n\n } while (ub > lb);\n\n }\n\n io.Print(s);\n }\n\n private long Pos0(long x)\n {\n return x > 0 ? x : 0;\n }\n\n private long Pow2(long x)\n {\n \n return x*x;\n }\n\n\n private long Pow2120(long x)\n {\n x = Pos0(x);\n\n return x * (x + 1L) / 2;\n }\n\n private long Calc(long n, long x, long y, long s)\n {\n // s = 37707;\n\n if (s == 0)\n return 1;\n\n \n var r = Pos0(s + y - n);\n var b = Pos0(s + x - n);\n\n var l = Pos0(1 - y + s);\n var t = Pos0(1 - x + s);\n \n var ix = 1 + n - x;\n var iy = 1 + n - y;\n\n var bse = s*s + (s + 1)*(s + 1) - Pow2(r) - Pow2(t) - Pow2(b) - Pow2(l);\n\n bse += Pow2120(l - x);\n bse += Pow2120(r - x);\n\n bse += Pow2120(l - ix);\n bse += Pow2120(r - ix);\n\n \n return bse;\n }\n }\n\n}\n\n", "lang": "Mono C#", "bug_code_uid": "8c50be8d2599281980619aa2a1a75564", "src_uid": "232c5206ee7c1903556c3625e0b0efc6", "apr_id": "51929141e6749de63fb9e8c5a59df4e1", "difficulty": 1800, "tags": ["math", "implementation", "binary search"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9700833333333333, "equal_cnt": 34, "replace_cnt": 15, "delete_cnt": 5, "insert_cnt": 13, "fix_ops_cnt": 33, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Diagnostics;\nusing System.Runtime.InteropServices;\nusing System.Text;\nusing System.Linq;\nusing System.IO;\nusing System.Globalization;\nusing System.Collections;\nusing System.Text.RegularExpressions;\n\nnamespace Task\n{\n\n #region MyIo\n\n internal class MyIo : IDisposable\n {\n private readonly TextReader inputStream;\n private readonly TextWriter outputStream = Console.Out;\n\n private string[] tokens;\n private int pointer;\n\n public MyIo()\n#if LOCAL_TEST\n : this(new StreamReader(\"input.txt\"))\n#else\n : this(System.Console.In)\n#endif\n {\n\n }\n\n public MyIo(TextReader inputStream)\n {\n this.inputStream = inputStream;\n }\n\n\n public char NextChar()\n {\n try\n {\n return (char)inputStream.Read();\n }\n catch (IOException)\n {\n return '\\0';\n }\n }\n\n public string NextLine()\n {\n try\n {\n return inputStream.ReadLine();\n }\n catch (IOException)\n {\n return null;\n }\n }\n\n public string NextString()\n {\n try\n {\n while (tokens == null || pointer >= tokens.Length)\n {\n tokens = (NextLine() + string.Empty).Split(new[] { ' ', '\\t' }, StringSplitOptions.RemoveEmptyEntries);\n pointer = 0;\n }\n return tokens[pointer++];\n }\n catch (IOException)\n {\n return null;\n }\n }\n\n public int NextInt()\n {\n return Next();\n }\n\n public long NextLong()\n {\n return Next();\n }\n\n public T Next()\n {\n var t = typeof(T);\n\n if (t == typeof(char))\n return (T)(object)NextChar();\n\n object s = NextString();\n\n if (t == typeof(string))\n return (T)s;\n\n return (T)Convert.ChangeType(s, typeof(T));\n }\n\n\n public IEnumerable NextWhile(Predicate pred)\n {\n if (pred == null)\n yield break;\n\n T res = Next();\n\n while (pred(res))\n {\n yield return res;\n\n res = Next();\n }\n }\n\n public IEnumerable NextSeq(long n)\n {\n for (var i = 0; i < n; i++)\n yield return Next();\n }\n\n public void Print(string format, params object[] args)\n {\n outputStream.Write(string.Format(CultureInfo.InvariantCulture, format, args));\n }\n\n public void PrintLine(string format, params object[] args)\n {\n Print(format, args);\n\n outputStream.WriteLine();\n }\n\n public void Print(bool o)\n {\n Print(o ? \"yes\" : \"no\");\n }\n\n public void PrintLine(bool o)\n {\n Print(o);\n\n outputStream.WriteLine();\n }\n\n public void Print(T o)\n {\n outputStream.Write(Convert.ToString(o, CultureInfo.InvariantCulture));\n }\n\n\n public void PrintLine(T o)\n {\n Print(o);\n\n outputStream.WriteLine();\n }\n\n public void Close()\n {\n inputStream.Close();\n outputStream.Close();\n }\n\n void IDisposable.Dispose()\n {\n Close();\n\n#if LOCAL_TEST\n Console.ReadLine();\n#endif\n }\n }\n\n\n public static class ListExtensions\n {\n public static void Each(this IEnumerable self, Action action)\n {\n foreach (var v in self)\n action(v);\n }\n\n public static IEnumerable ToCycleEnumerable(this IEnumerable self)\n {\n if (self != null)\n {\n for (; ; )\n {\n foreach (var x in self)\n yield return x;\n }\n }\n }\n\n public static T CycleGet(this IList self, int index)\n {\n var c = self.Count;\n return self[(index % c + c) % c];\n }\n\n\n public static IList Shuffle(this IList self)\n {\n var rnd = new Random(DateTime.Now.Millisecond);\n\n var n = self.Count;\n\n while (n > 1)\n {\n n--;\n var k = rnd.Next(n + 1);\n var value = self[k];\n self[k] = self[n];\n self[n] = value;\n }\n\n return self;\n }\n\n public static IList> UseForNew2D(this T def, int fd, int sd)\n {\n var fdim = new T[fd][];\n\n for (int i = 0; i < fd; i++)\n {\n fdim[i] = new T[sd];\n Fill(fdim[i], def);\n }\n\n return fdim;\n }\n\n public static IList Fill(this IList self, Func fval)\n {\n for (var i = 0; i < self.Count; i++)\n self[i] = fval();\n\n\n return self;\n }\n\n\n public static IList Fill(this IList self, T val)\n {\n return self.Fill(() => val);\n }\n\n public static long Hash(this IList self, Func val = null)\n {\n return val != null ? self.Hash((t, current) => unchecked(current * 19L + val(t))) : self.Hash(HashOne);\n }\n\n public static long Hash(this IList self, Func val)\n {\n return self.Aggregate(0L, (current, t) => unchecked(val(t, current)));\n }\n\n\n public static long HashOne(this T self, long current)\n {\n return unchecked(current * 19L + (Equals(self, default(T)) ? 0 : self.GetHashCode()));\n }\n\n\n public static IList BuildSegTree(this IList a, Func combine, Func convert)\n {\n var t = new T1[a.Count << 2];\n\n a.BuildSegTree(t, 1, 0, a.Count - 1, combine, convert);\n\n return t;\n }\n\n private static void BuildSegTree(this IList a, IList t, int v, int tl, int tr, Func combine, Func convert)\n {\n if (tl == tr)\n {\n t[v] = convert(a[tl]);\n }\n else\n {\n int tm = (tl + tr) >> 1;\n\n BuildSegTree(a, t, v << 1, tl, tm, combine, convert);\n BuildSegTree(a, t, (v << 1) + 1, tm + 1, tr, combine, convert);\n\n t[v] = combine(t[v << 1], t[(v << 1) + 1]);\n }\n }\n }\n\n public static class P\n {\n public static P Create(T1 key, T2 val)\n {\n return new P(key, val);\n }\n }\n\n public class P\n {\n private class PComparer : IComparer>\n {\n private readonly bool? byKey;\n\n public PComparer(bool? byKey)\n {\n this.byKey = byKey;\n }\n\n\n public int Compare(P x, P y)\n {\n x = x ?? new P();\n y = y ?? new P();\n\n\n if (byKey == true)\n return Comparer.Default.Compare(x.Key, y.Key);\n else if (byKey == false)\n return Comparer.Default.Compare(x.Value, y.Value);\n else\n {\n var tr = Comparer.Default.Compare(x.Key, y.Key);\n\n if (tr != 0)\n tr = Comparer.Default.Compare(x.Value, y.Value);\n\n return tr;\n }\n }\n }\n\n\n public P()\n {\n }\n\n public P(T1 key, T2 val)\n {\n this.Key = key;\n this.Value = val;\n }\n\n\n public T1 Key\n {\n get;\n set;\n }\n\n public T2 Value\n {\n get;\n set;\n }\n\n public P Clone()\n {\n return new P(Key, Value);\n }\n\n public static IComparer> KeyComparer\n {\n get { return new PComparer(true); }\n }\n\n public static IComparer> ValueComparer\n {\n get { return new PComparer(false); }\n }\n\n public static implicit operator T1(P obj)\n {\n return obj.Key;\n }\n\n public static implicit operator T2(P obj)\n {\n return obj.Value;\n }\n\n public P SetKey(T1 key)\n {\n Key = key;\n return this;\n }\n\n public P SetValue(T2 value)\n {\n Value = value;\n return this;\n }\n\n public override string ToString()\n {\n return string.Format(\"Key: {0}, Value: {1}\", Key, Value);\n }\n\n public override bool Equals(object obj)\n {\n var co = obj as P;\n\n return co != null && co.GetHashCode() == GetHashCode();\n }\n\n public override int GetHashCode()\n {\n int hash = 17;\n hash = hash * 31 + ((Equals(Key, default(T1))) ? 0 : Key.GetHashCode());\n hash = hash * 31 + ((Equals(Value, default(T1))) ? 0 : Value.GetHashCode());\n return hash;\n\n }\n }\n\n #endregion\n\n\n\n internal class Program\n {\n #region Program\n\n private readonly MyIo io;\n\n public Program(MyIo io)\n {\n this.io = io;\n }\n\n public static void Main(string[] args)\n {\n using (MyIo io = new MyIo())\n {\n new Program(io)\n .Solve();\n }\n }\n\n\n\n #endregion\n\n public const long MOD = 1000000007;\n public const double EPS = 1e-14;\n\n\n\n\n private void Solve()\n {\n var n = io.NextLong();\n\n var x = io.NextLong();\n var y = io.NextLong();\n\n var c = io.NextLong();\n\n\n long s = 0;\n\n if (c > 1)\n {\n\n var lb = 1;\n var ub = n;\n\n s = n;\n\n\n do\n {\n var m = (ub + lb) >> 1;\n var cn = Calc(n, x, y, m);\n\n if (cn > c)\n {\n ub--;\n s = Math.Min(m, s);\n }\n else if (cn < c)\n lb++;\n\n } while (lb < ub);\n\n }\n\n io.Print(s);\n }\n\n private long Pos0(long x)\n {\n return x > 0 ? x : 0;\n }\n\n private long Pow2(long x)\n {\n return x*x;\n }\n\n private long Calc(long n, long x, long y, long s)\n {\n if (s == 0)\n return 1;\n\n var r = Pos0(s + y - n);\n var b = Pos0(s + x - n);\n\n var l = Pos0(1 - y + s);\n var t = Pos0(1 - x + s);\n\n\n var bse = s * s + (s + 1) * (s + 1) - Pow2(r) - Pow2(t) - Pow2(b) - Pow2(l);\n\n if (r > 1 && b > 1)\n bse += r*(b - 1) / 2 ;\n\n if (l > 1 && b > 1)\n bse += l * (b - 1) / 2;\n\n if (r > 1 && t > 1)\n bse += r * (t - 1) / 2;\n\n if (l > 1 && t > 1)\n bse += l * (t - 1) /2;\n\n return bse;\n }\n }\n\n}\n\n", "lang": "Mono C#", "bug_code_uid": "6b7eb2761726662b2aa8f0f596fe5046", "src_uid": "232c5206ee7c1903556c3625e0b0efc6", "apr_id": "51929141e6749de63fb9e8c5a59df4e1", "difficulty": 1800, "tags": ["math", "implementation", "binary search"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.6992366412213741, "equal_cnt": 12, "replace_cnt": 5, "delete_cnt": 4, "insert_cnt": 3, "fix_ops_cnt": 12, "bug_source_code": "sing System;\nusing System.Linq;\n\nnamespace _119A\n{\n class Program\n {\n static void Main()\n {\n var input = Console.ReadLine().Split().Select(int.Parse).ToArray();\n int winner=0;\n while (true)\n {\n if (FindGCD(input[0], input[1]) <= input[2])\n input[2] -= input[0];\n else { winner = 1; break; }\n if (FindGCD(input[0], input[1]) <= input[2])\n input[2] -= input[1];\n else { winner = 0; break; }\n }\n Console.WriteLine(winner);\n }\n\n static int FindGCD(int x,int y)\n {\n int GCD=0;\n if (y > 0)\n {\n for (int i = 1; i <= Math.Min(x, y); i++)\n {\n if ((x % i == 0) && (y % i == 0)) { GCD = i; }\n }\n }\n else GCD = x;\n return GCD;\n }\n }\n}", "lang": "MS C#", "bug_code_uid": "939ad13c10c5d0ecf39e008252221ab8", "src_uid": "0bd6fbb6b0a2e7e5f080a70553149ac2", "apr_id": "b9cdf151b12f626900ff15d5dfc38312", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9404192110909391, "equal_cnt": 19, "replace_cnt": 3, "delete_cnt": 1, "insert_cnt": 14, "fix_ops_cnt": 18, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace Petya_Exam\n{\n class Program\n {\n struct Exam\n {\n public int ExamIndex;\n public int Publish;\n public int ExamDay;\n public int PrepDays;\n } \n \n static void Main(string[] args)\n {\n string[] s = (Console.ReadLine()).Split(' ');\n int N_Days = int.Parse(s[0]);\n int Total_exams = int.Parse(s[1]);\n List list2 = new List();\n for (int i = 0; i < Total_exams; ++i)\n {\n Exam exm;\n s = (Console.ReadLine()).Split(' ');\n exm.ExamIndex = i + 1;\n exm.Publish = int.Parse(s[0]);\n exm.ExamDay = int.Parse(s[1]);\n exm.PrepDays = int.Parse(s[2]);\n list2.Add(exm);\n }\n list2.Sort((x, y) => x.ExamDay.CompareTo(y.ExamDay));\n List seq = new List();\n for (int i = 0; i <= N_Days; ++i)\n {\n seq.Add(0);\n }\n int print = 0;\n foreach (Exam l in list2)\n {\n if (l.Publish - 1 + l.PrepDays < l.ExamDay)\n {\n if (Ispossible(l.ExamIndex, l, seq))\n {\n seq[l.ExamDay] = Total_exams + 1;\n \n continue;\n }\n else\n {\n print = -1;\n break;\n }\n }\n }\n if (print == 0)\n {\n if (seq.Sum() != 0)\n {\n for (int j = 1; j < seq.Count; ++j)\n {\n if (j + 1 == seq.Count)\n {\n Console.Write(seq[j]);\n continue;\n }\n Console.Write(seq[j] + \" \");\n }\n }\n else\n {\n Console.WriteLine(\"-1\");\n }\n }\n else\n {\n Console.WriteLine(\"-1\");\n }\n \n // Console.ReadKey();\n }\n\n private static bool Ispossible(int exam_number, Exam l, List seq)\n {\n int days = l.PrepDays;\n\n int i = l.Publish;\n while (i < l.ExamDay && days > 0)\n {\n if (seq[i] == 0)\n {\n seq[i] = exam_number;\n days--;\n }\n i++;\n }\n return days == 0 ? true : false;\n }\n\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "c81228d3367774fba463e27d27b95c31", "src_uid": "02d8d403eb60ae77756ff96f71b662d3", "apr_id": "c3027a3b5939f7a20d12e9f843fca02c", "difficulty": 1700, "tags": ["greedy", "sortings", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.9352850539291218, "equal_cnt": 10, "replace_cnt": 3, "delete_cnt": 2, "insert_cnt": 4, "fix_ops_cnt": 9, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\n\nnamespace CF2\n{\n class Program\n {\n static void Main(string[] args)\n {\n string s1 = Console.ReadLine();\n for (int i=1;i<=100;i++)\n s1 = RemoveSlashes(s1);\n if (s1[s1.Length] == '/') s1.Remove(s1.Length);\n Console.WriteLine(s1);\n\n\n }\n static string RemoveSlashes(string txt)\n {\n string text = txt.Replace(\"//\", \"/\");\n\n if (text.Contains(\"//\"))\n RemoveSlashes(text);\n return text;\n }\n\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "fb216281611a75c1ff30558ee5992865", "src_uid": "6c2e658ac3c3d6b0569dd373806fa031", "apr_id": "3100e3a070fa4fc5de90faa85240480a", "difficulty": 1700, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.9988505747126437, "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.IO;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace A\n{\n class Program\n {\n static void Main(string[] args)\n {\n TextReader sr = Console.In;\n //StreamReader sr = new StreamReader(\"in7.txt\");\n string[] s = sr.ReadLine().Split();\n int x = Convert.ToInt32(s[0]);\n int y = Convert.ToInt32(s[1]);\n int z = Convert.ToInt32(s[2]);\n int t1 = Convert.ToInt32(s[3]);\n int t2 = Convert.ToInt32(s[4]);\n int t3 = Convert.ToInt32(s[5]);\n int lift = Math.Abs(z - x) * t2 + 2 * t3 + Math.Abs(y - x) * t2;\n int poxod = Math.Abs(y - x) * t1;\n if(lift<=poxod) Console.WriteLine(\"YES\");\n else Console.WriteLine(\"NO\");\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "e2f36b205bc8c07de0c25027539917f6", "src_uid": "05cffd59b28b9e026ca3203718b2e6ca", "apr_id": "907c9b273a47e4b8c05d94f0aa0ce733", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9927745664739884, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "using System;\n\t\t\t\t\t\npublic class Program\n{\n\tpublic static void Main()\n\t{\n\t\tlong otv1 = 0;\n\t\tlong otv2 = 0;\n\t\tstring[] temp = Console.ReadLine().Split(' ');\n\t\tint x = Convert.ToInt32(temp[0]);\n\t\tint y = Convert.ToInt32(temp[1]);\n\t\tint lf = Convert.ToInt32(temp[2]);\n\t\tint sh = Convert.ToInt32(temp[3]);\n\t\tint d = Convert.ToInt32(temp[4]);\n\t\tint op = Convert.ToInt32(temp[5]);\n\t\tif(x>=y) \n\t\t{\n\t\t\totv1 = (x - y) * sh;\n\t\t\totv2 = ((x - y) * d) + 3;\n\t\t}\n\t\tif(x=x)\n\t\t{\n\t\t\totv2 += (lf-x) * d;\n\t\t}\n\t\tif(lf lift)\n {\n Console.WriteLine(\"YES\");\n }\n else\n {\n Console.WriteLine(\"NO\");\n }\n }\n }\n}", "lang": "Mono C#", "bug_code_uid": "1844797336cc6adf04f2466682c3c83e", "src_uid": "05cffd59b28b9e026ca3203718b2e6ca", "apr_id": "be96b3ffae2b302f80f8340e3f0eb450", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.9994353472614342, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "using System;\nusing System.Collections;\nusing System.Collections.Generic;\n\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\nusing System.Xml;\nusing System.Text.RegularExpressions;\n\nnamespace ProjectEuler\n{\n class Program\n {\n static void Main(string[] args)\n { \n string[] str1 = Console.ReadLine().Split(' ');\n \n int x = int.Parse(str1[0]);\n int y = int.Parse(str1[1]);\n int z = int.Parse(str1[2]);\n int t1 = int.Parse(str1[3]);\n int t2 = int.Parse(str1[4]);\n int t3 = int.Parse(str1[5]);\n\n if (Math.Abs(x-z)*t2 + Math.Abs(x-y)*t2 +3*t3 < Math.Abs(x-y)*t1)\n {\n Console.WriteLine(\"YES\");\n\n }\n else\n {\n Console.WriteLine(\"NO\");\n\n }\n }\n }\n}\n ", "lang": "Mono C#", "bug_code_uid": "96712a83cd9949bb68641f82399066c1", "src_uid": "05cffd59b28b9e026ca3203718b2e6ca", "apr_id": "e57333c7b5a867b5907a14a8ae919fc5", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.998389694041868, "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.Text;\n\nnamespace ConsoleApplication1\n{\n class Program\n {\n static void Main(string[] args)\n {\n string[] s = Console.ReadLine().Split(' ');\n int x = int.Parse(s[0]);\n int y = int.Parse(s[1]);\n int z = int.Parse(s[2]);\n int t1 = int.Parse(s[3]);\n int t2 = int.Parse(s[4]);\n int t3 = int.Parse(s[5]);\n int q1 = Math.Abs(x - z);\n int q2 = (Math.Max(x, y) - Math.Min(x, y))*t2;\n int lift = q1 + q2+t3*3;\n int mash = t1 * (Math.Max(x, y) - Math.Min(x, y));\n //Console.WriteLine(lift);\n //Console.WriteLine(mash);\n if (mash >= lift)\n Console.WriteLine(\"YES\");\n else\n Console.WriteLine(\"NO\");\n //Console.ReadKey();\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "a36f4a635c32d3fd55f07fd8b0c8741b", "src_uid": "05cffd59b28b9e026ca3203718b2e6ca", "apr_id": "90091be68846fcf397ddad01d33ac7fe", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.9972329828444937, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "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 ConsoleApp2\n{\n class Program\n {\n static void Main(string[] args)\n {\n var s = Console.ReadLine().Split(' ');\n int x = Convert.ToInt32(s[0]);\n int y = Convert.ToInt32(s[1]);\n int z = Convert.ToInt32(s[2]);\n int t1 = Convert.ToInt32(s[3]);\n int t2 = Convert.ToInt32(s[4]);\n int t3 = Convert.ToInt32(s[5]);\n\n var d = Math.Abs(x - y);\n var xx = Math.Abs(z - x);\n var tt1 = xx + 3 * t3 + d * t2;\n var tt2 = d * t1;\n \n if(tt1<=tt2)\n {\n Console.WriteLine(\"YES\");\n }\n else\n {\n Console.WriteLine(\"NO\");\n }\n\n }\n\n \n }\n \n}\n", "lang": "Mono C#", "bug_code_uid": "6207df16db320bf6b6047efaa9e18ad7", "src_uid": "05cffd59b28b9e026ca3203718b2e6ca", "apr_id": "bd42c13239788924ef951ac871f154fd", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.5628415300546448, "equal_cnt": 10, "replace_cnt": 6, "delete_cnt": 1, "insert_cnt": 3, "fix_ops_cnt": 10, "bug_source_code": "using System;\n\nclass MainClass\n{\n\tpublic static void Main (string[] args)\n\t{\n\t\tint x = Convert.ToInt32 (Console.ReadLine ());\n\t\tint count = 1;\n\t\twhile ((x != 1 || count==0) ) {\n\t\t\tx++;\n\t\t\tcount++;\n\t\t\twhile (x % 10 == 0)\n\t\t\t\tx /= 10;\n\t\t}\n\t\tConsole.WriteLine (count);\n\t}\n}\n", "lang": "Mono C#", "bug_code_uid": "94260a8d3c71a6976894b1b3f0f8689a", "src_uid": "055fbbde4b9ffd4473e6e716da6da899", "apr_id": "6e1029aa98a5523825f539a097f13444", "difficulty": 1100, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9565217391304348, "equal_cnt": 6, "replace_cnt": 2, "delete_cnt": 3, "insert_cnt": 0, "fix_ops_cnt": 5, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.IO;\n\t\t\t\t\t\npublic class Program\n{\n\tpublic static void Main()\n\t{\n\t\t//Console.SetIn(new StreamReader(\"input.txt\"));\n solve_555A();\n\t}\n\n\tpublic static void solve_555A()\n\t{ \n\t\tlong n = Convert.ToInt32(Console.ReadLine());\n\t\tlong num = n;\n\t\tlong count = 0;\n\n\t\twhile (true)\n\t\t{\n\t\t\tlong left = 10 - num % 10;\n\n\t\t\tcount += num < 10 ? 9 : left;\n\n\t\t\tnum += left;\n\n\t\t\twhile (num % 10 == 0)\n\t\t\t{\n\t\t\t\tnum /= 10;\n\t\t\t}\n\n\t\t\tif (num == 1)\n\t\t\t{\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\t/*while (n >= 10 && num > 1)\n\t\t{\n\t\t\tlong lastDigit = num % 10;\n\n\t\t\tlong left = 10 - lastDigit;\n\n\t\t\tConsole.WriteLine(left);\n\t\t\tcount += left;\n\n\t\t\tnum += left;\n\n\t\t\twhile (num % 10 == 0)\n\t\t\t{\n\t\t\t\tnum /= 10;\n\t\t\t}\n\t\t}\n \t\t*/\n\t\tConsole.WriteLine(count);\n\t}\n\tpublic static void solve_547B()\n\t{\n\t\tint n = Convert.ToInt32(Console.ReadLine());\n\t\tstring[] tests = Console.ReadLine().Split(' ');\n\n\t\tList maxs = new List();\n\t\tint curCount = 0;\n\t\tfor (int i = 0; i < tests.Length; i++)\n\t\t{\n\t\t\tif (tests[i] == \"1\")\n\t\t\t{\n\t\t\t\tcurCount++;\n\t\t\t}\n\t\t\t\n\t\t\tif (i == tests.Length - 1 || tests[i] == \"0\")\n\t\t\t{\n\t\t\t\tmaxs.Add(curCount);\n\t\t\t\tcurCount = 0;\n\t\t\t}\n\t\t}\n\t\t\n\t\tif (tests[0] == tests[tests.Length - 1] && tests[0] != \"0\")\n\t\t{\n\t\t\tmaxs[0] = maxs[0] + maxs[maxs.Count - 1];\n\t\t}\n\t\t\n\t\t\n\t\tint max = 0;\n\t\tfor (int i = 0; i < maxs.Count; i++)\n\t\t{\n\t\t\tif (max < maxs[i])\n\t\t\t{\n\t\t\t\tmax = maxs[i];\n\t\t\t}\n\t\t}\n\n\t\tConsole.WriteLine(max);\n\t}\n}", "lang": "Mono C#", "bug_code_uid": "5f7dbd0a7f75e660673d98639ebd0221", "src_uid": "055fbbde4b9ffd4473e6e716da6da899", "apr_id": "09bb59ccacfb1a9bb072b7529136be0e", "difficulty": 1100, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "C#"} {"similarity_score": 0.9826640333552776, "equal_cnt": 5, "replace_cnt": 1, "delete_cnt": 3, "insert_cnt": 0, "fix_ops_cnt": 4, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing CompLib.Util;\n\npublic class Program\n{\n\n public void Solve()\n {\n var sc = new Scanner();\n int n = sc.NextInt();\n\n long ans = 0;\n var hs = new HashSet();\n hs.Add(n);\n while (n > 1)\n {\n n = F(n);\n\n hs.Add(n);\n }\n\n Console.WriteLine(hs.Count);\n }\n\n int F(int n)\n {\n n++;\n while (n % 10 == 0)\n {\n n /= 10;\n }\n return n;\n }\n\n public static void Main(string[] args) => new Program().Solve();\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}\n", "lang": "Mono C#", "bug_code_uid": "dba0f2abd7ea5afd46f6157064766359", "src_uid": "055fbbde4b9ffd4473e6e716da6da899", "apr_id": "cc131af25e2a75def1140608c3557f17", "difficulty": 1100, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "C#"} {"similarity_score": 0.9646946564885496, "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 ConsoleApp14\n{\n class Program\n {\n public static int Reachable_Num(int i)\n {\n List dict = new List();\n dict.Add(i);\n do\n {\n i++;\n while (i % 10 == 0)\n {\n i = i / 10;\n }\n if (!dict.Contains(i))\n {\n dict.Add(i);\n }\n } while (!dict.Contains(RemoveZero(i+1)));\n foreach(int el in dict)\n { Console.WriteLine(el); }\n return dict.Count;\n }\n public static int RemoveZero(int i)\n {\n while (i % 10 == 0)\n {\n i = i / 10;\n }\n return i;\n }\n static void Main(string[] args)\n {\n Console.WriteLine(Reachable_Num(Convert.ToInt32(Console.ReadLine())));\n Console.ReadLine();\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "d9fd1e8bc21cae0f4a7c4d95f9434be1", "src_uid": "055fbbde4b9ffd4473e6e716da6da899", "apr_id": "551f07f465ff10d18ef911aa7a5fadbe", "difficulty": 1100, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "C#"} {"similarity_score": 0.9593114241001565, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "using System;\nusing System.Collections.Generic;\n\nnamespace ConsoleApp14\n{\n class Program\n {\n public static int Reachable_Num(int ip)\n {\n if (ip < 10)\n {\n Console.WriteLine('9');\n return;\n }\n int res = 10 - (ip % 10);\n ip /= 10;\n while(ip>= 10)\n {\n res += 9 - (ip % 10);\n ip /= 10;\n }\n res += 9;\n return res;\n }\n\n static void Main(string[] args)\n {\n Console.WriteLine(Reachable_Num(Convert.ToInt32(Console.ReadLine())));\n }\n }\n}", "lang": "Mono C#", "bug_code_uid": "3764e98494ac5478a0ee7409fe6a20f1", "src_uid": "055fbbde4b9ffd4473e6e716da6da899", "apr_id": "551f07f465ff10d18ef911aa7a5fadbe", "difficulty": 1100, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9949608062709966, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Globalization;\nusing System.IO;\nusing System.Linq;\nusing System.Text;\nusing static System.Array;\nusing static System.Console;\nusing static System.Math;\n\nnamespace Olymp\n{\n public class ProblemSolver\n {\n private readonly Tokenizer input;\n\n public void Solve()\n {\n var n = input.ReadInt();\n var f = (Func)(x =>\n {\n x++;\n while (x % 10 == 0)\n x /= 10;\n return x;\n });\n var a = new HashSet { n };\n do\n {\n n = f(n);\n if (a.Contains(n))\n break;\n a.Add(n);\n }\n while (n != 1);\n Write(a.Count);\n }\n\n public ProblemSolver(TextReader input)\n {\n this.input = new Tokenizer(input);\n }\n }\n\n #region Service classes\n\n public class Tokenizer\n {\n private readonly TextReader reader;\n\n public string ReadToEnd() => reader.ReadToEnd();\n\n public int ReadInt()\n {\n var c = SkipWs();\n if (c == -1)\n throw new EndOfStreamException();\n var isNegative = false;\n if (c == '-' || c == '+')\n {\n isNegative = c == '-';\n c = reader.Read();\n if (c == -1)\n throw new EndOfStreamException(\"Digit expected, but end of stream occurs\");\n }\n\n if (!char.IsDigit((char)c))\n throw new InvalidOperationException($\"Digit expected, but was: '{(char)c}'\");\n\n checked\n {\n var result = (char)c - '0';\n c = reader.Read();\n while (c > 0 && !char.IsWhiteSpace((char)c))\n {\n if (!char.IsDigit((char)c))\n throw new InvalidOperationException($\"Digit expected, but was: '{(char)c}'\");\n result = result * 10 + (char)c - '0';\n c = reader.Read();\n }\n\n if (isNegative)\n result = -result;\n return result;\n }\n }\n\n public string ReadLine() => reader.ReadLine();\n\n public long ReadLong() => long.Parse(ReadToken());\n\n public double ReadDouble() => double.Parse(ReadToken(), CultureInfo.InvariantCulture);\n\n public int[] ReadIntArray(int n)\n {\n var a = new int[n];\n for (var i = 0; i < n; i++)\n a[i] = ReadInt();\n return a;\n }\n\n public (int, int) Read2Int() => (ReadInt(), ReadInt());\n\n public (int, int, int) Read3Int() => (ReadInt(), ReadInt(), ReadInt());\n\n public (int, int, int, int) Read4Int() => (ReadInt(), ReadInt(), ReadInt(), ReadInt());\n\n public (long, long) Read2Long() => (ReadLong(), ReadLong());\n\n public long[] ReadLongArray(int n)\n {\n var a = new long[n];\n for (var i = 0; i < n; i++)\n a[i] = ReadLong();\n return a;\n }\n\n public double[] ReadDoubleArray(int n)\n {\n var a = new double[n];\n for (var i = 0; i < n; i++)\n a[i] = ReadDouble();\n return a;\n }\n\n public string ReadToken()\n {\n var c = SkipWs();\n if (c == -1)\n return null;\n var sb = new StringBuilder();\n while (c > 0 && !char.IsWhiteSpace((char)c))\n {\n sb.Append((char)c);\n c = reader.Read();\n }\n\n return sb.ToString();\n }\n\n private int SkipWs()\n {\n var c = reader.Read();\n if (c == -1)\n return c;\n while (c > 0 && char.IsWhiteSpace((char)c))\n c = reader.Read();\n return c;\n }\n\n public Tokenizer(TextReader reader)\n {\n this.reader = reader;\n }\n }\n\n internal class Program\n {\n public static void Main()\n {\n var solver = new ProblemSolver(In);\n solver.Solve();\n }\n }\n\n #endregion\n}\n", "lang": "Mono C#", "bug_code_uid": "469d8d6d4d85db0d4e451db345b27181", "src_uid": "055fbbde4b9ffd4473e6e716da6da899", "apr_id": "5e62ba64c6080ba1c68730203257f4c9", "difficulty": 1100, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9823434991974318, "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.IO;\nusing System.Linq;\n\nnamespace sm\n{\n class Program\n {\n static void Main(string[] args)\n {\n\n int k = int.Parse(Console.ReadLine());\n Dictionary dic = new Dictionary();\n int m = k;\n int i = 1;\n while (true)\n {\n int a = getDigit(k);\n if (!dic.ContainsKey(a))\n {\n dic.Add(a, a);\n i++;\n //Console.WriteLine(a);\n }\n else break;\n k = a;\n \n m--;\n }\n Console.WriteLine(i);\n\n\n }\n static int getDigit(int k)\n {\n int digit = k + 1;\n while (digit % 10 == 0)\n digit /= 10;\n return digit;\n }\n\n\n\n\n }\n}", "lang": "Mono C#", "bug_code_uid": "370a2a018db41d6276a529f0f06826ac", "src_uid": "055fbbde4b9ffd4473e6e716da6da899", "apr_id": "9508eb5a49824dc2327f5fe8b3f99cb0", "difficulty": 1100, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "C#"} {"similarity_score": 0.9244618395303327, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 3, "bug_source_code": "using System;\nusing System.Numerics;\nusing System.IO;\nusing System.Collections;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\nusing System.Xml;\nusing System.Text.RegularExpressions;\n\nnamespace ProjectEuler\n{\n class Program\n {\n\n private static void Main()\n {\n int n = int.Parse(Console.ReadLine());\n HashSet hs = new HashSet();\n bool flag = true;\n\n if (n == 1)\n {\n Console.WriteLine(9);\n }\n else\n {\n while (flag)\n {\n if (!hs.Contains(n))\n {\n hs.Add(n);\n }\n \n n = Fofx(n);\n if (hs.Contains(1) && hs.Contains(2) && hs.Contains(3) && hs.Contains(4) && hs.Contains(5) && hs.Contains(6) && hs.Contains(7) && hs.Contains(8) && hs.Contains(9))\n {\n flag = false;\n }\n }\n Console.WriteLine(hs.Count);\n }\n \n }\n }\n}", "lang": "Mono C#", "bug_code_uid": "658a58f709d329c5e349f8c70d879e2a", "src_uid": "055fbbde4b9ffd4473e6e716da6da899", "apr_id": "bfecfe2d2b1aae79c01ea73a5c7fa102", "difficulty": 1100, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.5639500297441998, "equal_cnt": 15, "replace_cnt": 5, "delete_cnt": 4, "insert_cnt": 6, "fix_ops_cnt": 15, "bug_source_code": "using System;\nusing System.Collections;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace C_sarp_tests\n{\n class Program\n {\n private static int counter = 1;\n static void Main(string[] args)\n {\n int num = Convert.ToInt32(Console.ReadLine());\n\n\n while (num > 0)\n {\n num = Important(num);\n }\n\n\n Console.WriteLine(counter);\n }\n\n private static int Important(int n)\n {\n n++;\n if (n % 10 != 0)\n {\n counter++;\n\n }\n\n while (n % 10 == 0)\n {\n n /= 10;\n\n if (n > 9 && n % 10 != 0)\n {\n counter++;\n\n }\n else if (n <= 9)\n {\n counter += 9;\n\n \n\n return 0;\n }\n }\n\n return n;\n }\n}}", "lang": "Mono C#", "bug_code_uid": "082f5feb675824068456b31a99e46305", "src_uid": "055fbbde4b9ffd4473e6e716da6da899", "apr_id": "c7256b3cd8437e5a7ca434221e1662af", "difficulty": 1100, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.5748360166964818, "equal_cnt": 18, "replace_cnt": 5, "delete_cnt": 6, "insert_cnt": 6, "fix_ops_cnt": 17, "bug_source_code": "using System;\nusing System.Collections;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\nnamespace C_sarp_tests\n{\n class Program\n {\n private static int counter = 1;\n static void Main(string[] args)\n {\n int num = Convert.ToInt32(Console.ReadLine());\n\n\n while (num > 0)\n {\n num = Important(num);\n }\n\n\n Console.WriteLine(counter);\n }\n\n private static int Important(int n)\n {\n n++;\n if (n % 10 != 0)\n {\n counter++;\n\n }\n\n while (n % 10 == 0)\n {\n n /= 10;\n\n if (n > 9 && n % 10 != 0)\n {\n counter++;\n\n }\n else if (n <= 9)\n {\n counter += 9;\n\n \n\n return 0;\n }\n }\n\n return n;\n }", "lang": "Mono C#", "bug_code_uid": "0923b277872c3dbd92813b01d3dabba2", "src_uid": "055fbbde4b9ffd4473e6e716da6da899", "apr_id": "c7256b3cd8437e5a7ca434221e1662af", "difficulty": 1100, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C#"} {"similarity_score": 0.9214953271028037, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "using System;\nusing System.Text;\n\nnamespace UdsuTest\n{\n class Program\n {\n public static void Main(string[] args)\n {\n Int64 input = Int64.Parse(Console.ReadLine());\n\n Int64 answer = 1;\n\n while (input >= 10L)\n {\n Int64 right = input % 10L;\n\n answer = 9L - right + answer;\n\n input /= 10;\n }\n\n answer += 9;\n\n Console.WriteLine(answer);\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "c80e3aceb03908f954d5cea45cadca87", "src_uid": "055fbbde4b9ffd4473e6e716da6da899", "apr_id": "e845c102daf0c29fb6ba59e744dda0e1", "difficulty": 1100, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.9968374446552815, "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 static System.Console;\nusing static System.Convert;\nusing static System.Math;\n//using Debug;\n//using static System.Globalization.CultureInfo;\n\nclass Program\n{\n static void Main(string[] args)\n {\n Solve();\n //WriteLine(Solve());\n }\n static void Solve()\n {\n var num = Input.num;\n var ct = 0;\n while ((num-1)/10 != 0)\n {\n ct++;\n num = f(num);\n }\n WriteLine(ct+9);\n }\n static int f(int num)\n {\n var s = (num + 1).ToString();\n var q = 0;\n while (q != s.Length && s[s.Length-q-1] == '0')\n q++;\n return int.Parse(s.Substring(0, s.Length - q));\n }\n}\n\npublic class Input\n{\n public static string read => ReadLine();\n public static int[] ar => Array.ConvertAll(read.Split(' '), int.Parse);\n public static int num => ToInt32(read);\n public static long[] arL => Array.ConvertAll(read.Split(' '), long.Parse);\n public static long numL => ToInt64(read);\n public static char[][] gred(int h) \n => Enumerable.Repeat(0, h).Select(v => read.ToCharArray()).ToArray();\n public static int[][] ar2D(int num)\n => Enumerable.Repeat(0, num).Select(v => ar).ToArray();\n public static long[][] arL2D(int num)\n => Enumerable.Repeat(0, num).Select(v => arL).ToArray();\n public const long Inf = (long)1e18;\n public const double eps = 1e-6;\n public const string Alfa = \"abcdefghijklmnopqrstuvwxyz\";\n public const int MOD = 1000000007;\n}\n", "lang": "Mono C#", "bug_code_uid": "d5a65874080620dc597626986ed74298", "src_uid": "055fbbde4b9ffd4473e6e716da6da899", "apr_id": "e2e20518e3fbe48397d0d8366055b7d2", "difficulty": 1100, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.5275908479138627, "equal_cnt": 13, "replace_cnt": 6, "delete_cnt": 2, "insert_cnt": 4, "fix_ops_cnt": 12, "bug_source_code": "using System;\nusing System.Collections.Generic;\n\nnamespace Test\n{\n class Program\n {\n static void Main(string[] args)\n {\n int number;\n int count = 2;\n \n\n bool sem = false;\n number = int.Parse(Console.ReadLine());\n if (number == 9)\n {\n count = 0;\n number++;\n sem = true;\n }\n else\n {\n number++;\n count++;\n }\n \n\n while(true)\n {\n if(number == 9 && sem == false)\n {\n sem = true;\n }\n if(number == 9 && sem == true)\n {\n break;\n }\n\n if (number % 10 == 0)\n {\n number = number / 10;\n }\n else\n {\n number++;\n count++;\n }\n }\n\n Console.WriteLine(count);\n\n //Console.ReadLine();\n }\n }\n}", "lang": "Mono C#", "bug_code_uid": "dd4c6139739a9a61b95b2977cf2ba2bc", "src_uid": "055fbbde4b9ffd4473e6e716da6da899", "apr_id": "d4edd3b585cdb15d2c3ed16385f8862a", "difficulty": 1100, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.4913557779799818, "equal_cnt": 10, "replace_cnt": 2, "delete_cnt": 6, "insert_cnt": 2, "fix_ops_cnt": 10, "bug_source_code": "using System;\nusing System.Collections.Generic;\nnamespace codef\n{\n class Program\n {\n static void Main(string[] args)\n {\n int number = int.Parse(Console.ReadLine());\n List list = new List();\n int counter = 0;\n while(!list.Contains(number)){\n if(number%10 == 0) number/=10;\n else {\n list.Add(number);\n counter++;\n number++;\n }\n }\n Console.WriteLine(counter);\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "4ef9d4ffcc02210c88306a952554aae7", "src_uid": "055fbbde4b9ffd4473e6e716da6da899", "apr_id": "4ae57e255e61fbe2aca0dcf94f1eb839", "difficulty": 1100, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "C#"} {"similarity_score": 0.9593172119487909, "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.Text;\n\nnamespace b\n{\n class Program\n {\n\n class Point\n {\n public Point(int x, int y)\n {\n this.x = x;\n this.y = y;\n }\n\n public bool Eq(Point an)\n {\n return (this.x == an.x && this.y == an.y);\n }\n\n public int x, y;\n }\n\n static void Main(string[] args)\n {\n string way = Console.ReadLine();\n Point[] pts = new Point[way.Length+1];\n pts[0] = new Point(0, 0);\n bool bug = false;\n for (int i = 0; i < way.Length; i++)\n {\n\n switch (way[i])\n {\n case 'L':\n pts[i + 1] = new Point(pts[i].x-1, pts[i].y);\n break;\n case 'R':\n pts[i + 1] = new Point(pts[i].x+1, pts[i].y);\n break;\n case 'U':\n pts[i + 1] = new Point(pts[i].x, pts[i].y+1);\n break;\n case 'D':\n pts[i + 1] = new Point(pts[i].x, pts[i].y-1);\n break;\n }\n\n for (int j = 0; j < i + 1; j++)\n {\n if (pts[i+1].Eq(pts[j]))\n {\n bug = true;\n break;\n }\n }\n if (bug) break;\n }\n if (bug) Console.WriteLine(\"BUG\");\n else Console.WriteLine(\"OK\");\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "a7b7c3d5c97cf0ec401da0b018420361", "src_uid": "bb7805cc9d1cc907b64371b209c564b3", "apr_id": "dd35d2eeb0210787adbe60f175d6eea9", "difficulty": 1400, "tags": ["graphs", "constructive algorithms", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.9675066312997348, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "using System;\nusing System.Collections;\nusing System.Collections.Generic;\nusing System.Diagnostics;\nusing System.IO;\nusing System.Linq;\n\nnamespace Codeforces\n{\n\tinternal class Template\n\t{\n\t\tprivate void Solve()\n\t\t{\n\t\t\tvar n = cin.NextInt();\n\t\t\tvar k = cin.NextInt();\n\t\t\tvar a = new int[n];\n\t\t\tvar pos = new Queue[n + 10];\n\t\t\tfor (var i = 0; i < pos.Length; i++)\n\t\t\t{\n\t\t\t\tpos[i] = new Queue();\n\t\t\t}\n\t\t\tfor (var i = 0; i < n; i++)\n\t\t\t{\n\t\t\t\ta[i] = cin.NextInt();\n\t\t\t\tpos[a[i]].Enqueue(i);\n\t\t\t}\n\t\t\tvar have = new HashSet();\n\t\t\tvar timesNeeded = new SortedDictionary();\n\t\t\tvar res = 0;\n\t\t\tfor (var i = 0; i < a.Length; i++)\n\t\t\t{\n\t\t\t\tif (!have.Contains(a[i]))\n\t\t\t\t{\n\t\t\t\t\tif (have.Count == k)\n\t\t\t\t\t{\n\t\t\t\t\t\tvar first = timesNeeded.First();\n\t\t\t\t\t\ttimesNeeded.Remove(first.Key);\n\t\t\t\t\t\thave.Remove(first.Value);\n\t\t\t\t\t}\n\t\t\t\t\thave.Add(a[i]);\n\t\t\t\t\tif (i != pos[a[i]].Peek())\n\t\t\t\t\t{\n\t\t\t\t\t\tthrow new AccessViolationException();\n\t\t\t\t\t}\n\t\t\t\t\tpos[a[i]].Dequeue();\n\t\t\t\t\tif (!pos[a[i]].Any())\n\t\t\t\t\t{\n\t\t\t\t\t\ttimesNeeded.Add(-1000000000 + i, a[i]);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\ttimesNeeded.Add(-pos[a[i]].Peek(), a[i]);\n\t\t\t\t\t}\n\t\t\t\t\tres++;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tpos[a[i]].Dequeue();\n\t\t\t\t}\n\t\t\t}\n\t\t\tConsole.WriteLine(res);\n\t\t}\n\n\t\tprivate static readonly Scanner cin = new Scanner();\n\n\t\tprivate static void Main()\n\t\t{\n#if DEBUG\n\t\t\tvar inputText = File.ReadAllText(@\"..\\..\\input.txt\");\n\t\t\tvar testCases = inputText.Split(new[] { \"input\" }, StringSplitOptions.RemoveEmptyEntries);\n\t\t\tvar consoleOut = Console.Out;\n\t\t\tfor (var i = 0; i < testCases.Length; i++)\n\t\t\t{\n\t\t\t\tvar parts = testCases[i].Split(new[] { \"output\" }, StringSplitOptions.RemoveEmptyEntries);\n\t\t\t\tConsole.SetIn(new StringReader(parts[0].Trim()));\n\t\t\t\tvar stringWriter = new StringWriter();\n\t\t\t\tConsole.SetOut(stringWriter);\n\t\t\t\tvar sw = Stopwatch.StartNew();\n\t\t\t\tnew Template().Solve();\n\t\t\t\tsw.Stop();\n\t\t\t\tvar output = stringWriter.ToString();\n\n\t\t\t\tConsole.SetOut(consoleOut);\n\t\t\t\tvar color = ConsoleColor.Green;\n\t\t\t\tvar status = \"Passed\";\n\t\t\t\tif (parts[1].Trim() != output.Trim())\n\t\t\t\t{\n\t\t\t\t\tcolor = ConsoleColor.Red;\n\t\t\t\t\tstatus = \"Failed\";\n\t\t\t\t}\n\t\t\t\tConsole.ForegroundColor = color;\n\t\t\t\tConsole.WriteLine(\"Test {0} {1} in {2}ms\", i + 1, status, sw.ElapsedMilliseconds);\n\t\t\t}\n\t\t\tConsole.ReadLine();\n\t\t\tConsole.ReadKey();\n#else\n\t\t\tnew Template().Solve();\n\t\t\tConsole.ReadLine();\n#endif\n\t\t}\n\t}\n\n\tinternal class Scanner\n\t{\n\t\tprivate string[] s = new string[0];\n\t\tprivate int i;\n\t\tprivate readonly char[] cs = { ' ' };\n\n\t\tpublic string NextString()\n\t\t{\n\t\t\tif (i < s.Length) return s[i++];\n\t\t\tvar line = Console.ReadLine() ?? string.Empty;\n\t\t\ts = line.Split(cs, StringSplitOptions.RemoveEmptyEntries);\n\t\t\ti = 1;\n\t\t\treturn s.First();\n\t\t}\n\n\t\tpublic double NextDouble()\n\t\t{\n\t\t\treturn double.Parse(NextString());\n\t\t}\n\n\t\tpublic int NextInt()\n\t\t{\n\t\t\treturn int.Parse(NextString());\n\t\t}\n\n\t\tpublic long NextLong()\n\t\t{\n\t\t\treturn long.Parse(NextString());\n\t\t}\n\t}\n}", "lang": "MS C#", "bug_code_uid": "8a4771d003569f317abf6e3ec2894009", "src_uid": "956228e31679caa9952b216e010f9773", "apr_id": "3bdd195db06070eaa551c5701eda928e", "difficulty": 1800, "tags": ["greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.9530358939953036, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 3, "bug_source_code": "using System;\nusing System.Collections;\nusing System.Collections.Generic;\nusing System.Diagnostics;\nusing System.IO;\nusing System.Linq;\n\nnamespace Codeforces\n{\n\tinternal class Template\n\t{\n\t\tprivate void Solve()\n\t\t{\n\t\t\tvar n = cin.NextInt();\n\t\t\tvar k = cin.NextInt();\n\t\t\tvar a = new int[n];\n\t\t\tvar pos = new Queue[n + 10];\n\t\t\tfor (var i = 0; i < pos.Length; i++)\n\t\t\t{\n\t\t\t\tpos[i] = new Queue();\n\t\t\t}\n\t\t\tfor (var i = 0; i < n; i++)\n\t\t\t{\n\t\t\t\ta[i] = cin.NextInt();\n\t\t\t\tpos[a[i]].Enqueue(i);\n\t\t\t}\n\t\t\tvar have = new HashSet();\n\t\t\tvar timesNeeded = new SortedDictionary();\n\t\t\tvar res = 0;\n\t\t\tfor (var i = 0; i < a.Length; i++)\n\t\t\t{\n\t\t\t\tif (!have.Contains(a[i]))\n\t\t\t\t{\n\t\t\t\t\tif (have.Count == k)\n\t\t\t\t\t{\n\t\t\t\t\t\tvar first = timesNeeded.First();\n\t\t\t\t\t\ttimesNeeded.Remove(first.Key);\n\t\t\t\t\t\thave.Remove(first.Value);\n\t\t\t\t\t}\n\t\t\t\t\thave.Add(a[i]);\n\t\t\t\t\tif (i != pos[a[i]].Dequeue())\n\t\t\t\t\t{\n\t\t\t\t\t\tthrow new AccessViolationException();\n\t\t\t\t\t}\n\t\t\t\t\tif (!pos[a[i]].Any())\n\t\t\t\t\t{\n\t\t\t\t\t\ttimesNeeded.Add(-1000000000 + i, a[i]);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\ttimesNeeded.Add(-pos[a[i]].Peek(), a[i]);\n\t\t\t\t\t}\n\t\t\t\t\tres++;\n\t\t\t\t}\n\t\t\t}\n\t\t\tConsole.WriteLine(res);\n\t\t}\n\n\t\tprivate static readonly Scanner cin = new Scanner();\n\n\t\tprivate static void Main()\n\t\t{\n#if DEBUG\n\t\t\tvar inputText = File.ReadAllText(@\"..\\..\\input.txt\");\n\t\t\tvar testCases = inputText.Split(new[] { \"input\" }, StringSplitOptions.RemoveEmptyEntries);\n\t\t\tvar consoleOut = Console.Out;\n\t\t\tfor (var i = 0; i < testCases.Length; i++)\n\t\t\t{\n\t\t\t\tvar parts = testCases[i].Split(new[] { \"output\" }, StringSplitOptions.RemoveEmptyEntries);\n\t\t\t\tConsole.SetIn(new StringReader(parts[0].Trim()));\n\t\t\t\tvar stringWriter = new StringWriter();\n\t\t\t\tConsole.SetOut(stringWriter);\n\t\t\t\tvar sw = Stopwatch.StartNew();\n\t\t\t\tnew Template().Solve();\n\t\t\t\tsw.Stop();\n\t\t\t\tvar output = stringWriter.ToString();\n\n\t\t\t\tConsole.SetOut(consoleOut);\n\t\t\t\tvar color = ConsoleColor.Green;\n\t\t\t\tvar status = \"Passed\";\n\t\t\t\tif (parts[1].Trim() != output.Trim())\n\t\t\t\t{\n\t\t\t\t\tcolor = ConsoleColor.Red;\n\t\t\t\t\tstatus = \"Failed\";\n\t\t\t\t}\n\t\t\t\tConsole.ForegroundColor = color;\n\t\t\t\tConsole.WriteLine(\"Test {0} {1} in {2}ms\", i + 1, status, sw.ElapsedMilliseconds);\n\t\t\t}\n\t\t\tConsole.ReadLine();\n\t\t\tConsole.ReadKey();\n#else\n\t\t\tnew Template().Solve();\n\t\t\tConsole.ReadLine();\n#endif\n\t\t}\n\t}\n\n\tinternal class Scanner\n\t{\n\t\tprivate string[] s = new string[0];\n\t\tprivate int i;\n\t\tprivate readonly char[] cs = { ' ' };\n\n\t\tpublic string NextString()\n\t\t{\n\t\t\tif (i < s.Length) return s[i++];\n\t\t\tvar line = Console.ReadLine() ?? string.Empty;\n\t\t\ts = line.Split(cs, StringSplitOptions.RemoveEmptyEntries);\n\t\t\ti = 1;\n\t\t\treturn s.First();\n\t\t}\n\n\t\tpublic double NextDouble()\n\t\t{\n\t\t\treturn double.Parse(NextString());\n\t\t}\n\n\t\tpublic int NextInt()\n\t\t{\n\t\t\treturn int.Parse(NextString());\n\t\t}\n\n\t\tpublic long NextLong()\n\t\t{\n\t\t\treturn long.Parse(NextString());\n\t\t}\n\t}\n}", "lang": "MS C#", "bug_code_uid": "2e94e85923f2f8013f258b9658ecc3ed", "src_uid": "956228e31679caa9952b216e010f9773", "apr_id": "3bdd195db06070eaa551c5701eda928e", "difficulty": 1800, "tags": ["greedy"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.9714988722575354, "equal_cnt": 12, "replace_cnt": 7, "delete_cnt": 0, "insert_cnt": 4, "fix_ops_cnt": 11, "bug_source_code": "using System;\nusing System.Linq;\nusing System.Collections.Generic;\nusing Debug = System.Diagnostics.Debug;\nusing SB = System.Text.StringBuilder;\n//using System.Numerics;\nusing Number = System.Int64;\nusing static System.Math;\n//using static MathEx;\n//using P = System.Collections.Generic.KeyValuePair;\nnamespace Program\n{\n public class Solver\n {\n public void Solve()\n {\n var n = ri;\n var k = ri;\n var a = Enumerate(n, x => ri - 1);\n var rand = new Random(1);\n //a = Enumerate(n, x => rand.Next() % n);\n //naive(n, k, a);\n\n var last = Enumerate(n, x => n + 1);\n var next = new int[n];\n for (int i = n - 1; i >= 0; i--)\n {\n next[i] = last[a[i]];\n last[a[i]] = i;\n }\n\n var prev = new int[n];\n var cnt = 0;\n Debug.WriteLine(a.AsJoinedString());\n var s = new SortedSet();\n var pq = new SortedSet();\n for (int i = 0; i < n; i++)\n {\n if (s.Add(a[i]))\n {\n Debug.WriteLine(a[i]);\n cnt++;\n pq.Add(next[i] * 1000000L + a[i]);\n if (s.Count > k)\n {\n var ma = pq.Max;\n Debug.WriteLine(\"!{0}\", ma);\n pq.Remove(ma);\n s.Remove(ma % 1000000L);\n }\n }\n else\n {\n pq.Remove(i * 1000000L + a[i]);\n pq.Add(next[i] * 1000000L + a[i]);\n }\n }\n IO.Printer.Out.WriteLine(cnt);\n }\n void naive(int n, int k, int[] a)\n {\n var dp = new int[1 << n];\n for (int i = 0; i < 1 << n; i++)\n dp[i] = 1000000;\n dp[0] = 0;\n foreach (var x in a)\n {\n var next = Enumerate(1 << n, y => 1000000);\n for (int i = 0; i < 1 << n; i++)\n {\n if (dp[i] >= 1000000) continue;\n var cnt = 0;\n for (int j = 0; j < n; j++)\n if ((i >> j & 1) == 1) cnt++;\n if (cnt > k) continue;\n if ((i >> x & 1) == 1)\n next[i] = Min(next[i], dp[i]);\n else\n {\n var nmask = i | 1 << x;\n if (cnt == k)\n for (int j = 0; j < n; j++)\n {\n if ((i >> j & 1) == 1)\n {\n var nnmask = nmask ^ (1 << j);\n next[nnmask] = Min(next[nnmask], dp[i] + 1);\n }\n\n }\n else\n {\n next[nmask] = Min(next[nmask], dp[i] + 1);\n }\n }\n }\n dp = next;\n }\n IO.Printer.Out.WriteLine(dp.Min());\n\n }\n //*\n int ri => sc.Integer();\n long rl => sc.Long();\n double rd => sc.Double();\n string rs => sc.Scan();\n char rc => sc.Char();\n\n [System.Diagnostics.Conditional(\"DEBUG\")]\n void put(params object[] a) => Debug.WriteLine(string.Join(\" \", a));\n\n //*/\n public IO.StreamScanner sc = new IO.StreamScanner(Console.OpenStandardInput());\n\n static T[] Enumerate(int n, Func f)\n {\n var a = new T[n];\n for (int i = 0; i < n; ++i) a[i] = f(i);\n return a;\n }\n static void Swap(ref T a, ref T b)\n {\n var tmp = a;\n a = b;\n b = tmp;\n }\n }\n}\n\n#region main\n\nstatic class Ex\n{\n public static string AsString(this IEnumerable ie)\n {\n return new string(ie.ToArray());\n }\n\n public static string AsJoinedString(this IEnumerable ie, string st = \" \")\n {\n return string.Join(st, ie);\n }\n\n public static void Main()\n {\n var solver = new Program.Solver();\n solver.Solve();\n Program.IO.Printer.Out.Flush();\n }\n}\n\n#endregion\n#region Ex\n\nnamespace Program.IO\n{\n using System.IO;\n using System.Text;\n using System.Globalization;\n\n public class Printer: StreamWriter\n {\n static Printer()\n {\n Out = new Printer(Console.OpenStandardOutput()) { AutoFlush = false };\n }\n\n public static Printer Out { get; set; }\n\n public override IFormatProvider FormatProvider\n {\n get { return CultureInfo.InvariantCulture; }\n }\n\n public Printer(Stream stream) : base(stream, new UTF8Encoding(false, true))\n {\n }\n\n public Printer(Stream stream, Encoding encoding) : base(stream, encoding)\n {\n }\n\n public void Write(string format, T[] source)\n {\n base.Write(format, source.OfType().ToArray());\n }\n\n public void WriteLine(string format, T[] source)\n {\n base.WriteLine(format, source.OfType().ToArray());\n }\n }\n\n public class StreamScanner\n {\n public StreamScanner(Stream stream)\n {\n str = stream;\n }\n\n public readonly Stream str;\n private readonly byte[] buf = new byte[1024];\n private int len, ptr;\n public bool isEof;\n\n public bool IsEndOfStream\n {\n get { return isEof; }\n }\n\n private byte read()\n {\n if (isEof) return 0;\n if (ptr < len) return buf[ptr++];\n ptr = 0;\n if ((len = str.Read(buf, 0, 1024)) > 0) return buf[ptr++];\n isEof = true;\n return 0;\n }\n\n public char Char()\n {\n byte b;\n do b = read(); while ((b < 33 || 126 < b) && !isEof);\n return (char)b;\n }\n\n public string Scan()\n {\n var sb = new StringBuilder();\n for (var b = Char(); b >= 33 && b <= 126; b = (char)read())\n sb.Append(b);\n return sb.ToString();\n }\n\n public string ScanLine()\n {\n var sb = new StringBuilder();\n for (var b = Char(); b != '\\n'; b = (char)read())\n if (b == 0) break;\n else if (b != '\\r') sb.Append(b);\n return sb.ToString();\n }\n\n public long Long()\n {\n if (isEof) return long.MinValue;\n long ret = 0;\n byte b;\n var ng = false;\n do b = read(); while (b != 0 && b != '-' && (b < '0' || '9' < b));\n if (b == 0) return long.MinValue;\n if (b == '-')\n {\n ng = true;\n b = read();\n }\n for (; ; b = read())\n {\n if (b < '0' || '9' < b)\n return ng ? -ret : ret;\n ret = ret * 10 + b - '0';\n }\n }\n\n public int Integer()\n {\n return (isEof) ? int.MinValue : (int)Long();\n }\n\n public double Double()\n {\n var s = Scan();\n return s != \"\" ? double.Parse(s, CultureInfo.InvariantCulture) : double.NaN;\n }\n\n static T[] enumerate(int n, Func f)\n {\n var a = new T[n];\n for (int i = 0; i < n; ++i) a[i] = f();\n return a;\n }\n\n public char[] Char(int n)\n {\n return enumerate(n, Char);\n }\n\n public string[] Scan(int n)\n {\n return enumerate(n, Scan);\n }\n\n public double[] Double(int n)\n {\n return enumerate(n, Double);\n }\n\n public int[] Integer(int n)\n {\n return enumerate(n, Integer);\n }\n\n public long[] Long(int n)\n {\n return enumerate(n, Long);\n }\n }\n}\n\n#endregion\n\n#region BinaryHeap\npublic class PriorityQueue\n{\n readonly List heap = new List();\n readonly IComparer cmp;\n public PriorityQueue() { cmp = Comparer.Default; }\n public PriorityQueue(Comparison f) { cmp = Comparer.Create(f); }\n public PriorityQueue(IComparer c) { cmp = c; }\n public void Enqueue(T item)\n {\n\n var i = heap.Count;\n heap.Add(item);\n while (i > 0)\n {\n var p = (i - 1) / 2;\n if (cmp.Compare(heap[p], item) <= 0)\n break;\n heap[i] = heap[p];\n i = p;\n }\n heap[i] = item;\n\n }\n public T Dequeue()\n {\n var ret = heap[0];\n var i = 0;\n var x = heap[heap.Count - 1];\n\n while ((i * 2) + 1 < heap.Count - 1)\n {\n var a = i * 2 + 1;\n var b = i * 2 + 2;\n if (b < heap.Count - 1 && cmp.Compare(heap[b], heap[a]) < 0) a = b;\n if (cmp.Compare(heap[a], x) >= 0)\n break;\n heap[i] = heap[a];\n i = a;\n }\n heap[i] = x;\n heap.RemoveAt(heap.Count - 1);\n return ret;\n\n }\n public T Peek() { return heap[0]; }\n public int Count { get { return heap.Count; } }\n public bool Any() { return heap.Count > 0; }\n public T[] Items\n {\n get\n {\n var ret = heap.ToArray();\n Array.Sort(ret, cmp);\n return ret;\n }\n }\n}\n#endregion\n\n", "lang": "MS C#", "bug_code_uid": "77c113cc6fac6a965eb355840ffcf62a", "src_uid": "956228e31679caa9952b216e010f9773", "apr_id": "548eed6b5fd7baeee5ae740211f830f3", "difficulty": 1800, "tags": ["greedy"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.7061093247588425, "equal_cnt": 21, "replace_cnt": 15, "delete_cnt": 4, "insert_cnt": 1, "fix_ops_cnt": 20, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Globalization;\n\nnamespace Codeforces\n{\n internal static class Program\n {\n private static void Main()\n {\n var m = long.Parse(Console.ReadLine());\n\n var result = new List();\n\n for (var i = 0; i < 100000; i++)\n {\n var n = GetDivisorCount(Factorial(i), 5);\n\n if (n == m)\n {\n result.Add(i);\n }\n else if (m < n)\n {\n break;\n }\n }\n\n Print(result.Count);\n\n if (result.Count > 0)\n {\n Print(string.Join(\" \", result));\n }\n }\n\n // Returns how many times 'n' can be divided by 'divisor'.\n private static long GetDivisorCount(long n, long divisor)\n {\n long count = 0;\n\n while (0 < n && n % divisor == 0)\n {\n n /= divisor;\n count++;\n }\n\n return count;\n }\n\n private static long Factorial(long n)\n {\n var acc = 1L;\n for (var i = 1L; i <= n; i++) { acc *= i; }\n return acc;\n }\n\n private static void Print(string s) { Console.WriteLine(s); }\n private static void Print(long x) { Console.WriteLine(x.ToString(CultureInfo.InvariantCulture)); }\n private static void Print(double x) { Console.WriteLine(x.ToString(CultureInfo.InvariantCulture)); }\n\n private static string S(long x) { return x.ToString(CultureInfo.InvariantCulture); }\n private static string S(double x) { return x.ToString(CultureInfo.InvariantCulture); }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "c4adf2703f25e6912992011e53607ca2", "src_uid": "c27ecc6e4755b21f95a6b1b657ef0744", "apr_id": "fba1c19410a7aa3c429de784a7e8bae3", "difficulty": 1300, "tags": ["brute force", "math", "constructive algorithms", "number theory"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9328512396694215, "equal_cnt": 11, "replace_cnt": 2, "delete_cnt": 3, "insert_cnt": 6, "fix_ops_cnt": 11, "bug_source_code": "using System;\nusing System.Globalization;\nusing System.Linq;\n\nnamespace Codeforces\n{\n internal static class Program\n {\n private static void Main()\n {\n var m = long.Parse(Console.ReadLine());\n var count = 0L;\n\n long i;\n for (i = 1; count < m; i++)\n {\n count = GetCount(i);\n }\n\n if (count == m)\n {\n Print(5);\n Print(string.Join(\" \", Enumerable.Range(i, 5)));\n }\n else\n {\n Print(0);\n }\n }\n\n private static long GetCount(long n)\n {\n var count = 0L;\n for (var t = 5L; t <= n; t *= 5) { count += n / t; }\n return count;\n }\n\n private static void Print(string s) { Console.WriteLine(s); }\n private static void Print(long x) { Console.WriteLine(x.ToString(CultureInfo.InvariantCulture)); }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "ef96cd3504896a7a562ba7aaf11f4c5b", "src_uid": "c27ecc6e4755b21f95a6b1b657ef0744", "apr_id": "fba1c19410a7aa3c429de784a7e8bae3", "difficulty": 1300, "tags": ["brute force", "math", "constructive algorithms", "number theory"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.9783057851239669, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 0, "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 CF633B {\n class Program {\n static void Main(string[] args) {\n int trailing = Convert.ToInt32(Console.ReadLine());\n\n int factorial = 0;\n int zeros = 0;\n while(zeros < trailing) {\n factorial += 5;\n\n if(factorial % 5 == 0) {\n zeros++;\n }\n int pow = 2;\n while(factorial == Math.Pow(5, pow)) {\n zeros++;\n }\n }\n\n if(zeros == trailing) {\n Console.WriteLine(5);\n for(int i = 0; i < 5; i++) {\n Console.Write(factorial + i + \" \");\n }\n Console.WriteLine();\n } else {\n Console.WriteLine(\"0\");\n }\n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "12979e57a7eec242290dc47bf992498f", "src_uid": "c27ecc6e4755b21f95a6b1b657ef0744", "apr_id": "b1dd7da8b27e94f41a07d919e0674436", "difficulty": 1300, "tags": ["brute force", "math", "constructive algorithms", "number theory"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.9931840311587147, "equal_cnt": 14, "replace_cnt": 1, "delete_cnt": 12, "insert_cnt": 0, "fix_ops_cnt": 13, "bug_source_code": "using System;\n\nnamespace Task_45A\n{\n class Program\n {\n static void Main(string[] args)\n {\n string currentMonth = Console.ReadLine();\n int timeRemaining = int.Parse(Console.ReadLine());\n string[] months = { \"January\", \"February\", \"March\", \"April\", \"May\", \"June\",\n \"July\", \"August\", \"September\", \"October\", \"November\", \"December\" };\n string ans = \".\";\n for(int i = 0; i < 12; i++)\n {\n if (months[i] == currentMonth)\n {\n if (i + timeRemaining % 12 > 12)\n {\n ans = months[i + timeRemaining % 12 - 12];\n break;\n }\n\n else\n {\n ans = months[i + timeRemaining % 12];\n break;\n }\n } \n }\n Console.WriteLine(ans);\n } \n }\n}\n", "lang": "Mono C#", "bug_code_uid": "70b288cbf8bc907eca71388ae5d80681", "src_uid": "a307b402b20554ce177a73db07170691", "apr_id": "694cacf22fde95553c289175bdd5648c", "difficulty": 900, "tags": ["implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C#"} {"similarity_score": 0.31362683438155137, "equal_cnt": 22, "replace_cnt": 12, "delete_cnt": 7, "insert_cnt": 3, "fix_ops_cnt": 22, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace Olimp5\n{\n struct DP\n {\n public bool b;\n public string s;\n public DP(bool b,string s)\n {\n this.b = b;\n this.s = s;\n }\n }\n class Program\n {\n static void Main(string[] args)\n {\n string word = Console.ReadLine();\n int n = int.Parse(Console.ReadLine());\n string[] dict = new string[n];\n for (int i = 0;i < n; i++)\n {\n dict[i] = Console.ReadLine();\n }\n DP[] dp = new DP[word.Length + 1];\n dp[0] = new DP(true,\"\");\n for (int i = 1;i < dp.Length; i++)\n {\n foreach (var s in dict)\n {\n if (i >= s.Length && dp[i - s.Length].b)\n {\n for (int j = 0;j < s.Length; j++)\n {\n if (s[j] != word[i - s.Length + j])\n {\n dp[i] = new DP(false, \"\");\n goto BREAK1;\n }\n }\n dp[i] = new DP(true, dp[i - s.Length].s + s + \" \");\n break;\n }\n BREAK1:;\n }\n }\n Console.WriteLine(dp.Last().s);\n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "1c624fb8ff9bfc37cbd25d4147a0e957", "src_uid": "a753bfa7bde157e108f34a28240f441f", "apr_id": "5a4ed6c1dd031ec36851cc5796d7df07", "difficulty": 1200, "tags": ["constructive algorithms", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9597069597069597, "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.Text;\n\nnamespace Square\n{\nclass Program\n{\nstatic void Main(string[] args){\nint n, x, y;\nvar coll = str.Split(' ');\nn = Convert.ToInt32(coll[0]);\nx = Convert.ToInt32(coll[1]);\ny = Convert.ToInt32(coll[2]);\nConsole.WriteLine(((x == n / 2 || x == n / 2 + 1) && (y == n / 2 || y == n / 2 + 1) ? \"NO\" : \"YES\")); \n}\n}\n}", "lang": "MS C#", "bug_code_uid": "97498afddb5cbf8e11b97d481dc7e67f", "src_uid": "dc891d57bcdad3108dcb4ccf9c798789", "apr_id": "a3c8555eefa7b8189fa6a3b02c34424b", "difficulty": 1200, "tags": ["math", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.7126903553299493, "equal_cnt": 7, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 8, "fix_ops_cnt": 8, "bug_source_code": " int n, x, y;\n string str = Console.ReadLine();\n var coll = str.Split(' ');\n n = Convert.ToInt32(coll[0]);\n x = Convert.ToInt32(coll[1]);\n y = Convert.ToInt32(coll[2]);\n Console.WriteLine(((x == n / 2 || x == n / 2 + 1) && (y == n / 2 || y == n / 2 + 1) ? \"NO\" : \"YES\")); ", "lang": "MS C#", "bug_code_uid": "b911fd0b7b88a83fbf5b15001cdf83e1", "src_uid": "dc891d57bcdad3108dcb4ccf9c798789", "apr_id": "040e0d26654316f153ad961eaabe5d4e", "difficulty": 1200, "tags": ["math", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.7696369636963697, "equal_cnt": 7, "replace_cnt": 5, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 6, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Globalization;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace CodeForcesTemplate\n{\n class Program\n {\n static int n, m, k;\n\n static void Main(string[] args)\n {\n\n LoadInput();\n\n Solve();\n }\n\n private static void Solve()\n {\n if (k > n + m - 2)\n {\n Console.WriteLine(-1);\n return;\n }\n int max = -1;\n for (int x = 1; x < n; x++)\n {\n int y = k + 2 - x;\n int cur = (int) (Math.Floor((double)n / x) * Math.Floor((double)m / y));\n if (cur > max)\n {\n max = cur;\n }\n }\n Console.WriteLine(max);\n }\n\n private static void LoadInput()\n {\n var inp = Console.ReadLine().Split(' ').Select(x => Convert.ToInt32(x)).ToArray();\n n = inp[0];\n m = inp[1];\n k = inp[2];\n if (n > m)\n {\n m = inp[0];\n n = inp[1];\n }\n }\n }\n\n\n static class Helpers\n {\n public static void Print(this IEnumerable source)\n {\n foreach (var item in source)\n {\n Console.Write(\"{0} \", item.ToString());\n }\n Console.WriteLine();\n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "b7726f544de6efad8f97d69f4d87376c", "src_uid": "bb453bbe60769bcaea6a824c72120f73", "apr_id": "315df45de68517f7f8cfbc175bdedcb7", "difficulty": 1700, "tags": ["math", "greedy"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.744140625, "equal_cnt": 29, "replace_cnt": 5, "delete_cnt": 6, "insert_cnt": 19, "fix_ops_cnt": 30, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Globalization;\nusing System.IO;\nusing System.Linq;\nusing System.Text;\n\nclass Program\n{\n\tprivate static void SolveC()\n {\n var n = RI();\n //var m = RIA(n);\n long ans = 0;\n for (int i = 0; i < n; i++)\n {\n\n }\n\n Console.WriteLine(ans);\n }\n\n private static void SolveB()\n {\n Console.ReadLine();\n var s = Console.ReadLine();\n int count = 0;\n int mAX = 0;\n\n while (s.Contains('('))\n {\n int p1 = s.IndexOf('(');\n int p2 = s.IndexOf(')');\n\n string ss = s.Substring(p1 + 1, p2 - p1 - 1);\n count += (ss.Split('_').Where(qwe => qwe.Length > 0).Count());\n\n s = s.Remove(p1, p2 - p1 + 1).Insert(p1, \"_\");\n }\n\n var words = s.Split('_').Where(qwe => qwe.Length > 0).ToArray();\n if (words.Length > 0)\n mAX = words.Max(ww => ww.Length);\n\n Console.WriteLine(mAX + \" \" + count);\n }\n\tstatic void Main(string[] args)\n {\n \n SolveB();\n //SolveC();\n }\n\n}", "lang": "MS C#", "bug_code_uid": "bb6b6c57d9ff65fc9daa2f9c1ff1eaed", "src_uid": "fc86df4931e787fa3a1a40e2aecf0b92", "apr_id": "bc5c3283a79a0c82540896a44333c828", "difficulty": 1100, "tags": ["strings", "implementation", "expression parsing"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.8893421723610403, "equal_cnt": 19, "replace_cnt": 5, "delete_cnt": 6, "insert_cnt": 8, "fix_ops_cnt": 19, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace taskA\n{\n class Program\n {\n double aMain(string[] args)\n {\n int n;\n string s;\n Console.WriteLine(\"Введите n\");\n n = int.Parse(Console.ReadLine());\n Console.WriteLine(\"Введите s\");\n s = Console.ReadLine();\n string answer = \"\";\n double counter=0;\n for (int i = 0; i < n; i++)\n {\n if (counter == 0)\n if (s[i].ToString() == \"0\") { answer += i.ToString(); counter = i;}\n else;\n else if(s[i].ToString() == \"0\") { answer += (i - counter - 1).ToString(); counter = i; }\n\n }\n if (counter == 0) answer = n.ToString();\n else\n answer+=(n-1-counter).ToString();\n counter = int.Parse(answer);\n return counter;\n Console.WriteLine(counter);\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "ee5fa794a110752bb705afdfea6a6415", "src_uid": "a4b3da4cb9b6a7ed0a33a862e940cafa", "apr_id": "648c79532bfe9addefcf7d8360fd190f", "difficulty": 1100, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.8468335787923417, "equal_cnt": 12, "replace_cnt": 4, "delete_cnt": 0, "insert_cnt": 7, "fix_ops_cnt": 11, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.IO;\n\t\t\t\t\t\npublic class Program\n{\n\tpublic static void Main()\n\t{\n solve_441A();\n\t}\n\t\n\tpublic static void solve_441A()\n\t{\n\t\tint n = Convert.ToInt32(Console.ReadLine());\n\t\tint a = Convert.ToInt32(Console.ReadLine());\n\t\tint b = Convert.ToInt32(Console.ReadLine());\n\t\tint c = Convert.ToInt32(Console.ReadLine());\n\n\t\tn = n - 1;\n\t\tint minStart = Math.Min(a, b);\n\t\tint totalLength = 0;\n\t\tif (minStart <= c)\n\t\t{\n\t\t\ttotalLength = minStart * n;\n\t\t}\n\t\telse\n\t\t{\n\t\t\ttotalLength = minStart + c * --n;\n\t\t}\n\t\t\n\t\tConsole.WriteLine(totalLength);\n\t}\n}", "lang": "Mono C#", "bug_code_uid": "4943785684a7fd5709235522703574db", "src_uid": "6058529f0144c853e9e17ed7c661fc50", "apr_id": "caa257135c374701c1ad03be0ae45fc2", "difficulty": 900, "tags": ["math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.9458762886597938, "equal_cnt": 6, "replace_cnt": 4, "delete_cnt": 0, "insert_cnt": 1, "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 Codeforces\n{\n class Program\n {\n static void Main(string[] args)\n {\n \n string[] numbers = Console.ReadLine().Split();\n double x = Convert.ToDouble(numbers[0]);\n double y = Convert.ToDouble(numbers[1]);\n double xpow = Math.Pow(x, y);\n double ypow = Math.Pow(y, x);\n\n if(xpow>ypow)\n {\n Console.WriteLine(\">\");\n }\n else if(xpow' : '<');\n }\n }\n}", "lang": "Mono C#", "bug_code_uid": "bdb35ae63bacdd08328fd0588d8d779c", "src_uid": "ec1e44ff41941f0e6436831b5ae543c6", "apr_id": "e386aa8b6ff8eef0e9bc0ea04411413f", "difficulty": 1100, "tags": ["math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.9996105919003115, "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.Text;\nusing System.IO;\nusing System.Net.Mail;\n\nnamespace Contest\n{\n class Scanner\n {\n private string[] line = new string[0];\n private int index = 0;\n public string Next()\n {\n if (line.Length <= index)\n {\n line = Console.ReadLine().Split(' ');\n index = 0;\n }\n var res = line[index];\n index++;\n return res;\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 string[] Array()\n {\n line = Console.ReadLine().Split(' ');\n index = line.Length;\n return line;\n }\n public int[] IntArray()\n {\n var array = Array();\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 public long[] LongArray()\n {\n var array = Array();\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 }\n\n class Program\n {\n private int X, Y;\n private void Scan()\n {\n var sc = new Scanner();\n X = sc.NextInt();\n Y = sc.NextInt();\n }\n\n public void Solve()\n {\n Scan();\n if (X == 1)\n {\n if (Y == 1)\n {\n Console.WriteLine(\"=\");\n }\n else\n {\n Console.WriteLine(\"<\");\n }\n return;\n }\n else if (Y == 1)\n {\n Console.WriteLine(\">\");\n return;\n }\n var a = Math.Log(X, Y);\n var b = (double)X / Y;\n Console.WriteLine($\"{a} {b}\");\n if (a > b)\n {\n Console.WriteLine(\">\");\n }\n else if (a < b)\n {\n Console.WriteLine(\"<\");\n }\n else\n {\n Console.WriteLine(\"=\");\n }\n }\n\n static void Main() => new Program().Solve();\n }\n}", "lang": "Mono C#", "bug_code_uid": "374a53a30bb7d08b4271826d60b9e114", "src_uid": "ec1e44ff41941f0e6436831b5ae543c6", "apr_id": "c0e57ac0a7e29e996b2e5ccce68e7cf0", "difficulty": 1100, "tags": ["math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.9702970297029703, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "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 bla\n{\n class Program\n {\n static void Main(string[] args)\n {\n string[] s = Console.ReadLine().Split();\n double x = double.Parse(s[0]);\n double y = double.Parse(s[1]);\n double a = y * Math.Log(x);\n double b = x * Math.Log(y);\n if (x == y)\n {\n Console.WriteLine(\"=\");\n return;\n }\n if (a > b)\n {\n Console.WriteLine(\">\");\n }\n else if (b > a)\n {\n Console.WriteLine(\"<\");\n }\n Console.WriteLine(\"=\");\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "2a80e08e932f4214c70fceb4e724817e", "src_uid": "ec1e44ff41941f0e6436831b5ae543c6", "apr_id": "fd25d9a3b3ce4583eaab56a0e87746bc", "difficulty": 1100, "tags": ["math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.997037037037037, "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 codeforces \n{ \nclass Program \n{ \nstatic void Main(string[] args) \n{ \nstring s = Console.ReadLine(); \ndouble x = double.Parse(s.Split(' ')[0]), y = double.Parse(s.Split(' ')[1]); \nif (x > 1000 || y > 1000) \n{ \nif (x < y) \n{ \nConsole.WriteLine(\">\"); \n} \nif (x > y) \n{ \nConsole.WriteLine(\"<\"); \n} \nif (x == y) \n{ \nConsole.WriteLine(\"=\"); \n} \n}else{ \ndouble t = Math.Pow(x, y); \ndouble h = Math.Pow(y, x); \nif (t < h) \n{ \nConsole.WriteLine(\"<\"); \n} \nif (t > h) \n{ \nConsole.WriteLine(\">\"); \n} \nif (t == h) \n{ \nConsole.WriteLine(\"=\"); \n} \n} \n} \n} \n}", "lang": "Mono C#", "bug_code_uid": "bebabe0d1a7e8dfd11f6c697f0c8e62f", "src_uid": "ec1e44ff41941f0e6436831b5ae543c6", "apr_id": "44152837c18213c055d63b5bc0d59c61", "difficulty": 1100, "tags": ["math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9916123019571296, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 0, "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 ConsoleApplication3\n{\n class Program\n {\n static void Main(string[] args)\n {\n \n string[] s = Console.ReadLine().Split(' ');\n Solution1 ss = new Solution1();\n ss.find_power_greater(Convert.ToInt32(s[0]), Convert.ToInt32(s[1]));\n \n}\n}\n\n public class Solution1\n {\n public void find_power_greater(int a, int b)\n {\n double ab = findapowerb(a, b);\n double ba = findapowerb(b, a);\n if (ab == ba)\n {\n Console.WriteLine(\"=\");\n }\n if (ab > ba)\n {\n Console.WriteLine(\">\");\n }\n if (ab < ba)\n {\n Console.WriteLine(\"<\");\n }\n }\n \n \n public static int findapowerb(int a, int b)\n { \n \n return (b) * (Math.Log(a) );\n\n }\n}\n}\n ", "lang": "Mono C#", "bug_code_uid": "e6b3cdd387f4549a64184c3a2884da51", "src_uid": "ec1e44ff41941f0e6436831b5ae543c6", "apr_id": "102601473c40b05615303a4163d8cbd9", "difficulty": 1100, "tags": ["math"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9307583608101743, "equal_cnt": 10, "replace_cnt": 5, "delete_cnt": 2, "insert_cnt": 3, "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 ConsoleApplication3\n{\n class Program\n {\n static void Main(string[] args)\n {\n \n string[] s = Console.ReadLine().Split(' ');\n Solution1 ss = new Solution1();\n ss.find_power_greater(Convert.ToInt32(s[0]), Convert.ToInt32(s[1]));\n \n}\n}\n\n public class Solution1\n {\n public void find_power_greater(int a, int b)\n {\n long ab = findapowerb(a, b);\n long ba = findapowerb(b, a);\n\n if (ab == ba)\n {\n Console.WriteLine(\"=\");\n }\n if (ab > ba)\n {\n Console.WriteLine(\">\");\n }\n if (ab < ba)\n {\n Console.WriteLine(\"<\");\n }\n }\n public static int findapowerb(int a, int b)\n {\n return (int)(b * Math.Log(a));\n\n \n }\n }\n}", "lang": "Mono C#", "bug_code_uid": "0a029a323609dee82c09e4dc46eb4f61", "src_uid": "ec1e44ff41941f0e6436831b5ae543c6", "apr_id": "102601473c40b05615303a4163d8cbd9", "difficulty": 1100, "tags": ["math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.993519718570635, "equal_cnt": 7, "replace_cnt": 3, "delete_cnt": 0, "insert_cnt": 3, "fix_ops_cnt": 6, "bug_source_code": "using System;\nusing System.Collections;\nusing System.Collections.Generic;\nusing System.Globalization;\nusing System.IO;\nusing System.Linq;\nusing System.Text;\nusing System.Threading;\n\npublic class CodeForces87\n{\n#if TEST\n // To set this go to Project -> Properties -> Build -> General -> Conditional compilation symbols: -> enter 'TEST' into text box.\n const bool testing = false;\n#else\nconst bool testing = false;\n#endif\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 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 class Node : IComparable\n {\n public int Index { get; set; }\n public double Value { get; set; }\n public int CompareTo(object obj)\n {\n return this.Value.CompareTo(((Node)obj).Value);\n }\n }\n static void program(TextReader input)\n {\n //var s = reader.ReadLine().TrimEnd();\n //var n = int.Parse(reader.ReadLine().TrimEnd());\n var data = reader.ReadLine().TrimEnd().Split(' ').Select(double.Parse).ToList();\n var x = data[0];\n var y = data[1];\n var res = y * Math.Log(x) / (x * Math.Log(y));\n Console.WriteLine(res == 1 ? \"=\" : res > 1 ? \">\" : \"<\");\n }\n\n public static void Main(string[] args)\n {\n CultureInfo nonInvariantCulture = new CultureInfo(\"en-US\");\n Thread.CurrentThread.CurrentCulture = nonInvariantCulture;\n if (!testing)\n { // set testing to false when submiting to codeforces\n program(Console.In); // write your program in 'program' function (its your new main !)\n return;\n }\n\n Console.WriteLine(\"Test Case(1) => expected :\");\n Console.WriteLine(\"3\\n2\\n4\\n\");\n Console.WriteLine(\"Test Case(1) => found :\");\n program(new StringReader(\"4 3\\n2\\n3\\n4\\n\"));\n Console.WriteLine();\n\n Console.WriteLine(\"Test Case(2) => expected :\");\n Console.WriteLine(\"13\\n3\\n8\\n9\\n\");\n Console.WriteLine(\"Test Case(2) => found :\");\n program(new StringReader(\"13 4\\n10\\n5\\n4\\n8\\n\"));\n Console.WriteLine();\n\n }\n}", "lang": "Mono C#", "bug_code_uid": "667d9130c197d744e7ddcb519ae2e82e", "src_uid": "ec1e44ff41941f0e6436831b5ae543c6", "apr_id": "01de322a3b3f0ecb4ed56e184d69f41d", "difficulty": 1100, "tags": ["math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9451851851851852, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "using System;\n\nnamespace CF_987_B\n{\n class Program\n {\n static void Main(string[] args)\n {\n string[] s = Console.ReadLine().Split();\n int x = int.Parse(s[0]);\n int y = int.Parse(s[1]);\n\n if(x==y)\n {\n Console.WriteLine(\"=\");\n return;\n }\n\n double LogXY = y * Math.Log(x);\n double LogYX = x * Math.Log(y);\n double diff = Math.Abs(LogXY - LogYX);\n\n if (LogXY > LogYX)\n Console.WriteLine(\">\");\n else\n Console.WriteLine(\"<\");\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "f43308047df1d51b196402d104fbab4f", "src_uid": "ec1e44ff41941f0e6436831b5ae543c6", "apr_id": "435b79981fbfcc54e590a9eefd937f10", "difficulty": 1100, "tags": ["math"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.995417048579285, "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.Text;\nusing System.Threading.Tasks;\n\nnamespace A\n{\n\tclass Program\n\t{\n\t\tstatic void Main(string[] args)\n\t\t{\n\t\t\tint[] a = Console.ReadLine().Split(' ').Select(int.Parse).ToArray();\n\t\t\tint x = a[0]; int y = a[1]; int z = a[2]; int t1 = a[3]; int t2 = a[4]; int t3 = a[5];\n\t\t\tint walk = Math.Abs(x - y) * t1;\n\t\t\tint lift = Math.Abs(z - x) * t2 + t3 + Math.Abs(y - x) * t2 + t3;\n\t\t\tif (walk < lift) Console.WriteLine(\"NO\");\n\t\t\telse Console.WriteLine(\"YES\");\n\t\t}\n\t}\n}\n", "lang": "Mono C#", "bug_code_uid": "4a9c4f15b68471876fc9a5684877b8de", "src_uid": "05cffd59b28b9e026ca3203718b2e6ca", "apr_id": "827a03f37f8e4373d799bce3daf21b58", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.6540084388185654, "equal_cnt": 18, "replace_cnt": 13, "delete_cnt": 3, "insert_cnt": 2, "fix_ops_cnt": 18, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text.RegularExpressions;\n\nnamespace Rextester\n{\n public class Program\n {\n public static void Main(string[] args)\n {\n //Your code goes here\n int x = Console.Re();\n int y = Console.Read();\n int z = Console.Read();\n int t1 = Console.Read();\n int t2 = Console.Read();\n int t3 = Console.Read();\n if (Math.Abs(z - x) * t2 + t3 + Math.Abs(x - y) * t2 + t3 >= Math.Abs(x - y) * t1)\n {\n Console.WriteLine(\"YES\");\n }\n else\n {\n Console.WriteLine(\"NO\");\n }\n }\n }\n}", "lang": "Mono C#", "bug_code_uid": "83926a9200ed263980fbb399060dfa2a", "src_uid": "05cffd59b28b9e026ca3203718b2e6ca", "apr_id": "2ffe2918c72e802c6139cf84cd8b3b26", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9963476990504018, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "using System;\n\t\t\t\t\t\npublic class Program\n{\n\tpublic static void Main()\n\t{\n string line = Console.ReadLine();\n string[] parts = line.Split(new char[] {' '});\n int x = int.Parse(parts[0]);\n int y = int.Parse(parts[1]);\n int z = int.Parse(parts[2]);\n int t1 = int.Parse(parts[3]);\n int t2 = int.Parse(parts[4]);\n int t3 = int.Parse(parts[5]);\n if (Math.Abs(z - x) * t2 + t3 + Math.Abs(x - y) * t2 + t3 <= Math.Abs(x - y) * t1)\n {\n Console.WriteLine(\"YES\");\n }\n else\n {\n Console.WriteLine(\"NO\");\n }\n\t}\n}", "lang": "Mono C#", "bug_code_uid": "e3bb6a8f3570de22a406c381f280b4da", "src_uid": "05cffd59b28b9e026ca3203718b2e6ca", "apr_id": "2ffe2918c72e802c6139cf84cd8b3b26", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.9990291262135922, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "//// /\\/\\ __ _| |__ __ _ __| |_ _ \n//// / \\ / _` | '_ \\ / _` |/ _` | | | | Coder: Md. Mahady Hasan\n///// /\\/\\ | (_| | | | | (_| | (_| | |_| | Created: 11.11.2018\n////\\/ \\/\\__,_|_| |_|\\__,_|\\__,_|\\__, | Last-updated: 11.11.2018\n//// |___/ \n////===================================================================================\nusing System;\n\npublic class Program\n{\n public static void Main()\n {\n string[] tokens = Console.ReadLine().Split();\n int x = Convert.ToInt32(tokens[0]);\n int y = Convert.ToInt32(tokens[1]);\n int z = Convert.ToInt32(tokens[2]);\n int t1 = Convert.ToInt32(tokens[3]);\n int t2 = Convert.ToInt32(tokens[4]);\n int t3 = Convert.ToInt32(tokens[5]);\n int ans1 = Math.Abs(x - z) + Math.Abs(x - y);\n ans1 *= t2;\n ans1 += t3 * 2;\n int ans2 = Math.Abs(x - y) * t1;\n if (ans1 <= ans2) Console.WriteLine(\"YES\");\n else Console.WriteLine(\"NO\");\n }\n\n}", "lang": "Mono C#", "bug_code_uid": "7ccf4cf034febb90904142841f22db85", "src_uid": "05cffd59b28b9e026ca3203718b2e6ca", "apr_id": "b374ec51d4270d5d4c515ac4140aa97c", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9565826330532213, "equal_cnt": 6, "replace_cnt": 1, "delete_cnt": 2, "insert_cnt": 2, "fix_ops_cnt": 5, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.IO;\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[] input = Console.ReadLine().Split(' ');\n\n int x = Convert.ToInt32(input[0]); // номер на котором Маша\n int y = Convert.ToInt32(input[1]); // номер куда хочет Маша\n int z = Convert.ToInt32(input[2]); // номер на котором лифт\n int t1 = Convert.ToInt32(input[3]); // время за какое проходит между этажами\n int t2 = Convert.ToInt32(input[4]); // время за которое лифт проезжает между этажами\n int t3 = Convert.ToInt32(input[5]); // время, за которое открываются и закрываются двери у лифта\n\n // x y z t1 t2 t3\n // 5 1 4 4 2 1\n // YES\n\n // x - y = f\n // 5 - 1 = 4\n // f * t1\n // 4 * 4 = 16\n // 2x - z - y = f2\n // 10 - 4 - 1 = 5\n // (f2 * t2) + 2*t3\n // 5 * 2 + 2 = 12\n\n int f = Math.Abs(x - y);\n int d = f * t1;\n\n int f2 = Math.Abs(2 * x - y - z);\n int d2 = (f2 * t2) + 2 * t3;\n\n if (d2 < d)\n Console.WriteLine(\"YES\");\n else\n Console.WriteLine(\"NO\");\n\n }\n }\n}", "lang": "Mono C#", "bug_code_uid": "dc05bab7b44d5657459d193d84b9ebea", "src_uid": "05cffd59b28b9e026ca3203718b2e6ca", "apr_id": "d16d7c4d33b5a7bc1c79b5d37523c8ed", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "C#"} {"similarity_score": 0.9987980769230769, "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 Mailru_code\n{\n class Program\n {\n static void Main(string[] args)\n {\n string[] input = Console.ReadLine().Split();\n int x = Convert.ToInt32(input[0]);\n int y = Convert.ToInt32(input[1]);\n int z = Convert.ToInt32(input[2]);\n int t1 = Convert.ToInt32(input[3]);\n int t2 = Convert.ToInt32(input[4]);\n int t3 = Convert.ToInt32(input[5]);\n int elevator = Math.Abs(z - x) * t2 + t3 * 2 + Math.Abs(x-y)*t2;\n int stairs = Math.Abs(x - y) * t1;\n if(elevator<=stairs)\n Console.WriteLine(\"YES\");\n else\n Console.WriteLine(\"NO\");\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "1ac9682726320203fe94a4e1856c4334", "src_uid": "05cffd59b28b9e026ca3203718b2e6ca", "apr_id": "524d7c8ddee1718fb16b2e1a763784a0", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9596443228454172, "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 Elevator_or_Stairs\n{\n class Program\n {\n static void Main(string[] args)\n {\n //The only line contains six integers x, y, z, t1, t2, t3(1≤x, y, z, t1, t2, t3≤1000) — \n //the floor Masha is at, the floor Masha wants to get to, the floor the elevator is located on, \n //the time it takes Masha to pass between two floors by stairs, the time it takes the elevator to \n // pass between two floors and the time it takes for the elevator to close or open the doors.\n int[] input = Console.ReadLine().Split(' ').Select(int.Parse).ToArray();\n int currentFloor = input[0];\n int floorToGet = input[1];\n int floorWhereElevatorIs = input[2];\n int timeTakeStairesPerFloor = input[3];\n int timeTakeElevatorPerFloor = input[4];\n int timeManageDoor = input[5];\n\n int timeFoot = timeTakeStairesPerFloor * Math.Abs(floorToGet - currentFloor);\n int timeElevator = timeTakeElevatorPerFloor * Math.Abs(currentFloor - floorWhereElevatorIs) +\n timeTakeElevatorPerFloor * Math.Abs(floorToGet - currentFloor) + timeManageDoor;\n\n if (Math.Abs(currentFloor - floorWhereElevatorIs) > 1)\n timeElevator += 2 * timeManageDoor;\n\n Console.WriteLine(timeElevator <= timeFoot ? \"YES\" : \"NO\");\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "26b3face29f6199cd2f14b113c0afc69", "src_uid": "05cffd59b28b9e026ca3203718b2e6ca", "apr_id": "42259e9fa43f561bfe01719a1dc74bb8", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9711934156378601, "equal_cnt": 5, "replace_cnt": 1, "delete_cnt": 2, "insert_cnt": 1, "fix_ops_cnt": 4, "bug_source_code": "using System;\n\nnamespace mail\n{\n class Program\n {\n static void Main(string[] args)\n {\n string[] s1 = Console.ReadLine().Split(' ');\n int x = int.Parse(s1[0]);\n int y = int.Parse(s1[1]);\n int z = int.Parse(s1[2]);\n int t1 = int.Parse(s1[3]);\n int t2= int.Parse(s1[4]);\n int t3 = int.Parse(s1[5]);\n\n int rxy;\n if (x > y) rxy = x - y;\n else rxy = y - x;\n\n int rxz;\n if (x > z) rxz=x - z;\n else rxz=z - x;\n\n if (rxy * t1 > rxz * t2 + t3 * 3 + rxy * t2) Console.WriteLine(\"YES\");\n else Console.WriteLine(\"NO\");\n\n Console.ReadLine();\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "3fac39c718ce6294011d37c16c02d6ae", "src_uid": "05cffd59b28b9e026ca3203718b2e6ca", "apr_id": "e3628b1b36c8ba8c75e61154ffd518a4", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "C#"} {"similarity_score": 0.9988465974625144, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "using System;\nusing System.Collections;\nusing System.Linq;\nusing System.Text;\n\n\n\nnamespace ConsoleApp1\n{\n\t\n static class Program\n {\n\t\tstatic double _With_lift(int start,int end,int position,int timerun,int timeopen)\n\t\t{\n\t\t\tint result = timerun * (Math.Abs(position - start)) + timeopen * 3 + timerun * ( Math.Abs(start - end) );\n\t\t\treturn result;\n\t\t}\n\t\tstatic double _With_lift( int start , int end , int timerun )\n\t\t{\n\t\t\treturn (Math.Abs( start - end )) * timerun;\n\t\t}\n\t\tstatic void Main(string[] args)\n {\n\t\t\tint[] _values = Console.ReadLine().Split(' ').Select(int.Parse).ToArray();\n\t\t\tdouble a = _With_lift(_values[0] , _values[1] , _values[2] , _values[4] , _values[5]);\n\t\t\tdouble b = _With_lift(_values[0] , _values[1] , _values[3]);\n\t\t\tif (a< b)\n\t\t\t\tConsole.WriteLine(\"YES\");\n\t\t\telse\n\t\t\t\tConsole.WriteLine(\"NO\");\n\t\t\tConsole.ReadLine();\n\t\t}\n\t}\n}\n", "lang": "Mono C#", "bug_code_uid": "379cebf14aea19dfca0b3d87ade8bed6", "src_uid": "05cffd59b28b9e026ca3203718b2e6ca", "apr_id": "9cc8d1bbcbf6a65635f42af50e7f507c", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.9817024661893397, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 0, "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 ConsoleApp6\n{\n class Program\n {\n static void Main(string[] args)\n {\n var inputStr = Console.ReadLine();\n var values = inputStr.Split(' ').Select(x=>int.Parse(x)).ToList();\n var a = Math.Abs(values[0] - values[1]);\n Console.WriteLine(((Math.Abs(values[0] - values[2])) * values[4] + a * values[4] +\n 2 * values[5])<= (a * values[3]) ? \"YES\" : \"NO\");\n Console.ReadLine();\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "e2f1d3ba68c9c97fd0bd16c2185ba420", "src_uid": "05cffd59b28b9e026ca3203718b2e6ca", "apr_id": "1042975074352979cad05231c46a1f5b", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.9995728321230244, "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.IO;\n//using System.Text;\n//using System.Text.RegularExpressions;\n//using System.Globalization;\n//using System.Diagnostics;\nusing static System.Console;\n//using System.Numerics;\n//using static System.Math;\n//using pair = Pair;\n\nclass Program\n{\n static void Main()\n {\n //SetOut(new StreamWriter(OpenStandardOutput()) { AutoFlush = false });\n new Program().solve();\n Out.Flush();\n }\n readonly Scanner cin = new Scanner();\n readonly int[] dd = { 0, 1, 0, -1, 0 }; //→↓←↑\n readonly int mod = 1000000007;\n void chmax(ref T a, T b) where T : IComparable { a = a.CompareTo(b) < 0 ? b : a; }\n void chmin(ref T a, T b) where T : IComparable { a = a.CompareTo(b) < 0 ? a : b; }\n\n void solve()\n {\n int x = cin.nextint;\n int y = cin.nextint;\n int z = cin.nextint;\n int t1 = cin.nextint;\n int t2 = cin.nextint;\n int t3 = cin.nextint;\n\n\n int ele = Math.Abs(z - x) * t2 + t3 * 2 + Math.Abs(y - x) * t2;\n int st = Math.Abs(x - y) * t1;\n\n //WriteLine(ele + \" \" + st);\n if (st < ele)\n {\n WriteLine(\"NO\");\n }\n else\n {\n WriteLine(\"YES\");\n }\n }\n\n}\n\nclass Scanner\n{\n string[] s; int i;\n readonly char[] cs = new char[] { ' ' };\n public Scanner() { s = new string[0]; i = 0; }\n public string[] scan { get { return ReadLine().Split(); } }\n public int[] scanint { get { return Array.ConvertAll(scan, int.Parse); } }\n public long[] scanlong { get { return Array.ConvertAll(scan, long.Parse); } }\n public double[] scandouble { get { return Array.ConvertAll(scan, double.Parse); } }\n public string next\n {\n get\n {\n if (i < s.Length) return s[i++];\n string st = ReadLine();\n while (st == \"\") st = ReadLine();\n s = st.Split(cs, StringSplitOptions.RemoveEmptyEntries);\n i = 0;\n return next;\n }\n }\n public int nextint { get { return int.Parse(next); } }\n public long nextlong { get { return long.Parse(next); } }\n public double nextdouble { get { return double.Parse(next); } }\n public string join(IEnumerable values) { return string.Join(\" \", values); }\n}", "lang": "Mono C#", "bug_code_uid": "5cdc17dd0f39234cf631af6b362aa920", "src_uid": "05cffd59b28b9e026ca3203718b2e6ca", "apr_id": "3fafb4ceeb8842d7189f0d548f1e017d", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9971477467199087, "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 main\n {\n static void printL(string s = \"\")\n {\n Console.WriteLine(s);\n }\n static void printL(int s)\n {\n Console.WriteLine(s);\n }\n\n static void Main(string[] args)\n {\n string s = Console.ReadLine();\n int[] a = s.Split(' ').Select(int.Parse).ToArray();\n int x = a[0], y = a[1], z = a[2], t1 = a[3], t2 = a[4], t3 = a[5];\n int te = 0, ts = 0;\n ts = Math.Abs(y - x) * t1;\n te = Math.Abs(z - x) * t2 + 3 * t3 + Math.Abs(x - y);\n if (te <= ts)\n printL(\"YES\");\n else\n printL(\"NO\");\n\n //Console.ReadKey();\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "1ffd6ad0ef649dc9ce554ddcce53c93f", "src_uid": "05cffd59b28b9e026ca3203718b2e6ca", "apr_id": "dd97a73c6d8ea1ade8f407fdacacc556", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.9970238095238095, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 3, "bug_source_code": "/*\n * Создано в SharpDevelop.\n * Пользователь: Nours\n * Дата: 18.10.2018\n * Время: 22:09\n * \n * Для изменения этого шаблона используйте меню \"Инструменты | Параметры | Кодирование | Стандартные заголовки\".\n */\nusing System;\n\nnamespace MailCup1A\n{\n\tclass Program\n\t{\n\t\tpublic static void Main(string[] args)\n\t\t{\n\t\t\tstring[] a=Console.ReadLine().Split();\n\t\t\t\n\t\t\tif((Math.Abs(Convert.ToInt32(a[2])-Convert.ToInt32(a[0]))*Math.Abs(Convert.ToInt32(a[0])-Convert.ToInt32(a[1]))*Convert.ToInt32(a[4])+3*Convert.ToInt32(a[5]))<=Math.Abs(Convert.ToInt32(a[1])-Convert.ToInt32(a[0]))*Convert.ToInt32(a[3]))\n\t\t\t\tConsole.WriteLine(\"YES\");\n\t\t\telse\n\t\t\t\tConsole.WriteLine(\"NO\");\n\t\t}\n\t}\n}", "lang": "Mono C#", "bug_code_uid": "152ea92873b6467eb48465e9b0767f31", "src_uid": "05cffd59b28b9e026ca3203718b2e6ca", "apr_id": "75f2a3ec35457ea8658695e8d6f88bb8", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.6268656716417911, "equal_cnt": 14, "replace_cnt": 10, "delete_cnt": 0, "insert_cnt": 4, "fix_ops_cnt": 14, "bug_source_code": "namespace MailCup1A\n{\n class Program\n {\n public static void Main(string[] args)\n {\n string[] a=Console.ReadLine().Split();\n if((Math.Abs(Convert.ToInt32(a[2])-Convert.ToInt32(a[1]))*Convert.ToInt32(a[4])+3*Convert.ToInt32(a[5]))<=Math.Abs(Convert.ToInt32(a[1])-Convert.ToInt32(a[0]))*Convert.ToInt32(a[3]))\n Console.WriteLine(\"YES\");\n else\n Console.WriteLine(\"NO\");\n }\n }\n}", "lang": "Mono C#", "bug_code_uid": "f6eedc2b960a8f0817472a8175c060ae", "src_uid": "05cffd59b28b9e026ca3203718b2e6ca", "apr_id": "75f2a3ec35457ea8658695e8d6f88bb8", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9932683060860008, "equal_cnt": 5, "replace_cnt": 2, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 4, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Globalization;\nusing System.IO;\nusing System.Linq;\nusing System.Text;\n\nclass Program\n{\n public static void Main(string[] args)\n {\n PushTestData(@\"\n5 1 4 4 2 1\nYES\n1 6 6 2 1 1\nNO\n4 1 7 4 1 2\nYES\n\n\n\n\n\n\n\");\n\n var x = RL();\n var y = RL();\n var z = RL();\n var t1 = RL();\n var t2 = RL();\n var t3 = RL();\n\n var lift = t2 * (Math.Abs(z - x) + Math.Abs(y - x)) + t3 * 3;\n var walk = t1 * Math.Abs(x - y);\n if (walk > lift)\n Console.WriteLine(\"YES\");\n else\n Console.WriteLine(\"NO\");\n }\n\n private const int Mod = 1000000000 + 7;\n\n #region Data Read\n\n private static int GCD(int a, int b)\n {\n if (a % b == 0) return b;\n return GCD(b, a % b);\n }\n\n private static List[] ReadTree(int n)\n {\n return ReadGraph(n, n - 1);\n }\n\n private static List[] ReadGraph(int n, int m)\n {\n List[] g = new List[n];\n for (int i = 0; i < g.Length; i++) g[i] = new List();\n for (int i = 0; i < m; i++)\n {\n int a = RI() - 1;\n int b = RI() - 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 = RI();\n int b = RI();\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 RI()\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 RUL()\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 RL()\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[] RIA(int n)\n {\n int[] ans = new int[n];\n for (int i = 0; i < n; i++)\n ans[i] = RI();\n return ans;\n }\n\n private static long[] RLA(int n)\n {\n long[] ans = new long[n];\n for (int i = 0; i < n; i++)\n ans[i] = RL();\n return ans;\n }\n\n private static char[] ReadWord()\n {\n int ans;\n\n do\n {\n ans = consoleReader.Read();\n } while (!((ans >= 'a' && ans <= 'z') || (ans >= 'A' && ans <= 'Z') || (ans == '*')));\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') || (ans == '*'));\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[] ReadStringLine()\n {\n int ans;\n\n do\n {\n ans = consoleReader.Read();\n } while (ans == 10 || ans == 13);\n\n List s = new List();\n\n do\n {\n s.Add((char)ans);\n ans = consoleReader.Read();\n } while (ans != 10 && ans != 13 && ans != -1);\n\n return s.ToArray();\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 private static char ReadNonLetter()\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 ReadAnyOf(IEnumerable allowed)\n {\n while (true)\n {\n char ans = (char)consoleReader.Read();\n if (allowed.Contains(ans))\n return 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 private static double DoubleFromString(string x)\n {\n return double.Parse(x, 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(StringBuilder sb)\n {\n PushTestData(sb.ToString());\n }\n private static void PushTestData(string data)\n {\n#if TOLYAN_TEST\n if (testData == null)\n {\n testData = new MemoryStream();\n consoleReader = new StreamReader(testData);\n }\n\n var pos = testData.Length;\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 #endregion\n}\n", "lang": "Mono C#", "bug_code_uid": "6ce862faba8ef54b7bfb31c1c703c859", "src_uid": "05cffd59b28b9e026ca3203718b2e6ca", "apr_id": "d005cf5a3dd3dad8c8c7bd029c088299", "difficulty": 800, "tags": ["implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9992605373428641, "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;\n\nnamespace prog2\n{\n class Program\n {\n static void Main(string[] args)\n {\n int n = Convert.ToInt32(Console.ReadLine());\n bool[,] map = new bool[5,5];\n for (int i = 0; i < n;i++ )\n {\n string[] ss = Console.ReadLine().Split(' ');\n map[Convert.ToInt32(ss[0])-1, Convert.ToInt32(ss[1])-1] = true;\n map[Convert.ToInt32(ss[1])-1, Convert.ToInt32(ss[0])-1] = true;\n }\n bool flag = false;\n for (int i = 0; i < 5;i++ )\n {\n for (int j=0;j<4;j++)\n if (map[i,j])\n {\n for(int q=j+1;q<5;q++)\n if ((map[i,q]) && (map[q,j]))\n {\n flag = true;\n break;\n }\n if (flag) break;\n }\n if (flag) break;\n }\n if (!flag)\n {\n map[0, 0] = true;\n map[1, 1] = true;\n map[2, 2] = true;\n map[3, 3] = true;\n map[4, 4] = true;\n for (int i = 0; i < 5; i++)\n {\n for (int j = 0; j < 4; j++)\n if (!map[i, j])\n {\n for (int q = j + 1; q < 5; q++)\n if ((!map[i, q]) && (!map[q, j]))\n {\n flag = true;\n break;\n }\n if (flag) break;\n }\n if (flag) break;\n } \n }\n if (flag) Console.WriteLine(\"WIN\"); else Console.WriteLine(\"FALSE\");\n }\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "aa2daf1962b75749c518a7dffbf1349d", "src_uid": "2bc18799c85ecaba87564a86a94e0322", "apr_id": "70adb36c5113b7f935d849889061ed10", "difficulty": 1300, "tags": ["graphs", "math", "implementation"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "delete", "lang_cluster": "C#"} {"similarity_score": 0.9554140127388535, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\n\nclass Program\n{\n static int Main()\n {\n //citire\n string[] citire = Console.ReadLine().Split(' ');\n int x, N, y, i = 0;\n x = Convert.ToInt32(citire[0]);\n citire = Console.ReadLine().Split(' ');\n N = Convert.ToInt32(citire[0]); y = x;\n\n //solve\n while (y <= N)\n {\n if (y == N) { Console.WriteLine(\"YES\"); Console.WriteLine(i); return 0; }\n y *= x; i++;\n }\n\n Console.WriteLine(\"NO\");\n return 0;\n }\n}\n", "lang": "Mono C#", "bug_code_uid": "8eb74f2a17eecc86f3345f15c5e631f3", "src_uid": "8ce89b754aa4080e7c3b2c3b10f4be46", "apr_id": "ff90e60d425e4fcdf5d6bef0a608ed7e", "difficulty": 1000, "tags": ["math"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.45770567786790267, "equal_cnt": 34, "replace_cnt": 25, "delete_cnt": 0, "insert_cnt": 8, "fix_ops_cnt": 33, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace ConsoleApp21\n{\n class Program\n {\n static void Main(string[] args)\n {\n int k = Convert.ToInt32(Console.ReadLine());\n int l = Convert.ToInt32(Console.ReadLine());\n int pow = k;\n int count = 0;\n \n\n \n while (l>pow)\n {\n pow *= k;\n count++;\n if (pow == l)\n {\n Console.WriteLine(\"YES\");\n Console.WriteLine(count);\n }\n\n\n else if (pow > l)\n {\n Console.WriteLine(\"NO\");\n }\n }\n if (pow == l)\n {\n Console.WriteLine(\"YES\");\n Console.WriteLine(count);\n }\n Console.ReadKey();\n\n\n\n }\n }\n}", "lang": "Mono C#", "bug_code_uid": "cb6e19c18f6b1e30ca002cdcdfc4f514", "src_uid": "8ce89b754aa4080e7c3b2c3b10f4be46", "apr_id": "546bb17136ffc654c1f35181ac643b68", "difficulty": 1000, "tags": ["math"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9993247805536799, "equal_cnt": 1, "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; \nusing System.Text; \nusing System.Threading.Tasks; \n\nnamespace Cifera_Mark_0 \n{ \nclass Program \n{ \n\nstatic void Main(string[] args) \n{ \nint number = Int32.Parse(Console.ReadLine()); \nint power = Int32.Parse(Console.ReadLine()); \nint count = 0; \nif (power != number && power % number == 0) \n{ \ndo \n{ \npower /= number; \nif (power % number == 0) \ncount++; \nelse \n{ \ncount = 0; \nbreak; \n} \n} \nwhile (power > number); \nif (count > 0) \n{ \nConsole.WriteLine(\"YES\"); \nConsole.WriteLine(count); \n} \nelse Console.WriteLine(\"NO\"); \n} \nelse if (power == number) \n{ \nConsole.WriteLine(\"YES\"); \nConsole.WriteLine(count); \n} \nelse Console.WriteLine(\"NO\"); \nConsole.ReadLine(); \n\n} \n} \n}.", "lang": "Mono C#", "bug_code_uid": "73be8b60d340e7adfa3434ee3ca7fb0c", "src_uid": "8ce89b754aa4080e7c3b2c3b10f4be46", "apr_id": "546bb17136ffc654c1f35181ac643b68", "difficulty": 1000, "tags": ["math"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C#"} {"similarity_score": 0.9072741806554756, "equal_cnt": 28, "replace_cnt": 9, "delete_cnt": 16, "insert_cnt": 2, "fix_ops_cnt": 27, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace ConsoleApp21\n{\n class Program\n {\n static void Main(string[] args)\n {\n int a = Convert.ToInt32(Console.ReadLine());\n int l = Convert.ToInt32(Console.ReadLine());\n int pow = k;\n int count = 0;\n\n if (l != a && l % a == 0)\n {\n do\n {\n l /= a;\n if (l % a == 0)\n \n count++;\n \n else\n {\n count = 0;\n break;\n }\n\n }\n while (l > a);\n \n if (count > 0)\n {\n Console.WriteLine(\"YES\");\n Console.WriteLine(count);\n }\n else Console.WriteLine(\"NO\");\n \n }\n\n else if (l == a)\n {\n Console.WriteLine(\"YES\");\n Console.WriteLine(count);\n }\n else Console.WriteLine(\"NO\");\n Console.ReadKey();\n \n }\n\n }\n }", "lang": "Mono C#", "bug_code_uid": "b82da491e9438277d62751907dd158d8", "src_uid": "8ce89b754aa4080e7c3b2c3b10f4be46", "apr_id": "546bb17136ffc654c1f35181ac643b68", "difficulty": 1000, "tags": ["math"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "delete", "lang_cluster": "C#"} {"similarity_score": 0.9959514170040485, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace Task2\n{\n class Program\n {\n static void Main()\n {\n int k = int.Parse(Console.ReadLine());\n int l = int.Parse(Console.ReadLine());\n int i = 0, number = k;\n\n do\n {\n if (number == l)\n {\n Console.WriteLine(\"YES\\n\" + i);\n break;\n }\n else\n {\n i++;\n number *= k;\n }\n\n if (number > l)\n {\n Console.WriteLine(\"NO\");\n break;\n }\n }\n while (number <= l);\n\n Console.ReadLine();\n }\n }\n}", "lang": "Mono C#", "bug_code_uid": "63ccd5b05224c421670c280a61db17c5", "src_uid": "8ce89b754aa4080e7c3b2c3b10f4be46", "apr_id": "173b35fd4ab081a889a82591da06335b", "difficulty": 1000, "tags": ["math"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.2635046113306983, "equal_cnt": 16, "replace_cnt": 7, "delete_cnt": 5, "insert_cnt": 5, "fix_ops_cnt": 17, "bug_source_code": "long k = long.Parse(Console.ReadLine());\n long l = long.Parse(Console.ReadLine());\n\n\n int count = 0;\n for(long r = l;;r/=k)\n {\n \n count =++count;\n \n if(r%k!=0||r ReadArrInt32 = () => Console.ReadLine().Split(spaceCharArray).Select(int.Parse).ToArray();\n static readonly Func ReadArrInt64 = () => Console.ReadLine().Split(spaceCharArray).Select(long.Parse).ToArray();\n static readonly Func ReadArrDouble = () => Console.ReadLine().Split(spaceCharArray).Select(double.Parse).ToArray();\n\n static void Main()\n {\n var data = ReadArrInt64();\n long n = data[0], a = data[1], b = data[2], p = data[3], q = data[4], nok = 0;\n long answer = (n / a) * p + (n / b) * q;\n for (int i = 1; i <= n / b; i++)\n if ((b * i) % a == 0)\n {\n nok = b * i;\n break;\n }\n if (nok != 0)\n if (p > q)\n {\n answer -= (n / nok) * q;\n }\n else\n {\n answer -= (n / nok) * p;\n }\n Console.WriteLine(answer);\n }\n }\n}", "lang": "MS C#", "bug_code_uid": "73ac4910063375eca2b74c8b938d4cab", "src_uid": "35d8a9f0d5b5ab22929ec050b55ec769", "apr_id": "6bc992098033d80de423cc097b9eadf6", "difficulty": 1600, "tags": ["number theory", "math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.7655284552845528, "equal_cnt": 14, "replace_cnt": 11, "delete_cnt": 1, "insert_cnt": 1, "fix_ops_cnt": 13, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.IO;\n\nnamespace ConsoleApplication1\n{\n\tclass Program\n\t{\n\t\tstatic void Main(string[] args)\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\tMain main = new Main();\n\t\t\t\tmain.ReadData();\n\t\t\t\tmain.Process();\n\t\t\t\tmain.WriteAnswer();\n\t\t\t}\n\t\t\tcatch (Exception e)\n\t\t\t{\n\t\t\t\tConsole.WriteLine(e);\n\t\t\t}\n\t\t}\n\t}\n\n\tclass Main\n\t{\n\t\tprivate long _result;\n\t\tprivate long _n;\n\t\tprivate long _a;\n\t\tprivate long _b;\n\t\tprivate long _p;\n\t\tprivate long _q;\n\n\t\tpublic void Process()\n\t\t{\n\t\t\tlong min = Math.Min(_p, _q);\n\n\n\t\t\tlong la = _n / _a;\n\t\t\tlong sa = la*_p;\n\n\t\t\tlong lb = _n / _b;\n\t\t\tlong sb = lb * _q;\n\n\t\t\t_result = sb + sa;\n\n\n\t\t\tlong step = Math.Max(_a, _b);\n\t\t\tint i = 0;\n\t\t\twhile (true)\n\t\t\t{\n\t\t\t\ti++;\n\t\t\t\tlong j = step*i;\n\t\t\t\tif (j <= _n)\n\t\t\t\t{\n\t\t\t\t\tif (j%_a == 0 && j%_b == 0)\n\t\t\t\t\t{\n\t\t\t\t\t\t_result -= (min);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t//_result = _y;\n\t\t}\n\n\n\t\tpublic void ReadData()\n\t\t{\n\t\t\tTextReader textReader = Console.In;\n\t\t\t//TextReader textReader = new StreamReader(\"input.txt\");\n\t\t\tusing (TextReader reader = textReader)\n\t\t\t{\n\t\t\t\tstring readLine = reader.ReadLine();\n\t\t\t\tstring[] strings = readLine.Split(' ');\n\n\t\t\t\t_n = long.Parse(strings[0]);\n\t\t\t\t_a = long.Parse(strings[1]);\n\t\t\t\t_b = long.Parse(strings[2]);\n\t\t\t\t_p = long.Parse(strings[3]);\n\t\t\t\t_q = long.Parse(strings[4]);\n\t\t\t\t \n\t\t\t}\n\t\t}\n\n\t\tpublic void WriteAnswer()\n\t\t{\n\t\t\tusing (TextWriter writer = Console.Out)\n\t\t\t{\n\t\t\t\twriter.WriteLine(_result);\n\t\t\t}\n\t\t}\n\t}\n}\n", "lang": "MS C#", "bug_code_uid": "de0334087c2e8201ff766d25272e1fba", "src_uid": "35d8a9f0d5b5ab22929ec050b55ec769", "apr_id": "f4f81ec6b01a8cd5bd62b0732726da77", "difficulty": 1600, "tags": ["number theory", "math", "implementation"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.13015968665260622, "equal_cnt": 79, "replace_cnt": 50, "delete_cnt": 17, "insert_cnt": 11, "fix_ops_cnt": 78, "bug_source_code": "/*C. Несправедливый опрос\n\nНа уроке литературы Серёжа заметил чудовищную несправедливость, ему кажется, что некоторых учеников спрашивают чаще чем других.\n\nРассадка в классе представляет собой прямоугольник, в котором n рядов по m учащихся в каждом.\n\nУчительница опрашивает учеников в следующем порядке: сначала она спрашивает всех учеников с первого\n ряда в порядке их рассадки на ряду, после опроса всех учеников на очередном ряду она переходит к следующему, \n по порядку следования опроса, ряду. Если учительница опросила последний ряд, то направление опроса сменяется, \n то есть опрашивается предыдущий ряд. Порядок опроса рядов выглядит следующим образом:\n 1-й ряд, 2-й ряд, ..., n - 1-й ряд, n-й ряд, n - 1-й ряд, ..., 2-й ряд, 1-й ряд, 2-й ряд, ...\n\nПорядок опроса учеников на одном ряду всегда один и тот же: 1-й ученик, 2-й ученик, ..., m-й ученик.\n\nЗа урок учительница успела опросить ровно k вопросов у учеников в порядке описанном выше. \n Серёжа сидит в x-м ряду, на y-м по порядку месте. Сергей решил доказать учителю,\n что ученики опрашиваются неравномерно, помогите ему вычислить три величины:\n\nмаксимальное количество вопросов, заданных одному из учеников,\nминимальное количество вопросов, заданных одному из учеников,\nсколько раз учительница спросила Серёжу.\nЕсли в классе только один ряд, то учительница всегда опрашивает детей с него.\n\nВходные данные\nПервая и единственная строка содержит пять целых чисел n, m, k, x и y (1 ≤ n, m ≤ 100, 1 ≤ k ≤ 1018, 1 ≤ x ≤ n, 1 ≤ y ≤ m).\n\nВыходные данные\nВыведите три числа:\n\nмаксимальное количество вопросов, заданных одному из учеников,\nминимальное количество вопросов, заданных одному из учеников,\nсколько раз учительница спросила Серёжу.*/\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace NespravedliviyOpros758C\n{\n class Program\n {\n static void Main(string[] args)\n {\n Console.Write(\"Введите количество рядов: \");\n int n = int.Parse(Console.ReadLine());\n\n Console.Write(\"Введите количество учащихся в ряде: \");\n int m = int.Parse(Console.ReadLine());\n\n Console.Write(\"Введите количество вопросов: \");\n long k = long.Parse(Console.ReadLine()); \n\n Console.Write(\"В каком ряду сидит Сережа: \");\n int x = int.Parse(Console.ReadLine());\n\n Console.Write(\"На каком по порядку месте сидит Сережа: \");\n int y = int.Parse(Console.ReadLine());\n \n //Создаем массив\n int[,] r = new int[n, m];\n\n int kol=0,p=1,i=0,j=0;\n\n //Если всего 1 ряд, то i не будет изменяться (i+p == i) не меняется\n if (n==1) {p=0;}\n\n //Прогоняем ситуацию в цикле\n do\n {\n j=0; //ряды\n do\n { \n r[i, j] += 1;//задали вопрос\n kol += 1;//количество вопросов заданных вопросов изменилосьт на 1\n j += 1;\n } while (kol != k && j != m); //Цикл продолжается пока количество вопросов не равно к и не опрошены все ученики в данном ряду.\n i+=p;\n if (i==n-1) {p*=-1;} // Если последний ряд, то идем в обратную сторону\n if (i == 0) { p *= -1; } // Если вернулись на первый ряд опять меняем направление\n } while (kol!=k);\n\n int max = r[0,0]; //Максимальное количество вопросов, заданных одному ученику.\n int min = r[0,0];//Минимальное количество вопросов, заданных одному ученику.\n\n //Проверяем у какого ученика меньше всего и больше всего вопросов\n\n for (i=0; i max) {max=r[i,j] ;}\n if (r[i, j] < min) { min = r[i, j]; }\n }\n\n }\n\n Console.WriteLine(\"Максимальнок количество вопросов {0}\", max);\n\n Console.WriteLine(\"Минимальное количество вопросов {0}\", min);\n\n Console.WriteLine(\"Учительница спросила сережу {0} раз\", r[x-1,y-1]);\n Console.ReadLine();\n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "a08552b2e42914a2b53bc12b91d93269", "src_uid": "e61debcad37eaa9a6e21d7a2122b8b21", "apr_id": "86c6859cc018e5a527e7a69ec60aa0b7", "difficulty": 1700, "tags": ["math", "constructive algorithms", "implementation", "binary search"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.31792273590880304, "equal_cnt": 47, "replace_cnt": 27, "delete_cnt": 5, "insert_cnt": 14, "fix_ops_cnt": 46, "bug_source_code": "/*C. Несправедливый опрос\n\nНа уроке литературы Серёжа заметил чудовищную несправедливость, ему кажется, что некоторых учеников спрашивают чаще чем других.\n\nРассадка в классе представляет собой прямоугольник, в котором n рядов по m учащихся в каждом.\n\nУчительница опрашивает учеников в следующем порядке: сначала она спрашивает всех учеников с первого\n ряда в порядке их рассадки на ряду, после опроса всех учеников на очередном ряду она переходит к следующему, \n по порядку следования опроса, ряду. Если учительница опросила последний ряд, то направление опроса сменяется, \n то есть опрашивается предыдущий ряд. Порядок опроса рядов выглядит следующим образом:\n 1-й ряд, 2-й ряд, ..., n - 1-й ряд, n-й ряд, n - 1-й ряд, ..., 2-й ряд, 1-й ряд, 2-й ряд, ...\n\nПорядок опроса учеников на одном ряду всегда один и тот же: 1-й ученик, 2-й ученик, ..., m-й ученик.\n\nЗа урок учительница успела опросить ровно k вопросов у учеников в порядке описанном выше. \n Серёжа сидит в x-м ряду, на y-м по порядку месте. Сергей решил доказать учителю,\n что ученики опрашиваются неравномерно, помогите ему вычислить три величины:\n\nмаксимальное количество вопросов, заданных одному из учеников,\nминимальное количество вопросов, заданных одному из учеников,\nсколько раз учительница спросила Серёжу.\nЕсли в классе только один ряд, то учительница всегда опрашивает детей с него.\n\nВходные данные\nПервая и единственная строка содержит пять целых чисел n, m, k, x и y (1 ≤ n, m ≤ 100, 1 ≤ k ≤ 1018, 1 ≤ x ≤ n, 1 ≤ y ≤ m).\n\nВыходные данные\nВыведите три числа:\n\nмаксимальное количество вопросов, заданных одному из учеников,\nминимальное количество вопросов, заданных одному из учеников,\nсколько раз учительница спросила Серёжу.*/\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace NespravedliviyOpros758C\n{\n class Program\n {\n static void Main(string[] args)\n {\n string vh = Console.ReadLine();\n string[] t = vh.Split(' ');\n \n int n = int.Parse(t[0]);\n\n int m = int.Parse(t[1]);\n\n //Введите количество вопросов:\n long k = long.Parse(t[2]); \n\n //В каком ряду сидит Сережа:\n int x = int.Parse(t[3]);\n\n //На каком по порядку месте сидит Сережа:\n int y = int.Parse(t[4]);\n \n //Создаем массив\n int[,] r = new int[n, m];\n\n int kol=0,p=1,i=0,j=0;\n\n //Если всего 1 ряд, то i не будет изменяться (i+p == i) не меняется\n if (n==1) {p=0;}\n\n //Прогоняем ситуацию в цикле\n do\n {\n j=0; //ряды\n do\n { \n r[i, j] += 1;//задали вопрос\n kol += 1;//количество вопросов заданных вопросов изменилосьт на 1\n j += 1;\n } while (kol != k && j != m); //Цикл продолжается пока количество вопросов не равно к и не опрошены все ученики в данном ряду.\n i+=p;\n if (i==n-1) {p*=-1;} // Если последний ряд, то идем в обратную сторону\n if (i == 0) { p *= -1; } // Если вернулись на первый ряд опять меняем направление\n } while (kol!=k);\n\n int max = r[0,0]; //Максимальное количество вопросов, заданных одному ученику.\n int min = r[0,0];//Минимальное количество вопросов, заданных одному ученику.\n\n //Проверяем у какого ученика меньше всего и больше всего вопросов\n\n for (i=0; i max) {max=r[i,j] ;}\n if (r[i, j] < min) { min = r[i, j]; }\n }\n\n }\n\n \n\n Console.WriteLine(\"{0} {1} {2}\", max, min, r[x-1,y-1]);\n\n \n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "dd7eb2b2c0d04b2a863cb12193217349", "src_uid": "e61debcad37eaa9a6e21d7a2122b8b21", "apr_id": "86c6859cc018e5a527e7a69ec60aa0b7", "difficulty": 1700, "tags": ["math", "constructive algorithms", "implementation", "binary search"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9995607484845823, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "//#define FILE_INPUT\nusing System;\nusing System.Collections.Generic;\nusing System.Text;\n//using System.Text.RegularExpressions;\nusing System.Linq;\n//using System.Collections;\n//using System.Collections.Specialized;\n//using System.Numerics;\n\n//94A. Восстановление пароля\n\nnamespace CodeForces\n{\n\n class Solution\n {\n static void Main()\n {\n new Solution().solve();\n Pause();\n }\n\n void solve()\n {\n string s = cin.Line();\n Dictionary m = new Dictionary();\n\n for (int i = 0; i < 10; i++)\n {\n m.Add(cin.Line(), i);\n }\n\n for (int i = 0; i < 8; i++)\n {\n Console.Write(m[s.Substring(i, 10)]);\n }\n\n Console.WriteLine();\n }\n\n #region Tools\n\n [System.Diagnostics.Conditional(\"DEBUG\")]\n static private void DebugOut(string format, T arg)\n {\n Console.WriteLine(format, arg);\n }\n\n [System.Diagnostics.Conditional(\"DEBUG\")]\n static private void DebugOut(string format, params object[] arg)\n {\n Console.WriteLine(format, arg);\n }\n\n [System.Diagnostics.Conditional(\"DEBUG\")]\n static private void DebugStop()\n {\n Console.ReadKey(true);\n }\n\n private static T[] ga(int n, Func f)\n {\n var a = new T[n];\n for (int i = 0; i < n; ++i) a[i] = f(i);\n return a;\n }\n\n private static T[] ga(int n, Func f)\n {\n var a = new T[n];\n for (int i = 0; i < n; ++i) a[i] = f();\n return a;\n }\n\n private static int gi()\n { return cin.gi(); }\n\n private static List gl(int n, Func f)\n {\n var a = new List(n + 1);\n for (int i = 0; i < n; ++i) a.Add(f(i));\n return a;\n }\n\n [System.Diagnostics.Conditional(\"DEBUG\")]\n static private void Pause()\n {\n Console.WriteLine(\"[debug]\");\n Console.ReadKey(true);\n }\n private static void swap(ref T a, ref T b)\n {\n T t = a; a = b; b = t;\n }\n\n #endregion Tools\n }\n\n class cin\n {\n public static int error { get; set; }\n\n static cin()\n {\n#if (ONLINE_JUDGE || !FILE_INPUT)\n reader = new System.IO.BufferedStream(Console.OpenStandardInput(1024 * 10), 1024 * 10);\n#else\n reader = new System.IO.BufferedStream((new System.IO.StreamReader(\"input.txt\")).BaseStream, 1024 * 16);\n#endif\n }\n\n public static System.IO.BufferedStream reader { get; private set; }\n public static char Char() { return (char)reader.ReadByte(); }\n\n public static int gi()\n {\n for (int c = read(); c != -1; c = read())\n {\n switch ((char)c)\n {\n case '-':\n return -(int)gu(read());\n\n default:\n if (char.IsDigit((char)c)) return (int)gu(c);\n break;\n }\n }\n\n throw new System.IO.IOException();\n }\n\n public static uint gu()\n {\n return gu(read());\n }\n\n public static string Line()\n {\n int c;\n StringBuilder sb = new StringBuilder();\n for (c = read(); c != 10; c = read()) sb.Append((char)c);\n if (sb.Length > 0 && sb[sb.Length - 1] == 13) sb.Length -= 1;\n return sb.ToString();\n }\n\n public static int rawLine(byte[] a, int offset = 0)\n {\n int c, i = offset;\n for (c = reader.ReadByte(); c != 10; c = reader.ReadByte()) a[i++] = (byte)c;\n if (i > 0 && a[i - 1] == 13) i--;\n return i - offset;\n }\n\n public static int rawLine(char[] a, int offset = 0)\n {\n Array.ConvertAll(a, Convert.ToInt16);\n\n int c, i = offset;\n for (c = read(); c != 10 && c != -1; c = read()) a[i++] = (char)c;\n if (i > 0 && a[i - 1] == 13) i--;\n return i;\n }\n\n public static int rawLine(T[] a, Func converter) where T : IComparable\n {\n int c, i = 0;\n for (c = read(); c != 10; c = read()) a[i++] = converter(c);\n if (i > 0 && a[i - 1].CompareTo(13) == 0) i--;\n return i;\n }\n\n public static string Scan()\n {\n int c;\n StringBuilder sb = new StringBuilder();\n do c = read(); while (c < 33 || c > 126);\n for (; c >= 33 && c <= 126; c = read()) sb.Append((char)c);\n return sb.ToString();\n }\n public static void Scan(Action f)\n {\n int c;\n StringBuilder sb = new StringBuilder();\n do c = read(); while (c < 33 || c > 126);\n for (; c >= 33 && c <= 126; c = read()) f(c);\n }\n\n private static uint gu(int first)\n {\n int c;\n uint u = (uint)first - '0';\n for (c = read(); c != -1 && char.IsDigit((char)c); c = read())\n {\n u = 10 * u + (uint)c - '0';\n }\n\n error = c;\n return u;\n }\n\n private static int read() { return reader.ReadByte(); }\n\n public static bool NewLine()\n {\n int c = error;\n if (c != 10) do c = reader.ReadByte(); while (c != -1 && c != 10);\n return c != -1;\n }\n }\n}", "lang": "Mono C#", "bug_code_uid": "d48e92f710bfd6ca7630bdcc411fc666", "src_uid": "0f4f7ca388dd1b2192436c67f9ac74d9", "apr_id": "dc43894605b73d99cbdbd8623768231a", "difficulty": 900, "tags": ["strings", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.7164550217565048, "equal_cnt": 32, "replace_cnt": 21, "delete_cnt": 4, "insert_cnt": 6, "fix_ops_cnt": 31, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Globalization;\nusing System.Linq;\nusing System.Text;\nusing System.Text.RegularExpressions;\nusing System.Threading;\n\nnamespace Codeforces\n{\n class E\n {\n private static ThreadStart s_threadStart = new E().Go;\n\n class Point\n {\n public int X, Y;\n public bool Keep;\n }\n\n private void Go()\n {\n long mod = 1000000007;\n\n int n = GetInt();\n Point[] points = new Point[n];\n for (int i = 0; i < n; i++)\n {\n points[i] = new Point() { X = GetInt(), Y = GetInt() };\n }\n\n Dictionary> xDict = new Dictionary>();\n Dictionary> yDict = new Dictionary>();\n for(int i = 0; i < n; i++)\n {\n List list;\n if (!xDict.TryGetValue(points[i].X, out list))\n list = xDict[points[i].X] = new List();\n\n list.Add(i);\n\n if (!yDict.TryGetValue(points[i].Y, out list))\n list = yDict[points[i].Y] = new List();\n\n list.Add(i);\n }\n\n long ans = 1;\n\n int k = n;\n for (int i = 0; i < n; i++)\n {\n if (xDict[points[i].X].Count == 1 && yDict[points[i].Y].Count == 1)\n {\n ans *= 3;\n ans %= mod;\n xDict.Remove(points[i].X);\n yDict.Remove(points[i].Y);\n k--;\n }\n }\n\n int m = xDict.Count() + yDict.Count();\n\n ans *= Bin(m, k, mod);\n ans %= mod;\n Wl(ans);\n }\n\n long Bin(long n, long k, long mod)\n {\n if (n < 2) return 1;\n\n long[] bin = new long[k + 1]; bin[0] = 1; bin[1] = 1;\n long[] next = new long[k + 1];\n long[] t;\n\n for (int i = 2; i <= k; i++)\n {\n next[0] = 1; next[i] = 1;\n for (int j = 1; j <= k && j < i; j++)\n next[j] = (bin[j] + bin[j - 1]) % mod;\n\n t = bin;\n bin = next;\n next = t;\n }\n\n long ans = 0;\n for (int i = 0; i <= k; i++)\n {\n ans += bin[i];\n ans %= mod;\n }\n return ans;\n }\n\n #region Template\n\n private static StringBuilder output = new StringBuilder();\n\n public static void Main(string[] args)\n {\n System.Diagnostics.Stopwatch timer = new System.Diagnostics.Stopwatch();\n output.Length = 0;\n Thread main = new Thread(new ThreadStart(s_threadStart), 512 * 1024 * 1024);\n timer.Start();\n main.Start();\n main.Join();\n Console.Write(output);\n timer.Stop();\n Console.Error.WriteLine(timer.ElapsedMilliseconds);\n }\n\n private static IEnumerator ioEnum;\n private static string GetString()\n {\n do\n {\n while (ioEnum == null || !ioEnum.MoveNext())\n {\n ioEnum = Console.ReadLine().Split().AsEnumerable().GetEnumerator();\n }\n } while (string.IsNullOrEmpty(ioEnum.Current));\n\n return ioEnum.Current;\n }\n\n\n private static int GetInt()\n {\n return int.Parse(GetString());\n }\n\n private static long GetLong()\n {\n return long.Parse(GetString());\n }\n\n private static double GetDouble()\n {\n return double.Parse(GetString());\n }\n\n private static List GetIntArr(int n)\n {\n List ret = new List(n);\n for (int i = 0; i < n; i++)\n {\n ret.Add(GetInt());\n }\n return ret;\n }\n\n private static void Wl(T o)\n {\n W(o);\n output.Append(Console.Out.NewLine);\n }\n\n private static void Wl(IEnumerable enumerable)\n {\n W(enumerable);\n output.Append(Console.Out.NewLine);\n }\n\n private static void W(T o)\n {\n if (o is double)\n {\n Wd((o as double?).Value, \"\");\n }\n else if (o is float)\n {\n Wd((o as float?).Value, \"\");\n }\n else\n output.Append(o.ToString());\n }\n\n private static void W(IEnumerable enumerable)\n {\n W(string.Join(\" \", enumerable.Select(e => e.ToString()).ToArray()));\n }\n\n private static void Wd(double d, string format)\n {\n W(d.ToString(format, CultureInfo.InvariantCulture));\n }\n\n #endregion\n }\n}", "lang": "MS C#", "bug_code_uid": "3c787c78e972535c839d7c8930cdb6fc", "src_uid": "8781003d9eea51a509145bc6db8b609c", "apr_id": "b866c7eb0f65e3ea718f22e9175f4a4d", "difficulty": 2300, "tags": ["graphs"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9962215612187475, "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.Globalization;\nusing System.Linq;\nusing System.Text;\nusing System.Text.RegularExpressions;\nusing System.Threading;\n\nnamespace Codeforces\n{\n class E\n {\n private static ThreadStart s_threadStart = new E().Go;\n\n class Point\n {\n public int X, Y;\n public bool Keep;\n }\n\n long[] F;\n\n private void Go()\n {\n long mod = 1000000007;\n\n int n = GetInt();\n Point[] points = new Point[n];\n for (int i = 0; i < n; i++)\n {\n points[i] = new Point() { X = GetInt(), Y = GetInt() };\n }\n\n F = new long[2*n + 1];\n F[0] = 1;\n for (int i = 1; i <= 2 * n; i++)\n F[i] = (F[i - 1] * i) % mod;\n\n Dictionary> xDict = new Dictionary>();\n Dictionary> yDict = new Dictionary>();\n for(int i = 0; i < n; i++)\n {\n List list;\n if (!xDict.TryGetValue(points[i].X, out list))\n list = xDict[points[i].X] = new List();\n\n list.Add(i);\n\n if (!yDict.TryGetValue(points[i].Y, out list))\n list = yDict[points[i].Y] = new List();\n\n list.Add(i);\n }\n\n long ans = 1;\n\n Queue queue = new Queue();\n while (xDict.Count > 0)\n {\n int k = 0;\n int m = 0;\n var pair = xDict.First();\n queue.Enqueue(pair.Value[0]);\n\n HashSet xDir = new HashSet();\n HashSet yDir = new HashSet();\n HashSet pSet = new HashSet();\n\n while (queue.Count > 0)\n {\n int pp = queue.Dequeue();\n Point point = points[pp];\n pSet.Add(pp);\n xDir.Add(point.X);\n yDir.Add(point.Y);\n if (xDict.ContainsKey(point.X))\n {\n foreach (int z in xDict[point.X])\n if (z != pp)\n queue.Enqueue(z);\n }\n if (yDict.ContainsKey(point.Y))\n {\n foreach (int z in yDict[point.Y])\n if (z != pp)\n queue.Enqueue(z);\n }\n xDict.Remove(point.X);\n yDict.Remove(point.Y);\n }\n\n ans *= Bin(xDir.Count() + yDir.Count(), pSet.Count(), mod);\n ans %= mod;\n }\n\n Wl(ans);\n }\n\n long Bin(long n, long k, long mod)\n {\n long ans = 0;\n for (int i = 0; i <= k; i++)\n {\n long add = F[n];\n add *= Inv(F[i], mod);\n add %= mod;\n add *= Inv(F[n - i], mod);\n add %= mod;\n ans += add;\n ans %= mod;\n }\n return ans;\n }\n\n public static long Pow(long a, long n, long mod)\n {\n long res = 1L;\n while (n > 0)\n {\n if ((n & 1) != 0)\n res = (res * a) % mod;\n a = (a * a) % mod;\n n >>= 1;\n }\n return res;\n }\n\n public static long Inv(long a, long mod)\n {\n return Pow(a, mod - 2, mod);\n }\n\n #region Template\n\n private static StringBuilder output = new StringBuilder();\n\n public static void Main(string[] args)\n {\n System.Diagnostics.Stopwatch timer = new System.Diagnostics.Stopwatch();\n output.Length = 0;\n Thread main = new Thread(new ThreadStart(s_threadStart), 512 * 1024 * 1024);\n timer.Start();\n main.Start();\n main.Join();\n Console.Write(output);\n timer.Stop();\n Console.Error.WriteLine(timer.ElapsedMilliseconds);\n }\n\n private static IEnumerator ioEnum;\n private static string GetString()\n {\n do\n {\n while (ioEnum == null || !ioEnum.MoveNext())\n {\n ioEnum = Console.ReadLine().Split().AsEnumerable().GetEnumerator();\n }\n } while (string.IsNullOrEmpty(ioEnum.Current));\n\n return ioEnum.Current;\n }\n\n\n private static int GetInt()\n {\n return int.Parse(GetString());\n }\n\n private static long GetLong()\n {\n return long.Parse(GetString());\n }\n\n private static double GetDouble()\n {\n return double.Parse(GetString());\n }\n\n private static List GetIntArr(int n)\n {\n List ret = new List(n);\n for (int i = 0; i < n; i++)\n {\n ret.Add(GetInt());\n }\n return ret;\n }\n\n private static void Wl(T o)\n {\n W(o);\n output.Append(Console.Out.NewLine);\n }\n\n private static void Wl(IEnumerable enumerable)\n {\n W(enumerable);\n output.Append(Console.Out.NewLine);\n }\n\n private static void W(T o)\n {\n if (o is double)\n {\n Wd((o as double?).Value, \"\");\n }\n else if (o is float)\n {\n Wd((o as float?).Value, \"\");\n }\n else\n output.Append(o.ToString());\n }\n\n private static void W(IEnumerable enumerable)\n {\n W(string.Join(\" \", enumerable.Select(e => e.ToString()).ToArray()));\n }\n\n private static void Wd(double d, string format)\n {\n W(d.ToString(format, CultureInfo.InvariantCulture));\n }\n\n #endregion\n }\n}", "lang": "MS C#", "bug_code_uid": "23bc59fb59151abb828493aa0478ec6f", "src_uid": "8781003d9eea51a509145bc6db8b609c", "apr_id": "b866c7eb0f65e3ea718f22e9175f4a4d", "difficulty": 2300, "tags": ["graphs"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.7974289861082314, "equal_cnt": 6, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 6, "fix_ops_cnt": 6, "bug_source_code": "using System;\nusing System.Collections;\nusing System.Collections.Generic;\nusing System.Collections.Specialized;\nusing System.Text;\nusing System.Text.RegularExpressions;\nusing System.IO;\n\npublic class NetworkXOneTimePad\n{\n public static void Main()\n {\n string str = Console.ReadLine();\n string[] values = str.Split(' ');\n int a = int.Parse(values[0]);\n int b = int.Parse(values[1]);\n str = Console.ReadLine();\n int x=0,y=0;\n List> lst = new List>();\n lst.Add(new KeyValuePair(0,0));\n\n for (int i = 0; i < str.Length; i++)\n {\n if (str[i] == 'R')\n {\n x++;\n }\n else if (str[i] == 'L')\n {\n x--;\n }\n else if (str[i] == 'U')\n {\n y++;\n }\n else\n {\n y--;\n }\n lst.Add(new KeyValuePair(x,y));\n }\n int px=x,py=y,ans=0;\n foreach (var kv in lst)\n {\n\n if(px!=0 && py!=0 && ((a-kv.Key)%px ==0) && ((b-kv.Value)%py==0) &&((a-kv.Key)/px ==(b-kv.Value)/py)&& (b-kv.Value)/p>=0)\n {\n ans=1;\n break;\n }\n else if (px == 0 && py == 0 && (a == kv.Key) && (b == kv.Value))\n {\n ans=1;\n break;\n }\n else if (px == 0 && (a == kv.Key) && ((b-kv.Value)%py ==0) && (b-kv.Value)/p>=0)\n {\n ans=1;\n break;\n }\n else if (py == 0 && (b == kv.Value) && ((a - kv.Key) % px == 0) &&(a-kv.Key)/p >=0)\n {\n ans=1;\n break;\n }\n }\n if(ans==0)Console.WriteLine(\"No\");\nelse Console.WriteLine(\"Yes\");\n Console.ReadLine();\n } \n}", "lang": "Mono C#", "bug_code_uid": "06122937c6e135333707263b63141a70", "src_uid": "5d6212e28c7942e9ff4d096938b782bf", "apr_id": "daabd6c408eb8f0e83c0b0fc25159b55", "difficulty": 1700, "tags": ["number theory", "math", "implementation"], "bug_exec_outcome": "COMPILATION_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.996713371389033, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "/*using System;\nusing System.Collections;\nusing System.Collections.Generic;\nusing System.Collections.Specialized;\nusing System.Text;\nusing System.Text.RegularExpressions;\nusing System.IO;\n\npublic class NetworkXOneTimePad\n{\n public static void Main()\n {\n int n = 100;\n int[,] G = new int[n+1,n+1];\n Dictionary d = new Dictionary();\n List> temp = new List>();\n d.Add(1,true);\n KeyValuePair ns;\n while (d.Count != n)\n {\n foreach(var current in d)\n { \n for (int i = 1; i < n + 1; i++)\n {\n if (!d.ContainsKey(i) && G[current.Key, i] != 0)\n {\n temp.Add(new KeyValuePair(i,G[current.Key,i]));\n }\n }\n }\n temp.Sort();\n }\n } \n}*/\n\n\nusing System;\nusing System.Collections;\nusing System.Collections.Generic;\nusing System.Collections.Specialized;\nusing System.Text;\nusing System.Text.RegularExpressions;\nusing System.IO;\n\npublic class NetworkXOneTimePad\n{\n public static void Main()\n {\n string str = Console.ReadLine();\n string[] values = str.Split(' ');\n int a = int.Parse(values[0]);\n int b = int.Parse(values[1]);\n str = Console.ReadLine();\n int x=0,y=0;\n List> lst = new List>();\n lst.Add(new KeyValuePair(0,0));\n\n for (int i = 0; i < str.Length; i++)\n {\n if (str[i] == 'R')\n {\n x++;\n }\n else if (str[i] == 'L')\n {\n x--;\n }\n else if (str[i] == 'U')\n {\n y++;\n }\n else\n {\n y--;\n }\n lst.Add(new KeyValuePair(x,y));\n }\n int px=x,py=y,ans=0;\n foreach (var kv in lst)\n {\n\n if(px!=0 && py!=0 && ((a-kv.Key)%px ==0) && ((b-kv.Value)%py==0) &&((a-kv.Key)/px ==(b-kv.Value)/py)&& (b-kv.Value)/py>=0)\n {\n ans=1;\n break;\n }\n else if (px == 0 && py == 0 && (a == kv.Key) && (b == kv.Value))\n {\n ans=1;\n break;\n }\n else if (px == 0 && (a == kv.Key) && ((b-kv.Value)%py ==0) && (b-kv.Value)/py>=0)\n {\n ans=1;\n break;\n }\n else if (py == 0 && (b == kv.Value) && ((a - kv.Key) % px == 0) &&(a-kv.Key)/px >=0)\n {\n ans=1;\n break;\n }\n }\n if(ans==0)Console.WriteLine(\"No\");\nelse Console.WriteLine(\"Yes\");\n Console.ReadLine();\n } \n}", "lang": "Mono C#", "bug_code_uid": "a1720a4d422e4a9dc6393776a0a19ee2", "src_uid": "5d6212e28c7942e9ff4d096938b782bf", "apr_id": "daabd6c408eb8f0e83c0b0fc25159b55", "difficulty": 1700, "tags": ["number theory", "math", "implementation"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.9982894286691755, "equal_cnt": 2, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 0, "fix_ops_cnt": 1, "bug_source_code": "using System;\n\nnamespace MakingSequences\n{\n class MakingSequences\n {\n static void Main(string[] args)\n {\n ulong w, m, k, pow10, cost = 0, rem = 0, count, lengthPow10, lastPow10, diff;\n string[] input;\n\n input = Console.ReadLine().Split();\n w = ulong.Parse(input[0]);\n m = ulong.Parse(input[1]);\n k = ulong.Parse(input[2]);\n\n lengthPow10 = (ulong)input[1].Length;\n cost = lengthPow10 * k;\n pow10 = (ulong)Math.Pow(10, lengthPow10);\n rem = (pow10 - m) * k;\n\n if (rem > w)\n Console.WriteLine(w / cost);\n else\n {\n count = rem / cost;\n w -= rem;\n\n while (true)\n {\n lastPow10 = pow10;\n lengthPow10++;\n cost = lengthPow10 * k;\n pow10 = (ulong)Math.Pow(10, lengthPow10);\n diff = pow10 - lastPow10;\n rem = diff * cost;\n\n if (rem < w)\n {\n count += (rem / cost);\n w -= rem;\n }\n else\n {\n count += (w / cost);\n break;\n }\n }\n\n Console.WriteLine(count);\n }\n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "45d2eeb7745d5be0c8f1344276e86473", "src_uid": "8ef8a09e33d38a2d7f023316bc38b6ea", "apr_id": "666491b1937ef3b37c88d30049a9c35a", "difficulty": 1600, "tags": ["math", "implementation", "binary search"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9997454823110206, "equal_cnt": 2, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 1, "fix_ops_cnt": 1, "bug_source_code": "\n\nusing System;\nusing System.Text;\nusing System.Collections.Generic;\nusing System.IO;\n\nnamespace С1\n{\n class Program\n {\n static bool isFileIO = false;\n\n static string[] lines;\n static int pointer = 0;\n\n\n static void Main(string[] args)\n {\n if (isFileIO)\n {\n lines = File.ReadAllLines(\"input.txt\");\n }\n ClearFile();\n Solve();\n }\n\n static string ReadLine()\n {\n if (isFileIO)\n {\n return lines[pointer++];\n }\n else\n {\n return Console.ReadLine();\n }\n }\n\n static void ClearFile()\n {\n File.WriteAllText(\"output.txt\", \"\");\n }\n\n static void WriteLine(string str)\n {\n if (isFileIO)\n {\n File.AppendAllText(\"output.txt\", str + \"\\n\");\n }\n else\n {\n Console.WriteLine(str);\n }\n }\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n static void Solve()\n {\n long w;\n long m;\n long k;\n\n string[] s = Console.ReadLine().Split(' ');\n w = long.Parse(s[0]);\n m = long.Parse(s[1]);\n k = long.Parse(s[2]);\n\n long balls = w / k;\n //Console.WriteLine(naive(balls, m));\n Console.WriteLine(real(balls, m));\n }\n\n static long summ(long a) \n {\n string s = a + \"\";\n return s.Length;\n }\n\n static long real(long balls, long m)\n {\n int n = 18;\n long first = summ(m);\n long sec = 0;\n for (long i = 1; i < n; i++)\n {\n long power = (long)Math.Pow(10, i);\n if(power >= m)\n {\n sec = i;\n break;\n }\n }\n\n List longs = new List();\n longs.Add(m);\n for (long i = sec; i < n; i++)\n {\n longs.Add((long)Math.Pow(10, i));\n }\n\n for (int i = 0; i < longs.Count; i++ )\n {\n //Console.WriteLine(longs[i]);\n }\n\n List dl = new List();\n\n List points = new List();\n long portion = first * ((long)Math.Pow(10, sec)-m);\n points.Add(portion);\n dl.Add(sec);\n for (long i = sec + 1; i < n; i++)\n {\n points.Add(i * ((long)Math.Pow(10, i) - (long)Math.Pow(10, i-1)));\n dl.Add(i);\n }\n\n for (int i = 0; i < points.Count; i++)\n {\n Console.WriteLine(points[i]);\n }\n\n \n long total = 0;\n for (int i = 0; i < points.Count; i++ )\n {\n if (balls >= points[i])\n {\n total += points[i]/dl[i];\n balls -= points[i];\n }\n else \n {\n long diff = balls / dl[i];\n total += diff;\n balls -= diff * dl[i];\n }\n }\n\n //Console.WriteLine(total);\n\n return total;\n }\n\n static long naive(long balls, long m) \n {\n long total = 0;\n long i = m;\n long c = 0;\n while(total 0){\n n /= 10;\n count += 1;\n }\n return count;\n }\n static UInt64 MinNum(ulong n){\n UInt64 res = 1;\n UInt64 num = 10;\n n -= 1;\n while (n > 0){\n if (n % 2 == 1){\n res *= num;\n }\n num *= num;\n n /= 2;\n }\n return res;\n }\n static UInt64 MaxNum(ulong n){\n return MinNum(n + 1) - 1;\n }\n static UInt64 cost(UInt64 l, UInt64 r, UInt64 k){\n UInt64 c = 0;\n UInt64 sl = S(l);\n while (r > MaxNum(sl)){\n c += (MaxNum(sl) - l + 1) * sl * k;\n l = MinNum(sl + 1);\n sl +=1;\n }\n c += (r - l + +1)*sl*k;\n return c;\n }\n\n\n static void Main() \n {\n UInt64 w, m, k;\n string[] s = Console.ReadLine().Split();\n w = UInt64.Parse(s[0]);\n m = UInt64.Parse(s[1]);\n k = UInt64.Parse(s[2]);\n\n //Console.WriteLine(cost(5, 10, 14));\n\n if (S(m) * k > w)\n {\n Console.WriteLine(0);\n }else{\n UInt64 diff = 100;\n UInt64 r = m + diff;\n while (cost(m, r, k) < w)\n {\n diff += diff;\n k += diff;\n }\n\n UInt64 l = m;\n \n while (r - l > 1)\n {\n UInt64 med = l + (r - l) / 2;\n UInt64 c = cost(m, med, k);\n if (c == w)\n {\n r = med;\n break;\n }\n else if (c > w)\n {\n r = med;\n }\n else l = med;\n }\n if (cost(m, r, k) <= w) Console.WriteLine(r - m + 1);\n else Console.WriteLine(l - m + 1);\n }\n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "f44940ceb80eb6b523d87f514c9c771c", "src_uid": "8ef8a09e33d38a2d7f023316bc38b6ea", "apr_id": "586b74ec6a181bedbeb4e98e4b48ca7c", "difficulty": 1600, "tags": ["math", "implementation", "binary search"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9894324853228963, "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.Text;\n\nnamespace CodeForces\n{\n class Program\n {\n static void Main(string[] args)\n {\n var line = Console.ReadLine().Split(' ');\n var W = long.Parse(line[0]);\n var M = long.Parse(line[1]);\n var K = long.Parse(line[2]);\n\n var count = W / K;\n long ans = 0;\n var digits = (long)Math.Floor(Math.Log10(M) + 1);\n\n while (count >= digits)\n {\n digits = (long)Math.Floor(Math.Log10(M) + 1);\n if (count - digits < 0)\n break;\n\n var times = (long)Math.Pow(10, digits) - M;\n\n if (count >= times * digits)\n {\n //Batch\n count -= times * digits;\n M = (long)Math.Pow(10, digits);\n ans += times;\n }\n else\n {\n times = count / digits;\n\n //One Time\n //count -= digits;\n //M++;\n ans += times;\n }\n }\n\n Console.WriteLine(ans);\n }\n }\n}", "lang": "MS C#", "bug_code_uid": "2770b667097b3413b65d84de4e8d8a45", "src_uid": "8ef8a09e33d38a2d7f023316bc38b6ea", "apr_id": "68dec83e045e8ec576077482808ff6db", "difficulty": 1600, "tags": ["math", "implementation", "binary search"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.900497512437811, "equal_cnt": 16, "replace_cnt": 5, "delete_cnt": 1, "insert_cnt": 9, "fix_ops_cnt": 15, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\n\nnamespace CodeForces\n{\n class Program\n {\n static void Main(string[] args)\n {\n var line = Console.ReadLine().Split(' ');\n var W = long.Parse(line[0]);\n var M = long.Parse(line[1]);\n var K = long.Parse(line[2]);\n var count = W / K;\n long ans = 0;\n\n while (count != 0)\n {\n var digits = (long)Math.Floor(Math.Log10(M) + 1);\n if (count - digits < 0)\n break;\n\n var times = digits * 10 - M + 1;\n if (count >= times * digits)\n {\n //Batch\n count -= times * digits;\n M = M + digits * 10;\n ans += times;\n }\n else\n {\n //One Time\n count -= digits;\n M++;\n ans++;\n }\n }\n\n Console.WriteLine(ans);\n }\n }\n}", "lang": "MS C#", "bug_code_uid": "cbccd894fe3f46e4505607bd6db726ef", "src_uid": "8ef8a09e33d38a2d7f023316bc38b6ea", "apr_id": "68dec83e045e8ec576077482808ff6db", "difficulty": 1600, "tags": ["math", "implementation", "binary search"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.8219554030874786, "equal_cnt": 33, "replace_cnt": 12, "delete_cnt": 1, "insert_cnt": 19, "fix_ops_cnt": 32, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace B\n{\n\tclass Program\n\t{\n\t\tstatic void Main(string[] args)\n\t\t{\n\t\t\t//Console.SetIn(File.OpenText(\"in.txt\"));\n\t\t\tvar d = Console.ReadLine().Split(' ').Select(i => long.Parse(i)).ToArray();\n\t\t\tvar w = d[0];\n\t\t\tvar m = d[1];\n\t\t\tvar k = d[2];\n\n\t\t\tlong cur = getCount(m);\n\t\t\tvar min = m;\n\t\t\tlong sum = 0;\n\t\t\twhile (true)\n\t\t\t{\n\t\t\t\tvar next = cur + 1;\n\t\t\t\tlong max = pow(cur);\n\n\n\t\t\t\t\n\t\t\t\tvar diff = max - min;\n\t\t\t\t\n\t\t\t\tif (diff * k * cur <= w)\n\t\t\t\t{\n\t\t\t\t\tw -= diff * k * cur;\n\t\t\t\t\tcur++;\n\t\t\t\t\tmin = max;\n\t\t\t\t\tsum += diff;\n\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tvar l = min;\n\t\t\t\tvar r = max - 1;\n\t\t\t\twhile (true)\n\t\t\t\t{\n\t\t\t\t\tif (l == r)\n\t\t\t\t\t{\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\tvar p = l + (r - l + 1) / 2;\n\t\t\t\t\tdiff = p - min;\n\t\t\t\t\tif (diff * k * cur <= w)\n\t\t\t\t\t{\n\t\t\t\t\t\tl = p;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tr = p - 1;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tvar added = l - min;\n\t\t\t\tif (k * cur * l <= w)\n\t\t\t\t{\n\t\t\t\t\tadded++;\n\t\t\t\t}\n\t\t\t\t//var cost = added * k * cur;\n\t\t\t\t//w -= cost;\n\n\t\t\t\tsum += added;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tConsole.WriteLine(sum);\n\n\t\t}\n\n\t\t\n\n\t\tstatic long pow(long p)\n\t\t{\n\t\t\tlong a = 1;\n\t\t\tfor (int i = 0; i < p; i++)\n\t\t\t{\n\t\t\t\ta *= 10;\n\t\t\t}\n\n\t\t\treturn a;\n\t\t}\n\n\t\tstatic long getCount(long i)\n\t\t{\n\t\t\tlong c = 0;\n\t\t\twhile (true)\n\t\t\t{\n\t\t\t\tif (i == 0)\n\t\t\t\t{\n\t\t\t\t\tbreak;\t\n\t\t\t\t}\n\t\t\t\ti = i / 10;\n\t\t\t\tc++;\n\t\t\t}\n\n\t\t\treturn c;\n\t\t}\n\t}\n}\n", "lang": "MS C#", "bug_code_uid": "ed072ea56a0407e587fb5a91da04c3e2", "src_uid": "8ef8a09e33d38a2d7f023316bc38b6ea", "apr_id": "aa9fe79539d70c56adb350d5600ef6ed", "difficulty": 1600, "tags": ["math", "implementation", "binary search"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.9955535793686082, "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.Globalization;\nusing System.IO;\nusing System.Linq;\nusing System.Text;\nusing System.Threading;\n\n// (づ°ω°)づミ★゜・。。・゜゜・。。・゜☆゜・。。・゜゜・。。・゜\npublic class Solver\n{\n public void Solve()\n {\n long w = ReadLong();\n long m = ReadLong();\n long k = ReadLong();\n\n int n = m.ToString().Length;\n if (n * k > w)\n {\n Write(0);\n return;\n }\n w -= n * k;\n\n long d = 0;\n while (d <= m)\n d = d * 10 + 9;\n\n long x = m;\n while (true)\n {\n if (w < n * k)\n break;\n long v = Math.Min(d - x, w / n / k);\n w -= v * n * k;\n x += v;\n d = d * 10 + 9;\n n++;\n }\n\n Write(x - m + 1);\n }\n\n #region Main\n\n protected static TextReader reader;\n protected static TextWriter writer;\n\n static void Main()\n {\n#if DEBUG\n reader = new StreamReader(\"..\\\\..\\\\input.txt\");\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(\"cycle.in\");\n //writer = new StreamWriter(\"cycle.out\");\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#if DEBUG\n Console.WriteLine(ex);\n#else\n Console.WriteLine(ex);\n throw;\n#endif\n }\n reader.Close();\n writer.Close();\n }\n\n #endregion\n\n #region Read / Write\n\n private static Queue currentLineTokens = new Queue();\n\n private static string[] ReadAndSplitLine()\n {\n return reader.ReadLine().Split(new[] { ' ', '\\t' }, StringSplitOptions.RemoveEmptyEntries);\n }\n\n public static string ReadToken()\n {\n while (currentLineTokens.Count == 0)\n currentLineTokens = new Queue(ReadAndSplitLine());\n return currentLineTokens.Dequeue();\n }\n\n public static int ReadInt()\n {\n return int.Parse(ReadToken());\n }\n\n public static long ReadLong()\n {\n return long.Parse(ReadToken());\n }\n\n public static double ReadDouble()\n {\n return double.Parse(ReadToken(), CultureInfo.InvariantCulture);\n }\n\n public static int[] ReadIntArray()\n {\n return ReadAndSplitLine().Select(int.Parse).ToArray();\n }\n\n public static long[] ReadLongArray()\n {\n return ReadAndSplitLine().Select(long.Parse).ToArray();\n }\n\n public static double[] ReadDoubleArray()\n {\n return ReadAndSplitLine().Select(s => double.Parse(s, CultureInfo.InvariantCulture)).ToArray();\n }\n\n public static int[][] ReadIntMatrix(int numberOfRows)\n {\n int[][] matrix = new int[numberOfRows][];\n for (int i = 0; i < numberOfRows; i++)\n matrix[i] = ReadIntArray();\n return matrix;\n }\n\n public static int[][] ReadAndTransposeIntMatrix(int numberOfRows)\n {\n int[][] matrix = ReadIntMatrix(numberOfRows);\n int[][] ret = new int[matrix[0].Length][];\n for (int i = 0; i < ret.Length; i++)\n {\n ret[i] = new int[numberOfRows];\n for (int j = 0; j < numberOfRows; j++)\n ret[i][j] = matrix[j][i];\n }\n return ret;\n }\n\n public static string[] ReadLines(int quantity)\n {\n string[] lines = new string[quantity];\n for (int i = 0; i < quantity; i++)\n lines[i] = reader.ReadLine().Trim();\n return lines;\n }\n\n public static void WriteArray(IEnumerable array)\n {\n writer.WriteLine(string.Join(\" \", array));\n }\n\n public static void Write(params object[] array)\n {\n WriteArray(array);\n }\n\n public static void WriteLines(IEnumerable array)\n {\n foreach (var a in array)\n writer.WriteLine(a);\n }\n\n 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\n #endregion\n}", "lang": "MS C#", "bug_code_uid": "8f062c37419a3b2f2e503918b0771465", "src_uid": "8ef8a09e33d38a2d7f023316bc38b6ea", "apr_id": "6fa7e5ccc82c714ea7c0ecf04141ac4e", "difficulty": 1600, "tags": ["math", "implementation", "binary search"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.7646622123236823, "equal_cnt": 38, "replace_cnt": 6, "delete_cnt": 1, "insert_cnt": 31, "fix_ops_cnt": 38, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace _373_B\n{\n class Program\n {\n static void Main(string[] args)\n {\n\n long[] input = Console.ReadLine().Split().Select(long.Parse).ToArray();\n\n long w = input[0];\n long m = input[1];\n long k = input[2];\n\n long overallCount = 0;\n long cost = 0;\n long current = m;\n\n while (cost < w)\n {\n int unitLength = current.ToString().Count();\n long unitCost = ((long)unitLength)*k;\n var biggest = long.Parse(new string('9', unitLength));\n long count = biggest - current + 1;\n long currentCost = count*unitCost;\n if (cost + currentCost <= w)\n {\n cost += currentCost;\n overallCount += count;\n current = biggest + 1;\n }\n else\n {\n long countmin = (w - cost)/unitCost;\n overallCount += countmin;\n Console.WriteLine(overallCount);\n return;\n }\n }\n Console.WriteLine(overallCount);\n }\n }\n}\n", "lang": "MS C#", "bug_code_uid": "2667c92020dc89f5148e9f73f484080c", "src_uid": "8ef8a09e33d38a2d7f023316bc38b6ea", "apr_id": "8eb5c158515e2a356aa5be601dcd44ba", "difficulty": 1600, "tags": ["math", "implementation", "binary search"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.9366591928251121, "equal_cnt": 16, "replace_cnt": 9, "delete_cnt": 0, "insert_cnt": 6, "fix_ops_cnt": 15, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing CompLib.Util;\n\npublic class Program\n{\n int N, M;\n int[] K;\n int[] D, T;\n\n List[] S;\n public void Solve()\n {\n var sc = new Scanner();\n N = sc.NextInt();\n M = sc.NextInt();\n\n K = sc.IntArray();\n S = new List[400001];\n for (int i = 0; i <= 400000; i++)\n {\n S[i] = new List();\n }\n for (int i = 0; i < M; i++)\n {\n int d = sc.NextInt();\n int t = sc.NextInt() - 1;\n S[d].Add(t);\n }\n\n /*\n * 毎日1B獲得\n * \n * n種類\n * 通常2B \n * セール1B\n * \n * タイプiをK_i個\n * \n * m個\n * \n * タイプt_iがd_iにセール\n * \n * 全部買う 最小日数\n */\n\n /*\n * i日で達成できるか?\n * \n * 最後から見る\n * \n */\n int ok = 400000;\n int ng = 0;\n while (ok - ng > 1)\n {\n int mid = (ok + ng) / 2;\n if (F(mid)) ok = mid;\n else ng = mid;\n }\n Console.WriteLine(ok);\n\n }\n\n // t日でできるか?\n bool F(int t)\n {\n int[] tmp = new int[N];\n Array.Copy(K, tmp, N);\n int B = 0;\n for (int i = 1; i <= t; i++)\n {\n B++;\n foreach (var type in S[i])\n {\n int min = Math.Min(tmp[type], B);\n tmp[type] -= min;\n B -= min;\n }\n }\n long sum = 0;\n foreach (var i in tmp)\n {\n sum += i;\n }\n\n return sum * 2 <= B;\n }\n\n public static void Main(string[] args) => new Program().Solve();\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}\n", "lang": "Mono C#", "bug_code_uid": "227ae69bcac6a55d19d561ff09eed58d", "src_uid": "2eb101dcfcc487fe6e44c9b4c0e4024d", "apr_id": "f1c6bb59cc25b49c715eff5b5d9cc810", "difficulty": 2000, "tags": ["greedy", "binary search"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9916165090283748, "equal_cnt": 3, "replace_cnt": 1, "delete_cnt": 1, "insert_cnt": 0, "fix_ops_cnt": 2, "bug_source_code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.IO;\nusing SB = System.Text.StringBuilder;\n//using System.Threading.Tasks;\n//using System.Text.RegularExpressions;\n//using System.Globalization;\n//using System.Diagnostics;\nusing static System.Console;\nusing System.Numerics;\nusing static System.Math;\nusing pair = Pair;\n\nclass Program\n{\n static void Main()\n {\n //SetOut(new StreamWriter(OpenStandardOutput()) { AutoFlush = false });\n new Program().solve();\n Out.Flush();\n }\n readonly Scanner cin = new Scanner();\n readonly int[] dd = { 0, 1, 0, -1, 0 }; //→↓←↑\n readonly int mod = 1000000007;\n readonly int dom = 998244353;\n bool chmax(ref T a, T b) where T : IComparable { if (a.CompareTo(b) < 0) { a = b; return true; } return false; }\n bool chmin(ref T a, T b) where T : IComparable { if (b.CompareTo(a) < 0) { a = b; return true; } return false; }\n\n bool calc(int day, int[] K, List[] L, int Sum)\n {\n int used = 0;\n int money = day;\n for (int i = day - 1; i >= 0; i--)\n { \n if (i < L.Length)\n {\n foreach (var v in L[i])\n {\n int buy = Min(K[v], money);\n money -= buy;\n K[v] -= buy;\n used += buy;\n }\n }\n money = Min(i, money);\n }\n\n\n int remain = Sum - used;\n\n if (day == 7)\n {\n WriteLine(used);\n }\n return remain * 2 <= (day - used);\n\n }\n void solve()\n {\n int N = cin.nextint;\n int M = cin.nextint;\n var K = cin.scanint;\n\n var L = new List[N];\n for (int i = 0; i < L.Length; i++)\n {\n L[i] = new List();\n }\n for (int i = 0; i < M; i++)\n {\n L[cin.nextint - 1].Add(cin.nextint - 1);\n }\n int Sum = K.Sum();\n\n\n int ng = 0;\n int ok = Sum * 2;\n while (ok - ng > 1)\n {\n int mid = (ok + ng) / 2;\n\n var Z = new int[N];\n for (int i = 0; i < Z.Length; i++)\n {\n Z[i] = K[i];\n }\n\n if (calc(mid, Z, L, Sum))\n {\n ok = mid;\n }\n else\n {\n ng = mid;\n }\n }\n\n WriteLine(ok);\n\n }\n\n}\n\n\nstatic class Ex\n{\n public static void join(this IEnumerable values, string sep = \" \") => WriteLine(string.Join(sep, values));\n public static string concat(this IEnumerable values) => string.Concat(values);\n public static string reverse(this string s) { var t = s.ToCharArray(); Array.Reverse(t); return t.concat(); }\n\n public static int lower_bound(this IList arr, T val) where T : IComparable\n {\n int low = 0, high = arr.Count;\n int mid;\n while (low < high)\n {\n mid = ((high - low) >> 1) + low;\n if (arr[mid].CompareTo(val) < 0) low = mid + 1;\n else high = mid;\n }\n return low;\n }\n public static int upper_bound(this IList arr, T val) where T : IComparable\n {\n int low = 0, high = arr.Count;\n int mid;\n while (low < high)\n {\n mid = ((high - low) >> 1) + low;\n if (arr[mid].CompareTo(val) <= 0) low = mid + 1;\n else high = mid;\n }\n return low;\n }\n}\n\nclass Pair : IComparable> where T : IComparable where U : IComparable\n{\n public T f; public U s;\n public Pair(T f, U s) { this.f = f; this.s = s; }\n public int CompareTo(Pair a) => f.CompareTo(a.f) != 0 ? f.CompareTo(a.f) : s.CompareTo(a.s);\n public override string ToString() => $\"{f} {s}\";\n}\n\nclass Scanner\n{\n string[] s; int i;\n readonly char[] cs = new char[] { ' ' };\n public Scanner() { s = new string[0]; i = 0; }\n public string[] scan => ReadLine().Split();\n public int[] scanint => Array.ConvertAll(scan, int.Parse);\n public long[] scanlong => Array.ConvertAll(scan, long.Parse);\n public double[] scandouble => Array.ConvertAll(scan, double.Parse);\n public string next\n {\n get\n {\n if (i < s.Length) return s[i++];\n string st = ReadLine();\n while (st == \"\") st = ReadLine();\n s = st.Split(cs, StringSplitOptions.RemoveEmptyEntries);\n i = 0;\n return next;\n }\n }\n public int nextint => int.Parse(next);\n public long nextlong => long.Parse(next);\n public double nextdouble => double.Parse(next);\n}\n", "lang": "Mono C#", "bug_code_uid": "158df1d1d07825e6286c43efc8564130", "src_uid": "2eb101dcfcc487fe6e44c9b4c0e4024d", "apr_id": "6d1ebc6d8c306f10cee34981944bcc1a", "difficulty": 2000, "tags": ["greedy", "binary search"], "bug_exec_outcome": "WRONG_ANSWER", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9992418498862775, "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.IO;\nusing SB = System.Text.StringBuilder;\n//using System.Threading.Tasks;\n//using System.Text.RegularExpressions;\n//using System.Globalization;\n//using System.Diagnostics;\nusing static System.Console;\nusing System.Numerics;\nusing static System.Math;\nusing pair = Pair;\n\nclass Program\n{\n static void Main()\n {\n //SetOut(new StreamWriter(OpenStandardOutput()) { AutoFlush = false });\n new Program().solve();\n Out.Flush();\n }\n readonly Scanner cin = new Scanner();\n readonly int[] dd = { 0, 1, 0, -1, 0 }; //→↓←↑\n readonly int mod = 1000000007;\n readonly int dom = 998244353;\n bool chmax(ref T a, T b) where T : IComparable { if (a.CompareTo(b) < 0) { a = b; return true; } return false; }\n bool chmin(ref T a, T b) where T : IComparable { if (b.CompareTo(a) < 0) { a = b; return true; } return false; }\n\n bool calc(int day, int[] K, List[] L, int Sum)\n {\n int used = 0;\n int money = day;\n for (int i = day - 1; i >= 0; i--)\n { \n if (i < L.Length)\n {\n foreach (var v in L[i])\n {\n int buy = Min(K[v], money);\n money -= buy;\n K[v] -= buy;\n used += buy;\n }\n }\n money = Min(i, money);\n }\n\n\n int remain = Sum - used;\n\n return remain * 2 <= (day - used);\n\n }\n void solve()\n {\n int N = cin.nextint;\n int M = cin.nextint;\n var K = cin.scanint;\n\n var L = new List[N];\n for (int i = 0; i < L.Length; i++)\n {\n L[i] = new List();\n }\n for (int i = 0; i < M; i++)\n {\n L[cin.nextint - 1].Add(cin.nextint - 1);\n }\n int Sum = K.Sum();\n\n\n int ng = 0;\n int ok = Sum * 2;\n while (ok - ng > 1)\n {\n int mid = (ok + ng) / 2;\n\n var Z = new int[N];\n for (int i = 0; i < Z.Length; i++)\n {\n Z[i] = K[i];\n }\n\n if (calc(mid, Z, L, Sum))\n {\n ok = mid;\n }\n else\n {\n ng = mid;\n }\n }\n\n WriteLine(ok);\n\n }\n\n}\n\n\nstatic class Ex\n{\n public static void join(this IEnumerable values, string sep = \" \") => WriteLine(string.Join(sep, values));\n public static string concat(this IEnumerable values) => string.Concat(values);\n public static string reverse(this string s) { var t = s.ToCharArray(); Array.Reverse(t); return t.concat(); }\n\n public static int lower_bound(this IList arr, T val) where T : IComparable\n {\n int low = 0, high = arr.Count;\n int mid;\n while (low < high)\n {\n mid = ((high - low) >> 1) + low;\n if (arr[mid].CompareTo(val) < 0) low = mid + 1;\n else high = mid;\n }\n return low;\n }\n public static int upper_bound(this IList arr, T val) where T : IComparable\n {\n int low = 0, high = arr.Count;\n int mid;\n while (low < high)\n {\n mid = ((high - low) >> 1) + low;\n if (arr[mid].CompareTo(val) <= 0) low = mid + 1;\n else high = mid;\n }\n return low;\n }\n}\n\nclass Pair : IComparable> where T : IComparable where U : IComparable\n{\n public T f; public U s;\n public Pair(T f, U s) { this.f = f; this.s = s; }\n public int CompareTo(Pair a) => f.CompareTo(a.f) != 0 ? f.CompareTo(a.f) : s.CompareTo(a.s);\n public override string ToString() => $\"{f} {s}\";\n}\n\nclass Scanner\n{\n string[] s; int i;\n readonly char[] cs = new char[] { ' ' };\n public Scanner() { s = new string[0]; i = 0; }\n public string[] scan => ReadLine().Split();\n public int[] scanint => Array.ConvertAll(scan, int.Parse);\n public long[] scanlong => Array.ConvertAll(scan, long.Parse);\n public double[] scandouble => Array.ConvertAll(scan, double.Parse);\n public string next\n {\n get\n {\n if (i < s.Length) return s[i++];\n string st = ReadLine();\n while (st == \"\") st = ReadLine();\n s = st.Split(cs, StringSplitOptions.RemoveEmptyEntries);\n i = 0;\n return next;\n }\n }\n public int nextint => int.Parse(next);\n public long nextlong => long.Parse(next);\n public double nextdouble => double.Parse(next);\n}\n", "lang": "Mono C#", "bug_code_uid": "129104ec6ba930d12762d46d8588acd0", "src_uid": "2eb101dcfcc487fe6e44c9b4c0e4024d", "apr_id": "6d1ebc6d8c306f10cee34981944bcc1a", "difficulty": 2000, "tags": ["greedy", "binary search"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9873443629541191, "equal_cnt": 4, "replace_cnt": 1, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 3, "bug_source_code": "using System;\r\nusing System.Collections.Generic;\r\nusing System.Globalization;\r\nusing System.IO;\r\nusing System.Linq;\r\nusing System.Runtime.CompilerServices;\r\n\r\nnamespace Task\r\n{\r\n static class Program\r\n {\r\n #region Read / Write\r\n static TextReader Reader;\r\n static TextWriter Writer;\r\n private static Queue _currentLineTokens = new Queue();\r\n private static string[] ReadAndSplitLine() { return Reader.ReadLine().Split(new[] { ' ', '\\t', }, StringSplitOptions.RemoveEmptyEntries); }\r\n public static string ReadToken() { while (_currentLineTokens.Count == 0) _currentLineTokens = new Queue(ReadAndSplitLine()); return _currentLineTokens.Dequeue(); }\r\n public static int ReadInt() { return int.Parse(ReadToken()); }\r\n public static long ReadLong() { return long.Parse(ReadToken()); }\r\n public static double ReadDouble() { return double.Parse(ReadToken(), CultureInfo.InvariantCulture); }\r\n public static int[] ReadIntArray() { return ReadAndSplitLine().Select(int.Parse).ToArray(); }\r\n public static long[] ReadLongArray() { return ReadAndSplitLine().Select(long.Parse).ToArray(); }\r\n public static double[] ReadDoubleArray() { return ReadAndSplitLine().Select(s => double.Parse(s, CultureInfo.InvariantCulture)).ToArray(); }\r\n public static int[][] ReadIntMatrix(int numberOfRows) { int[][] matrix = new int[numberOfRows][]; for (int i = 0; i < numberOfRows; i++) matrix[i] = ReadIntArray(); return matrix; }\r\n public static int[][] ReadAndTransposeIntMatrix(int numberOfRows)\r\n {\r\n int[][] matrix = ReadIntMatrix(numberOfRows); int[][] ret = new int[matrix[0].Length][];\r\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]; }\r\n return ret;\r\n }\r\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; }\r\n public static void WriteArray(IEnumerable array) { Writer.WriteLine(string.Join(\" \", array)); }\r\n public static void Write(params object[] array) { WriteArray(array); }\r\n public static void WriteLines(IEnumerable array) { foreach (var a in array) Writer.WriteLine(a); }\r\n private class SDictionary : Dictionary\r\n {\r\n public new TValue this[TKey key]\r\n {\r\n get { return ContainsKey(key) ? base[key] : default(TValue); }\r\n set { base[key] = value; }\r\n }\r\n }\r\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; }\r\n #endregion=\r\n\r\n public static bool NextPermutation(List perm)\r\n {\r\n for (int i = perm.Count - 2; i >= 0; i--)\r\n {\r\n if (perm[i] < perm[i + 1])\r\n {\r\n int min = i + 1;\r\n for (int j = min; j < perm.Count; j++)\r\n if (perm[j] > perm[i] && perm[j] < perm[min])\r\n min = j;\r\n\r\n var tmp = perm[i];\r\n perm[i] = perm[min];\r\n perm[min] = tmp;\r\n perm.Reverse(i + 1, perm.Count - i - 1);\r\n return true;\r\n }\r\n }\r\n\r\n return false;\r\n }\r\n\r\n #region SegmentTree\r\n\r\n public static long SegmentTreeFunc(long a, long b)\r\n {\r\n return a + b;\r\n }\r\n\r\n public static void BuildSegmentTree(long[] a, long v, long tl, long tr)\r\n {\r\n if (tl == tr)\r\n t[v] = a[tl];\r\n else\r\n {\r\n long tm = (tl + tr) / 2;\r\n BuildSegmentTree(a, v * 2, tl, tm);\r\n BuildSegmentTree(a, v * 2 + 1, tm + 1, tr);\r\n t[v] = SegmentTreeFunc(t[v * 2], t[v * 2 + 1]);\r\n }\r\n }\r\n\r\n public static long QuerySegmentTree(long v, long tl, long tr, long l, long r)\r\n {\r\n if (l > r)\r\n return 0;\r\n if (l == tl && r == tr)\r\n return t[v];\r\n\r\n var tm = (tl + tr) / 2;\r\n var res = SegmentTreeFunc(QuerySegmentTree(v * 2, tl, tm, l, Math.Min(r, tm)), QuerySegmentTree(v * 2 + 1, tm + 1, tr, Math.Max(l, tm + 1), r));\r\n return res;\r\n }\r\n \r\n public static void UpdateSegmentTree(int v, int tl, int tr, int pos, int new_val)\r\n {\r\n if (tl == tr)\r\n t[v] = new_val;\r\n else\r\n {\r\n int tm = (tl + tr) / 2;\r\n if (pos <= tm)\r\n UpdateSegmentTree(v * 2, tl, tm, pos, new_val);\r\n else\r\n UpdateSegmentTree(v * 2 + 1, tm + 1, tr, pos, new_val);\r\n t[v] = SegmentTreeFunc(t[v * 2], t[v * 2 + 1]);\r\n }\r\n }\r\n\r\n public static long[] t;\r\n\r\n #endregion\r\n\r\n private static readonly int modulus = 1000000007;\r\n // private static readonly int modulus1 = modulus - 1;\r\n\r\n \r\n public static long Pow(long a, long b)\r\n {\r\n long y = 1;\r\n\r\n while (true)\r\n {\r\n if ((b & 1) != 0)\r\n y = a * y % modulus;\r\n b = b >> 1;\r\n if (b == 0)\r\n return y;\r\n a = a * a % modulus;\r\n }\r\n }\r\n \r\n public static long ReversedNumbByPrimeModulo(long a)\r\n {\r\n return Pow(a, modulus - 2);\r\n }\r\n\r\n public static long FactByModulo(long a)\r\n {\r\n long ans = 1;\r\n\r\n while (a > 0)\r\n {\r\n ans = ans * a % modulus;\r\n a--;\r\n }\r\n\r\n return ans;\r\n }\r\n\r\n public static long nCkModulo(long n, long k)\r\n {\r\n if (k < n >> 1)\r\n k = n - k;\r\n\r\n long ans = 1;\r\n for (long i = n; i > k; i--)\r\n ans = ans * i % modulus;\r\n\r\n k = n - k;\r\n var fact = FactByModulo(k);\r\n var revFact = ReversedNumbByPrimeModulo(fact);\r\n\r\n ans = ans * revFact % modulus;\r\n\r\n return ans;\r\n }\r\n\r\n public static int maxForPrimeCalc = 1000000;\r\n public static List primes = new List(maxForPrimeCalc) {2};\r\n // public static int[] minPrimeDiv = new int[maxForPrimeCalc + 1];\r\n public static bool[] isPrime = new bool[maxForPrimeCalc + 1];\r\n \r\n public static void CalcPrimes()\r\n {\r\n isPrime[2] = true;\r\n for (var i = 4; i <= maxForPrimeCalc; i += 2)\r\n {\r\n isPrime[i] = false;\r\n // minPrimeDiv[i] = 2;\r\n }\r\n for (var i = 3; i <= maxForPrimeCalc; i += 2)\r\n {\r\n isPrime[i] = true;\r\n }\r\n \r\n for (var i = 3; i * i <= maxForPrimeCalc; i += 2)\r\n {\r\n if (isPrime[i])\r\n {\r\n // minPrimeDiv[i] = i;\r\n primes.Add(i);\r\n for (var j = i * i; j <= maxForPrimeCalc; j += i)\r\n {\r\n if (isPrime[j])\r\n {\r\n isPrime[j] = false;\r\n // minPrimeDiv[j] = i;\r\n }\r\n }\r\n }\r\n }\r\n }\r\n //\r\n // public static int[] PrimeDifferentDividersCountHash = new int[maxForPrimeCalc + 1];\r\n //\r\n // private static int PrimeDifferentDividersCount(long numb)\r\n // {\r\n // if (numb == 1)\r\n // return 0;\r\n // if (isPrime[numb])\r\n // return 1;\r\n // \r\n // if (PrimeDifferentDividersCountHash[numb] > 0)\r\n // return PrimeDifferentDividersCountHash[numb];\r\n // \r\n // var divider = minPrimeDiv[numb];\r\n // var prevNumb = numb / divider;\r\n // var ans = PrimeDifferentDividersCount(prevNumb);\r\n //\r\n // if (divider != minPrimeDiv[prevNumb])\r\n // {\r\n // ans += 1;\r\n // }\r\n //\r\n // PrimeDifferentDividersCountHash[numb] = ans;\r\n //\r\n // return ans;\r\n // }\r\n\r\n // #region Heap\r\n //\r\n // public static void InsertElementInHeap(MyStruct value, MyStruct[] arr, ref int sizeOfTree)\r\n // { \r\n // sizeOfTree++;\r\n // arr[sizeOfTree] = value;\r\n // HeapifyUp(sizeOfTree, arr); \r\n // }\r\n //\r\n // public static void HeapifyUp(int cur, MyStruct[] arr)\r\n // {\r\n // while (true)\r\n // {\r\n // if (cur == 1)\r\n // {\r\n // return;\r\n // }\r\n //\r\n // var parent = cur >> 1;\r\n //\r\n // if (arr[cur].Value < arr[parent].Value)\r\n // {\r\n // arr[cur].Value ^= arr[parent].Value;\r\n // arr[parent].Value ^= arr[cur].Value;\r\n // arr[cur].Value ^= arr[parent].Value;\r\n // \r\n // // arr[cur].Index ^= arr[parent].Index;\r\n // // arr[parent].Index ^= arr[cur].Index;\r\n // // arr[cur].Index ^= arr[parent].Index;\r\n //\r\n // cur = parent;\r\n // continue;\r\n // }\r\n //\r\n // break;\r\n // }\r\n // }\r\n //\r\n // public static MyStruct ExtractHeadOfHeap(MyStruct[] arr, ref int sizeOfTree)\r\n // {\r\n // var extractedValue = arr[1]; \r\n // arr[1] = arr[sizeOfTree]; \r\n // sizeOfTree--; \r\n // HeapifyDown(1, sizeOfTree, arr); \r\n // return extractedValue;\r\n // }\r\n //\r\n // public static void HeapifyDown(int cur, int sizeOfTree, MyStruct[] arr)\r\n // {\r\n // while (true)\r\n // {\r\n // var left = cur << 1;\r\n // var right = left + 1;\r\n // int smallestChild;\r\n //\r\n // if (sizeOfTree < left)\r\n // {\r\n // return;\r\n // }\r\n //\r\n // if (sizeOfTree == left || arr[left].Value < arr[right].Value)\r\n // smallestChild = left;\r\n // else\r\n // smallestChild = right;\r\n //\r\n // if (arr[cur].Value > arr[smallestChild].Value)\r\n // {\r\n // arr[cur].Value ^= arr[smallestChild].Value;\r\n // arr[smallestChild].Value ^= arr[cur].Value;\r\n // arr[cur].Value ^= arr[smallestChild].Value;\r\n // \r\n // // arr[cur].Index ^= arr[smallestChild].Index;\r\n // // arr[smallestChild].Index ^= arr[cur].Index;\r\n // // arr[cur].Index ^= arr[smallestChild].Index;\r\n //\r\n // cur = smallestChild;\r\n // continue;\r\n // }\r\n //\r\n // break;\r\n // }\r\n // }\r\n //\r\n // #endregion\r\n \r\n #region Sorted Set\r\n \r\n public class LowerBoundSortedSet : SortedSet\r\n {\r\n private ComparerDecorator _comparerDecorator;\r\n private class ComparerDecorator : IComparer\r\n {\r\n private IComparer _comparer;\r\n public T LowerBound { get; private set; }\r\n public T HigherBound { get; private set; }\r\n private bool _reset = true;\r\n public void Reset()\r\n {\r\n _reset = true;\r\n }\r\n public ComparerDecorator(IComparer comparer)\r\n {\r\n _comparer = comparer;\r\n }\r\n public int Compare(T x, T y)\r\n {\r\n int num = _comparer.Compare(x, y);\r\n if (_reset)\r\n {\r\n LowerBound = y;\r\n }\r\n if (num >= 0)\r\n {\r\n LowerBound = y;\r\n _reset = false;\r\n }\r\n if (num <= 0)\r\n {\r\n HigherBound = y;\r\n _reset = false;\r\n }\r\n return num;\r\n }\r\n }\r\n public LowerBoundSortedSet()\r\n : this(Comparer.Default) {}\r\n public LowerBoundSortedSet(IComparer comparer)\r\n : base(new ComparerDecorator(comparer))\r\n {\r\n _comparerDecorator = (ComparerDecorator) Comparer;\r\n }\r\n public T FindLowerBound(T key)\r\n {\r\n _comparerDecorator.Reset();\r\n this.Contains(key);\r\n return _comparerDecorator.LowerBound;\r\n }\r\n public T FindHigherBound(T key)\r\n {\r\n _comparerDecorator.Reset();\r\n this.Contains(key);\r\n return _comparerDecorator.HigherBound;\r\n }\r\n }\r\n \r\n #endregion\r\n\r\n static long GCD(long a, long b)\r\n {\r\n while (b > 0) {\r\n a %= b;\r\n a ^= b;\r\n b ^= a;\r\n a ^= b;\r\n }\r\n return a;\r\n }\r\n\r\n // private static List[] _divs = new List[100000 + 1];\r\n\r\n // private static void CalcDivs()\r\n // {\r\n // for (var i = 0; i < _divs.Length; i++)\r\n // _divs[i] = new List();\r\n // \r\n // for (var i = 1; i < _divs.Length; i++)\r\n // {\r\n // for (var j = i; j < _divs.Length; j += i)\r\n // _divs[j].Add(i);\r\n // }\r\n // }\r\n\r\n static void Main(string[] args)\r\n {\r\n Reader = new StreamReader(Console.OpenStandardInput());\r\n Writer = new StreamWriter(Console.OpenStandardOutput());\r\n\r\n // CalcPrimes();\r\n // CalcDivs();\r\n\r\n // var t = ReadInt();\r\n // for (var tmp = 0; tmp < t; tmp++)\r\n {\r\n Solve();\r\n }\r\n \r\n Reader.Close();\r\n Writer.Close();\r\n }\r\n\r\n static void Solve()\r\n {\r\n var n = ReadInt();\r\n\r\n var mod = 998244353L;\r\n var dp = new long[n + 1];\r\n dp[0] = 1;\r\n dp[1] = 1;\r\n var sum = 2L;\r\n for (var i = 2; i <= n; i++)\r\n {\r\n dp[i] = sum;\r\n dp[i] %= mod;\r\n\r\n var tmp = 0L;\r\n for (var j = 2; j <= i; j++)\r\n if (i % j == 0)\r\n {\r\n dp[i] += 1;\r\n dp[i] %= mod;\r\n }\r\n\r\n dp[i] += tmp;\r\n sum += dp[i];\r\n sum %= mod;\r\n }\r\n \r\n Write(dp[n]);\r\n }\r\n\r\n private static int RevertInd(int[] chainNumb, int ind, int[] inChainNumb, int permCount, List> chains, out int oldInd)\r\n {\r\n var cn = chainNumb[ind];\r\n var inC = inChainNumb[ind];\r\n\r\n oldInd = inC - permCount % chains[cn].Count;\r\n if (oldInd < 0)\r\n oldInd += chains[cn].Count;\r\n return cn;\r\n }\r\n\r\n public struct MyStruct\r\n {\r\n public char Dir;\r\n public int X;\r\n public int Index;\r\n\r\n public MyStruct(char dir, int x, int index)\r\n {\r\n Dir = dir;\r\n X = x;\r\n Index = index;\r\n }\r\n }\r\n\r\n private static int gcdex (int a, int b, out int x, out int y) {\r\n if (a == 0) {\r\n x = 0; y = 1;\r\n return b;\r\n }\r\n int x1, y1;\r\n int d = gcdex (b%a, a, out x1, out y1);\r\n x = y1 - (b / a) * x1;\r\n y = x1;\r\n return d;\r\n }\r\n\r\n private static long GetNumb(Dictionary letterDic, List permutation, string s)\r\n {\r\n long res = 0;\r\n long mult = 1;\r\n for (var i = s.Length - 1; i >= 0; i--)\r\n {\r\n res += permutation[letterDic[s[i]]] * mult;\r\n\r\n mult *= 10;\r\n }\r\n\r\n return res;\r\n }\r\n\r\n static void Inc(this Dictionary dict, long key, long addedValue)\r\n {\r\n if (dict.ContainsKey(key))\r\n dict[key] += addedValue;\r\n else\r\n dict[key] = addedValue;\r\n }\r\n\r\n static void Inc(this Dictionary dict, int key, int addedValue)\r\n {\r\n if (dict.ContainsKey(key))\r\n dict[key] += addedValue;\r\n else\r\n dict[key] = addedValue;\r\n }\r\n }\r\n}", "lang": "Mono C#", "bug_code_uid": "6128d8623196f25cad9d3ce38764ea7a", "src_uid": "09be46206a151c237dc9912df7e0f057", "apr_id": "d8531bb0a0680c808891bf4b8b74ec1a", "difficulty": 1700, "tags": ["dp", "math", "combinatorics", "number theory"], "bug_exec_outcome": "TIME_LIMIT_EXCEEDED", "potential_dominant_fix_op": "insert", "lang_cluster": "C#"} {"similarity_score": 0.7868783953196824, "equal_cnt": 19, "replace_cnt": 13, "delete_cnt": 1, "insert_cnt": 4, "fix_ops_cnt": 18, "bug_source_code": "using System;\r\nusing System.Linq;\r\nusing System.Collections.Generic;\r\n\r\nnamespace ConsoleApp9\r\n{\r\n class Program\r\n {\r\n static long M = 1000000007l;\r\n\r\n static long getEvenCount(int n)\r\n {\r\n long nf = 1;\r\n for (int i = 2; i <= n; i++)\r\n nf = (nf * i) % M;\r\n\r\n var rf = new long[n + 1];\r\n var inf = new long[n + 1];\r\n rf[1] = inf[0] = inf[1] = 1;\r\n for(int i=2; i<= n; i++)\r\n {\r\n long a = M / i, b = M % i;\r\n rf[i] = M - (rf[b] * a) % M;\r\n inf[i] = (rf[i] * inf[i - 1]) % M;\r\n }\r\n\r\n long res = 0;\r\n for(int i=0; i<= n; i += 2)\r\n res = (res + nf* inf[i]* inf[n-i] ) % M;\r\n return res;\r\n }\r\n\r\n\r\n static void Main(string[] args)\r\n {\r\n var t = int.Parse(Console.ReadLine());\r\n for(int tc = 1; tc <= t; tc++)\r\n {\r\n var input = Console.ReadLine().Split(' ').Select(int.Parse).ToList();\r\n int n = input[0], k = input[1];\r\n if( k == 0)\r\n {\r\n Console.WriteLine(1);\r\n continue;\r\n }\r\n if( n%2 == 1)\r\n {\r\n var even = getEvenCount(n);\r\n long res = 1;\r\n for (int i = 0; i < k; i++)\r\n res = (res * (even+1)) % M;\r\n Console.WriteLine(res);\r\n }\r\n else\r\n {\r\n var even = getEvenCount(n);\r\n var ev = new long[k + 1];\r\n var ori = new long[k+1];\r\n ev[0] = 1;\r\n ori[0] = 1;\r\n ori[1] = 2;\r\n for (int i = 2; i <= n; i++)\r\n ori[1] = (ori[1] * 2) % M;\r\n for (int i = 2; i < k; i++)\r\n ori[i] = (ori[i - 1] * ori[1]) % M;\r\n for (int i = 1; i <= k; i++)\r\n ev[i] = (ev[i - 1] * (even-1)) % M;\r\n long res = ev[k];\r\n for (int r1 = 0, r2 = k - 1; r1 < k; r1++, r2--)\r\n res = (res + ev[r1] * ori[n * r2]) % M;\r\n Console.WriteLine(res);\r\n }\r\n }\r\n }\r\n }\r\n}\r\n", "lang": "Mono C#", "bug_code_uid": "5428893e3091ed87d4403239e57fbda1", "src_uid": "02f5fe43ea60939dd4a53299b5fa0881", "apr_id": "94d5d26c66acaa46da7efaa62d7db1c2", "difficulty": 1700, "tags": ["dp", "combinatorics", "matrices", "bitmasks", "math"], "bug_exec_outcome": "RUNTIME_ERROR", "potential_dominant_fix_op": "replace", "lang_cluster": "C#"} {"similarity_score": 0.9980765120752297, "equal_cnt": 3, "replace_cnt": 0, "delete_cnt": 0, "insert_cnt": 2, "fix_ops_cnt": 2, "bug_source_code": "using System;\r\nusing System.Linq;\r\nusing System.Collections.Generic;\r\n\r\nnamespace ConsoleApp9\r\n{\r\n class Program\r\n {\r\n static long M = 1000000007l;\r\n\r\n static long getEvenCount(int n)\r\n {\r\n long nf = 1;\r\n for (int i = 2; i <= n; i++)\r\n nf = (nf * i) % M;\r\n\r\n var rf = new long[n + 1];\r\n var inf = new long[n + 1];\r\n rf[1] = inf[0] = inf[1] = 1;\r\n for(int i=2; i<= n; i++)\r\n {\r\n long a = M / i, b = M % i;\r\n rf[i] = M - (rf[b] * a) % M;\r\n inf[i] = (rf[i] * inf[i - 1]) % M;\r\n }\r\n\r\n long res = 0;\r\n for(int i=0; i<= n; i += 2)\r\n res = (res + nf* inf[i]* inf[n-i] ) % M;\r\n return res;\r\n }\r\n\r\n\r\n static void Main(string[] args)\r\n {\r\n var t = int.Parse(Console.ReadLine());\r\n for(int tc = 1; tc <= t; tc++)\r\n {\r\n var input = Console.ReadLine().Split(' ').Select(int.Parse).ToList();\r\n int n = input[0], k = input[1];\r\n if( k == 0)\r\n {\r\n Console.WriteLine(1);\r\n continue;\r\n }\r\n if( n%2 == 1)\r\n {\r\n var even = getEvenCount(n);\r\n long res = 1;\r\n for (int i = 0; i < k; i++)\r\n res = (res * (even+1)) % M;\r\n Console.WriteLine(res);\r\n }\r\n else\r\n {\r\n var even = getEvenCount(n);\r\n var orin = 1l;\r\n for (int i = 1; i <= n; i++)\r\n orin = (orin * 2) % M;\r\n var dp = new long[k + 1, 2];\r\n dp[0, 0] = 1;\r\n dp[0, 1] = even-1;\r\n for (int i=1; i