예제 #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("Process was supended");
                }
                if (records.Any())
                {
                    Console.WriteLine($"AveTime is {records.Average()}ms");
                }
            }
        }
예제 #2
0
파일: 4979811.cs 프로젝트: qifanyyy/CLCDSA
 public static void Main(string[] args)
 {
     using (var sc = new SetConsole())
     {
         var ny = GetArrayIntInput();
         for (int i = 0; i <= ny[0]; i++)         // 10000
         {
             for (int j = 0; j + i <= ny[0]; j++) // 5000
             {
                 int thousandNum = ny[0] - i - j;
                 if (ny[1] == i * 10000 + j * 5000 + thousandNum * 1000)
                 {
                     CWrite($"{i} {j} {thousandNum}");
                     return;
                 }
             }
         }
         CWrite("-1 -1 -1");
     }
 }