답안 #124247

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
124247 2019-07-02T21:54:16 Z tutis Mountains (IOI17_mountains) C++17
70 / 100
1000 ms 219372 KB
#pragma GCC optimize ("O3")
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
bitset<2000>ok[2000];
unordered_map<bitset<2000>, int>M;
int dp(bitset<2000> x)
{
	int i = x._Find_first();
	if (i >= 2000)
		return 0;
	int &ans = M[x];
	if (ans != 0)
		return ans;
	x[i] = false;
	ans = max(1 + dp(x & ok[i]), dp(x));
	return ans;
}
int maximum_deevs(vector<int> y)
{
	bitset<2000>deevs;
	for (ll i = 0; i < (ll)y.size(); i++)
	{
		ll k = i + 1;
		for (ll j = i + 1; j < (ll)y.size(); j++)
		{
			if ((y[j] - y[i]) * (k - i) >= (y[k] - y[i]) * (j - i))
				k = j;
			if (j != k)
			{
				ok[i][j] = true;
			}
			else
				ok[i][j] = false;
		}
		deevs[i] = true;
	}
	return dp(deevs);
}/*
int main()
{
	cout << maximum_deevs({ 6, 1, 5, 2, 3, 1}) << endl;//3
	cout << maximum_deevs({ 0, 1, 2}) << endl;//1
}/**/

Compilation message

mountains.cpp:45:2: warning: "/*" within comment [-Wcomment]
 }/**/
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 376 KB Output is correct
2 Correct 2 ms 376 KB Output is correct
3 Correct 2 ms 376 KB Output is correct
4 Correct 2 ms 376 KB Output is correct
5 Correct 2 ms 376 KB Output is correct
6 Correct 2 ms 376 KB Output is correct
7 Correct 2 ms 376 KB Output is correct
8 Correct 2 ms 376 KB Output is correct
9 Correct 2 ms 376 KB Output is correct
10 Correct 2 ms 376 KB Output is correct
11 Correct 2 ms 380 KB Output is correct
12 Correct 2 ms 376 KB Output is correct
13 Correct 2 ms 376 KB Output is correct
14 Correct 2 ms 376 KB Output is correct
15 Correct 2 ms 376 KB Output is correct
16 Correct 2 ms 376 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 376 KB Output is correct
2 Correct 2 ms 376 KB Output is correct
3 Correct 2 ms 376 KB Output is correct
4 Correct 2 ms 376 KB Output is correct
5 Correct 2 ms 376 KB Output is correct
6 Correct 2 ms 376 KB Output is correct
7 Correct 2 ms 376 KB Output is correct
8 Correct 2 ms 376 KB Output is correct
9 Correct 2 ms 376 KB Output is correct
10 Correct 2 ms 376 KB Output is correct
11 Correct 2 ms 380 KB Output is correct
12 Correct 2 ms 376 KB Output is correct
13 Correct 2 ms 376 KB Output is correct
14 Correct 2 ms 376 KB Output is correct
15 Correct 2 ms 376 KB Output is correct
16 Correct 2 ms 376 KB Output is correct
17 Correct 2 ms 376 KB Output is correct
18 Correct 2 ms 376 KB Output is correct
19 Correct 2 ms 376 KB Output is correct
20 Correct 2 ms 376 KB Output is correct
21 Correct 2 ms 376 KB Output is correct
22 Correct 2 ms 376 KB Output is correct
23 Correct 2 ms 376 KB Output is correct
24 Correct 2 ms 376 KB Output is correct
25 Correct 2 ms 376 KB Output is correct
26 Correct 2 ms 376 KB Output is correct
27 Correct 2 ms 380 KB Output is correct
28 Correct 2 ms 376 KB Output is correct
29 Correct 2 ms 376 KB Output is correct
30 Correct 2 ms 376 KB Output is correct
31 Correct 2 ms 376 KB Output is correct
32 Correct 2 ms 504 KB Output is correct
33 Correct 2 ms 376 KB Output is correct
34 Correct 2 ms 376 KB Output is correct
35 Correct 2 ms 376 KB Output is correct
36 Correct 2 ms 376 KB Output is correct
37 Correct 2 ms 376 KB Output is correct
38 Correct 2 ms 376 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 376 KB Output is correct
2 Correct 2 ms 376 KB Output is correct
3 Correct 2 ms 376 KB Output is correct
4 Correct 2 ms 376 KB Output is correct
5 Correct 2 ms 376 KB Output is correct
6 Correct 2 ms 376 KB Output is correct
7 Correct 2 ms 376 KB Output is correct
8 Correct 2 ms 376 KB Output is correct
9 Correct 2 ms 376 KB Output is correct
10 Correct 2 ms 376 KB Output is correct
11 Correct 2 ms 380 KB Output is correct
12 Correct 2 ms 376 KB Output is correct
13 Correct 2 ms 376 KB Output is correct
14 Correct 2 ms 376 KB Output is correct
15 Correct 2 ms 376 KB Output is correct
16 Correct 2 ms 376 KB Output is correct
17 Correct 2 ms 376 KB Output is correct
18 Correct 2 ms 376 KB Output is correct
19 Correct 2 ms 376 KB Output is correct
20 Correct 2 ms 376 KB Output is correct
21 Correct 2 ms 376 KB Output is correct
22 Correct 2 ms 376 KB Output is correct
23 Correct 2 ms 376 KB Output is correct
24 Correct 2 ms 376 KB Output is correct
25 Correct 2 ms 376 KB Output is correct
26 Correct 2 ms 376 KB Output is correct
27 Correct 2 ms 380 KB Output is correct
28 Correct 2 ms 376 KB Output is correct
29 Correct 2 ms 376 KB Output is correct
30 Correct 2 ms 376 KB Output is correct
31 Correct 2 ms 376 KB Output is correct
32 Correct 2 ms 504 KB Output is correct
33 Correct 2 ms 376 KB Output is correct
34 Correct 2 ms 376 KB Output is correct
35 Correct 2 ms 376 KB Output is correct
36 Correct 2 ms 376 KB Output is correct
37 Correct 2 ms 376 KB Output is correct
38 Correct 2 ms 376 KB Output is correct
39 Correct 3 ms 760 KB Output is correct
40 Correct 3 ms 888 KB Output is correct
41 Correct 4 ms 1016 KB Output is correct
42 Correct 4 ms 1016 KB Output is correct
43 Correct 3 ms 888 KB Output is correct
44 Correct 3 ms 888 KB Output is correct
45 Correct 6 ms 1656 KB Output is correct
46 Correct 6 ms 1528 KB Output is correct
47 Correct 5 ms 1400 KB Output is correct
48 Correct 6 ms 1656 KB Output is correct
49 Correct 5 ms 1528 KB Output is correct
50 Correct 5 ms 1528 KB Output is correct
51 Correct 3 ms 1016 KB Output is correct
52 Correct 7 ms 1912 KB Output is correct
53 Correct 6 ms 1784 KB Output is correct
54 Correct 6 ms 1912 KB Output is correct
55 Correct 6 ms 1912 KB Output is correct
56 Correct 6 ms 1912 KB Output is correct
57 Correct 3 ms 640 KB Output is correct
58 Correct 6 ms 1912 KB Output is correct
59 Correct 4 ms 1144 KB Output is correct
60 Correct 3 ms 760 KB Output is correct
61 Correct 3 ms 888 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 376 KB Output is correct
2 Correct 2 ms 376 KB Output is correct
3 Correct 2 ms 376 KB Output is correct
4 Correct 2 ms 376 KB Output is correct
5 Correct 2 ms 376 KB Output is correct
6 Correct 2 ms 376 KB Output is correct
7 Correct 2 ms 376 KB Output is correct
8 Correct 2 ms 376 KB Output is correct
9 Correct 2 ms 376 KB Output is correct
10 Correct 2 ms 376 KB Output is correct
11 Correct 2 ms 380 KB Output is correct
12 Correct 2 ms 376 KB Output is correct
13 Correct 2 ms 376 KB Output is correct
14 Correct 2 ms 376 KB Output is correct
15 Correct 2 ms 376 KB Output is correct
16 Correct 2 ms 376 KB Output is correct
17 Correct 2 ms 376 KB Output is correct
18 Correct 2 ms 376 KB Output is correct
19 Correct 2 ms 376 KB Output is correct
20 Correct 2 ms 376 KB Output is correct
21 Correct 2 ms 376 KB Output is correct
22 Correct 2 ms 376 KB Output is correct
23 Correct 2 ms 376 KB Output is correct
24 Correct 2 ms 376 KB Output is correct
25 Correct 2 ms 376 KB Output is correct
26 Correct 2 ms 376 KB Output is correct
27 Correct 2 ms 380 KB Output is correct
28 Correct 2 ms 376 KB Output is correct
29 Correct 2 ms 376 KB Output is correct
30 Correct 2 ms 376 KB Output is correct
31 Correct 2 ms 376 KB Output is correct
32 Correct 2 ms 504 KB Output is correct
33 Correct 2 ms 376 KB Output is correct
34 Correct 2 ms 376 KB Output is correct
35 Correct 2 ms 376 KB Output is correct
36 Correct 2 ms 376 KB Output is correct
37 Correct 2 ms 376 KB Output is correct
38 Correct 2 ms 376 KB Output is correct
39 Correct 3 ms 760 KB Output is correct
40 Correct 3 ms 888 KB Output is correct
41 Correct 4 ms 1016 KB Output is correct
42 Correct 4 ms 1016 KB Output is correct
43 Correct 3 ms 888 KB Output is correct
44 Correct 3 ms 888 KB Output is correct
45 Correct 6 ms 1656 KB Output is correct
46 Correct 6 ms 1528 KB Output is correct
47 Correct 5 ms 1400 KB Output is correct
48 Correct 6 ms 1656 KB Output is correct
49 Correct 5 ms 1528 KB Output is correct
50 Correct 5 ms 1528 KB Output is correct
51 Correct 3 ms 1016 KB Output is correct
52 Correct 7 ms 1912 KB Output is correct
53 Correct 6 ms 1784 KB Output is correct
54 Correct 6 ms 1912 KB Output is correct
55 Correct 6 ms 1912 KB Output is correct
56 Correct 6 ms 1912 KB Output is correct
57 Correct 3 ms 640 KB Output is correct
58 Correct 6 ms 1912 KB Output is correct
59 Correct 4 ms 1144 KB Output is correct
60 Correct 3 ms 760 KB Output is correct
61 Correct 3 ms 888 KB Output is correct
62 Correct 11 ms 3064 KB Output is correct
63 Correct 28 ms 6776 KB Output is correct
64 Correct 22 ms 5368 KB Output is correct
65 Correct 26 ms 6264 KB Output is correct
66 Correct 26 ms 6264 KB Output is correct
67 Correct 25 ms 6008 KB Output is correct
68 Correct 24 ms 5624 KB Output is correct
69 Correct 26 ms 6140 KB Output is correct
70 Correct 169 ms 37052 KB Output is correct
71 Correct 126 ms 30856 KB Output is correct
72 Correct 135 ms 32240 KB Output is correct
73 Correct 120 ms 30216 KB Output is correct
74 Correct 130 ms 31768 KB Output is correct
75 Correct 134 ms 32136 KB Output is correct
76 Correct 28 ms 6776 KB Output is correct
77 Correct 21 ms 4856 KB Output is correct
78 Correct 19 ms 4216 KB Output is correct
79 Correct 19 ms 4216 KB Output is correct
80 Correct 19 ms 4216 KB Output is correct
81 Correct 19 ms 4344 KB Output is correct
82 Correct 14 ms 2552 KB Output is correct
83 Correct 443 ms 86356 KB Output is correct
84 Execution timed out 1096 ms 219372 KB Time limit exceeded
85 Halted 0 ms 0 KB -