9702022-02-07 19:58:36HobimmToronyépítés (80 pont)cpp11Wrong answer 26/806ms9728 KiB
#include <bits/stdc++.h>

using namespace std;

int main()
{
    int n;
    cin >> n;
    int a[n];
    a[0]=3;
    a[1]=10;
    for (int i=2;i<n;i++) {
       a[i]=a[i-2]+a[i-1]*3;
    }
    cout << a[n-1];
    return 0;
}
SubtaskSumTestVerdictTimeMemory
base26/80
1Accepted0/01ms1864 KiB
2Wrong answer0/01ms1916 KiB
3Accepted4/41ms1968 KiB
4Accepted4/41ms1976 KiB
5Wrong answer0/51ms1984 KiB
6Wrong answer0/51ms1984 KiB
7Wrong answer0/66ms9728 KiB
8Wrong answer0/62ms2852 KiB
9Accepted7/71ms1996 KiB
10Accepted7/71ms2000 KiB
11Wrong answer0/82ms3556 KiB
12Wrong answer0/86ms9704 KiB
13Wrong answer0/84ms8756 KiB
14Wrong answer0/82ms4608 KiB
15Accepted2/21ms2016 KiB
16Accepted2/21ms2020 KiB