QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#489768 | #8811. Heat Stroke | bambam# | 0 | 4ms | 3620kb | C++17 | 700b | 2024-07-25 00:31:16 | 2024-07-25 00:31:17 |
answer
#include<bits/stdc++.h>
using namespace std;
int main() {
cin.tie(nullptr)->sync_with_stdio(false);
int k;
cin >> k;
vector<int> c(k);
for (auto& i : c) cin >> i;
int n;
cin >> n;
vector<int> x(n);
for (auto& i : x) cin >> i, --i;
int ans = 0;
for (int mask = 0; mask < (1 << n); ++mask) {
auto d = c;
for (int i = 0; i < n; ++i) {
int dir = (mask >> i & 1);
if (c[x[i] + dir] == 0) c[x[i] + (dir ^ 1)]--;
else c[x[i] + dir]--;
}
int cur = 0;
for (auto& i : c) cur += max(0, -i);
ans = max(ans, cur);
c = d;
}
cout << ans;
}
Details
Tip: Click on the bar to expand more detailed information
Subtask #1:
score: 0
Time Limit Exceeded
Test #1:
score: 6
Accepted
time: 0ms
memory: 3524kb
input:
2 0 0 1 1
output:
1
result:
ok single line: '1'
Test #2:
score: 6
Accepted
time: 0ms
memory: 3620kb
input:
2 0 1 1 1
output:
0
result:
ok single line: '0'
Test #3:
score: 6
Accepted
time: 0ms
memory: 3616kb
input:
2 1 0 1 1
output:
0
result:
ok single line: '0'
Test #4:
score: 6
Accepted
time: 0ms
memory: 3552kb
input:
2 1 1 1 1
output:
0
result:
ok single line: '0'
Test #5:
score: 6
Accepted
time: 0ms
memory: 3528kb
input:
2 2 2 1 1
output:
0
result:
ok single line: '0'
Test #6:
score: 6
Accepted
time: 0ms
memory: 3608kb
input:
2 1 1 2 1 1
output:
0
result:
ok single line: '0'
Test #7:
score: 6
Accepted
time: 0ms
memory: 3524kb
input:
2 2 2 2 1 1
output:
0
result:
ok single line: '0'
Test #8:
score: 6
Accepted
time: 0ms
memory: 3616kb
input:
2 3 3 2 1 1
output:
0
result:
ok single line: '0'
Test #9:
score: 0
Time Limit Exceeded
input:
2 298 299 600 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ...
output:
result:
Subtask #2:
score: 0
Wrong Answer
Test #33:
score: 7
Accepted
time: 0ms
memory: 3592kb
input:
3 1 1 1 3 1 2 1
output:
1
result:
ok single line: '1'
Test #34:
score: 7
Accepted
time: 0ms
memory: 3524kb
input:
3 1 1 1 3 2 1 2
output:
1
result:
ok single line: '1'
Test #35:
score: 7
Accepted
time: 0ms
memory: 3540kb
input:
7 1 1 1 1 1 1 1 8 2 1 6 5 4 3 2 6
output:
3
result:
ok single line: '3'
Test #36:
score: 7
Accepted
time: 0ms
memory: 3600kb
input:
8 1 1 1 1 1 1 1 1 10 6 7 4 1 2 3 4 5 6 1
output:
4
result:
ok single line: '4'
Test #37:
score: 7
Accepted
time: 1ms
memory: 3604kb
input:
18 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 13 13 17 13 9 15 4 12 11 12 7 5 15 1
output:
1
result:
ok single line: '1'
Test #38:
score: 7
Accepted
time: 2ms
memory: 3588kb
input:
18 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 15 17 12 6 3 15 17 3 10 6 12 15 17 11 12 14
output:
3
result:
ok single line: '3'
Test #39:
score: 0
Wrong Answer
time: 4ms
memory: 3524kb
input:
18 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 16 16 11 13 10 5 3 10 6 13 16 16 2 14 9 9 3
output:
5
result:
wrong answer 1st lines differ - expected: '4', found: '5'
Subtask #3:
score: 0
Skipped
Dependency #2:
0%
Subtask #4:
score: 0
Skipped
Dependency #3:
0%
Subtask #5:
score: 0
Skipped
Dependency #4:
0%
Subtask #6:
score: 0
Skipped
Dependency #5:
0%
Subtask #7:
score: 0
Skipped
Dependency #6:
0%
Subtask #8:
score: 0
Skipped
Dependency #1:
0%