| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 701665 | vjudge1 | Exhibition (JOI19_ho_t2) | C++17 | 59 ms | 6768 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>
#define fast ios_base::sync_with_stdio(false); cin.tie(NULL);
#define int long long
#define inf ((int)1e18)
#define N 200005
using namespace std;
vector <pair<int,int> > arr;
vector <int> brr;
int32_t main(){
fast
int n, m;
cin>>n>>m;
for(int i=0; i<n; i++){
int a, b;
cin>>a>>b;
arr.push_back({b, a});
}
for(int i=0; i<m; i++){
int a;
cin>>a;
brr.push_back(a);
}
sort(arr.begin(), arr.end());
sort(brr.begin(), brr.end());
reverse(arr.begin(), arr.end());
reverse(brr.begin(), brr.end());
int ans=0, l=0, r=0;
while(l < arr.size() and r < brr.size()){
int size=arr[l].second, frame=brr[r];
if(size <= frame){
//cout<<size<<" "<<frame<<"\n";
ans++;
l++;
r++;
}
else{
l++;
}
}
cout<<ans;
}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... | ||||
