78082024-01-11 10:45:41NotYouJárda-L (40)csharpAccepted 40/4029ms25060 KiB
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace IL_EST
{
    class Program
    {
        static void Main(string[] args)
        {
            List<long> jh = new List<long>();
            int n = int.Parse(Console.ReadLine());
            jh.Add(1);
            jh.Add(1);
            jh.Add(2);
            jh.Add(5);
            for (int i = 4; i < n + 1; i++)
            {
                jh.Add(jh[i - 1] + jh[i - 2] + 2 * (jh.Sum() - jh[i - 1] - jh[i - 2]));
            }
            Console.WriteLine(jh[n]);
            Console.ReadLine();
        }
    }
}
SubtaskSumTestVerdictTimeMemory
base40/40
1Accepted0/027ms21060 KiB
2Accepted0/028ms21536 KiB
3Accepted2/226ms21364 KiB
4Accepted2/226ms22044 KiB
5Accepted2/227ms22272 KiB
6Accepted2/227ms22700 KiB
7Accepted2/228ms23208 KiB
8Accepted3/329ms23268 KiB
9Accepted3/329ms23712 KiB
10Accepted3/328ms24180 KiB
11Accepted3/328ms24708 KiB
12Accepted3/328ms24512 KiB
13Accepted3/329ms24408 KiB
14Accepted3/329ms24904 KiB
15Accepted3/328ms25060 KiB
16Accepted3/328ms24980 KiB
17Accepted3/328ms24972 KiB