Submission #466697

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
4666972021-08-20 09:16:47Valaki2Exam (eJOI20_exam)C++14
39 / 100
61 ms2508 KiB
#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;
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...