救!!!
  • 板块P1161 开灯
  • 楼主nobody_here
  • 当前回复0
  • 已保存回复0
  • 发布时间2024/8/23 11:03
  • 上次更新2024/8/23 13:58:43
查看原帖
救!!!
1057197
nobody_here楼主2024/8/23 11:03

#2、3、5、6

#include<bits/stdc++.h>
using namespace std;
int main(){
	double a;
	int T,t,sum=0,tt=0;
	bool b[2001000]={false};
	cin>>T;
	while(T--){
		cin>>a>>t;
		tt=max(tt,t);
		for(int i=1;i<=t;i++){
			int bi=a*i;
			if(b[bi]) b[bi]=false;
			else b[bi]=true;
		}
	}
	for(int i=1;i<=tt;i++){
		if(b[i]){
			cout<<i;
			return 0;
		}
	}
	return 0;
}

2024/8/23 11:03
加载中...