#include <bits/stdc++.h>
#pragma GCC optimize("O3")
using namespace std;
#define ll long long
#define pb push_back
#define fr first
#define sc second
#define MAX ((ll)(1e12+100))
#define MX ((ll)(1e6+100))
#define ARRS ((ll)(2e5+100))
#define HS ((ll)(233))
#define MOD ((ll)(1e9+7))
#define EP ((double)(1e-9))
#define LG 21
#define mul(a,b) a=((a)*(b))%MOD
using namespace std;
ll dp[40][300][300];
ll pas[400];
int main(){
#ifdef KHOKHO
freopen("in.in","r",stdin);
freopen("out.out","w",stdout);
#endif // KHOKHO
ios::sync_with_stdio(0);
dp[0][0][100]=1;
for(int i=0; i<=30; i++){
pas[i]=0;
for(int j=0; j<=200; j++){
for(int k=0; k<=200; k++){
dp[i][j][k]%=MOD;
if(k>=1)
dp[i+1][j+2][min(99,k-1)]+=dp[i][j][k];
if(j>=1)
dp[i+1][j-1][k+2]+=dp[i][j][k];
dp[i][j][k]%=MOD;
//if(dp[i][j][k])
//cout<<i<<" "<<j<<" "<<k<<" "<<dp[i][j][k]<<endl;
if(k>=100)
pas[i]+=dp[i][j][k];
}
}
pas[i]%=MOD;
}
ll q,n;
cin>>q>>q;
while(q--){
cin>>n;
cout<<pas[n]<<endl;
}
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
24 ms |
15736 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
25 ms |
15848 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
25 ms |
15848 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
25 ms |
15848 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
31 ms |
15848 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
31 ms |
15848 KB |
Output is correct |
2 |
Correct |
22 ms |
15896 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
31 ms |
15848 KB |
Output is correct |
2 |
Correct |
22 ms |
15896 KB |
Output is correct |
3 |
Incorrect |
21 ms |
15912 KB |
Output isn't correct |