为什么啊全是RE浮点错误,我甚至完完全全把题解视频的代码抄下来了
#include <bits/stdc++.h>
using namespace std;
int cnt[5050];
int main()
{
ios::sync_with_stdio(false);
cin.tie(NULL); cout.tie(NULL);
int n, q;
cin >> n >> q;
for (int i = 1; i <= n; i++)
{
int a, b, c, x;
scanf("%dx%d=%d", &a, &b, &c);
x = (c - b) / a;
cnt[x]++;
}
while (q--)
{
int l, r, ans = 0;
cin >> l >> r;
for (int i = l; i <= r; i++)
{
if (cnt[i]) ans++;
}
cout << ans << '\n';
}
return 0;
}