Submission #833617

#TimeUsernameProblemLanguageResultExecution timeMemory
833617vjudge1Exam (eJOI20_exam)C++17
0 / 100
36 ms980 KiB
#include <bits/stdc++.h> using namespace std; #define ll long long int main() { int n; cin >> n; int height[n + 5]; int targets[n + 5]; for(int i = 0; i < n; i++) { cin >> height[i]; } for(int i = 0; i < n; i++) { cin >> targets[i]; } int target = targets[0]; int temp = 0; ll res = 0; int ok = 0; for(int i = 0; i < n; i++) { if(height[i] < target) { if(ok == 0) { temp++; } else { res++; } } else if(height[i] > target) { ok = 0; temp = 0; } else if(height[i] == target) { res += temp; ok = 1; res++; } } cout << res << 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...