Submission #547865

# Submission time Handle Problem Language Result Execution time Memory
547865 2022-04-11T22:30:57 Z Olympia Boat (APIO16_boat) C++17
0 / 100
1 ms 320 KB
#include <cmath>
#include <iostream>
#include <set>
#include <climits>
#include <algorithm>
#include <cassert>
#include <vector>
#include <iomanip>
#include <type_traits>
#include <string>
#include <queue>
#include <map>

const int MOD = 1e9 + 7;
using namespace std;
int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int N;
    cin >> N;
    vector<int64_t> v(N); for (int i = 0; i < N; i++) {
        int x; cin >> x;
        cin >> v[i];
    }
    vector<int64_t> dp(N + 1); dp[0] = 0;
    for (int i = 1; i <= N; i++) {
        dp[i] = 1;
        for (int j = 1; j < i; j++) {
            dp[i] += dp[j] * (v[j - 1] < v[i - 1]);
        }
        dp[i] %= MOD;
    }
    int64_t ans = 0;
    for (int i: dp) {
        ans += i;
    }
    cout << ans;
}
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 320 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -