# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
789070 | olisoe | Knapsack (NOI18_knapsack) | C++11 | 68 ms | 35148 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 "iostream"
#include "vector"
#include "algorithm"
#include "queue"
#include "set"
#include "unordered_set"
#include "stack"
#include "map"
#include "limits.h"
#include "cstdio"
#include "math.h"
#include <numeric>
using namespace std;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int limit, n;
cin>>limit>>n;
map<int, vector<pair<int,int>>> weight;
for(int i = 0; i<n; i++)
{
int value,wei,amt;
cin>>value>>wei>>amt;
if(wei<=limit&&amt>0)
weight[wei].push_back(make_pair(value,amt));
}
vector<vector<long long>> dp(weight.size()+1,vector<long long>(limit+1,INT32_MIN));
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... |