제출 #103611

#제출 시각아이디문제언어결과실행 시간메모리
103611AllianceExhibition (JOI19_ho_t2)C++14
100 / 100
98 ms4660 KiB
// In the name of Allah. Ya ali!
#include<bits/stdc++.h>
#define double long double
typedef long long ll;
const ll MAX_N = 1e5+10;
const ll MOD = 1e9+7;
using namespace std;

pair<int,int> lr[MAX_N];
int a[MAX_N];
int n,m;

int main()
{
    cin >> n >> m;
    for(int i = 1;i<=n;++i)
        scanf("%d%d",&lr[i].second,&lr[i].first);
    for(int i = 1;i<=m;++i)
        scanf("%d",&a[i]);
    sort(a+1,a+m+1);
    sort(lr+1,lr+n+1);
    int ans = 0;
    int p = n;
    for(int i = m;i>=1 and p>0;--i)
    {
        while(p and lr[p].second>a[i])
            p--;
        if (p>0)
            ans++;
        p--;
    }
    cout << ans;
    return 0;
}

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

joi2019_ho_t2.cpp: In function 'int main()':
joi2019_ho_t2.cpp:17:14: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
         scanf("%d%d",&lr[i].second,&lr[i].first);
         ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
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[i]);
         ~~~~~^~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...