Submission #38781

# Submission time Handle Problem Language Result Execution time Memory
38781 2018-01-06T14:01:11 Z oTTo_22 Boat (APIO16_boat) C++14
0 / 100
0 ms 2176 KB
#include <bits/stdc++.h>
#define se second
#define fi first
const int MOD=1000000007;
using namespace std;

int dp[501];

int main () {

    ios_base::sync_with_stdio(false);
    cin.tie(0);

    int n;
    cin >> n;

    int p[n+1];

    p[0]=0;

    for (int i=1; i<=n; i++) {
        int l,r;
        cin >> l >> r;
        p[i]=r;
    }

    for (int i=1; i<=n; i++) {
        for (int k=1; k<i; k++)
            if (p[i]>p[k])
                dp[i]=dp[i]+dp[k]+1;
        dp[i]++;
    }

    cout << dp[n];

    return 0;
}
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 2176 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 2176 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 2176 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 2176 KB Output isn't correct
2 Halted 0 ms 0 KB -