79812024-01-12 09:38:39Leventusz09Egykorúak (75 pont)csharpAccepted 75/7554ms30280 KiB
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Egykorúak{
    class Program{
        static void Main(){
            int N = int.Parse(Console.ReadLine());
            //int[] P = Console.ReadLine().Split().Select(int.Parse).ToArray();
            Array[] T = new Array[N+1];
            int[] Ts = new int[N+1];

            int[] temp;
            for(int i=0; i<N+1; i++){
                temp = Console.ReadLine().Split().Select(int.Parse).ToArray();
                T[i] = temp;
                for(int j = 1950; j<temp[0]; j++){
                    Ts[i] += 365;
                    if (j % 4 == 0) Ts[i]++;
                }
                for(int j = 0; j<temp[1]; j++){
                    switch (j){
                        case 2:
                            Ts[i] += 28;
                            if (temp[0] % 4 == 0) Ts[i]++;
                            break;
                        case 4:
                            Ts[i] += 30;
                            break;
                        case 6:
                            Ts[i] += 30;
                            break;
                        case 9:
                            Ts[i] += 30;
                            break;
                        case 11:
                            Ts[i] += 30;
                            break;
                        default:
                            Ts[i] += 31;
                            break;

                    }
                }
                Ts[i] += temp[2];
            }
            int o1 = 0;
            for(int i=0; i<N; i++){
                if (Math.Abs(Ts[i + 1] - Ts[0]) <= 365) o1++;
            }

            Console.WriteLine(o1);

            //
        }
    }
}
SubtaskSumTestVerdictTimeMemory
base75/75
1Accepted0/030ms22288 KiB
2Accepted0/054ms28496 KiB
3Accepted5/530ms22780 KiB
4Accepted5/532ms23132 KiB
5Accepted5/530ms23884 KiB
6Accepted5/532ms23744 KiB
7Accepted5/532ms23588 KiB
8Accepted5/534ms24040 KiB
9Accepted5/532ms24552 KiB
10Accepted5/537ms25716 KiB
11Accepted5/535ms25992 KiB
12Accepted5/539ms26944 KiB
13Accepted5/541ms27888 KiB
14Accepted5/545ms28644 KiB
15Accepted5/546ms29172 KiB
16Accepted5/548ms29636 KiB
17Accepted5/554ms30280 KiB