https://www.luogu.com.cn/problem/T343252
#include <iostream>
#include <vector>
using namespace std;
vector<int> countMeals(int n, int t1, int t2, vector<int>& prices) {
int normalCount = 0;
int luxuryCount = 0;
int deluxeCount = 0;
for (int i = 0; i < n; i++) {
for (int j = i + 1; j < n; j++) {
int totalPrice = prices[i] + prices[j];
if (totalPrice <= t1) {
normalCount++;
} else if (totalPrice <= t2) {
luxuryCount++;
} else {
deluxeCount++;
}
}
}
return { normalCount, luxuryCount, deluxeCount };
}
int main() {
int n, t1, t2;
cin >> n >> t1 >> t2;
vector<int> prices(n);
for (int i = 0; i < n; i++) {
cin >> prices[i];
}
vector<int> result = countMeals(n, t1, t2, prices);
cout << result[0] << " " << result[1] << " " << result[2] << endl;
return 0;
}
//求大佬