45752023-03-30 09:35:41TortelliniJrÁtvágás (75 pont)csharpRuntime error 0/75307ms36428 KiB
using System;
using System.Linq;
namespace Átvágás
{
    class Program
    {
        static void Main(string[] args)
        {
            int num = int.Parse(Console.ReadLine());
            int[] kapcs = new int[num];
            int[] inp = new int[2];
            for (int i = 0; i < num; i++)
            {
                inp = Console.ReadLine().Split().Select(int.Parse).ToArray();
                kapcs[inp[0]]++;
                kapcs[inp[1]]++;
            }
            int er1 = 0;
            int er2 = int.MaxValue;
            for (int i = 0; i < num; i++)
            {
                er1 += Math.Max(0, inp[i] - 2);
                er2 = Math.Min(er2, num - 1 - inp[i]);
            }
            Console.WriteLine(er1 + " " + er2);
        }
    }
}
SubtaskSumTestVerdictTimeMemory
base0/75
1Runtime error0/032ms20744 KiB
2Runtime error0/032ms21524 KiB
3Runtime error0/034ms22508 KiB
4Runtime error0/430ms21816 KiB
5Runtime error0/432ms22372 KiB
6Runtime error0/432ms22812 KiB
7Runtime error0/432ms23028 KiB
8Runtime error0/432ms23424 KiB
9Runtime error0/432ms23760 KiB
10Runtime error0/4307ms34836 KiB
11Runtime error0/4194ms34916 KiB
12Runtime error0/493ms34996 KiB
13Runtime error0/483ms35124 KiB
14Runtime error0/4303ms35556 KiB
15Runtime error0/4218ms35496 KiB
16Runtime error0/479ms35792 KiB
17Runtime error0/4225ms36428 KiB
18Runtime error0/5134ms36068 KiB
19Runtime error0/6284ms36000 KiB
20Runtime error0/6300ms35972 KiB
21Runtime error0/232ms25348 KiB