39212023-03-05 16:04:41czitaVilágnaptár (45 pont)csharpWrong answer 40/4532ms25924 KiB
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace vilagnaptart
{
    class Program
    {
        static void Main(string[] args)
        {
            int[] st = Console.ReadLine().Split().Select(int.Parse).ToArray();
            //int[] st = "2020 1 1".Split().Select(int.Parse).ToArray();
            int[] hod = { 0, 31, 28, 31,  30, 31,  30,  31,   31, 30,  31,  30,  31 };
            int[] hodv = {0, 31, 61, 91, 122, 152, 182, 213, 243, 273, 304, 334, 364, 370 };
            //          { 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, 364 };
            int ev = st[0];
            int ho = st[1];
            int nap = st[2];
           
            int hossz = 0;
            
            for (int i = 1; i < ho; i++)
            {
                hossz += hod[i];
            }
            int ossznap = hossz + nap;
            //for (int j = 1; j < 367; j++)
            //{
            //    int ossznap =j;
           // Console.WriteLine(ossznap);
                string ki = "";
            if (ev % 4 == 0)
                ossznap++;
                if (ev % 4 == 0 && ossznap >= 183)
                {
                    if (ossznap == 183)
                    {
                        ki = ev + " 6 SZN";
                    }
                    else if (ossznap == 366)
                    {
                        ki = ev + " 12 VE";
                    }
                    else
                        ossznap--;
                }
                else
                {
                    if (ossznap == 365)
                    { ki = ev + " 12 VE"; }
                }

                int vev = ev;
                int vho = 0;
                int vnap = 0;
                int ossznapv = 0;

                if (ki == "")
                {
                    for (int i = 1; i < 13; i++)
                    {
                        if (ossznap <= hodv[i])
                        {
                            ki = vev + " " + i + " " + (ossznap - hodv[i - 1]);
                            break;
                        }
                    }
                }
                Console.WriteLine(ki);
           // }
            Console.ReadKey();

        }
    }
}
SubtaskSumTestVerdictTimeMemory
base40/45
1Accepted0/030ms21736 KiB
2Accepted0/029ms21996 KiB
3Wrong answer0/029ms22248 KiB
4Accepted2/232ms22952 KiB
5Wrong answer0/230ms23228 KiB
6Wrong answer0/330ms23684 KiB
7Accepted3/330ms23972 KiB
8Accepted3/330ms24444 KiB
9Accepted3/330ms24168 KiB
10Accepted3/330ms24764 KiB
11Accepted3/330ms24688 KiB
12Accepted3/330ms24916 KiB
13Accepted3/330ms24880 KiB
14Accepted3/330ms24784 KiB
15Accepted3/330ms25000 KiB
16Accepted3/330ms25116 KiB
17Accepted3/330ms25472 KiB
18Accepted2/230ms25588 KiB
19Accepted3/332ms25924 KiB