救命!样例都过不了,求救!
#include<iostream>
using namespace std;
int main()
{
int n;
double a, t;
int s[2000000];
for (int i = 0; i < 2000000; i++)
{
s[i] = -1;
}
cin >> n;
for (int i = 0; i < n; i++)
{
cin >> a >> t;
for ( double j = 1; j <= t; j++)
{
if (s[(int)(j * a)] == -1)
{
s[(int)(j * (int)a)] = 1;
}
else
{
s[(int)(j * a)] = -1;
}
}
}
for (int i = 1; i < 2000000; i++)
{
if (s[i] == 1)
{
cout << i;
break;
}
}
system("pause");
return 0;
}