Submission #465964

# Submission time Handle Problem Language Result Execution time Memory
465964 2021-08-17T12:49:04 Z fuad27 Exam (eJOI20_exam) C++17
0 / 100
1000 ms 1668 KB
#include<bits/stdc++.h>
using namespace std;
#define int long long
int32_t main () {
    int n;
    cin >> n;
    int a[n], b[n];
    for(int i = 0;i<n;i++)cin>>a[i];
    for(int i =0;i<n;i++)cin>>b[i];
    for(int i = 0;i<n;i++) {
        if(a[i] == b[i]) {
            for(int j = i-1;j>=0;j--) {
                if(a[j] <= a[i]) {
                    a[j] = a[i];
                }
                else {
                    break;
                }
            }
            for(int j = i+1;j<n;j++) {
                if(a[j] <= a[i]) {
                    a[j] = a[i];
                }
                else {
                    break;
                }
            }
        }
    }
    int ans = 0;
    for(int i = 0;i<n;i++) {
        if(a[i] == b[i])ans++;
    }
    cout<<ans<<endl;
}
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 204 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 2 ms 204 KB Output is correct
2 Correct 393 ms 588 KB Output is correct
3 Execution timed out 1082 ms 1668 KB Time limit exceeded
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 204 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 7 ms 332 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 204 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 204 KB Output isn't correct
2 Halted 0 ms 0 KB -