QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#407912 | #8284. Cats and Fish | light_ink_dots# | RE | 1ms | 3924kb | C++14 | 614b | 2024-05-09 14:39:00 | 2024-05-09 14:39:00 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
int main() {
static const int maxn = 1010;
int m, n, x;
scanf("%d %d %d", &m, &n, &x);
static vector<int> vec[maxn];
vec[0].resize(n);
for (int& x : vec[0]) scanf("%d", &x);
int p = m, q = n;
for (int t = 1; t <= x; t++) {
q -= vec[t - 1].size();
sort(vec[t - 1].begin(), vec[t - 1].end());
for (int i = 0; i < vec[t - 1].size() && p; i++)
p--, q++, vec[t - 1 + vec[t - 1][i]].push_back(vec[t - 1][i]);
}
q -= vec[x].size();
printf("%d %d\n", p, q);
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 1ms
memory: 3864kb
input:
2 1 1 1
output:
1 0
result:
ok 2 number(s): "1 0"
Test #2:
score: 0
Accepted
time: 1ms
memory: 3924kb
input:
8 3 5 1 3 4
output:
0 1
result:
ok 2 number(s): "0 1"
Test #3:
score: 0
Accepted
time: 1ms
memory: 3860kb
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: 3760kb
input:
1 1 10 1
output:
0 0
result:
ok 2 number(s): "0 0"
Test #5:
score: 0
Accepted
time: 0ms
memory: 3880kb
input:
14 3 10 1 40 50
output:
2 2
result:
ok 2 number(s): "2 2"
Test #6:
score: 0
Accepted
time: 1ms
memory: 3816kb
input:
8 2 7 12 13
output:
6 2
result:
ok 2 number(s): "6 2"
Test #7:
score: 0
Accepted
time: 0ms
memory: 3816kb
input:
1 1 1 2
output:
0 1
result:
ok 2 number(s): "0 1"
Test #8:
score: 0
Accepted
time: 0ms
memory: 3908kb
input:
12 2 11 8 3
output:
6 2
result:
ok 2 number(s): "6 2"
Test #9:
score: 0
Accepted
time: 0ms
memory: 3892kb
input:
2 2 12 24 1
output:
0 1
result:
ok 2 number(s): "0 1"
Test #10:
score: 0
Accepted
time: 0ms
memory: 3776kb
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: 1ms
memory: 3752kb
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
Runtime Error
input:
3656 13 123 1887 26 800 12 77 32 11 1 77 32 77 32 155