diff --git a/CourseApp.Tests/CourseApp.Tests.csproj b/CourseApp.Tests/CourseApp.Tests.csproj index ae46394..79653f6 100644 --- a/CourseApp.Tests/CourseApp.Tests.csproj +++ b/CourseApp.Tests/CourseApp.Tests.csproj @@ -1,7 +1,7 @@  - netcoreapp2.1 + netcoreapp3.1 True 1573,1591,1701;1702;1705 false diff --git a/CourseApp/CourseApp.csproj b/CourseApp/CourseApp.csproj index 9551450..3634a9e 100644 --- a/CourseApp/CourseApp.csproj +++ b/CourseApp/CourseApp.csproj @@ -1,23 +1,18 @@ - - + Exe - netcoreapp2.1 + netcoreapp3.1 True 1573,1591,1701;1702;1705; - - - - - - ../_stylecop/stylecop.ruleset + ../_stylecop/stylecop.ruleset true - - + + + + - - + \ No newline at end of file diff --git a/CourseApp/Module5/Task_1/BinaryTree.cs b/CourseApp/Module5/Task_1/BinaryTree.cs new file mode 100644 index 0000000..b376f0d --- /dev/null +++ b/CourseApp/Module5/Task_1/BinaryTree.cs @@ -0,0 +1,82 @@ +using System.Collections.Generic; + +namespace CourseApp.Module5.Task_1 +{ + public class BinaryTree + { + private Node root = null; + private int size = 0; + + public bool Find (int n) + { + return InnerFind(n, root); + } + + public List GetElements() + { + List elements = new List(); + InnerGetElements(root, elements); + return elements; + } + + public void Insert (int n) + { + root = InnerInsert(n, root); + } + + private bool InnerFind (int n, Node current) + { + if (current == null) + { + return false; + } + else if (current.Data == n) + { + return true; + } + else if (current.Data > n) + { + return InnerFind(n, current.Left); + } + else + { + return InnerFind(n, current.Right); + } + } + + private Node InnerInsert(int n, Node current) + { + if (current == null) + { + size++; + return new Node(n); + } + else if (current.Data > n) + { + current.Left = InnerInsert(n, current.Left); + } + else if (current.Data < n) + { + current.Right = InnerInsert(n, current.Right); + } + + return current; + } + + private void InnerGetElements(Node current, List elements) + { + if (current == null) + { + return; + } + + InnerGetElements(current.Left, elements); + if ((current.Left == null && current.Right != null) || (current.Right == null && current.Left != null)) + { + elements.Add(current.Data); + } + + InnerGetElements(current.Right, elements); + } + } +} \ No newline at end of file diff --git a/CourseApp/Module5/Task_1/Node.cs b/CourseApp/Module5/Task_1/Node.cs new file mode 100644 index 0000000..2d95f5c --- /dev/null +++ b/CourseApp/Module5/Task_1/Node.cs @@ -0,0 +1,18 @@ +namespace CourseApp.Module5.Task_1 +{ + public class Node + { + public Node (int input) + { + Left = null; + Right = null; + Data = input; + } + + public Node Left { get; set; } + + public Node Right { get; set; } + + public int Data { get; set; } + } +} diff --git a/CourseApp/Module5/Task_1/OneChildNode.cs b/CourseApp/Module5/Task_1/OneChildNode.cs new file mode 100644 index 0000000..f711cf0 --- /dev/null +++ b/CourseApp/Module5/Task_1/OneChildNode.cs @@ -0,0 +1,34 @@ +using System; +using System.IO; +using System.Linq; +using System.Collections.Generic; + +namespace CourseApp.Module5.Task_1 +{ + public class OneChildNode + { + public static void FindNode() + { + StreamReader reader = new StreamReader("input.txt"); + int[] numbers = reader.ReadLine().Trim().Split(' ').Select(n => Convert.ToInt32(n)).ToArray(); + reader.Close(); + BinaryTree tree = new BinaryTree(); + foreach (var item in numbers) + { + if (item != 0) + { + tree.Insert(item); + } + } + + List ans = tree.GetElements(); + StreamWriter output = new StreamWriter("output.txt"); + foreach (var item in ans) + { + output.WriteLine(item); + } + + output.Close(); + } + } +} \ No newline at end of file diff --git a/CourseApp/Module5/Task_2/BinaryTree.cs b/CourseApp/Module5/Task_2/BinaryTree.cs new file mode 100644 index 0000000..734c884 --- /dev/null +++ b/CourseApp/Module5/Task_2/BinaryTree.cs @@ -0,0 +1,91 @@ +using System; +using System.Collections.Generic; + +namespace CourseApp.Module5.Task_2 +{ + public class BinaryTree + { + private Node root = null; + + private int size = 0; + + private bool trigger; + + public void Insert (int n) + { + root = InnerInsert(n, root, null, 0); + } + + public bool IsBalanced() + { + trigger = true; + InnerCheckBalanced(root); + return trigger; + } + + private void InnerCheckBalanced(Node current) + { + if (current == null || !trigger) + { + return; + } + + InnerCheckBalanced(current.Left); + if (Math.Abs(current.Height_left - current.Height_right) > 1) + { + trigger = false; + } + + InnerCheckBalanced(current.Right); + } + + private Node InnerInsert(int n, Node current, Node previous, int depth) + { + if (current == null) + { + size++; + Node temp = new Node(n); + temp.Previous = previous; + temp.Height_left = 0; + temp.Height_right = 0; + Node buffer1 = temp; + int i = depth - 1; + while (buffer1 != null) + { + if (buffer1.Previous != null) + { + if (buffer1.Data < buffer1.Previous.Data) + { + if (buffer1.Previous.Height_left < depth - i) + { + buffer1.Previous.Height_left = depth - i; + } + } + else + { + if (buffer1.Previous.Height_right < depth - i) + { + buffer1.Previous.Height_right = depth - i; + } + } + } + + buffer1 = buffer1.Previous; + i--; + } + + return temp; + } + else if (current.Data > n) + { + current.Left = InnerInsert(n, current.Left, current, depth + 1); + } + else if (current.Data < n) + { + current.Right = InnerInsert(n, current.Right, current, depth + 1); + } + + return current; + } + } +} \ No newline at end of file diff --git a/CourseApp/Module5/Task_2/CheckBalancedTree.cs b/CourseApp/Module5/Task_2/CheckBalancedTree.cs new file mode 100644 index 0000000..13e6d83 --- /dev/null +++ b/CourseApp/Module5/Task_2/CheckBalancedTree.cs @@ -0,0 +1,29 @@ +using System; +using System.IO; +using System.Linq; +using System.Collections.Generic; + +namespace CourseApp.Module5.Task_2 +{ + public class CheckBalancedTree + { + public static void CheckTree() + { + StreamReader reader = new StreamReader("input.txt"); + int[] numbers = reader.ReadLine().Trim().Split(' ').Select(n => Convert.ToInt32(n)).ToArray(); + reader.Close(); + BinaryTree tree = new BinaryTree(); + foreach (var item in numbers) + { + if (item != 0) + { + tree.Insert(item); + } + } + + StreamWriter output = new StreamWriter("output.txt"); + output.WriteLine(tree.IsBalanced() ? "YES" : "NO"); + output.Close(); + } + } +} \ No newline at end of file diff --git a/CourseApp/Module5/Task_2/Node.cs b/CourseApp/Module5/Task_2/Node.cs new file mode 100644 index 0000000..5c09dcd --- /dev/null +++ b/CourseApp/Module5/Task_2/Node.cs @@ -0,0 +1,24 @@ +namespace CourseApp.Module5.Task_2 +{ + public class Node + { + public Node (int input) + { + Left = null; + Right = null; + Data = input; + } + + public Node Previous { get; set; } + + public Node Left { get; set; } + + public Node Right { get; set; } + + public int Data { get; set; } + + public int Height_left { get; set; } + + public int Height_right { get; set; } + } +} \ No newline at end of file diff --git a/CourseApp/Module5/Task_3/SegmentGCD.cs b/CourseApp/Module5/Task_3/SegmentGCD.cs new file mode 100644 index 0000000..ed43170 --- /dev/null +++ b/CourseApp/Module5/Task_3/SegmentGCD.cs @@ -0,0 +1,31 @@ +using System; +using System.IO; +using System.Linq; +using System.Collections.Generic; + +namespace CourseApp.Module5.Task_3 +{ + public class SegmentGCD + { + public static void FindGCD() + { + StreamReader reader = new StreamReader("input.txt"); + int size = int.Parse(reader.ReadLine()); + int[] numbers = reader.ReadLine().Trim().Split(' ').Select(n => Convert.ToInt32(n)).ToArray(); + int query_count = int.Parse(reader.ReadLine()); + SegmentTree tree = new SegmentTree(size); + tree.Build(numbers); + List res = new List(); + for (int i = 0; i < query_count; i++) + { + int[] borders = reader.ReadLine().Trim().Split(' ').Select(n => Convert.ToInt32(n)).ToArray(); + res.Add(tree.GetGCD(borders[0], borders[1])); + } + + reader.Close(); + StreamWriter output = new StreamWriter("output.txt"); + output.WriteLine(string.Join(" ", res)); + output.Close(); + } + } +} \ No newline at end of file diff --git a/CourseApp/Module5/Task_3/SegmentTree.cs b/CourseApp/Module5/Task_3/SegmentTree.cs new file mode 100644 index 0000000..a9701ae --- /dev/null +++ b/CourseApp/Module5/Task_3/SegmentTree.cs @@ -0,0 +1,69 @@ +namespace CourseApp.Module5.Task_3 +{ + public class SegmentTree + { + private int[] segments; + + private int size; + + public SegmentTree(int input) + { + segments = new int[4 * input]; + size = input; + } + + public int GCD(int a, int b) + { + while (b != 0) + { + int temp = b; + b = a % b; + a = temp; + } + + return a; + } + + public void Build(int[] numbers) + { + InnerBuild(0, 0, size, numbers); + } + + public int GetGCD(int query_left, int query_right) + { + return InnerGetGCD(0, 0, size, segments, query_left - 1, query_right); + } + + private void InnerBuild(int index, int left, int right, int[] numbers) + { + if (right - left == 1) + { + segments[index] = numbers[left]; + return; + } + + int half = (left + right) / 2; + InnerBuild((2 * index) + 1, left, half, numbers); + InnerBuild((2 * index) + 2, half, right, numbers); + segments[index] = GCD(segments[(2 * index) + 1], segments[(2 * index) + 2]); + } + + private int InnerGetGCD(int index, int left, int right, int[] segment, int query_left, int query_right) + { + if (query_left <= left && query_right >= right) + { + return segment[index]; + } + + if (query_left >= right || query_right <= left) + { + return 0; + } + + int half = (left + right) / 2; + int ans_left = InnerGetGCD((2 * index) + 1, left, half, segment, query_left, query_right); + int ans_right = InnerGetGCD((2 * index) + 2, half, right, segment, query_left, query_right); + return GCD(ans_left, ans_right); + } + } +} \ No newline at end of file diff --git a/CourseApp/Module5/Task_4/IndexOfNulls.cs b/CourseApp/Module5/Task_4/IndexOfNulls.cs new file mode 100644 index 0000000..513aead --- /dev/null +++ b/CourseApp/Module5/Task_4/IndexOfNulls.cs @@ -0,0 +1,31 @@ +using System; +using System.IO; +using System.Linq; +using System.Collections.Generic; + +namespace CourseApp.Module5.Task_4 +{ + public class IndexOfNulls + { + public static void CheckIndexs() + { + StreamReader reader = new StreamReader("input.txt"); + int size = int.Parse(reader.ReadLine()); + int[] numbers = reader.ReadLine().Trim().Split(' ').Select(n => Convert.ToInt32(n)).ToArray(); + int query_count = int.Parse(reader.ReadLine()); + SegmentTree tree = new SegmentTree(size); + tree.Build(numbers); + List res = new List(); + for (int i = 0; i < query_count; i++) + { + int[] comands = reader.ReadLine().Trim().Split(' ').Select(n => Convert.ToInt32(n)).ToArray(); + res.Add(tree.GetIndex(comands[0], comands[1], comands[2])); + } + + reader.Close(); + StreamWriter output = new StreamWriter("output.txt"); + output.WriteLine(string.Join(" ", res)); + output.Close(); + } + } +} \ No newline at end of file diff --git a/CourseApp/Module5/Task_4/SegmentTree.cs b/CourseApp/Module5/Task_4/SegmentTree.cs new file mode 100644 index 0000000..844d53b --- /dev/null +++ b/CourseApp/Module5/Task_4/SegmentTree.cs @@ -0,0 +1,126 @@ +using System; +using System.IO; +using System.Linq; +using System.Collections.Generic; + +namespace CourseApp.Module5.Task_4 +{ + public class SegmentTree + { + private List[] segments; + + private int size; + + public SegmentTree(int input) + { + segments = new List[4 * input]; + size = input; + } + + public List Check(List a, List b) + { + List temp; + if (a.Count() == 0 && b.Count() != 0) + { + temp = new List(b); + return temp; + } + else if (a.Count() != 0 && b.Count() != 0) + { + temp = new List(a); + temp.AddRange(b); + return temp; + } + + temp = new List(a); + return temp; + } + + public void Build(int[] numbers) + { + InnerBuild(0, 0, size, numbers); + } + + public int GetIndex(int query_left, int query_right, int find) + { + bool trigger = true; + List buf = InnerGetIndex(0, 0, size, segments, query_left - 1, query_right, ref find, ref trigger); + if (buf.Count() < find) + { + return -1; + } + else + { + return buf.ElementAt(find - 1); + } + } + + private void InnerBuild(int index, int left, int right, int[] numbers) + { + if (right - left == 1) + { + segments[index] = new List(); + if (numbers[left] == 0) + { + segments[index].Add(left + 1); + } + + return; + } + + int half = (left + right) / 2; + InnerBuild((2 * index) + 1, left, half, numbers); + InnerBuild((2 * index) + 2, half, right, numbers); + segments[index] = Check(segments[(2 * index) + 1], segments[(2 * index) + 2]); + } + + private List InnerGetIndex(int index, int left, int right, List[] segment, int query_left, int query_right, ref int find, ref bool trigger) + { + if (!trigger) + { + return new List(); + } + + if (query_left <= left && query_right >= right) + { + return segment[index]; + } + + if (query_left >= right || query_right <= left) + { + return new List(); + } + + int half = (left + right) / 2; + List ans_left = InnerGetIndex((2 * index) + 1, left, half, segment, query_left, query_right, ref find, ref trigger); + if (ans_left.Count() != 0) + { + if (ans_left.Count() < find) + { + find -= ans_left.Count(); + } + else + { + trigger = false; + return ans_left; + } + } + + List ans_right = InnerGetIndex((2 * index) + 2, half, right, segment, query_left, query_right, ref find, ref trigger); + if (ans_right.Count() != 0) + { + if (ans_right.Count() < find) + { + find -= ans_right.Count(); + } + else + { + trigger = false; + return ans_right; + } + } + + return new List(); + } + } +} \ No newline at end of file diff --git a/CourseApp/Module5/Task_5/DynamicSegmentTree.cs b/CourseApp/Module5/Task_5/DynamicSegmentTree.cs new file mode 100644 index 0000000..bd51c2c --- /dev/null +++ b/CourseApp/Module5/Task_5/DynamicSegmentTree.cs @@ -0,0 +1,95 @@ +namespace CourseApp.Module5.Task_5 +{ + public class DynamicSegmentTree + { + private int[] segments; + + private int size; + + public DynamicSegmentTree(int input) + { + segments = new int[4 * input]; + size = input; + } + + public int GCD(int a, int b) + { + while (b != 0) + { + int temp = b; + b = a % b; + a = temp; + } + + return a; + } + + public void Build(int[] numbers) + { + InnerBuild(0, 0, size, numbers); + } + + public void Update (int index, int value) + { + InnerUpdate(0, 0, size, segments, index - 1, value); + } + + public int GetGCD(int query_left, int query_right) + { + return InnerGetGCD(0, 0, size, segments, query_left - 1, query_right); + } + + private void InnerBuild(int index, int left, int right, int[] numbers) + { + if (right - left == 1) + { + segments[index] = numbers[left]; + return; + } + + int half = (left + right) / 2; + InnerBuild((2 * index) + 1, left, half, numbers); + InnerBuild((2 * index) + 2, half, right, numbers); + segments[index] = GCD(segments[(2 * index) + 1], segments[(2 * index) + 2]); + } + + private void InnerUpdate (int index, int left, int right, int[] segment, int upd_index, int value) + { + if (right - left == 1) + { + segments[index] = value; + return; + } + + int half = (left + right) / 2; + if (upd_index < half) + { + InnerUpdate((2 * index) + 1, left, half, segment, upd_index, value); + } + else + { + InnerUpdate((2 * index) + 2, half, right, segment, upd_index, value); + } + + segments[index] = GCD(segments[(2 * index) + 1], segments[(2 * index) + 2]); + } + + private int InnerGetGCD(int index, int left, int right, int[] segment, int query_left, int query_right) + { + if (query_left <= left && query_right >= right) + { + return segment[index]; + } + + if (query_left >= right || query_right <= left) + { + return 0; + } + + int half = (left + right) / 2; + int ans_left = InnerGetGCD((2 * index) + 1, left, half, segment, query_left, query_right); + int ans_right = InnerGetGCD((2 * index) + 2, half, right, segment, query_left, query_right); + return GCD(ans_left, ans_right); + } + } +} \ No newline at end of file diff --git a/CourseApp/Module5/Task_5/SegmentGCD.cs b/CourseApp/Module5/Task_5/SegmentGCD.cs new file mode 100644 index 0000000..f8f0391 --- /dev/null +++ b/CourseApp/Module5/Task_5/SegmentGCD.cs @@ -0,0 +1,38 @@ +using System; +using System.IO; +using System.Linq; +using System.Collections.Generic; + +namespace CourseApp.Module5.Task_5 +{ + public class SegmentGCD + { + public static void FindGCD() + { + StreamReader reader = new StreamReader("input.txt"); + int size = int.Parse(reader.ReadLine()); + int[] numbers = reader.ReadLine().Trim().Split(' ').Select(n => Convert.ToInt32(n)).ToArray(); + int query_count = int.Parse(reader.ReadLine()); + DynamicSegmentTree tree = new DynamicSegmentTree(size); + tree.Build(numbers); + List res = new List(); + for (int i = 0; i < query_count; i++) + { + string[] borders = reader.ReadLine().Trim().Split(' ').ToArray(); + if (borders[0] == "u") + { + tree.Update(int.Parse(borders[1]), int.Parse(borders[2])); + } + else + { + res.Add(tree.GetGCD(int.Parse(borders[1]), int.Parse(borders[2]))); + } + } + + reader.Close(); + StreamWriter output = new StreamWriter("output.txt"); + output.WriteLine(string.Join(" ", res)); + output.Close(); + } + } +} \ No newline at end of file diff --git a/CourseApp/Module5/Task_6/DynamicSegmentTree.cs b/CourseApp/Module5/Task_6/DynamicSegmentTree.cs new file mode 100644 index 0000000..0ba277e --- /dev/null +++ b/CourseApp/Module5/Task_6/DynamicSegmentTree.cs @@ -0,0 +1,171 @@ +using System; +using System.IO; +using System.Linq; +using System.Collections.Generic; + +namespace CourseApp.Module5.Task_6 +{ + public class DynamicSegmentTree + { + private List[] segments; + + private int size; + + public DynamicSegmentTree(int input) + { + size = input; + int arr_size = 4 * size; + segments = new List[arr_size]; + } + + public void Build(int[] numbers) + { + InnerBuild(0, 0, size, numbers); + } + + public void Update (int index, bool trigger) + { + int pos = 0; + InnerUpdate(0, 0, size, segments, index - 1, trigger, ref pos); + } + + public int GetIndex(int query_left, int query_right, int find) + { + bool trigger = true; + List buf = InnerGetIndex(0, 0, size, segments, query_left - 1, query_right, ref find, ref trigger); + if (buf.Count() < find) + { + return -1; + } + else + { + return buf.ElementAt(find - 1); + } + } + + private void InnerBuild(int index, int left, int right, int[] numbers) + { + if (right - left <= 1) + { + segments[index] = new List(); + if (numbers[left] == 0) + { + segments[index].Add(left + 1); + } + + return; + } + + int half = (left + right) / 2; + InnerBuild((2 * index) + 1, left, half, numbers); + InnerBuild((2 * index) + 2, half, right, numbers); + segments[index] = new List(segments[(2 * index) + 1]); + segments[index].AddRange(segments[(2 * index) + 2]); + } + + private void InnerUpdate (int index, int left, int right, List[] segments, int upd_index, bool trigger, ref int pos) + { + if (right - left <= 1) + { + if (trigger) + { + segments[index].Add(upd_index + 1); + } + else + { + segments[index] = new List(); + } + + return; + } + + int half = (left + right) / 2; + if (upd_index < half) + { + InnerUpdate((2 * index) + 1, left, half, segments, upd_index, trigger, ref pos); + if (trigger) + { + segments[index].Insert(pos, upd_index + 1); + } + else + { + segments[index].Remove(upd_index + 1); + } + } + else + { + InnerUpdate((2 * index) + 2, half, right, segments, upd_index, trigger, ref pos); + if (trigger) + { + if (segments[index].Count() == 0) + { + segments[index].Add(upd_index + 1); + } + else if (segments[(2 * index) + 2].Count() == 1) + { + pos = segments[index].Count(); + segments[index].Add(upd_index + 1); + } + else + { + pos = segments[(2 * index) + 1].Count() + pos; + segments[index].Insert(pos, upd_index + 1); + } + } + else + { + segments[index].Remove(upd_index + 1); + } + } + } + + private List InnerGetIndex(int index, int left, int right, List[] segments, int query_left, int query_right, ref int find, ref bool trigger) + { + if (trigger == false) + { + return new List(); + } + + if (query_left <= left && query_right >= right) + { + return segments[index]; + } + + if (query_left >= right || query_right <= left) + { + return new List(); + } + + int half = (left + right) / 2; + List ans_left = InnerGetIndex((2 * index) + 1, left, half, segments, query_left, query_right, ref find, ref trigger); + if (ans_left.Count() != 0) + { + if (ans_left.Count() < find) + { + find -= ans_left.Count(); + } + else + { + trigger = false; + return ans_left; + } + } + + List ans_right = InnerGetIndex((2 * index) + 2, half, right, segments, query_left, query_right, ref find, ref trigger); + if (ans_right.Count() != 0) + { + if (ans_right.Count() < find) + { + find -= ans_right.Count(); + } + else + { + trigger = false; + return ans_right; + } + } + + return new List(); + } + } +} \ No newline at end of file diff --git a/CourseApp/Module5/Task_6/IndexOfNulls.cs b/CourseApp/Module5/Task_6/IndexOfNulls.cs new file mode 100644 index 0000000..8a40b93 --- /dev/null +++ b/CourseApp/Module5/Task_6/IndexOfNulls.cs @@ -0,0 +1,45 @@ +using System; +using System.IO; +using System.Linq; +using System.Collections.Generic; + +namespace CourseApp.Module5.Task_6 +{ + public class IndexOfNulls + { + public static void CheckIndexs() + { + StreamReader reader = new StreamReader("input.txt"); + int size = int.Parse(reader.ReadLine()); + int[] numbers = reader.ReadLine().Trim().Split(' ').Select(n => Convert.ToInt32(n)).ToArray(); + int query_count = int.Parse(reader.ReadLine()); + DynamicSegmentTree tree = new DynamicSegmentTree(size); + tree.Build(numbers); + List res = new List(); + for (int i = 0; i < query_count; i++) + { + string[] comands = reader.ReadLine().Trim().Split(' ').ToArray(); + if (comands[0] == "u") + { + int first = int.Parse(comands[1]); + int second = int.Parse(comands[2]); + if ((numbers[first - 1] != 0 && second == 0) || (numbers[first - 1] == 0 && second != 0)) + { + bool add_or_del = (numbers[first - 1] != 0 && second == 0) ? true : false; + numbers[first - 1] = second; + tree.Update(first, add_or_del); + } + } + else + { + res.Add(tree.GetIndex(int.Parse(comands[1]), int.Parse(comands[2]), int.Parse(comands[3]))); + } + } + + reader.Close(); + StreamWriter output = new StreamWriter("output.txt"); + output.WriteLine(string.Join(" ", res)); + output.Close(); + } + } +} \ No newline at end of file diff --git a/CourseApp/Program.cs b/CourseApp/Program.cs index cafa825..6689ebc 100644 --- a/CourseApp/Program.cs +++ b/CourseApp/Program.cs @@ -1,5 +1,4 @@ -using System; -using CourseApp.Module2; +using CourseApp.Module5.Task_6; namespace CourseApp { @@ -7,9 +6,7 @@ public class Program { public static void Main(string[] args) { - BubbleSort.BubbleSortMethod(); - - Console.WriteLine("Hello World"); + IndexOfNulls.CheckIndexs(); } } -} +} \ No newline at end of file diff --git a/CourseApp/input.txt b/CourseApp/input.txt new file mode 100644 index 0000000..5bd10d4 --- /dev/null +++ b/CourseApp/input.txt @@ -0,0 +1,6 @@ +5 +0 0 3 0 2 +3 +u 1 5 +u 1 0 +s 1 5 3 \ No newline at end of file diff --git a/CourseApp/output.txt b/CourseApp/output.txt new file mode 100644 index 0000000..b8626c4 --- /dev/null +++ b/CourseApp/output.txt @@ -0,0 +1 @@ +4