Submission #692281

# Submission time Handle Problem Language Result Execution time Memory
692281 2023-02-01T09:38:48 Z zeroesandones Mountains (IOI17_mountains) C++17
0 / 100
1 ms 296 KB
#include <bits/stdc++.h>
#include "mountains.h"
using namespace std;

using ll = long long;
using vi = vector<ll>;

int maximum_deevs(vector<int> y) {
	int n = y.size();
	vector<int> dp(n, 1);
	for(int i = 1; i < n; ++i) {
		bool bigger = false;
		set<int> seen;
		for(int j = i - 1; j >= 0; --j) {
			bigger |= (y[j] > y[i]);
			auto it = seen.upper_bound(y[j]);
			if(it != seen.end() && bigger) {
				dp[i] = max(dp[i], dp[j] + 1);
			}
			seen.insert(y[j]);
		}
	}

	return *max_element(dp.begin(), dp.end());
}
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Correct 1 ms 296 KB Output is correct
4 Correct 0 ms 212 KB Output is correct
5 Correct 1 ms 212 KB Output is correct
6 Incorrect 0 ms 212 KB Output isn't correct
7 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Correct 1 ms 296 KB Output is correct
4 Correct 0 ms 212 KB Output is correct
5 Correct 1 ms 212 KB Output is correct
6 Incorrect 0 ms 212 KB Output isn't correct
7 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Correct 1 ms 296 KB Output is correct
4 Correct 0 ms 212 KB Output is correct
5 Correct 1 ms 212 KB Output is correct
6 Incorrect 0 ms 212 KB Output isn't correct
7 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Correct 1 ms 296 KB Output is correct
4 Correct 0 ms 212 KB Output is correct
5 Correct 1 ms 212 KB Output is correct
6 Incorrect 0 ms 212 KB Output isn't correct
7 Halted 0 ms 0 KB -