103612024-04-01 11:04:08MagyarKendeSZLGHadjáratcpp17Wrong answer 18/100298ms12624 KiB
#include <bits/stdc++.h>

#define all(v) v.begin(), v.end()
#define rall(v) v.rbegin(), v.rend()
#define size(v) (int)v.size()

using namespace std;
using ll = long long;

int main() {
    cin.tie(0), ios::sync_with_stdio(0);

    int N;
    cin >> N;
    vector<int> R(N + 1), A(N + 1);
    for (int i = 1; i <= N; i++) {
        cin >> R[i] >> A[i];
    }

    vector<int> dp(N + 1, 1);

    for (int i = 1; i <= N; i++) {
        for (int j = 1; j < i; j++) {
            if (R[j] < R[i] && A[j] < A[i]) {
                dp[i] = max(dp[i], dp[j] + 1);
            }
        }
    }

   cout << *max_element(all(dp));
}
SubtaskSumTestVerdictTimeMemory
base18/100
1Wrong answer0/03ms1828 KiB
2Time limit exceeded0/0298ms2556 KiB
3Partially correct2/43ms2932 KiB
4Partially correct2/42ms2900 KiB
5Partially correct2/43ms3312 KiB
6Partially correct2/43ms3308 KiB
7Partially correct2/43ms3304 KiB
8Partially correct2/43ms3460 KiB
9Partially correct2/43ms3548 KiB
10Partially correct2/46ms3784 KiB
11Partially correct2/492ms3932 KiB
12Time limit exceeded0/4284ms3516 KiB
13Time limit exceeded0/6248ms3564 KiB
14Time limit exceeded0/6256ms3948 KiB
15Time limit exceeded0/6261ms4328 KiB
16Time limit exceeded0/6273ms5228 KiB
17Time limit exceeded0/6268ms6144 KiB
18Time limit exceeded0/6277ms7148 KiB
19Time limit exceeded0/6268ms8420 KiB
20Time limit exceeded0/6252ms10004 KiB
21Time limit exceeded0/6277ms11356 KiB
22Time limit exceeded0/6268ms12624 KiB