93132024-02-20 12:36:00Leventusz09Átvágás (75 pont)csharpWrong answer 8/75363ms45716 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] >= 3) o1++;
                if (i != Fmi && F[i] > 1) o2+= F[i];
            }
            Console.WriteLine("{0} {1}", o1, o2-1);



        }
    }
}
SubtaskSumTestVerdictTimeMemory
base8/75
1Accepted0/030ms21628 KiB
2Accepted0/029ms22284 KiB
3Wrong answer0/046ms25312 KiB
4Wrong answer0/430ms23096 KiB
5Wrong answer0/430ms22776 KiB
6Partially correct2/430ms23120 KiB
7Wrong answer0/430ms23644 KiB
8Wrong answer0/429ms23648 KiB
9Wrong answer0/429ms23768 KiB
10Partially correct2/4342ms39636 KiB
11Wrong answer0/4352ms41492 KiB
12Wrong answer0/4351ms43936 KiB
13Wrong answer0/4358ms44668 KiB
14Wrong answer0/4356ms44940 KiB
15Wrong answer0/4347ms45040 KiB
16Wrong answer0/4363ms45004 KiB
17Wrong answer0/4352ms45024 KiB
18Wrong answer0/5351ms45228 KiB
19Wrong answer0/6356ms45716 KiB
20Partially correct3/6356ms45420 KiB
21Partially correct1/230ms31404 KiB