抄题解
  • 板块P1161 开灯
  • 楼主huangsibo
  • 当前回复2
  • 已保存回复2
  • 发布时间2024/7/27 17:08
  • 上次更新2024/7/27 17:10:08
查看原帖
抄题解
553469
huangsibo楼主2024/7/27 17:08

dulonghan2013 抄 第1个题解 提交记录

代码如下:

#include<bits/stdc++.h>
using namespace std;
int a[2000001], n;
double x, y;
int main(){
	ios :: sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);
	
	//freopen (".in", "r", stdin);
	//freopen (".in", "w", stdout);
	
	cin >> n;
	for(int i = 1; i <= n; i ++){
		cin >> x >> y;
		for(double j = 1; j <= y; j ++){
			if(a[int(j * x)] == 0) a[int(j * x)] = 1;
			else a[int(j * x)] = 0;
		}
	}
	for(int i = 1; ; i ++){
		if(a[i] == 1){
			cout << i;
			break;
		}
	}
	return 0;
} 
2024/7/27 17:08
加载中...