제출 #1023603

#제출 시각아이디문제언어결과실행 시간메모리
1023603vjudge1Exhibition (JOI19_ho_t2)C++17
100 / 100
53 ms5020 KiB
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define fi first
#define se second
ll m,n,k,tong;
struct picture
{
    int s,v;
} a[100005];
ll frame[100005];
bool cmp(picture x,picture y)
{
    if (x.v==y.v) return x.s<y.s;
    return x.v<y.v;
}
main()
{
    ios_base::sync_with_stdio(false); cin.tie(NULL);
    cin>>n>>m;
    for (int i=1;i<=n;++i)
    {
        cin>>a[i].s>>a[i].v;
    }
    for (int i=1;i<=m;++i) cin>>frame[i];
    sort(frame+1,frame+m+1);
    sort(a+1,a+n+1,cmp);
    k=m;
    for (int i=n;i>=1;--i)
    {
        if (k!=0 && a[i].s<=frame[k])
        {
            tong++;
            k--;
        }
    }
    cout<<tong;

}

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

joi2019_ho_t2.cpp:17:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
   17 | main()
      | ^~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...