Submission #576592

#TimeUsernameProblemLanguageResultExecution timeMemory
576592JassarExam (eJOI20_exam)C++14
12 / 100
22 ms1200 KiB
#include <bits/stdc++.h> #define ll long long using namespace std; bool h[100010]; int main() { ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0); int n; cin >> n; int a[n],b[n]; for (int i=0; n>i; i++) { cin >> a[i]; } int cnt = 0; for (int i=0; n>i; i++) { cin >> b[i]; if (b[i] == a[i] && h[i] == 0) { int j=i; int y=i; for (; j>=0; j--) { if (a[j] > a[i]) { break; } h[j] = 1; } for (; n>y; y++) { if (a[y] > a[i]) { break; } h[y] = 1; } y--; cnt += y - j; } } cout << cnt << endl; return 0; }
#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...