80392024-01-12 11:12:23Boti010Egykorúak (75 pont)csharpWrong answer 10/7556ms30008 KiB
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace eletkor
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = int.Parse(Console.ReadLine());
            int[] P = Console.ReadLine().Split().Select(int.Parse).ToArray();
            int[] TE = new int[n];
            int[] TH = new int[n];
            int[] TN = new int[n];
            int[] tval = new int[3];
            int Pn = 0;
            int[] OY = { 1950, 1, 1 };
            int[] h = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };
            int sz = 0;
            int peti = 0;
            int db = 0;
            for (int i = 0; i < n; i++)
            {
                tval = Console.ReadLine().Split().Select(int.Parse).ToArray();
                TE[i] = tval[0];
                TH[i] = tval[1];
                TN[i] = tval[2];
            }
            Pn = (P[0] - 1950) * 365;
            for (int i = 1950; i < P[0]; i++)
            {
                if (i % 4 ==0)
                {
                    sz++;
                }
            }
            Pn += sz;
            for (int i = 0; i < P[1]; i++)
            {
                Pn += h[i];
            }
            if (P[0] % 4 == 0 && P[1] > 2)
            {
                Pn++;
            }
            Pn += P[2];
            peti = Pn;
            for (int j = 0; j < n; j++)
            {
                Pn = 0;
                P[0] = TE[j];
                P[1] = TH[j];
                P[2] = TN[j];
                Pn = (P[0] - 1950) * 365;
                for (int i = 1950; i < P[0]; i++)
                {
                    if (i % 4 == 0)
                    {
                        sz++;
                    }
                }
                Pn += sz;
                for (int i = 0; i < P[1]; i++)
                {
                    Pn += h[i];
                }
                if (P[0] % 4 == 0 && P[1] > 2)
                {
                    Pn++;
                }
                Pn += P[2];
                if (Math.Abs(Pn - peti) <= 365)
                {
                    db++;
                }
                //Console.WriteLine(Pn + " " + peti);
            }
            Console.WriteLine(db);
            Console.ReadKey();
        }
    }
}
 /*for (int i = 0; i < n; i++)
            {
                tval[0] = TE[i];
                tval[1] = TH[i];
                tval[2] = TN[i];
                if (tval[0] % 4 == 0 && tval[1] >= 2)
                {
                    if (tval[2] == 29 || tval[1] > 2)
                    {
                        tval[2]++;
                    }
                    
                }
            }˛*/
SubtaskSumTestVerdictTimeMemory
base10/75
1Accepted0/032ms22388 KiB
2Wrong answer0/056ms28176 KiB
3Accepted5/532ms22892 KiB
4Accepted5/532ms23076 KiB
5Wrong answer0/530ms23344 KiB
6Wrong answer0/532ms24344 KiB
7Wrong answer0/532ms24252 KiB
8Wrong answer0/532ms24032 KiB
9Wrong answer0/534ms24520 KiB
10Wrong answer0/535ms25640 KiB
11Wrong answer0/537ms26060 KiB
12Wrong answer0/539ms26340 KiB
13Wrong answer0/541ms26888 KiB
14Wrong answer0/543ms27592 KiB
15Wrong answer0/546ms28320 KiB
16Wrong answer0/548ms28876 KiB
17Wrong answer0/554ms30008 KiB