Exemplo n.º 1
0
        static void Main()
        {
            var records = new List <long>();

            while (true)
            {
                try
                {
                    using (var sc = new SetConsole())
                    {
                        var sw = new Stopwatch();
                        sw.Start();
                        Program.Main(null);
                        sw.Stop();
                        records.Add(sw.ElapsedMilliseconds);
                        sw.Reset();
                    }
                }
                catch (Exception ex)
                {
                    Console.WriteLine(ex);
                    Console.WriteLine("\n====================");
                    Console.WriteLine("Process was supended");
                    Console.WriteLine("====================\n");
                }
                if (records.Any())
                {
                    Console.WriteLine("\n====================");
                    Console.WriteLine($"Time is {records.Last()}ms");
                    Console.WriteLine($"AveTime is {records.Average()}ms");
                    Console.WriteLine("====================\n");
                }
            }
        }
Exemplo n.º 2
0
 public static void Main(string[] args)
 {
     using (var sc = new SetConsole())
     {
         int n  = GetString().ToInt();
         var ts = new List <int[]>
         {
             new int[] { 0, 0, 0 }
         };
         for (int i = 1; i <= n; i++)
         {
             ts.Add(GetArray <int>());
         }
         for (int i = 1; i <= n; i++)
         {
             if (Abs(ts[i][0] - ts[i - 1][0]) < Abs(ts[i][1] - ts[i - 1][1]) + Abs(ts[i][2] - ts[i - 1][2]))
             {
                 CWrite("No");
                 return;
             }
             if (ts[i][0] % 2 != (ts[i][1] + ts[i][2]) % 2)
             {
                 CWrite("No");
                 return;
             }
         }
         CWrite("Yes");
     }
 }