Submission #833561

# Submission time Handle Problem Language Result Execution time Memory
833561 2023-08-22T06:51:26 Z vjudge1 Exam (eJOI20_exam) C++17
0 / 100
1 ms 436 KB
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;

const int MX = 1e5 + 5;

int N;
int H[MX], T[MX];

int main() {
      cin.tie(0); ios_base::sync_with_stdio(0);

      cin >> N;
      for(int i = 1; i <= N; i++) cin >> H[i];
      for(int i = 1; i <= N; i++) cin >> T[i];

      int ans = 0;
      for(int i = 1; i <= N; i++) {
            if(H[i] > T[1]) continue;
            int j = i + 1;
            bool hv = H[i] == T[1];
            while(j + 1 <= N && H[j + 1] <= T[1]) {
                  j++;
                  hv |= H[j] == T[1];
            }

            if(hv) {
                  ans += j - i + 1;
                  i = j;
            }
      }
      cout << ans << '\n';
      
}
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 344 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 436 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -