当前位置 : 主页 > 编程语言 > java >

hdu5238

来源:互联网 收集:自由互联 发布时间:2022-08-10
0: 1 1: 1 2: 3 3: 3 4: 5 5: 5 6: 7 7: 7 8: 9 9: 9 10: 11 11: 11 | 0: 0 1: 1 2: 0 3: 1 4: 0 5: 1 6: 0 7: 1 8: 0 9: 1 10: 0 11: 1 12: 0 13: 1 14: 0 15: 1 16: 0 17: 1 18: 0 19: 1 #includebits/stdc++.h using namespace std ; typedef long long LL


0: 1
1: 1
2: 3
3: 3
4: 5
5: 5
6: 7
7: 7
8: 9
9: 9
10: 11

11: 11

|

0: 0
1: 1
2: 0
3: 1
4: 0
5: 1
6: 0
7: 1
8: 0
9: 1
10: 0
11: 1
12: 0
13: 1
14: 0
15: 1
16: 0
17: 1
18: 0
19: 1

&

#include<bits/stdc++.h>
using namespace std;
typedef long long LL;
const int MOD = 29393;
const int MAXN = 50005;
int mod[4] = {7,13,17,19};
int p[4][20][MOD];
int f[MAXN << 2][4][20];
void preprocess(){
for(int i=0;i<4;i++){
for(int j=0,m=mod[i];j<m;j++){
p[i][j][0]=1;
for(int k=1;k<MOD;k++){
p[i][j][k]=p[i][j][k-1]*j%m;
}
}
}
}
void push_up(int o){
for(int i=0;i<4;i++){
for(int j=0,m=mod[i];j<m;j++){
f[o][i][j]=f[rs][i][f[ls] ]
}
}
}
void build(int o,int l,int r){
if(l==r){

}
int m=(l+r)>>1;
build( (o<<1) ,l,m );
build( (o<<1|1),m+1,r );
push_up(o);
}
void solve(){
char c;
scanf("%d%d",&n,&m);
build(1,1,n);
}
int main()
{
int T;
scanf("%d",&T);
preprocess();
for(int i=1;i<=T;i++){
printf("Case #%d:\n",i);
solve();
}
return 0;
}
/*


*/



上一篇:[高效算法 deque运用]UVa120 - Stacks of Flapjacks
下一篇:没有了
网友评论