Problem | lis_easy |
---|---|
User | baobaocar |
Submission Time | 2023-02-24 23:39:48 |
Score | 0 |
Max Time | N/A |
Max Memory | N/A |
Owl Get a Life
lis_easy.cpp: In function ‘int main()’:
lis_easy.cpp:2:14: error: ‘cin’ was not declared in this scope
2 | int main() { cin >> N; for (int i = 0; i < N; ++i) cin >> nums[i]; for (int i = 0; i < N; ++i) { dp[i] = 1; for (int j = 0; j < i; ++j) { if (nums[j] < nums[i]) dp[i] = max(dp[i], dp[j] + 1);
| ^~~
lis_easy.cpp:2:170: error: ‘max’ was not declared in this scope
2 | int main() { cin >> N; for (int i = 0; i < N; ++i) cin >> nums[i]; for (int i = 0; i < N; ++i) { dp[i] = 1; for (int j = 0; j < i; ++j) { if (nums[j] < nums[i]) dp[i] = max(dp[i], dp[j] + 1);
| ^~~
lis_easy.cpp:4:48: error: ‘max’ was not declared in this scope
4 | int sol = 0; for (int i = 0; i < N; ++i) sol = max(sol, dp[i]); cout << sol