45762023-03-30 09:36:37TortelliniJrÁtvágás (75 pont)csharpRuntime error 0/75312ms35492 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 = 1000000;
            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/032ms21220 KiB
2Runtime error0/032ms21956 KiB
3Runtime error0/035ms23292 KiB
4Runtime error0/432ms22524 KiB
5Runtime error0/432ms23004 KiB
6Runtime error0/430ms22636 KiB
7Runtime error0/432ms22956 KiB
8Runtime error0/432ms23424 KiB
9Runtime error0/432ms24064 KiB
10Runtime error0/4303ms34928 KiB
11Runtime error0/4194ms34516 KiB
12Runtime error0/496ms34608 KiB
13Runtime error0/489ms34924 KiB
14Runtime error0/4300ms34820 KiB
15Runtime error0/4215ms34488 KiB
16Runtime error0/479ms34664 KiB
17Runtime error0/4218ms34488 KiB
18Runtime error0/5134ms34952 KiB
19Runtime error0/6284ms35076 KiB
20Runtime error0/6312ms35492 KiB
21Runtime error0/232ms25072 KiB