9722022-02-07 20:07:51HobimmToronyépítés (80 pont)cpp11Wrong answer 26/808ms17616 KiB
#include <bits/stdc++.h>
#define ll long long
using namespace std;

int main()
{
    int n;
    cin >> n;
    long long 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/02ms1880 KiB
2Wrong answer0/01ms1980 KiB
3Accepted4/41ms1976 KiB
4Accepted4/41ms1984 KiB
5Wrong answer0/51ms1988 KiB
6Wrong answer0/51ms1988 KiB
7Wrong answer0/68ms17616 KiB
8Wrong answer0/62ms3856 KiB
9Accepted7/71ms2004 KiB
10Accepted7/71ms2008 KiB
11Wrong answer0/82ms5124 KiB
12Wrong answer0/88ms17408 KiB
13Wrong answer0/88ms15640 KiB
14Wrong answer0/84ms7208 KiB
15Accepted2/21ms2032 KiB
16Accepted2/21ms2032 KiB