#include<cstdio>#define ll long long
llread(){charc=getchar();llnum=0;while(c>'9'||c<'0'){c=getchar();}while(c<='9'&&c>='0'){num=(num<<1)+(num<<3)+(c^'0');c=getchar();}returnnum;}
#include<cstdio>#include<algorithm>#define ll long long
usingnamespacestd;llread(){charc=getchar();llnum=0;while(c>'9'||c<'0'){c=getchar();}while(c<='9'&&c>='0'){num=(num<<1)+(num<<3)+(c^'0');c=getchar();}returnnum;}llyear=-4713,month=1,day=1;intDayInMon(inty,intm){boolr_year=false;if(y<0){if((-(y+1))%4==0)r_year=true;}elseif(y<1582){if(y%4==0)r_year=true;}else{if(y%4==0&&(y%400==0||y%100!=0))r_year=true;}if(m==2)returnr_year?29:28;if(m<=7)returnm%2==0?30:31;elsereturnm%2==0?31:30;}voidadd(){if(day<DayInMon(year,month)){day++;}else{if(month<12){month++;day=1;}else{if(year==-1)year++;year++;month=1;day=1;}}}llAyear[100010],Amonth[100010],Aday[100010];structque{llrnk;lldate;}q[100010];boolcmp(quea,queb){returna.date<b.date;}intmain(){freopen("julian.in","r",stdin);freopen("julian.out","w",stdout);llT=read();llmaxon=0;for(lli=1;i<=T;i++){q[i].date=read();q[i].rnk=i;if(maxon<q[i].date)maxon=q[i].date;}llda=0;sort(q,q+T,cmp);llcnt=1;lllu=maxon;while(lu){da++;if(year==1582&&month==10&&day==4){lu--;day=15;}else{add();lu--;}while(da==q[cnt].date){Ayear[q[cnt].rnk]=year;Amonth[q[cnt].rnk]=month;Aday[q[cnt].rnk]=day;cnt++;}}for(inti=1;i<=T;i++){if(Ayear[i]<0)printf("%lld %lld %lld",Aday[i],Amonth[i],-Ayear[i]);elseprintf("%lld %lld %lld",Aday[i],Amonth[i],Ayear[i]);if(year<0)printf(" BC");putchar('\n');}fclose(stdin);fclose(stdout);return0;}
#include<cstdio>#include<algorithm>#define ll long long
usingnamespacestd;llread(){charc=getchar();llnum=0;while(c>'9'||c<'0'){c=getchar();}while(c<='9'&&c>='0'){num=(num<<1)+(num<<3)+(c^'0');c=getchar();}returnnum;}llyear=-4713,month=1,day=1;intDayInMon(inty,intm){boolr_year=false;if(y<0){if((-(y+1))%4==0)r_year=true;}elseif(y<1582){if(y%4==0)r_year=true;}else{if(y%4==0&&(y%400==0||y%100!=0))r_year=true;}if(m==2)returnr_year?29:28;if(m<=7)returnm%2==0?30:31;elsereturnm%2==0?31:30;}voidadd(){if(day<DayInMon(year,month)){day++;}else{if(month<12){month++;day=1;}else{if(year==-1)year++;year++;month=1;day=1;}}}llAyear[100010],Amonth[100010],Aday[100010];structque{llrnk;lldate;}q[100010];boolcmp(quea,queb){returna.date<b.date;}intmain(){freopen("julian.in","r",stdin);freopen("julian.out","w",stdout);llT=read();llmaxon=0;for(lli=1;i<=T;i++){q[i].date=read();q[i].rnk=i;if(maxon<q[i].date)maxon=q[i].date;}llda=0;sort(q+1,q+T+1,cmp);llcnt=1;while(da==q[cnt].date){Ayear[q[cnt].rnk]=year;Amonth[q[cnt].rnk]=month;Aday[q[cnt].rnk]=day;cnt++;}lllu=maxon;while(lu){da++;if(year==1582&&month==10&&day==4){lu--;day=15;}else{add();lu--;}while(da==q[cnt].date){Ayear[q[cnt].rnk]=year;Amonth[q[cnt].rnk]=month;Aday[q[cnt].rnk]=day;cnt++;}}for(inti=1;i<=T;i++){if(Ayear[i]<0)printf("%lld %lld %lld",Aday[i],Amonth[i],-Ayear[i]);elseprintf("%lld %lld %lld",Aday[i],Amonth[i],Ayear[i]);if(Ayear[i]<0)printf(" BC");putchar('\n');}fclose(stdin);fclose(stdout);return0;}
#include<cstdio>#include<algorithm>#include<set>#define ll long long
usingnamespacestd;llread(){charc=getchar();llnum=0;while(c>'9'||c<'0'){c=getchar();}while(c<='9'&&c>='0'){num=(num<<1)+(num<<3)+(c^'0');c=getchar();}returnnum;}intA[1000010];intq[1000010],p[1000010];llcnt=0;set<ll>cannot;intmain(){freopen("zoo.in","r",stdin);freopen("zoo.out","w",stdout);lln=read(),m=read(),c=read(),k=read();for(inti=0;i<n;i++)A[i]=read();for(inti=0;i<m;i++){p[i]=read();q[i]=read();}for(inti=0;i<m;i++){boolflag=false;for(intj=0;j<n;j++){if(A[j]&(1<<(p[i]))){flag=true;}}if(!flag&&cannot.find(1<<(p[i]))==cannot.end()){cnt++;cannot.insert(1<<(p[i]));}}printf("%lld",(1<<(k-cnt))-n);fclose(stdin);fclose(stdout);return0;}
#include<cstdio>#include<algorithm>#include<vector>#define ll long long
#define mod 998244353
usingnamespacestd;llread(){charc=getchar();llnum=0;while(c>'9'||c<'0'){c=getchar();}while(c<='9'&&c>='0'){num=(num<<1)+(num<<3)+(c^'0');c=getchar();}returnnum;}#define ls (p<<1)
#define rs (ls|1)
#define mid (ln[p]+rn[p]>>1)
intnum[100010],ln[400010],rn[400010];llla[400010],lm[400010];lldat[400010];intmx;voidbuild(intp,intl,intr){mx=max(mx,p);ln[p]=l;rn[p]=r;lm[p]=1;if(l==r){dat[p]=num[l];return;}build(ls,l,mid);build(rs,mid+1,r);}voiddown(intp){if(ln[p]==rn[p])return;if(ln[ls]==rn[ls]){if(lm[p]!=1){dat[ls]*=lm[p];}if(la[p]){dat[ls]+=la[p];}dat[ls]%=mod;}else{la[ls]*=lm[p];lm[ls]*=lm[p];la[ls]+=la[p];la[ls]%=mod;}if(ln[rs]==rn[rs]){if(lm[p]!=1){dat[rs]*=lm[p];}if(la[p]){dat[rs]+=la[p];}dat[rs]%=mod;}else{la[rs]*=lm[p];lm[rs]*=lm[p];la[rs]+=la[p];la[rs]%=mod;}lm[p]=1;la[p]=0;}voidadd(intp,intpos,intv){if(ln[p]==rn[p]){dat[p]+=v;return;}down(p);if(pos<=mid)add(ls,pos,v);elseadd(rs,pos,v);}voidmut(intv){la[1]*=v;lm[1]*=v;}voidout(intp){if(ln[p]==rn[p]){printf("%lld ",dat[p]%mod);return;}down(p);out(ls);out(rs);}structfun{intcla;intp,v;inttot;vector<int>fl;}F[100010];voidrun(intrnk){switch(F[rnk].cla){case1:{add(1,F[rnk].p,F[rnk].v);break;}case2:{mut(F[rnk].v);break;}case3:{for(inti=0;i<F[rnk].tot;i++){run(F[rnk].fl[i]);}}}}intFUN[100010];intmain(){freopen("call.in","r",stdin);freopen("call.out","w",stdout);intn=read();for(inti=1;i<=n;i++){num[i]=read();}build(1,1,n);intm=read();for(inti=1;i<=m;i++){intt=read();F[i].cla=t;switch(t){case1:{intp=read(),v=read();F[i].p=p;F[i].v=v;break;}case2:{intv=read();F[i].v=v;break;}case3:{intc=read();F[i].tot=c;for(intj=0;j<c;j++){F[i].fl.push_back(read());}}}}intQ=read();for(inti=0;i<Q;i++){FUN[i]=read();}for(inti=0;i<Q;i++){run(FUN[i]);}out(1);fclose(stdin);fclose(stdout);return0;}
而且!因为我忘记了乘法能不能直接取模,于是我就没给乘法取模,样例3 long long乘爆了输出全是0!