# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
128434 | dragonslayerit | Exhibition (JOI19_ho_t2) | C++14 | 74 ms | 4524 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 <cstdio>
#include <algorithm>
#include <tuple>
struct Pic{
int s,v;
void read(){
scanf("%d %d",&s,&v);
}
bool operator<(Pic p)const{
return std::tie(v,s)>std::tie(p.v,p.s);
}
}pics[100005];
int cs[100005];
int main(){
int N,M;
scanf("%d %d",&N,&M);
for(int i=0;i<N;i++){
pics[i].read();
}
for(int i=0;i<M;i++){
scanf("%d",&cs[i]);
}
std::sort(pics,pics+N);
std::sort(cs,cs+M,std::greater<int>());
int len=0;
for(int i=0;i<N;i++){
if(len<M&&pics[i].s<=cs[len]){
len++;
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |