| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 1360405 | huseyncafarli | Asteroid Mining (CCO25_day1problem1) | C++20 | 3120 ms | 790908 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];
}
vector<int> dp(M + 1);
for(int i = 1; i <= n; i++) {
for(int j = M; j >= m[i]; j--) {
dp[j] = max(dp[j], dp[j-m[i]] + v[i]);
}
}
cout << dp[M] << 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... | ||||
