제출 #207925

#제출 시각아이디문제언어결과실행 시간메모리
207925DodgeBallManExhibition (JOI19_ho_t2)C++14
100 / 100
94 ms5012 KiB
#include <bits/stdc++.h>
#define pii pair<int, int>
#define x first
#define y second

using namespace std;

int n, m, ans, now;
vector<int> fra;
vector<pii> pic;
int main()
{
    scanf("%d %d",&n,&m);
    for( int i = 0, a, b ; i < n ; i++ ) {
        scanf("%d %d",&a,&b);
        pic.emplace_back( pii( b, a ) );
    }
    for( int i = 0, a ; i < m ; i++ ) {
        scanf("%d",&a);
        fra.emplace_back( a );
    }
    sort( pic.begin(), pic.end(), greater<pii>() ), sort( fra.begin(), fra.end(), greater<int>() );
    for( int i = 0 ; i < m ; i++ ) {
        while( pic[now].y > fra[i] && now < n ) now++;
        if( now == n ) break;
        ans++, now++;
    }
    printf("%d",ans);
    return 0;
}

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

joi2019_ho_t2.cpp: In function 'int main()':
joi2019_ho_t2.cpp:13:10: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
     scanf("%d %d",&n,&m);
     ~~~~~^~~~~~~~~~~~~~~
joi2019_ho_t2.cpp:15:14: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
         scanf("%d %d",&a,&b);
         ~~~~~^~~~~~~~~~~~~~~
joi2019_ho_t2.cpp:19:14: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
         scanf("%d",&a);
         ~~~~~^~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...