QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#336142 | #8284. Cats and Fish | ucup-team052# | WA | 0ms | 3980kb | C++23 | 650b | 2024-02-24 13:28:22 | 2024-02-24 13:28:22 |
Judging History
answer
#include <bits/stdc++.h>
#define rep(i, a, b) for (int i = a; i <= b; i++)
#define per(i, b, a) for (int i = b; i >= a; i--)
using namespace std;
const int N = 5005;
set <int> all;
vector <int> vec[N];
int a[N];
int m, n, x, ans;
int main() {
scanf("%d%d%d", &m, &n, &x);
for (int i = 1; i <= n; i++) {
int t;
scanf("%d", &t);
all.insert(t);
}
for (int i = 0; i < x; i++) {
for (auto j : vec[i]) all.insert(j);
while (m && all.size()) {
int t = *all.begin();
all.erase(all.begin());
--m;
if (i + t > x) ++ans;
else vec[i + t].push_back(t);
}
}
printf("%d %d\n", m, ans);
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 0ms
memory: 3936kb
input:
2 1 1 1
output:
1 0
result:
ok 2 number(s): "1 0"
Test #2:
score: 0
Accepted
time: 0ms
memory: 3940kb
input:
8 3 5 1 3 4
output:
0 1
result:
ok 2 number(s): "0 1"
Test #3:
score: 0
Accepted
time: 0ms
memory: 3936kb
input:
4 5 1 5 4 3 2 1
output:
0 3
result:
ok 2 number(s): "0 3"
Test #4:
score: 0
Accepted
time: 0ms
memory: 3840kb
input:
1 1 10 1
output:
0 0
result:
ok 2 number(s): "0 0"
Test #5:
score: 0
Accepted
time: 0ms
memory: 3976kb
input:
14 3 10 1 40 50
output:
2 2
result:
ok 2 number(s): "2 2"
Test #6:
score: 0
Accepted
time: 0ms
memory: 3768kb
input:
8 2 7 12 13
output:
6 2
result:
ok 2 number(s): "6 2"
Test #7:
score: 0
Accepted
time: 0ms
memory: 3840kb
input:
1 1 1 2
output:
0 1
result:
ok 2 number(s): "0 1"
Test #8:
score: 0
Accepted
time: 0ms
memory: 3932kb
input:
12 2 11 8 3
output:
6 2
result:
ok 2 number(s): "6 2"
Test #9:
score: 0
Accepted
time: 0ms
memory: 3980kb
input:
2 2 12 24 1
output:
0 1
result:
ok 2 number(s): "0 1"
Test #10:
score: 0
Accepted
time: 0ms
memory: 3808kb
input:
562 8 232 17 26 800 12 77 32 11 2
output:
368 7
result:
ok 2 number(s): "368 7"
Test #11:
score: 0
Accepted
time: 0ms
memory: 3932kb
input:
562 8 1 17 26 800 12 77 32 11 1
output:
554 7
result:
ok 2 number(s): "554 7"
Test #12:
score: -100
Wrong Answer
time: 0ms
memory: 3864kb
input:
3656 13 123 1887 26 800 12 77 32 11 1 77 32 77 32 155
output:
3496 8
result:
wrong answer 1st numbers differ - expected: '3484', found: '3496'