# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
890284 | pcc | Preokret (COCI18_preokret) | C++14 | 1 ms | 348 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#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 |
---|---|---|---|---|
Fetching results... |