题解:AT_awc0003_a 商品の品質評価

· · 题解

设 C_i = A_i \times B_i,枚举 i,计算 C_i \ge K 的 i 的个数即可。 ::::success[CODE]

#include<bits/stdc++.h>
#define int long long
#define void inline void
using namespace std;
const int maxn = 2e+5 + 5;
int k, n;
int a[maxn];
signed main() {
    ios::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    cin >> n >> k;
    int ans = 0;
    for (int i = 1; i <= n; i++) {
        int x, y;
        cin >> x >> y;
        a[i] = x * y;
        if (a[i] >= k) ans++;
    }
    cout << ans;
    return 0;
}

::::