# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
12076 | ainta | 배낭 문제 준비하기 (GA9_invknapsack) | C++98 | 0 ms | 1100 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<stdio.h>
#include<algorithm>
using namespace std;
#define INF 1000000000000000000LL
long long K, D[320];
bool v[320];
struct A{
int num;
long long S;
bool operator <(const A &p)const{
return S < p.S;
}
}P[320];
bool Do(int n){
int i, C = n;
long long S = K;
for (i = n; i >= 0; i--){
if (P[i].S == -1)break;
v[i] = false;
if (S >= P[i].S){
S -= P[i].S;
v[300 - P[i].num] = true;
C++;
}
}
if (!S){
printf("%d %d\n", C, 300);
for (i = 1; i <= n; i++)printf("1 ");
for (i = 150; i <= 300; i++)if (v[i])printf("%d ", i);
printf("\n");
# | 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... |