32212023-02-22 18:09:07baranyimarcellToronyépítés (80 pont)cpp17Wrong answer 6/806ms10856 KiB
#include <iostream>
#include <vector>
using namespace std;

int main()
{
    int N, i, j, ossz;
    cin>>N;
    vector<int>ki(N);
    ki[0]=3;
    ki[1]=10;
    if (i>1)
    {
        for (i=2; i<N; i++)
        {
            ossz=0;
            if ((i+1)%2==0)
            {
                ossz+=ki[i-2]+3*ki[i-1];
                ossz%=20210108;
            }
            else
            {
                ossz+=3*ki[i-1]+ki[i-2];
                ossz%=20210108;
            }
            ki[i]=ossz;
        }
    }
    cout<<ki[N-1]<<endl;
}
SubtaskSumTestVerdictTimeMemory
base6/80
1Wrong answer0/03ms1812 KiB
2Wrong answer0/03ms2012 KiB
3Wrong answer0/43ms2364 KiB
4Accepted4/43ms2448 KiB
5Wrong answer0/53ms2476 KiB
6Wrong answer0/53ms2572 KiB
7Wrong answer0/64ms10508 KiB
8Wrong answer0/63ms3708 KiB
9Wrong answer0/73ms3248 KiB
10Wrong answer0/73ms3188 KiB
11Wrong answer0/83ms4584 KiB
12Wrong answer0/84ms10856 KiB
13Wrong answer0/86ms10068 KiB
14Wrong answer0/84ms5996 KiB
15Wrong answer0/23ms3824 KiB
16Accepted2/23ms3760 KiB