mirror of
https://github.com/TheAlgorithms/C-Plus-Plus.git
synced 2026-02-09 21:47:07 +08:00
fix: vla in lisnlogn
This commit is contained in:
@@ -4,6 +4,7 @@
|
||||
|
||||
#include <iostream>
|
||||
#include <set>
|
||||
#include <vector>
|
||||
|
||||
using namespace std;
|
||||
int LIS(int arr[], int n) {
|
||||
@@ -32,7 +33,7 @@ int main(int argc, char const* argv[]) {
|
||||
int n;
|
||||
cout << "Enter size of array: ";
|
||||
cin >> n;
|
||||
int a[n];
|
||||
std::vector<int> a(n);
|
||||
cout << "Enter array elements: ";
|
||||
for (int i = 0; i < n; ++i) {
|
||||
cin >> a[i];
|
||||
|
||||
Reference in New Issue
Block a user