# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
595364 | yaroslav06 | Knapsack (NOI18_knapsack) | C++14 | 1 ms | 340 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 <algorithm>
const int N = 2001, M = 1e5;
using namespace std;
typedef long long ll;
int s, n;
pair<int, pair<int, int>> d[M];
bool comp(pair<int, pair<int, int>> a, pair<int, pair<int, int>> b){
return a.second.first < b.second.first;
}
int main(){
ios_base::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
int dp[N][2]{};
int sm[N]{};
cin >> s >> n;
for(int i = 0; i < n; ++i)
cin >> d[i].second.first >> d[i].first >> d[i].second.second;
sort(d, d + n, comp);
for(int i = 0; i < n; ++i){
int k = d[i].second.second,
v = d[i].second.first,
w = d[i].first;
if(sm[w] >= 2000) continue;
# | 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... |