Submission #833530

# Submission time Handle Problem Language Result Execution time Memory
833530 2023-08-22T06:33:14 Z vjudge1 Exam (eJOI20_exam) C++17
0 / 100
1000 ms 1460 KB
#include <bits/stdc++.h>

using namespace std;

const int MAXN = 1e5 + 10;
const int INF = INT_MAX;
const long long LINF = LLONG_MAX;
const int MOD = 1e9 + 7;
const int MOD2 = 998244353;


void solv(){
    int n;
    cin >> n;
    int h[n], t[n];
    for(int i = 0; i < n; i++)cin >> h[i];
    for(int i = 0; i < n; i++)cin >> t[i];

    int temp = t[0];
    int ans = 0;
    int nyala[n] = {};
    for(int i = 0; i < n; i++){
        if(h[i] == temp){
            int l = 0, r = n-1;
            for(int j = 0; j < n; j++){
                if(i == j)continue;
                if(h[j] > temp){
                    if(j < i)l = j+1;
                    else{
                        r = j-1;
                        break;
                    }
                }
            }
            // cerr << l << " " << r << endl;
            for(int i = l; i <= r; i++){
                nyala[i] = 1;
            }
        }
    }

    for(int i = 0; i < n; i++){
        if(nyala[i] == 1)ans++;
    }

    cout << ans << endl;
}

int main(){
    int tc = 1;
//    cin >> tc;
    while(tc--)solv();
    return 0;
}
# Verdict Execution time Memory Grader output
1 Correct 0 ms 212 KB Output is correct
2 Incorrect 1 ms 212 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 240 KB Output is correct
2 Correct 58 ms 448 KB Output is correct
3 Correct 36 ms 1232 KB Output is correct
4 Correct 26 ms 1460 KB Output is correct
5 Correct 58 ms 1440 KB Output is correct
6 Execution timed out 1085 ms 1436 KB Time limit exceeded
7 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 256 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 4 ms 332 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 212 KB Output is correct
2 Incorrect 1 ms 212 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 212 KB Output is correct
2 Incorrect 1 ms 212 KB Output isn't correct
3 Halted 0 ms 0 KB -