QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#412196 | #6692. Building Company | zrzring | WA | 1ms | 3728kb | C++20 | 1.2kb | 2024-05-16 10:17:37 | 2024-05-16 10:17:37 |
Judging History
answer
#include <bits/stdc++.h>
using i64 = long long;
#define endl '\n'
#define PII std::pair<i64, i64>
#define NO return (void)(std::cout << "NO" << endl)
#define YES return (void)(std::cout << "YES" << endl)
#define Fast_IOS std::ios::sync_with_stdio(false), std::cin.tie(0), std::cout.tie(0)
const i64 mod = 998244353;
template <class T> void MOD(T &x) {x = (x % mod + mod) % mod;}
template <class T> T lg(T x) {return (T)log10(x);}
template <class T> T log(T x) {return (T)log2(x);}
template <class T> T abs(T x) {return x < 0 ? -x : x;}
template <class T> T mysqrt(T x) {return std::floor(sqrtl(x));}
struct WORK {
int n, m;
WORK() {}
void solve() {
int n, m;
std::cin >> n >> m;
std::vector<PII> a(n + 1);
for (int i = 1; i <= n; i++) {
int x, t;
std::cin >> x >> t;
a[i] = {x, t};
}
std::sort(a.begin(), a.end());
i64 sum = 0;
for (int i = 1; i <= n; i++) {
sum += a[i].second;
if (sum > a[i].first * m) {
return (void)(std::cout << "No" << endl);
}
}
return (void)(std::cout << "Yes" << endl);
}
};
int main() {
Fast_IOS;
WORK work;
int T = 1;
std::cin >> T;
while (T--) {
work.solve();
}
return 0;
}
详细
Test #1:
score: 0
Wrong Answer
time: 1ms
memory: 3728kb
input:
2 2 1 1 2 5 1 3 1 0 2 1 1 2 1 2 3 2 2 1 3 1 5 2 3 3 4 1 2 5 3 2 1 1 1 3 4 1 1 3 0 1 3 2
output:
No No
result:
wrong output format Expected integer, but "No" found