6273 | 2023-11-11 12:59:14 | MrChipser | Legmesszebbi rossz sorrendű (35 pont) | cpp11 | Forditási hiba |
#include <iostream>
#include <vector>
using namespace std;
int a[100000];
int main()
{
int n;
cin >> n;
vector<int>s;
int maxim = =-1;
int maxim1 =-1;
int maxim2 =-1;
for(int i =0; i < n; i++)
{
int a;
cin >> a;
int relativi =-1;
for(int i = s.size()-1; i >= 0; i--)
{
if(s[i]>a)
{
relativi=i;
}
}
//cout << i << " " << relativi << endl;
int lokaltav = i-relativi;
if((lokaltav > maxim && relativi!=-1) or (lokaltav==maxim && relativi!=-1 && relativi < maxim1))
{
maxim = lokaltav;
maxim1 = relativi;
maxim2= i;
}
s.push_back(a);
}
if(maxim!=-1)
cout << maxim1+1 << " " << maxim2+1;
else
cout << -1;
return 0;
}
exit status 1
main.cpp: In function 'int main()':
main.cpp:10:17: error: expected primary-expression before '=' token
10 | int maxim = =-1;
| ^
Exited with error status 1