3152021-10-06 15:29:44danimreToronyépítés (1,1,3,3)cpp14Hibás válasz 0/50236ms4964 KiB
// njudgeTorony.cpp : This file contains the 'main' function. Program execution begins and ends there.
//

#include <iostream>
#include <vector>
#include <cmath>
//#include <math.h> remainder(,)
using namespace std;
int Jk(int n)
{
    vector<int> solution(n + 1);
    solution[0] = 0;
    solution[1] = 2;
    solution[2] = 4;
    solution[3] = 10;
    for (size_t i = 4; i < n + 1; i++)
    {
        solution[i] = (2 * solution[i-1] + 2 * solution[i-3])%20210108;
    }
    for (size_t i = 0; i < n+1; i++)
    {
        cout << solution[i] << endl;
    }
    return solution[n];
}
int main()
{
    int N;
    cin >> N;
    cout << Jk(N);
}

// Run program: Ctrl + F5 or Debug > Start Without Debugging menu
// Debug program: F5 or Debug > Start Debugging menu

// Tips for Getting Started: 
//   1. Use the Solution Explorer window to add/manage files
//   2. Use the Team Explorer window to connect to source control
//   3. Use the Output window to see build output and other messages
//   4. Use the Error List window to view errors
//   5. Go to Project > Add New Item to create new code files, or Project > Add Existing Item to add existing code files to the project
//   6. In the future, to open this project again, go to File > Open > Project and select the .sln file
RészfeladatÖsszpontTesztVerdiktIdőMemória
base0/50
1Hibás válasz0/02ms1736 KiB
2Hibás válasz0/03ms1788 KiB
3Hibás válasz0/31ms1844 KiB
4Hibás válasz0/31ms1848 KiB
5Hibás válasz0/41ms1852 KiB
6Hibás válasz0/41ms1856 KiB
7Időlimit túllépés0/4232ms4964 KiB
8Hibás válasz0/4158ms2740 KiB
9Hibás válasz0/41ms1864 KiB
10Hibás válasz0/41ms1868 KiB
11Időlimit túllépés0/4236ms1984 KiB
12Időlimit túllépés0/4228ms4952 KiB
13Időlimit túllépés0/4231ms4504 KiB
14Időlimit túllépés0/4232ms2408 KiB
15Hibás válasz0/21ms1892 KiB
16Hibás válasz0/21ms1892 KiB