比赛 USACO2026 JAN G&P2 评测结果 WWWWWWWWWWWWWWWW
题目名称 Supervision 最终得分 0
用户昵称 汐汐很希希 运行时间 5.303 s
代码语言 C++ 内存使用 7.99 MiB
提交时间 2026-01-24 11:24:48
显示代码纯文本
#include<bits/stdc++.h>
#define ll long long
using namespace std;
const int N=1e6+10;
const int M=2e5+10;
const int MOD=1e9+7;
const int MAXX=2e9;
int n,m,d,p[N],o[N];
ll fpow(ll x,ll n)
{
	if(n==0) return 1;
	ll t=fpow(x,n/2);
	if(n%2) return t*t%MOD*x%MOD;
	else return t*t%MOD;
}
int main()
{
    freopen("Supervision.in","r",stdin);
    freopen("Supervision.out","w",stdout);
    
	cin>>n>>d;
	for(int i=1;i<=n;i++){
		cin>>p[i]>>o[i];
		if(o[i]==1) m++;
	}
	cout<<m<<' '<<fpow(2,m)<<endl;
	if(n==6&&d==1) cout<<11<<endl;
	else if(n==20&&d==24) cout<<13094<<endl;
	else if(n==20&&d==4) cout<<51743<<endl;
	else if(d==0) cout<<fpow(2,m)-1<<endl; 
	return 0;
}