Submission
Status:
[P][P][P][P][P][TSSSSSSS]
Subtask/Task Score:
{17/17}{17/17}{17/17}{17/17}{17/17}{0/17}
Score: 85
User: Pera
Problemset: ขายรถยนต์
Language: cpp
Time: 1.075 second
Submitted On: 2025-09-23 13:06:59
#include <bits/stdc++.h>
using namespace std;
int main() {
ios_base::sync_with_stdio(false);
int n; cin >> n;
vector<int> prices(n);
vector<int> efficiency(n);
for (int i = 0; i < n; i++) {
cin >> prices[i] >> efficiency[i];
}
int cantSell = 0;
for (int i = 0; i < n; i++) {
bool sell = true;
for (int j = i + 1; j < n; j++) {
if (efficiency[j] > efficiency[i]) {
sell = false;
break;
}
}
if (!sell) cantSell++;
}
cout << cantSell << "\n";
return 0;
}