39172023-03-05 14:43:55czitaVilágnaptár (45 pont)csharpWrong answer 31/4532ms24920 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[] hod = { 0, 31, 28, 31,  30, 31,  30,  31,   31, 30,  31,  30,  31 };
            int[] hodv = {0, 31, 60, 90, 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;
            string ki = "";
            for (int i = 1; i < ho; i++)
            {
                hossz += hod[i];
            }
            int ossznap = hossz + nap;
            if (ev % 4 == 0 && ossznap >= 182)
            {
                if (ossznap == 182)
                {
                    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
base31/45
1Accepted0/030ms21968 KiB
2Accepted0/029ms22320 KiB
3Wrong answer0/029ms22608 KiB
4Accepted2/229ms23056 KiB
5Wrong answer0/229ms23224 KiB
6Accepted3/329ms23468 KiB
7Wrong answer0/332ms23708 KiB
8Accepted3/330ms23912 KiB
9Accepted3/329ms24248 KiB
10Wrong answer0/329ms24588 KiB
11Accepted3/329ms24424 KiB
12Accepted3/329ms24584 KiB
13Wrong answer0/329ms24472 KiB
14Accepted3/329ms24428 KiB
15Accepted3/332ms24760 KiB
16Accepted3/329ms24748 KiB
17Wrong answer0/329ms24648 KiB
18Accepted2/229ms24920 KiB
19Accepted3/329ms24888 KiB