可以帮忙看看吗?C题
#include <iostream>
#include <cstdio>
#include <cmath>
#include <algorithm>
using namespace std;
int n,m,op;
double me = 1,tt = 1,x;
int main() {
scanf("%d",&n);
while(n--)
{
scanf("%d %lf",&op,&x);
if(op == 1) me *= x;
else me /= x;
}
scanf("%d",&m);
while(m--)
{
scanf("%d %lf",&op,&x);
if(op == 1) tt *= x;
else tt /= x;
}
if(tt == me || fabs(tt - me <1e-9)) printf("YES");
else printf("NO");
return 0;
}

