230712026-01-16 11:38:38MagyarKendeSZLGJárdakövezés háromféle elemmelcpp17Wrong answer 0/30200ms1272 KiB
#include <bits/stdc++.h>
using namespace std;
#define int int64_t

const int MOD = 2023;

int32_t main() {
    cin.tie(0), ios::sync_with_stdio(0);
    int n;
    cin >> n;
    vector<int> dp(n + 1);
    dp[0] = 1;
    for (int i = 1; i <= n; i++) {
        (dp[i] += 2 * dp[i - 1]) %= MOD;
        if (i >= 2) (dp[i] += 7 * dp[i - 2]) %= MOD;
        for (int j = 0; j < i - 2; j++) {
            (dp[i] += 4 * dp[j]) %= MOD;
        }
    }
    cout << dp[n] << "\n";
}
SubtaskSumTestVerdictTimeMemory
base0/30
1Accepted0/01ms512 KiB
2Wrong answer0/01ms500 KiB
3Wrong answer0/21ms316 KiB
4Wrong answer0/21ms500 KiB
5Wrong answer0/21ms316 KiB
6Wrong answer0/21ms324 KiB
7Wrong answer0/21ms508 KiB
8Wrong answer0/21ms316 KiB
9Time limit exceeded0/2200ms640 KiB
10Time limit exceeded0/2200ms756 KiB
11Time limit exceeded0/2199ms820 KiB
12Time limit exceeded0/3200ms820 KiB
13Time limit exceeded0/3173ms508 KiB
14Time limit exceeded0/3174ms384 KiB
15Time limit exceeded0/3175ms1272 KiB