39722023-03-07 08:11:16PeterVilágnaptár (45 pont)csharpAccepted 45/4532ms26504 KiB
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace vilagnaptar
{
    class Program
    {
        static void Main(string[] args)
        {
            var st = Console.ReadLine().Split().Select(int.Parse).ToArray();
            int ev = st[0];
            int ho = st[1];
            int nap = st[2];

            int[] gergelyhohossz = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };
            int[] vilaghohossz = { 31, 30, 30, 31, 30, 30, 31, 30, 30, 31, 30, 31 };

            if (ev%4==0)
            {
                gergelyhohossz[1] = 29;
                vilaghohossz[5] = 31; //SZN-nek kell majd kiírattatni
            }

            int honap_nap = 0;

            for (int i = 0; i < ho-1; i++)
            {
                honap_nap += gergelyhohossz[i];
            }
            honap_nap += nap;

            if (honap_nap==365)
            {
                Console.WriteLine(ev+" 12 VN");
            }
            else if (honap_nap == 183 && ev%4==0)
            {
                Console.WriteLine(ev+" 6 SZN");
            }
            else
            {
                int cv = 0;
                while (honap_nap > vilaghohossz[cv])
                {
                    honap_nap -= vilaghohossz[cv];
                    cv++;
                }

                Console.WriteLine("{0} {1} {2}", ev, cv+1, honap_nap);


                
                //Leosztani az elemeket
            }

            Console.ReadKey();
        }
    }
}
SubtaskSumTestVerdictTimeMemory
base45/45
1Accepted0/032ms21744 KiB
2Accepted0/030ms22372 KiB
3Accepted0/030ms22488 KiB
4Accepted2/232ms23196 KiB
5Accepted2/230ms23244 KiB
6Accepted3/332ms23464 KiB
7Accepted3/330ms23732 KiB
8Accepted3/330ms24444 KiB
9Accepted3/332ms24608 KiB
10Accepted3/330ms24616 KiB
11Accepted3/329ms25268 KiB
12Accepted3/329ms25484 KiB
13Accepted3/332ms25540 KiB
14Accepted3/330ms25720 KiB
15Accepted3/329ms25676 KiB
16Accepted3/329ms25744 KiB
17Accepted3/332ms25948 KiB
18Accepted2/230ms26108 KiB
19Accepted3/329ms26504 KiB