78052024-01-11 10:39:15TortelliniJrJárda-L (40)csharpAccepted 40/4029ms24560 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> er = new List<long>();
            int n = int.Parse(Console.ReadLine());
            er.Add(1);
            er.Add(1);
            er.Add(2);
            er.Add(5);
            for (int i = 4; i < n + 1; i++)
            {
                er.Add(er[i - 1] + er[i - 2] + 2 * (er.Sum() - er[i - 1] - er[i - 2]));
            }
            Console.WriteLine(er[n]);
            Console.ReadLine();
        }
    }
}
SubtaskSumTestVerdictTimeMemory
base40/40
1Accepted0/028ms21136 KiB
2Accepted0/028ms21652 KiB
3Accepted2/227ms21808 KiB
4Accepted2/226ms22388 KiB
5Accepted2/228ms22720 KiB
6Accepted2/228ms22852 KiB
7Accepted2/228ms23444 KiB
8Accepted3/328ms23668 KiB
9Accepted3/328ms23884 KiB
10Accepted3/328ms23724 KiB
11Accepted3/328ms23884 KiB
12Accepted3/328ms23984 KiB
13Accepted3/328ms24344 KiB
14Accepted3/328ms24372 KiB
15Accepted3/329ms24296 KiB
16Accepted3/329ms24248 KiB
17Accepted3/328ms24560 KiB