Submission #675670

# Submission time Handle Problem Language Result Execution time Memory
675670 2022-12-27T17:37:05 Z Truitadepatates Exam (eJOI20_exam) C++14
0 / 100
4 ms 844 KB
#include <bits/stdc++.h>
using namespace std;

int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int n;
  cin >> n;
  vector<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];
  }
  //subtask 2:
  int ans = 0, count = 0, bb = b[0];
  bool pot = false;
  for (int i = 0; i < n; i++){
    if (a[i] > bb){
      if (pot){
        ans += count;
        pot = false;
      }
      count = 0;
    }
    else{
      count++;
      if (a[i] == bb) pot = true;
    }
  }
  cout << ans << "\n";
  return 0;
}
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB Output is correct
2 Incorrect 4 ms 844 KB Output isn't correct
3 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 340 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -