제출 #103609

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

int dp[MAX_N][MAX_N];
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:18: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:20: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...