# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1121455 | vjudge1 | Knapsack (NOI18_knapsack) | C++17 | 380 ms | 3928 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.
/////////////////////////////////////////////////////////////////
//////// Born_To_Laugh - Hughie Do ////////
/////////////////////////////////////////////////////////////////
// #pragma GCC optimize("unroll-loops")
// #pragma GCC optimize("Ofast")
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
const ll MAXN=3e5+5;
const int INF=1e9+7;
/*
Idea:
*/
void solve(){
map<int,vector<pair<int,int>>> wei;
int s, t;
cin >> s >> t;
while(t--){
int v, w, k;
cin >> v >> w >> k;
if(w <= s){
wei[w].push_back(make_pair(v,k));
}
}
vector<int> dp(s+1, 0);
for(int i=0; i<=s; ++i){
if(wei[i].size() == 0)continue;
sort(wei[i].begin(), wei[i].end(), greater<pair<int,int>>());
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... |