# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
745288 | HoriaHaivas | Exhibition (JOI19_ho_t2) | C++14 | 1 ms | 212 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
/*
"TLE is like the wind, always by my side"
- Yasuo - 2022 -
*/
#include <bits/stdc++.h>
#define debug(x) cerr << #x << " " << x << "\n"
#define debugs(x) cerr << #x << " " << x << " "
#pragma GCC optimize("Ofast")
using namespace std;
struct painting
{
int s;
int v;
};
painting a[100001];
int sz[100001];
bool cmp(painting aa, painting bb)
{
if (aa.v!=bb.v)
return aa.v<bb.v;
else
return aa.s>bb.s;
}
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
int n,m,i,j,k;
cin >> n >> m;
for (i=1;i<=n;i++)
{
cin >> a[i].s >> a[i].v;
}
for (i=1;i<=m;i++)
{
cin >> sz[i];
}
sort(sz+1,sz+1+m);
sort(a+1,a+1+n,cmp);
k=0;
for (i=n;i>=1;i--)
{
if (sz[m-k]>=a[i].s && m-k>=1)
k++;
}
cout << k;
}
컴파일 시 표준 에러 (stderr) 메시지
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |