Submission #771949

#TimeUsernameProblemLanguageResultExecution timeMemory
771949BlockOGExam (eJOI20_exam)C++14
12 / 100
55 ms2964 KiB
#include <iostream> using namespace std; /* 3 1 2 3 2 2 2 4 10 1 9 1 10 9 10 9 */ int 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]; int res = 0; int i = 0, ma = 0, j = 0; for (; i < n; i++) { if (a[i] > b[0]) { if (ma == b[0]) res += i - j; j = i + 1; ma = 0; } else { ma = max(ma, a[i]); } } if (ma == b[0]) res += i - j; cout << res << endl; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...