72522024-01-05 14:43:15czitaVilágnaptár (45 pont)csharpAccepted 45/4532ms26096 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)
        {
            int[] st = Console.ReadLine().Split().Select(int.Parse).ToArray();

            int ev = st[0];
            int ho = st[1];
            int nap = st[2];
            if (ho == 12 && nap == 31)
            {
                Console.WriteLine($"{ev} 12 VN");
            }
            else if (ev % 4 == 0 && ho == 7 && nap == 1)
            {
                Console.WriteLine($"{ev} 6 SZN");
            }
            else
            if (ev % 4 != 0)//szököév-e
            {
                int[] hoN = { 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, 365 };
                int[] hoVN = { 1, 32, 62, 92, 123, 153, 183, 214, 244, 274, 305, 335, 365 };
                int evnapja = hoN[ho - 1] + nap;
                int cv = 0;
                while (cv < 12 && evnapja >= hoVN[cv])
                {
                    cv++;
                }

                Console.WriteLine($"{ev} {cv} {evnapja - hoVN[cv - 1] + 1}");

            }
            else
            {

                int[] hoN = { 0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335, 366 };
                int[] hoVN = { 1, 32, 62, 92, 123, 153, 184, 215, 245, 275, 306, 336, 366 };
                int evnapja = hoN[ho - 1] + nap;
                int cv = 0;
                while (cv < 12 && evnapja >= hoVN[cv])
                {
                    cv++;
                }

                Console.WriteLine($"{ev} {cv} {evnapja - hoVN[cv - 1] + 1}");

            }
            Console.ReadKey();
        }
    }
}
SubtaskSumTestVerdictTimeMemory
base45/45
1Accepted0/032ms22176 KiB
2Accepted0/030ms23048 KiB
3Accepted0/030ms23316 KiB
4Accepted2/230ms23480 KiB
5Accepted2/229ms23724 KiB
6Accepted3/329ms23620 KiB
7Accepted3/330ms23568 KiB
8Accepted3/330ms23784 KiB
9Accepted3/330ms24000 KiB
10Accepted3/332ms24304 KiB
11Accepted3/330ms24296 KiB
12Accepted3/330ms24308 KiB
13Accepted3/330ms24616 KiB
14Accepted3/330ms25204 KiB
15Accepted3/330ms25028 KiB
16Accepted3/332ms25128 KiB
17Accepted3/332ms25516 KiB
18Accepted2/232ms25568 KiB
19Accepted3/332ms26096 KiB