# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
914294 | May27_th | Knapsack (NOI18_knapsack) | C++17 | 11 ms | 47836 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
#define int64_t long long
#define double long double
using namespace std;
using type = int64_t;
const long long mod = 998244353, inf = 1e18;
const int base = 33;
const int N = 2e5 + 10;
const int LG = 20;
int dx[] = {1, -1, 0, 0};
int dy[] = {0, 0, 1, -1};
void Minimize(int64_t &a, int64_t b) {if(b < a) a = b;}
void Maximize(int64_t &a, int64_t b) {if(b > a) a = b;}
void Add(int64_t& a, int64_t b) {a = a + b; a %= mod;}
void Dec(int64_t& a, int64_t b) {a = a - b + mod; a %= mod;}
int S, n; vector<pair<int64_t, int64_t>>items[3000]; int64_t f[3000][3000];
void Solve(void)
{
/**
item: v, w, k;
sort theo weight: 1 <= w <= S
voi moi weight chon toi da S/w thang gia tri nhat
f[i][j] la dung den cac thg weight i va dang co space j
f[i][j] = f[i - 1][j - w * t] + v * t;
**/
cin >> S >> n;
for(int i = 1; i <= n; i ++){
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |