QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#759497#6960. Make 2nullptr_qwqCompile Error//C++141.9kb2024-11-18 09:16:452024-11-18 09:16:45

詳細信息

answer.code:8:1707: error: stray ‘#’ in program
    8 | using namespace std;inline char nc(){static char buf[1000000],*p=buf,*q=buf;return p==q&&(q=(p=buf)+fread(buf,1,1000000,stdin),p==q)?EOF:*p++;}inline ll read(){ll res=0;char c=nc();while(c<'0'||c>'9')c=nc();while(c<='9'&&c>='0')res=res*10+c-'0',c=nc();return res;}char obuf[1<<21],*p3=obuf;inline void pc(char c){p3-obuf<=(1<<20)?(*p3++=c):(fwrite(obuf,p3-obuf,1,stdout),p3=obuf,*p3++=c);}inline void write(ll x){if(x<0)pc('-'),x=-x;if(x>9)write(x/10);pc(x%10+'0');}struct node{ll x,y;}p[N];ll T,n,m,i,a[6][6],b[6][6],t[6][6],g[6][6],las;inline void times(ll a[6][6],ll b[6][6],ll n1,ll n2,ll n3){for(ll i=0;i<=n1;i++){for(ll j=0;j<=n3;j++){for(ll k=0;k<=n2;k++)t[i][j]=(t[i][j]+a[i][k]*b[k][j])%mod;}}for(ll i=0;i<=n1;i++)for(ll j=0;j<=n3;j++)a[i][j]=t[i][j],t[i][j]=0;}inline void calc(ll pos){for(ll i=0;i<=5;i++)for(ll j=0;j<=5;j++)g[i][j]=b[i][j];while(pos){if(pos&1)times(a,g,0,5,5);times(g,g,5,5,5);pos>>=1;}}inline void solve(){memset(a,0,sizeof(a));n=read(),m=read();for(i=1;i<=m;i++)p[i].x=read(),p[i].y=read();a[0][0]=1;for(i=1,las=0;i<=m;i++){calc(p[i].x-las-1),las=p[i].x;if(p[i].y>=4||p[i].y==0)memset(a,0,sizeof(a));else{if(p[i].y==1){t[0][1]+=a[0][0],t[0][2]+=a[0][1],t[0][4]+=a[0][3],t[0][0]+=a[0][4],t[0][5]+=a[0][5];}else if(p[i].y==2){t[0][0]+=a[0][0],t[0][5]+=a[0][1],t[0][4]+=a[0][5],t[0][3]+=a[0][2];}else{t[0][4]+=a[0][1];}a[0][0]=t[0][0]%mod,a[0][1]=t[0][1]%mod,a[0][2]=t[0][2]%mod,a[0][3]=t[0][3]%mod;a[0][4]=t[0][4]%mod,a[0][5]=t[0][5]%mod;memset(t,0,sizeof(t));}}calc(n-las);write(a[0][0]),pc('\n');}int main(){b[0][0]++,b[0][1]++,b[1][5]++,b[1][2]++,b[1][4]++,b[2][3]++,b[3][4]++,b[5][4]++,b[5][5]++,b[4][0]++;T=read();while(T--)solve();return fwrite(obuf,p3-obuf,1,stdout),0;}#include<iostream>int main(){std::cout<<"Hello World!"<<std::endl;return 0;}
      |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           ^
answer.code:8:1708: error: ‘include’ does not name a type
    8 | using namespace std;inline char nc(){static char buf[1000000],*p=buf,*q=buf;return p==q&&(q=(p=buf)+fread(buf,1,1000000,stdin),p==q)?EOF:*p++;}inline ll read(){ll res=0;char c=nc();while(c<'0'||c>'9')c=nc();while(c<='9'&&c>='0')res=res*10+c-'0',c=nc();return res;}char obuf[1<<21],*p3=obuf;inline void pc(char c){p3-obuf<=(1<<20)?(*p3++=c):(fwrite(obuf,p3-obuf,1,stdout),p3=obuf,*p3++=c);}inline void write(ll x){if(x<0)pc('-'),x=-x;if(x>9)write(x/10);pc(x%10+'0');}struct node{ll x,y;}p[N];ll T,n,m,i,a[6][6],b[6][6],t[6][6],g[6][6],las;inline void times(ll a[6][6],ll b[6][6],ll n1,ll n2,ll n3){for(ll i=0;i<=n1;i++){for(ll j=0;j<=n3;j++){for(ll k=0;k<=n2;k++)t[i][j]=(t[i][j]+a[i][k]*b[k][j])%mod;}}for(ll i=0;i<=n1;i++)for(ll j=0;j<=n3;j++)a[i][j]=t[i][j],t[i][j]=0;}inline void calc(ll pos){for(ll i=0;i<=5;i++)for(ll j=0;j<=5;j++)g[i][j]=b[i][j];while(pos){if(pos&1)times(a,g,0,5,5);times(g,g,5,5,5);pos>>=1;}}inline void solve(){memset(a,0,sizeof(a));n=read(),m=read();for(i=1;i<=m;i++)p[i].x=read(),p[i].y=read();a[0][0]=1;for(i=1,las=0;i<=m;i++){calc(p[i].x-las-1),las=p[i].x;if(p[i].y>=4||p[i].y==0)memset(a,0,sizeof(a));else{if(p[i].y==1){t[0][1]+=a[0][0],t[0][2]+=a[0][1],t[0][4]+=a[0][3],t[0][0]+=a[0][4],t[0][5]+=a[0][5];}else if(p[i].y==2){t[0][0]+=a[0][0],t[0][5]+=a[0][1],t[0][4]+=a[0][5],t[0][3]+=a[0][2];}else{t[0][4]+=a[0][1];}a[0][0]=t[0][0]%mod,a[0][1]=t[0]...