65672023-12-12 08:35:43Huni136Toronyépítés (1,1,3,3)cpp17Accepted 50/508ms3572 KiB
#include <iostream>
using namespace std;

int main()
{
    long long n,elso=2,masodik=4,harmadik=10;
    cin>>n;
    switch (n)
    {
        case 1:cout<<2; break;
        case 2:cout<<4;break;
        case 3:cout<<10;break;
        default:
        {
            int seged;
            for(int i=n-3;i>=1;i--)
            {
                seged=(harmadik*2+elso*2)%20210108;
                elso=masodik%20210108;
                masodik=harmadik%20210108;
                harmadik=seged%20210108;
            }
            cout<<harmadik;
        }
    }
    
    return 0;
}
SubtaskSumTestVerdictTimeMemory
base50/50
1Accepted0/03ms1748 KiB
2Accepted0/03ms1912 KiB
3Accepted3/33ms2124 KiB
4Accepted3/33ms2336 KiB
5Accepted4/43ms2528 KiB
6Accepted4/43ms2740 KiB
7Accepted4/48ms2968 KiB
8Accepted4/43ms3020 KiB
9Accepted4/43ms3236 KiB
10Accepted4/43ms3248 KiB
11Accepted4/44ms3400 KiB
12Accepted4/48ms3356 KiB
13Accepted4/48ms3320 KiB
14Accepted4/44ms3456 KiB
15Accepted2/23ms3540 KiB
16Accepted2/23ms3572 KiB