# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
833237 |
2023-08-22T03:30:55 Z |
vjudge1 |
Exam (eJOI20_exam) |
C++17 |
|
11 ms |
1108 KB |
#include<bits/stdc++.h>
using namespace std;
#define ll long long
int main(){
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int n;
cin >> n;
vector<int> h(n);
vector<int> t(n);
for(int i = 0 ; i < n ; i++)
{
cin >> h[i];
}
for(int i = 0 ; i < n ; i++)
{
cin >> t[i];
}
// T sama semua
int T = t[0];
int l = -1;
int ans = 0;
bool Tfnd = 0;
for(int i = 0 ; i < n ; i++){
//cout << T << endl;
if(h[i] < T && l == -1){
if(Tfnd){
//cout << "hm";
ans++;
}else{
l = i;
}
}
else if(h[i] < T){
if(Tfnd){
//cout <<"hm";
ans++;
}
}
else if(h[i] > T){
l = -1;
Tfnd = 0;
}else{
//cout <<"yay";
Tfnd =1;
if(l != -1){
ans += i-l;
}
ans++;
}
}
cout << ans;
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
212 KB |
Output is correct |
2 |
Incorrect |
1 ms |
212 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
212 KB |
Output is correct |
2 |
Correct |
4 ms |
468 KB |
Output is correct |
3 |
Correct |
11 ms |
980 KB |
Output is correct |
4 |
Incorrect |
8 ms |
1108 KB |
Output isn't correct |
5 |
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 |
2 ms |
388 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 |
1 ms |
212 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
212 KB |
Output is correct |
2 |
Incorrect |
1 ms |
212 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |