81082024-01-12 13:46:30DominikVilágnaptár (45 pont)csharpWrong answer 30/4529ms24752 KiB
using System;

namespace vilagnaptar2
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] line = Console.ReadLine().Split(' ');
            int ev = int.Parse(line[0]);
            int honap = int.Parse(line[1]);
            int nap = int.Parse(line[2]);
            int[] napok = new int[12] { 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334 };
            int[] napok1 = new int[13] { 0, 31, 61, 91, 122, 152, 182, 213, 243, 273, 304, 334, 365 };
            int[] napok2 = new int[13] { 0, 31, 61, 91, 122, 152, 183, 214, 244, 274, 305, 335, 366 };
            int newnap = 0, newhonap = 0;
            if (ev % 4 == 0)
            {
                if (honap==7&&nap==1)
                {
                    Console.WriteLine(ev + " " + 6 + " SZN");
                }
                else if (honap==12&&nap==31)
                {
                    Console.WriteLine(ev + " " + honap + " VN");
                }
                else
                {
                    int elteltnap = napok[honap - 1] + nap;
                    for (int i = 0; i < napok2.Length; i++)
                    {
                        if (napok2[i] >= elteltnap)
                        {
                            newhonap = i;
                            newnap = elteltnap - napok2[i];
                            i = napok.Length;
                        }
                    }
                    Console.WriteLine(ev + " " + newhonap + " " + newnap);
                }
            }
            else
            {
                if (honap == 12 && nap == 31)
                {
                    Console.WriteLine(ev + " " + honap + " VN");
                }
                else
                {
                    int elteltnap = napok[honap - 1] + nap;
                    //int iciklus = 0;
                    for (int i = 0; i < napok1.Length; i++)
                    {
                        if (napok2[i] >= elteltnap)
                        {
                            newhonap = i;
                            newnap = elteltnap - napok1[i - 1];
                            i = napok.Length;
                        }
                    }
                    Console.WriteLine(ev + " " + newhonap + " " + newnap);
                }
            }
            
            Console.ReadKey();
        }
    }
}
SubtaskSumTestVerdictTimeMemory
base30/45
1Accepted0/029ms20816 KiB
2Accepted0/028ms21056 KiB
3Accepted0/027ms21512 KiB
4Accepted2/227ms21772 KiB
5Accepted2/228ms21920 KiB
6Wrong answer0/328ms22720 KiB
7Wrong answer0/328ms23248 KiB
8Accepted3/328ms23120 KiB
9Accepted3/328ms23540 KiB
10Wrong answer0/328ms23536 KiB
11Wrong answer0/328ms23832 KiB
12Accepted3/328ms23948 KiB
13Accepted3/328ms23852 KiB
14Accepted3/327ms23788 KiB
15Accepted3/328ms23840 KiB
16Accepted3/328ms24268 KiB
17Accepted3/327ms24320 KiB
18Accepted2/228ms24220 KiB
19Wrong answer0/328ms24752 KiB