# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
466697 | Valaki2 | Exam (eJOI20_exam) | C++14 | 61 ms | 2508 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
using namespace std;
int n;
vector<int> a;
vector<int> b;
void solve_bf() {
set<int> a_set;
vector<bool> possible(1 + n, false);
for(int i = 1; i <= n; ++i) a_set.insert(a[i]);
for(int i = 1; i <= n; ++i) if(a_set.count(b[i])) possible[i] = true;
int ans = 0;
vector<bool> cur(1 + n, false);
for(int mask = 0; mask < (1 << n); ++mask) {
bool ok = true;
for(int i = 0; i < n; ++i) {
if(mask & (1 << i)) {
cur[i + 1] = true;
if(!possible[i + 1]) ok = false;
} else {
cur[i + 1] = false;
}
}
if(!ok) continue;
for(int i = 1; i <= n; ++i) {
if(!cur[i]) continue;
bool done = false;
for(int j = i; j >= 1; --j) {
if(a[j] > b[i] || (cur[j] && b[j] < b[i])) break;
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |