3565146167
#define rd(l,r) (rnd()%((r)-(l)+1)+(l))
mt19937 rnd(chrono::steady_clock::now().time_since_epoch().count());编译
-O2 -Wall -std=c++11 -Wl,--stack=512000000缺省源(data)
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N=1e5+15;
inline ll read(){
ll x=0;char f=1,c=getchar();
while(c<48||c>57){if(c=='-')f=0;c=getchar();}
while(c>=48&&c<=57){x=(x<<1)+(x<<3)+c-48;c=getchar();}
return f?x:-x;
}
int solve(){
return 0;
}
int main(){
// freopen(".in","r",stdin);
// freopen(".out","w",stdout);
int T=1;
while(T--){
solve();
if(T!=0)printf("\n");
}
fclose(stdin),fclose(stdout);
return 0;
}checker(大样例)
#include<bits/stdc++.h>
#include<windows.h>
#define S system
using namespace std;
typedef long long ll;
const int N=1e5+15;
inline ll read(){
ll x=0;char f=1,c=getchar();
while(c<48||c>57){if(c=='-')f=0;c=getchar();}
while(c>=48&&c<=57){x=(x<<1)+(x<<3)+c-48;c=getchar();}
return f?x:-x;
}
char s0[105]="",s1[105],s2[105]="";//file,exe
int solve(){
int l=1,r=1;
for(int i=l;i<=r;++i){
memset(s1,0,sizeof(s1));
sprintf(s1,"%s.exe < %s%d.in > test.out",s2,s0,i);
S(s1);
memset(s1,0,sizeof(s1));
sprintf(s1,"fc %s%d.ans test.out",s0,i);
if(S(s1)){
puts("MANBAOUT");
return 0;
}else{
puts("fine");
}
}
return 0;
}
int main(){
// freopen(".in","r",stdin);
// freopen(".out","w",stdout);
int T=1;
while(T--){
solve();
// printf("\n");
}
S("pause");
fclose(stdin),fclose(stdout);
return 0;
}creator
#include<bits/stdc++.h>
#include<windows.h>
#define S system
using namespace std;
typedef long long ll;
const int N=1e5+15;
inline ll read(){
ll x=0;char f=1,c=getchar();
while(c<48||c>57){if(c=='-')f=0;c=getchar();}
while(c>=48&&c<=57){x=(x<<1)+(x<<3)+c-48;c=getchar();}
return f?x:-x;
}
char s0[105]="",s1[105],s2[105]="";//file,exe
int solve(){
int l=1,r=1;
for(int i=l;i<=r;++i){
memset(s1,0,sizeof(s1));
sprintf(s1,"data.exe > %s%d.in",s0,i);
S(s1);
memset(s1,0,sizeof(s1));
sprintf(s1,"%s.exe < %s%d.in > %s%d.out",s2,s0,i,s0,i);
S(s1);
}
return 0;
}
int main(){
// freopen(".in","r",stdin);
// freopen(".out","w",stdout);
int T=1;
while(T--){
solve();
// printf("\n");
}
fclose(stdin),fclose(stdout);
return 0;
}哈希/ntt
//(g 是mod(r*2^k+1)的原根)
素数 r k g
3 1 1 2
5 1 2 2
17 1 4 3
97 3 5 5
193 3 6 5
257 1 8 3
7681 15 9 17
12289 3 12 11
40961 5 13 3
65537 1 16 3
786433 3 18 10
5767169 11 19 3
7340033 7 20 3
23068673 11 21 3
104857601 25 22 3
167772161 5 25 3
469762049 7 26 3
1004535809 479 21 3
2013265921 15 27 31
2281701377 17 27 3
3221225473 3 30 5
75161927681 35 31 3
77309411329 9 33 7
206158430209 3 36 22
2061584302081 15 37 7
2748779069441 5 39 3
6597069766657 3 41 5
39582418599937 9 42 5
79164837199873 9 43 5
263882790666241 15 44 7
1231453023109121 35 45 3
1337006139375617 19 46 3
3799912185593857 27 47 5
4222124650659841 15 48 19
7881299347898369 7 50 6
31525197391593473 7 52 3
180143985094819841 5 55 6
1945555039024054273 27 56 5
4179340454199820289 29 57 3
