Submission

Status:

PPPPPPPPPP

Subtask/Task Score:

100/100

Score: 100

User: tull

Problemset: Medulla

Language: cpp

Time: 1.497 second

Submitted On: 2026-06-02 23:02:12

#pragma GCC optimize("O3,unroll-loops")
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define bp '\n'
#define ld long double
#define vp cout<<'\n';
#define all(A) A.begin(),A.end()
using pii=pair<int,int>;
const int MOD=1e9+7;
const int MNLL=-1e18;
const int MXLL=1e18;
const int N=2e5+10;
const string sans[]={"NO","YES"};
int d[7'500'500];
signed main(){
    cin.tie(nullptr)->sync_with_stdio(false);
    d[0]=0;
    d[1]=1;
    d[2]=8;
    int n,q,mod=20011;
    cin>>q;
    for(int i=3;i<=7500000;++i){
        d[i]=d[i-1]*d[i-2]%mod+(d[i-3]*d[i-3]%mod*d[i-3])%mod;
        d[i]%=mod;
    }
    while(q--){
        cin>>n;
        cout<<d[n]<<'\n';
    }
}