80992024-01-12 13:09:14DominikVilágnaptár (45 pont)csharpWrong answer 0/4528ms23880 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)
            {
                int elteltnap = napok[honap - 1] + nap;
                for (int i = 0; i < napok2.Length; i++)
                {
                    if (napok2[i] > elteltnap)
                    {
                        newhonap = i;
                        newnap = napok2[i] - elteltnap;
                    }
                }
            }
            else
            {
                int elteltnap = napok[honap - 1] + nap;
                for (int i = 0; i < napok1.Length; i++)
                {
                    if (napok1[i] > elteltnap)
                    {
                        newhonap = i;
                        newnap = napok1[i] - elteltnap;
                    }
                }
            }
            Console.WriteLine(ev + " " + newhonap + " " + newnap);
        }
    }
}
SubtaskSumTestVerdictTimeMemory
base0/45
1Wrong answer0/027ms20532 KiB
2Wrong answer0/027ms20988 KiB
3Wrong answer0/027ms21056 KiB
4Wrong answer0/227ms21708 KiB
5Wrong answer0/228ms21904 KiB
6Wrong answer0/327ms22044 KiB
7Wrong answer0/327ms22140 KiB
8Wrong answer0/328ms22856 KiB
9Wrong answer0/327ms22528 KiB
10Wrong answer0/328ms23144 KiB
11Wrong answer0/328ms23088 KiB
12Wrong answer0/328ms23088 KiB
13Wrong answer0/328ms22864 KiB
14Wrong answer0/327ms22732 KiB
15Wrong answer0/328ms23540 KiB
16Wrong answer0/328ms23692 KiB
17Wrong answer0/328ms23684 KiB
18Wrong answer0/228ms23576 KiB
19Wrong answer0/328ms23880 KiB