# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
778088 | vjudge1 | Preokret (COCI18_preokret) | C++17 | 1 ms | 340 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 int long long
#define faster ios_base::sync_with_stdio(false);cin.tie(NULL);
#define OYY 1000000005
#define mod 998244353
int cev=0,da[3000],ba[3000],mp[3000];
int32_t main(){
faster
int a;cin>>a;
for(int i=1;i<=a;i++){
cin>>da[i];
if(da[i]<=1440){
cev++;
}
mp[da[i]]++;
}
int b;cin>>b;
for(int i=1;i<=b;i++) {
cin>>ba[i];
if(ba[i]<=1440){
cev++;
}
mp[ba[i]]--;
}
cout<<cev<<'\n';
int ger=0;
cev=0;
for(int i=1;i<=3000;i++){
mp[i]+=mp[i-1];
if(ger==0){
if(mp[i]>0){
ger=1;
}
else if(mp[i]<0){
ger=2;
}
}
else if(ger==2 && mp[i]>0){
cev++;
ger=1;
}
else if(ger==1 && mp[i]<0){
cev++;
ger=2;
}
}
cout<<cev<<'\n';
return 0;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |