# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
156922 | AKaan37 | Preokret (COCI18_preokret) | C++17 | 3 ms | 504 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.
//Sani buyuk Osman Pasa Plevneden cikmam diyor.
//FatihSultanMehmedHan
//Abdulhamid Han
//Bismillahirrahmanirrahim
//█▀█─█──█──█▀█─█─█
//█▄█─█──█──█▄█─█▄█
//█─█─█▄─█▄─█─█─█─█
#pragma GCC optimize ("O3")
#pragma GCC target ("sse4")
#include <bits/stdc++.h>
using namespace std;
typedef long long lo;
typedef pair< lo,lo > PII;
#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define fio() ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
#define FOR for(int i=1;i<=n;i++)
#define mid ((start+end)/2)
#define ort ((bas+son)/2)
const lo MAX = -1000000000000000000;
const lo MIN = 1000000000000000000;
const lo inf = 1000000000;
const lo KOK = 100000;
const lo LOG = 30;
const lo li = 500005;
const lo mod = 1000000007;
int n,m,b[li],a[li],k,flag,t;
int cev,cev1,vis[10];
string s;
vector<PII> v;
int main(void){
scanf("%d",&n);
FOR{
scanf("%d",&a[i]);
v.pb(mp(a[i],1));
}
scanf("%d",&m);
for(int i=1;i<=m;i++){
scanf("%d",&b[i]);
v.pb(mp(b[i],2));
}
sort(v.begin(),v.end());
for(int i=0;i<(int)v.size();i++){
if(v[i].fi<=1440)cev++;
vis[v[i].se]++;
if(i<=1)continue;
if(vis[1]==vis[2]+1 && v[i-1].se==1 && v[i].se==1)cev1++;
if(vis[1]==vis[2]-1 && v[i-1].se==2 && v[i].se==2)cev1++;
}
printf("%d\n%d\n",cev,cev1);
return 0;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |