답안 #315914

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
315914 2020-10-24T12:23:27 Z dangtiendung1201 Jelly Flavours (IOI20_jelly) C++14
24 / 100
143 ms 156536 KB
#include <bits/stdc++.h>
#define debug(x) cerr << #x << " = " << x << endl;
#define task ""
using namespace std;
int fdp[2001][10001], bdp[2001][10001], ans;
pair<int, int> c[2001];
int n;
int find_maximum_unique(int x, int y, vector<int> a, vector<int> b)
{
    ans = 0;
    n = a.size();
    for (int i=0; i<n; i++) c[i] = make_pair(a[i], b[i]);
    sort(c, c+n);
    for (int i=1; i<=n; i++)
    {
        for (int j=0; j<=x; j++)
        {
            fdp[i][j] = fdp[i-1][j]+c[i-1].second;
            if(j >= c[i-1].first)
            {
                fdp[i][j] = min(fdp[i][j], fdp[i-1][j-c[i-1].first]);
            }
        }
    }
    for(int i=n-1; i>=0; i--)
    {
        for (int j=0; j<y; j++)
        {
            bdp[i][j] = bdp[i+1][j];
            if(j >= c[i].second)
            {
                bdp[i][j] = max(bdp[i][j], bdp[i+1][j-c[i].second]+1);
            }
        }
    }
    for (int i=0; i<=n; i++)
    {
        int yleft = y-fdp[i][x];
        if(yleft >= 0) ans = max(ans, i+bdp[i][yleft]);
    }
    return ans;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 384 KB Output is correct
2 Correct 1 ms 384 KB Output is correct
3 Correct 1 ms 384 KB Output is correct
4 Correct 1 ms 512 KB Output is correct
5 Correct 0 ms 384 KB Output is correct
6 Correct 1 ms 384 KB Output is correct
7 Correct 1 ms 384 KB Output is correct
8 Incorrect 0 ms 384 KB 1st lines differ - on the 1st token, expected: '5', found: '4'
9 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 384 KB Output is correct
2 Correct 1 ms 384 KB Output is correct
3 Correct 1 ms 384 KB Output is correct
4 Correct 1 ms 512 KB Output is correct
5 Correct 0 ms 384 KB Output is correct
6 Correct 1 ms 384 KB Output is correct
7 Correct 1 ms 384 KB Output is correct
8 Incorrect 0 ms 384 KB 1st lines differ - on the 1st token, expected: '5', found: '4'
9 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 17 ms 21256 KB 1st lines differ - on the 1st token, expected: '689', found: '65'
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 79 ms 94328 KB Output is correct
2 Correct 133 ms 155560 KB Output is correct
3 Correct 129 ms 156408 KB Output is correct
4 Correct 136 ms 149624 KB Output is correct
5 Correct 140 ms 155132 KB Output is correct
6 Correct 128 ms 149424 KB Output is correct
7 Correct 133 ms 154232 KB Output is correct
8 Correct 128 ms 150168 KB Output is correct
9 Correct 130 ms 150008 KB Output is correct
10 Correct 133 ms 152184 KB Output is correct
11 Correct 70 ms 88824 KB Output is correct
12 Correct 6 ms 8064 KB Output is correct
13 Correct 69 ms 86600 KB Output is correct
14 Correct 72 ms 85624 KB Output is correct
15 Correct 74 ms 88440 KB Output is correct
16 Correct 66 ms 84164 KB Output is correct
17 Correct 71 ms 87160 KB Output is correct
18 Correct 81 ms 94328 KB Output is correct
19 Correct 76 ms 90776 KB Output is correct
20 Correct 73 ms 86136 KB Output is correct
21 Correct 79 ms 94456 KB Output is correct
22 Correct 130 ms 155640 KB Output is correct
23 Correct 129 ms 156212 KB Output is correct
24 Correct 133 ms 149752 KB Output is correct
25 Correct 138 ms 155128 KB Output is correct
26 Correct 128 ms 149496 KB Output is correct
27 Correct 130 ms 154248 KB Output is correct
28 Correct 124 ms 150072 KB Output is correct
29 Correct 130 ms 150008 KB Output is correct
30 Correct 133 ms 152184 KB Output is correct
31 Correct 69 ms 88824 KB Output is correct
32 Correct 5 ms 8064 KB Output is correct
33 Correct 68 ms 86520 KB Output is correct
34 Correct 73 ms 85624 KB Output is correct
35 Correct 75 ms 88440 KB Output is correct
36 Correct 65 ms 84148 KB Output is correct
37 Correct 72 ms 87160 KB Output is correct
38 Correct 79 ms 94328 KB Output is correct
39 Correct 85 ms 90824 KB Output is correct
40 Correct 70 ms 86136 KB Output is correct
41 Correct 83 ms 94328 KB Output is correct
42 Correct 130 ms 155640 KB Output is correct
43 Correct 130 ms 156280 KB Output is correct
44 Correct 131 ms 149624 KB Output is correct
45 Correct 137 ms 155128 KB Output is correct
46 Correct 129 ms 149368 KB Output is correct
47 Correct 129 ms 154232 KB Output is correct
48 Correct 123 ms 150136 KB Output is correct
49 Correct 129 ms 150008 KB Output is correct
50 Correct 132 ms 152184 KB Output is correct
51 Correct 70 ms 88780 KB Output is correct
52 Correct 5 ms 8096 KB Output is correct
53 Correct 72 ms 86648 KB Output is correct
54 Correct 72 ms 85568 KB Output is correct
55 Correct 75 ms 88560 KB Output is correct
56 Correct 67 ms 84180 KB Output is correct
57 Correct 76 ms 87160 KB Output is correct
58 Correct 81 ms 94328 KB Output is correct
59 Correct 78 ms 91004 KB Output is correct
60 Correct 69 ms 86136 KB Output is correct
61 Correct 79 ms 94328 KB Output is correct
62 Correct 129 ms 155640 KB Output is correct
63 Correct 132 ms 156348 KB Output is correct
64 Correct 134 ms 149628 KB Output is correct
65 Correct 136 ms 155108 KB Output is correct
66 Correct 128 ms 149368 KB Output is correct
67 Correct 134 ms 154152 KB Output is correct
68 Correct 124 ms 150136 KB Output is correct
69 Correct 130 ms 150176 KB Output is correct
70 Correct 133 ms 152184 KB Output is correct
71 Correct 73 ms 88952 KB Output is correct
72 Correct 5 ms 8064 KB Output is correct
73 Correct 70 ms 86648 KB Output is correct
74 Correct 74 ms 85624 KB Output is correct
75 Correct 75 ms 88440 KB Output is correct
76 Correct 66 ms 84220 KB Output is correct
77 Correct 75 ms 87160 KB Output is correct
78 Correct 79 ms 94328 KB Output is correct
79 Correct 78 ms 90872 KB Output is correct
80 Correct 69 ms 86136 KB Output is correct
81 Correct 79 ms 94584 KB Output is correct
82 Correct 132 ms 155640 KB Output is correct
83 Correct 131 ms 156280 KB Output is correct
84 Correct 136 ms 149624 KB Output is correct
85 Correct 143 ms 155176 KB Output is correct
86 Correct 131 ms 149368 KB Output is correct
87 Correct 133 ms 154232 KB Output is correct
88 Correct 125 ms 150136 KB Output is correct
89 Correct 133 ms 150136 KB Output is correct
90 Correct 133 ms 152184 KB Output is correct
91 Correct 70 ms 88772 KB Output is correct
92 Correct 5 ms 8064 KB Output is correct
93 Correct 69 ms 86520 KB Output is correct
94 Correct 73 ms 85752 KB Output is correct
95 Correct 74 ms 88440 KB Output is correct
96 Correct 66 ms 84216 KB Output is correct
97 Correct 72 ms 87160 KB Output is correct
98 Correct 79 ms 94328 KB Output is correct
99 Correct 79 ms 90744 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 80 ms 93304 KB Output is correct
2 Correct 132 ms 150008 KB Output is correct
3 Correct 129 ms 154232 KB Output is correct
4 Correct 134 ms 153720 KB Output is correct
5 Correct 134 ms 149212 KB Output is correct
6 Correct 130 ms 153848 KB Output is correct
7 Correct 131 ms 155640 KB Output is correct
8 Correct 127 ms 149752 KB Output is correct
9 Correct 134 ms 154232 KB Output is correct
10 Correct 139 ms 156280 KB Output is correct
11 Correct 72 ms 86008 KB Output is correct
12 Correct 5 ms 8320 KB Output is correct
13 Correct 83 ms 97176 KB Output is correct
14 Correct 76 ms 88952 KB Output is correct
15 Correct 85 ms 98040 KB Output is correct
16 Correct 80 ms 93348 KB Output is correct
17 Correct 84 ms 100856 KB Output is correct
18 Correct 86 ms 100856 KB Output is correct
19 Correct 75 ms 86264 KB Output is correct
20 Correct 72 ms 86648 KB Output is correct
21 Correct 79 ms 93308 KB Output is correct
22 Correct 127 ms 150008 KB Output is correct
23 Correct 127 ms 154240 KB Output is correct
24 Correct 136 ms 153464 KB Output is correct
25 Correct 130 ms 149240 KB Output is correct
26 Correct 132 ms 153848 KB Output is correct
27 Correct 131 ms 155768 KB Output is correct
28 Correct 127 ms 149768 KB Output is correct
29 Correct 134 ms 154320 KB Output is correct
30 Correct 140 ms 156280 KB Output is correct
31 Correct 73 ms 86008 KB Output is correct
32 Correct 5 ms 8320 KB Output is correct
33 Correct 84 ms 97148 KB Output is correct
34 Correct 75 ms 88952 KB Output is correct
35 Correct 83 ms 98044 KB Output is correct
36 Correct 77 ms 93304 KB Output is correct
37 Correct 82 ms 100856 KB Output is correct
38 Correct 85 ms 101000 KB Output is correct
39 Correct 72 ms 86264 KB Output is correct
40 Correct 75 ms 86648 KB Output is correct
41 Correct 77 ms 93304 KB Output is correct
42 Correct 125 ms 150008 KB Output is correct
43 Correct 130 ms 154232 KB Output is correct
44 Correct 134 ms 153464 KB Output is correct
45 Correct 132 ms 149112 KB Output is correct
46 Correct 131 ms 153848 KB Output is correct
47 Correct 131 ms 155640 KB Output is correct
48 Correct 126 ms 149752 KB Output is correct
49 Correct 133 ms 154232 KB Output is correct
50 Correct 137 ms 156536 KB Output is correct
51 Correct 72 ms 86008 KB Output is correct
52 Correct 5 ms 8320 KB Output is correct
53 Correct 82 ms 97144 KB Output is correct
54 Correct 77 ms 88956 KB Output is correct
55 Correct 83 ms 98168 KB Output is correct
56 Correct 77 ms 93304 KB Output is correct
57 Correct 84 ms 100984 KB Output is correct
58 Correct 84 ms 100860 KB Output is correct
59 Correct 75 ms 86264 KB Output is correct
60 Correct 73 ms 86776 KB Output is correct
61 Correct 77 ms 93304 KB Output is correct
62 Correct 127 ms 150008 KB Output is correct
63 Correct 128 ms 154232 KB Output is correct
64 Correct 134 ms 153464 KB Output is correct
65 Correct 130 ms 149240 KB Output is correct
66 Correct 129 ms 153836 KB Output is correct
67 Correct 133 ms 155640 KB Output is correct
68 Correct 130 ms 149864 KB Output is correct
69 Correct 134 ms 154232 KB Output is correct
70 Correct 137 ms 156280 KB Output is correct
71 Correct 74 ms 86136 KB Output is correct
72 Correct 5 ms 8320 KB Output is correct
73 Correct 82 ms 97148 KB Output is correct
74 Correct 75 ms 88872 KB Output is correct
75 Correct 82 ms 98040 KB Output is correct
76 Correct 79 ms 93304 KB Output is correct
77 Correct 82 ms 100856 KB Output is correct
78 Correct 82 ms 100856 KB Output is correct
79 Correct 74 ms 86264 KB Output is correct
80 Correct 72 ms 86692 KB Output is correct
81 Correct 76 ms 93304 KB Output is correct
82 Correct 126 ms 150008 KB Output is correct
83 Correct 129 ms 154288 KB Output is correct
84 Correct 135 ms 153464 KB Output is correct
85 Correct 131 ms 149116 KB Output is correct
86 Correct 134 ms 153836 KB Output is correct
87 Correct 130 ms 155640 KB Output is correct
88 Correct 129 ms 150008 KB Output is correct
89 Correct 133 ms 154232 KB Output is correct
90 Correct 139 ms 156280 KB Output is correct
91 Correct 73 ms 86008 KB Output is correct
92 Correct 6 ms 8320 KB Output is correct
93 Correct 85 ms 97144 KB Output is correct
94 Correct 75 ms 88952 KB Output is correct
95 Correct 83 ms 98040 KB Output is correct
96 Correct 76 ms 93304 KB Output is correct
97 Correct 83 ms 100860 KB Output is correct
98 Correct 82 ms 100856 KB Output is correct
99 Correct 74 ms 86264 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 384 KB Output is correct
2 Correct 1 ms 384 KB Output is correct
3 Correct 1 ms 384 KB Output is correct
4 Correct 1 ms 512 KB Output is correct
5 Correct 0 ms 384 KB Output is correct
6 Correct 1 ms 384 KB Output is correct
7 Correct 1 ms 384 KB Output is correct
8 Incorrect 0 ms 384 KB 1st lines differ - on the 1st token, expected: '5', found: '4'
9 Halted 0 ms 0 KB -