Run ID | 作者 | 问题 | 语言 | 测评结果 | 分数 | 时间 | 内存 | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|---|
48320 | seanlsy | 【AB-1】图 | C++ | 通过 | 100 | 79 MS | 1752 KB | 730 | 2022-04-11 22:01:31 |
using namespace std; inline int read(int x=0,bool f=1){ char c=getchar(); while(c>'9'||c<'0'){if(c=='-')f=0;c=getchar();} while(c>='0'&&c<='9'){x=(x<<3)+(x<<1)+c-'0';c=getchar();} return f?x:-x; } int n,m,t,u,v,in[200010],ans=1; int Pow(int x,int y){ int res=1; while(y){ if(y&1) res=res*x%mod; x=x*x%mod; y>>=1; } return res; } signed main(){ n=read(),m=read(),t=read(); while(m--) u=read(),in[v=read()]++; for(int i=2;i<=n;i++) ans=ans*in[i]%mod; printf("%lld\n",ans); for(int i=1;i<=t;i++){ u=read(),v=read(); ans=ans*Pow(in[v],mod-2)%mod*(++in[v])%mod; printf("%lld\n",ans); } return 0; }
exit code: 0, checker exit code: 0
exit code: 0, checker exit code: 0
exit code: 0, checker exit code: 0
exit code: 0, checker exit code: 0
exit code: 0, checker exit code: 0
exit code: 0, checker exit code: 0
exit code: 0, checker exit code: 0
exit code: 0, checker exit code: 0
exit code: 0, checker exit code: 0
exit code: 0, checker exit code: 0