Submission #1019980

# Submission time Handle Problem Language Result Execution time Memory
1019980 2024-07-11T11:44:10 Z coolboy19521 Exam (eJOI20_exam) C++17
0 / 100
1 ms 604 KB
#include "bits/stdc++.h"
#define int long long

using namespace std;

const int sz = 15;

int a[sz], b[sz];

signed main() {
    cin.tie(nullptr)->sync_with_stdio(false);

    int n;
    cin >> n;

    for (int i = 1; i <= n; i ++)
        cin >> a[i];

    for (int i = 1; i <= n; i ++)
        cin >> b[i];

    int an = 0;

    for (int i = 0; i < (1 << n); i ++) {
        int k = 0;
        int c = 0;
        for (int j = 0; j < n; j = k) {
            int tm = 0 < (i & (1 << j));
            int mx = 0;
            for (; k < n; k ++) {
                int r = 0 < (i & (1 << k));
                if (r != tm) break;
                mx = max(mx, a[k+1]);
            }
            for (int l = j; l < k; l ++)
                if (b[l+1] == mx) c ++;
        }
        an = max(an, c);
    }

    cout << an << '\n';
}
# Verdict Execution time Memory Grader output
1 Correct 0 ms 344 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Correct 1 ms 456 KB Output is correct
5 Incorrect 1 ms 600 KB Output isn't correct
6 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 1 ms 600 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 348 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 1 ms 604 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 344 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Correct 1 ms 456 KB Output is correct
5 Incorrect 1 ms 600 KB Output isn't correct
6 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 344 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Correct 1 ms 456 KB Output is correct
5 Incorrect 1 ms 600 KB Output isn't correct
6 Halted 0 ms 0 KB -