You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
29 lines
552 B
29 lines
552 B
#include<bits/stdc++.h>//万能头文件
|
|
|
|
using namespace std;
|
|
|
|
//注意大数组在放到main函数外边
|
|
int const maxN = 2000001;
|
|
int arr[maxN] = {0};
|
|
|
|
int main() {
|
|
int n=0;
|
|
cin >> n;
|
|
double a;
|
|
int t;
|
|
|
|
for (int i = 1; i <= n; i++) {
|
|
cin >> a >> t;
|
|
for (int k = 1; k <= t; k++) {
|
|
int c = floor(a * k);
|
|
arr[c] = abs(arr[c] - 1);
|
|
}
|
|
}
|
|
for (int i = 1; i <= maxN; i++) {
|
|
if (arr[i] == 1) {
|
|
cout << i << endl;
|
|
break;
|
|
}
|
|
}
|
|
return 0;
|
|
} |