| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 1326180 | hehe | Festival (IOI25_festival) | C++20 | 0 ms | 0 KiB |
#include <bits/stdc++.h>
using namespace std;
#define int long long
signed main(){
int n, a; cin >> n >> a;
int add;
vector<int> values;
for(int i = 0; i < n; i++){
cin >> add;
values.push_back(add);
cin >> add;
}
sort(values.begin(), values.end());
int i = 0;
while(a >= values[i] && i < n){
a-= values[i];
i++;
}
cout << i;
}
