72482024-01-05 12:43:49czitaVilágnaptár (45 pont)csharpWrong answer 25/4532ms25852 KiB
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace naptar
{
    class Program
    {
        static void Main(string[] args)
        {
            int[] st = Console.ReadLine().Split().Select(int.Parse).ToArray();
            // int[] st = "2021 1 1".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 };
                int[] hoVN = { 0, 31, 61, 91, 122, 152, 182, 213, 243, 273, 305, 335 };
                int evnapja = hoN[ho - 1] + nap;
                
                int cv = 0;
                while (evnapja >= hoVN[cv])
                {
                    cv++;
                }

                Console.WriteLine($"{ev} {cv} {evnapja - hoVN[cv - 1]}");
            }
            else
            {
               
                int[] hoN = { 0, 31, 60, 91, 121, 152, 181, 212, 243, 273, 304, 334 };
                int[] hoVN = { 0, 31, 61, 91, 122, 152, 182, 212, 243, 273, 305, 335 };
                int evnapja = hoN[ho - 1] + nap;
                int cv = 0;
                while (evnapja >= hoVN[cv])
                {
                    cv++;
                }
                
                Console.WriteLine($"{ev} {cv} {evnapja - hoVN[cv - 1]}");
            }
            Console.ReadKey();
        }
    }
}
SubtaskSumTestVerdictTimeMemory
base25/45
1Accepted0/032ms22128 KiB
2Accepted0/030ms22644 KiB
3Accepted0/030ms23224 KiB
4Wrong answer0/230ms23972 KiB
5Accepted2/230ms24072 KiB
6Accepted3/330ms24200 KiB
7Wrong answer0/330ms24368 KiB
8Accepted3/330ms24312 KiB
9Wrong answer0/332ms24728 KiB
10Accepted3/332ms25132 KiB
11Wrong answer0/332ms25296 KiB
12Accepted3/330ms25308 KiB
13Wrong answer0/332ms25620 KiB
14Accepted3/330ms25736 KiB
15Wrong answer0/330ms25652 KiB
16Accepted3/332ms25772 KiB
17Wrong answer0/330ms25852 KiB
18Accepted2/230ms25452 KiB
19Accepted3/329ms25544 KiB