답안 #833190

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
833190 2023-08-22T03:02:46 Z vjudge1 Exam (eJOI20_exam) C++17
0 / 100
4 ms 468 KB
#include <bits/stdc++.h>
using namespace std;

const int MX = 2005;

int N;
int H[MX], T[MX], dp[MX];

int main() {
      cin.tie(0); ios_base::sync_with_stdio(0);
      
      cin >> N;
      for(int i = 1; i <= N; i++) cin >> H[i];
      for(int i = 1; i <= N; i++) cin >> T[i];

      for(int i = 1; i <= N; i++) {
            int mx = H[i];
            map<int,int> cnt;
            cnt[T[i]]++;
            for(int j = i - 1; j >= 0; j--) {
                  dp[i] = max(dp[i], dp[j] + cnt[mx]);
                  mx = max(mx, H[j]);
                  cnt[T[j]]++;
            }
            cnt.clear();
      }

      cout << dp[N] << '\n';

}
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 216 KB Output is correct
2 Correct 1 ms 324 KB Output is correct
3 Correct 1 ms 212 KB Output is correct
4 Correct 1 ms 212 KB Output is correct
5 Incorrect 1 ms 212 KB Output isn't correct
6 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 4 ms 340 KB Output is correct
2 Runtime error 1 ms 380 KB Execution killed with signal 11
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Runtime error 1 ms 468 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 216 KB Output is correct
2 Correct 1 ms 324 KB Output is correct
3 Correct 1 ms 212 KB Output is correct
4 Correct 1 ms 212 KB Output is correct
5 Incorrect 1 ms 212 KB Output isn't correct
6 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 216 KB Output is correct
2 Correct 1 ms 324 KB Output is correct
3 Correct 1 ms 212 KB Output is correct
4 Correct 1 ms 212 KB Output is correct
5 Incorrect 1 ms 212 KB Output isn't correct
6 Halted 0 ms 0 KB -