Submission #890284

#TimeUsernameProblemLanguageResultExecution timeMemory
890284pccPreokret (COCI18_preokret)C++14
16.40 / 50
1 ms348 KiB
#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 timeMemoryGrader output
Fetching results...