QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#489770 | #8811. Heat Stroke | bambam# | 0 | 0ms | 3744kb | C++17 | 729b | 2024-07-25 00:32:33 | 2024-07-25 00:32:33 |
Judging History
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;
int cur = 0;
for (int i = 0; i < n; ++i) {
int d1 = (mask >> i & 1);
int d2 = (mask >> i & 1);
if (c[x[i] + d1] > 0) c[x[i] + d1]--;
else if (c[x[i] + d2] > 0) c[x[i] + d2]--;
else cur++;
}
ans = max(ans, cur);
c = d;
}
cout << ans;
}
Details
Tip: Click on the bar to expand more detailed information
Subtask #1:
score: 0
Wrong Answer
Test #1:
score: 6
Accepted
time: 0ms
memory: 3604kb
input:
2 0 0 1 1
output:
1
result:
ok single line: '1'
Test #2:
score: 0
Wrong Answer
time: 0ms
memory: 3608kb
input:
2 0 1 1 1
output:
1
result:
wrong answer 1st lines differ - expected: '0', found: '1'
Subtask #2:
score: 0
Wrong Answer
Test #33:
score: 0
Wrong Answer
time: 0ms
memory: 3744kb
input:
3 1 1 1 3 1 2 1
output:
2
result:
wrong answer 1st lines differ - expected: '1', found: '2'
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%