-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path228c.cpp
More file actions
37 lines (28 loc) · 703 Bytes
/
228c.cpp
File metadata and controls
37 lines (28 loc) · 703 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pi = pair<ll, ll>;
using vi = vector<ll>;
using vpi = vector<pi>;
using vb = vector<bool>;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
ll n, k;
cin >> n >> k;
vi sum(n);
vi ss(n);
for(int i = 0; i < n; i++) {
for(int j = 0; j < 3; j++) {
int a;
cin >> a;
sum[i] += a;
}
}
ss = sum;
sort(ss.begin(), ss.end(), greater<int>());
for (int i = 0; i < n; i++) {
cout << ((lower_bound(ss.begin(), ss.end(), sum[i] + 300, greater<int>()) - ss.begin()) < k ? "Yes" : "No") << endl;
}
return 0;
}