# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
141072 | 44442 | Preokret (COCI18_preokret) | C++11 | 4 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.
#include <bits/stdc++.h>
using namespace std;
int a,b,as[2890],bs[2890],ok,okk,aa[2890],bb[2890],c[2890],va[2890],vb[2890];
set<int>s;
int main (){
ios::sync_with_stdio(0);
//cin.tie(0); cout.tie(0);
scanf("%d\n",&a);
for(int i=0;i<a;i++){
scanf("%d\n",&as[i]);
if(as[i]<1441)
ok++;
aa[as[i]]=1;
s.insert(as[i]);
}
scanf("%d",&b);
for(int j=0;j<b;j++){
scanf("\n%d",&bs[j]);
if(bs[j]<1441)
ok++;
bb[bs[j]]=1;
s.insert(bs[j]);
}
printf("%d\n",ok);
for(set<int>::iterator it=s.begin();it!=s.end();it++){
set<int>::iterator itt=s.lower_bound(*it);
itt--;
if(aa[*it]==1){
va[*it]=va[*itt]+1;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |