# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
890284 |
2023-12-21T00:13:14 Z |
pcc |
Preokret (COCI18_preokret) |
C++14 |
|
1 ms |
348 KB |
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define pll pair<ll,ll>
#define pii pair<int,int>
#define fs first
#define sc second
#define tlll tuple<ll,ll,ll>
vector<pii> v;
int main(){
ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
int n;
cin>>n;
for(int i = 0;i<n;i++){
int k;
cin>>k;
v.push_back({k,1});
}
cin>>n;
for(int i = 0;i<n;i++){
int k;
cin>>k;
v.push_back({k,2});
}
int ans1 = 0,ans2 = 0;
sort(v.begin(),v.end());
int s = 0;
for(auto &i:v){
if(i.fs<=2*12*60)ans1++;
if(!s)ans2++;
if(i.sc == 1)s--;
else s++;
}
ans2--;
cout<<ans1<<'\n'<<ans2;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
348 KB |
Output is correct |
2 |
Correct |
1 ms |
348 KB |
Output is correct |
3 |
Partially correct |
0 ms |
348 KB |
Output is partially correct |
4 |
Partially correct |
0 ms |
344 KB |
Output is partially correct |
5 |
Partially correct |
0 ms |
348 KB |
Output is partially correct |
6 |
Partially correct |
1 ms |
348 KB |
Output is partially correct |
7 |
Partially correct |
1 ms |
348 KB |
Output is partially correct |
8 |
Partially correct |
1 ms |
348 KB |
Output is partially correct |
9 |
Partially correct |
1 ms |
348 KB |
Output is partially correct |
10 |
Correct |
0 ms |
348 KB |
Output is correct |