Submission
Status:
PPPPPPPPPP
Score: 100
User: PakinDioxide
Problemset: Medulla
Language: cpp
Time: 2.296 second
Submitted On: 2024-12-10 23:22:40
#include <bits/stdc++.h>
using namespace std;
int dp[7500005], mod = 20011;
int main() {
int t, mx = 3;
scanf("%d", &t);
dp[0] = 0, dp[1] = 1, dp[2] = 8;
while (t--) {
int x;
scanf("%d", &x);
if (x >= mx) for (; mx <= x; mx++) dp[mx] = ((((dp[mx-3] * dp[mx-3]) % mod) * dp[mx-3]) % mod + (dp[mx-2] * dp[mx-1]) % mod) % mod;
printf("%d\n", dp[x]);
}
}