47982023-03-31 12:35:37Leventusz19Átvágás (75 pont)csharpAccepted 75/75374ms34604 KiB
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Átvágás{
    class Program{
        static void Main(){
            int N = int.Parse(Console.ReadLine());
            int[] A = new int[N], tmp = new int[2];
            for (int i = 0;  i < N-1;  i++){
                tmp = Console.ReadLine().Split().Select(int.Parse).ToArray();
                A[tmp[0]-1]++;
                A[tmp[1]-1]++;
            }
            int o1 = 0, o2 = 0;
            o2 = N - A.Max() - 1;
            foreach (int i in A) if (i > 2) o1 += i - 2;
            Console.WriteLine(o1 + " " + o2);
            Console.ReadKey();
        }
    }
}
SubtaskSumTestVerdictTimeMemory
base75/75
1Accepted0/032ms22092 KiB
2Accepted0/032ms22660 KiB
3Accepted0/048ms27576 KiB
4Accepted4/430ms22876 KiB
5Accepted4/432ms23216 KiB
6Accepted4/432ms23464 KiB
7Accepted4/432ms23516 KiB
8Accepted4/432ms23872 KiB
9Accepted4/432ms23492 KiB
10Accepted4/4337ms33288 KiB
11Accepted4/4354ms33844 KiB
12Accepted4/4363ms33524 KiB
13Accepted4/4365ms33872 KiB
14Accepted4/4365ms34180 KiB
15Accepted4/4365ms34044 KiB
16Accepted4/4368ms34028 KiB
17Accepted4/4368ms34224 KiB
18Accepted5/5370ms34328 KiB
19Accepted6/6374ms34220 KiB
20Accepted6/6368ms34604 KiB
21Accepted2/232ms25440 KiB