93152024-02-20 12:44:15Leventusz09Átvágás (75 pont)csharpWrong answer 39/75372ms39348 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], B = new int[N];
            string[] temp;

            int[] F = new int[N];
            int[] F2 = new int[N];
            for(int i=0; i<N-1; i++){
                temp = Console.ReadLine().Split();
                A[i] = int.Parse(temp[0]) - 1;
                B[i] = int.Parse(temp[1]) - 1;
                F[A[i]]++;
                F[B[i]]++;
                //F[B[i]]++;
            }
            int o1 = 0, o2= 0, Fmi=Array.IndexOf(F, F.Max());
            for(int i=0; i<N; i++){
                if (F[i] > 2) o1+= F[i] - 2;
                if (i != Fmi && F[i] > 1) o2+= F[i];
            }
            Console.WriteLine("{0} {1}", o1, o2-1);



        }
    }
}
SubtaskSumTestVerdictTimeMemory
base39/75
1Accepted0/030ms21708 KiB
2Accepted0/029ms22068 KiB
3Wrong answer0/046ms25692 KiB
4Partially correct2/430ms22772 KiB
5Partially correct2/429ms22932 KiB
6Partially correct2/428ms22716 KiB
7Partially correct2/429ms23080 KiB
8Partially correct2/429ms23352 KiB
9Partially correct2/429ms23184 KiB
10Accepted4/4326ms37312 KiB
11Partially correct2/4342ms37764 KiB
12Partially correct2/4347ms38032 KiB
13Partially correct2/4372ms38200 KiB
14Partially correct2/4356ms37988 KiB
15Partially correct2/4358ms38224 KiB
16Partially correct2/4352ms38296 KiB
17Partially correct2/4358ms38560 KiB
18Partially correct2/5354ms38644 KiB
19Partially correct3/6352ms38748 KiB
20Partially correct3/6349ms39348 KiB
21Partially correct1/229ms25300 KiB