跳到正文

题解

题解:AT_awc0003_a 商品の品質評価

DrDuck约 1 分钟
原文
文章信息与版本

文章信息

收录
2026年2月13日
更新
2026年2月13日
篇幅
约 1 分钟

版本

  1. v1当前

设 Ci=Ai×BiC_i = A_i \times B_i,枚举 ii,计算 Ci≥KC_i \ge K 的 ii 的个数即可。

CODE
C++
#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;
}
原文