# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
103608 | Alliance | Exhibition (JOI19_ho_t2) | C++14 | 393 ms | 11476 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
// 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);
for(int i = 1;i<=n;++i)
{
for(int j = 1;j<=m;++j)
{
dp[i][j] = max(dp[i-1][j],dp[i][j-1]);
if (lr[i].second<=a[j])
dp[i][j] = max(dp[i][j],dp[i-1][j-1]+1);
}
}
cout << dp[n][m];
return 0;
}
컴파일 시 표준 에러 (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... |