답안 #402466

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
402466 2021-05-11T18:04:08 Z fadi57 Exhibition (JOI19_ho_t2) C++14
0 / 100
1 ms 204 KB
#include<bits/stdc++.h>
using namespace std;
const int mx=1002;
typedef long long ll;
int inf=1e9+10;
const int mod=1e9+7;
int n,m;
vector<pair<int,int>>v;
vector<int>f;

int main(){


  /*  f.push_back(5);  f.push_back(8);
    auto it=lower_bound(f.begin(),f.end(),9)-f.begin();
    cout<<it;
    */

cin>>n>>m;
int s[n];
int vv[n];
for(int i=0;i<n;i++){
    cin>>s[i]>>vv[i];

    v.push_back({vv[i],s[i]});
  }
  sort(v.begin(),v.end());

  for(int i=0;i<m;i++){
    int x;cin>>x;
    f.push_back(x);
  }
  sort(f.begin(),f.end());
  int l=m-1;
  int ans=0;
for(int j=n-1;j>=0;j--){
    if(v[j].second<f[l]){
        ans++;
        l--;
    }
 }
 cout<< ans;
 }
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 204 KB Output is correct
2 Incorrect 1 ms 204 KB Output isn't correct
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 204 KB Output is correct
2 Incorrect 1 ms 204 KB Output isn't correct
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 204 KB Output is correct
2 Incorrect 1 ms 204 KB Output isn't correct
3 Halted 0 ms 0 KB -