QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#412196#6692. Building CompanyzrzringWA 1ms3728kbC++201.2kb2024-05-16 10:17:372024-05-16 10:17:37

Judging History

你现在查看的是最新测评结果

  • [2024-05-16 10:17:37]
  • 评测
  • 测评结果:WA
  • 用时:1ms
  • 内存:3728kb
  • [2024-05-16 10:17:37]
  • 提交

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