제출 #540382

#제출 시각아이디문제언어결과실행 시간메모리
540382krit3379Exhibition (JOI19_ho_t2)C++17
0 / 100
1 ms312 KiB
#include<bits/stdc++.h>
using namespace std;
#define N 200005

int c[N],ans;
pair<int,int> a[N];

int main(){
    int n,m,i,j;
    scanf("%d %d",&n,&m);
    for(i=1;i<=n;i++)scanf("%d %d",&a[i].second,&a[i].first);
    for(i=1;i<=m;i++)scanf("%d",&c[i]);
    sort(a+1,a+n+1,greater<pair<int,int>>());
    sort(c+1,c+m+1,greater<int>());
    for(i=1,j=1;i<=m;i++){
        while(j<=n){
            if(a[i].second<=c[i])break;
            else j++;
        }
        if(j<=n)j++,ans++;
    }
    printf("%d",ans);
    return 0;
}

컴파일 시 표준 에러 (stderr) 메시지

joi2019_ho_t2.cpp: In function 'int main()':
joi2019_ho_t2.cpp:10:10: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   10 |     scanf("%d %d",&n,&m);
      |     ~~~~~^~~~~~~~~~~~~~~
joi2019_ho_t2.cpp:11:27: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   11 |     for(i=1;i<=n;i++)scanf("%d %d",&a[i].second,&a[i].first);
      |                      ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
joi2019_ho_t2.cpp:12:27: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   12 |     for(i=1;i<=m;i++)scanf("%d",&c[i]);
      |                      ~~~~~^~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...