답안 #572252

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
572252 2022-06-04T07:03:24 Z PiejanVDC Exhibition (JOI19_ho_t2) C++17
0 / 100
1 ms 212 KB
#include <bits/stdc++.h>
using namespace std;

signed main() {
  int n,m; cin>>n>>m;
  vector<pair<int,int>>v(n);
  for(auto &z : v) {
    cin>>z.second>>z.first;
  }
  sort(v.begin(),v.end());
  vector<int>c(m);
  for(auto &z : c) {
    cin>>z;
  }
  sort(c.begin(),c.end());
  int dp[n+5][m+5];

  for(int i = 0 ; i <= n ; i++) {
    for(int j = 0 ; j <= m ; j++) {
      dp[i][j] = 0;
    }
  }
  
  for(int i = 1 ; i <= n ; i++) {
    for(int j = 1 ; j <= m ; j++) {
      dp[i][j] = dp[i][j-1];
      if(v[i-1].second <= c[j-1])
        dp[i][j] = max(dp[i][j], dp[i-1][j-1] + 1);
    }
  }
  cout << dp[n][m];
}
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Correct 0 ms 212 KB Output is correct
4 Correct 0 ms 212 KB Output is correct
5 Correct 0 ms 212 KB Output is correct
6 Correct 0 ms 212 KB Output is correct
7 Incorrect 0 ms 212 KB Output isn't correct
8 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Correct 0 ms 212 KB Output is correct
4 Correct 0 ms 212 KB Output is correct
5 Correct 0 ms 212 KB Output is correct
6 Correct 0 ms 212 KB Output is correct
7 Incorrect 0 ms 212 KB Output isn't correct
8 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Correct 0 ms 212 KB Output is correct
4 Correct 0 ms 212 KB Output is correct
5 Correct 0 ms 212 KB Output is correct
6 Correct 0 ms 212 KB Output is correct
7 Incorrect 0 ms 212 KB Output isn't correct
8 Halted 0 ms 0 KB -