| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 1360429 | huseyncafarli | Asteroid Mining (CCO25_day1problem1) | C++20 | 88 ms | 8268 KiB |
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define int ll
const int MAXN = 1e6 + 5;
const int inf = (int)2e9 + 5;
const int infll = (int)4e18 + 5;
const int mod = (int)1e9 + 7;
void solve(){
int n, M;
cin >> n >> M;
vector<int> v(n+1), m(n + 1);
for(int i = 1; i <= n; i++) {
cin >> v[i] >> m[i];
}
int cnt = M / m[1];
sort(v.begin(), v.end());
reverse(v.begin() + 1, v.end());
int res = 0;
for(int i = 1; i <= min(n, cnt); i++) {
res += v[i];
}
cout << res << endl;
}
signed main() {
ios::sync_with_stdio(0);
cin.tie(0);
int t = 1;
//cin >> t;
while(t--)
solve();
return 0;
}
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
