10901 | 2024-04-18 15:47:06 | Kristóf | Zebra (75 pont) | cpp17 | Compilation error |
#include <iostream>
#include <vector>
#include <bits/stdc++.h>
using namespace std;
int main()
{
int n;
cin>>n;
int old[n];
int ido[n];
for(int i=0;i<n;i++)
{
cin>>old[i];
}
for(int i=0;i<n;i++)
{
cin>>ido[i];
}
vector<int>egy;
vector<int>nulla;
vector<int>vala1;
vector<int>vala0;
int ans=0;
for(int i=0;i<n;i++)
{
if(old[i]==1)
{
egy.push_back(ido[i]);
}
else
{
nulla.push_back(ido[i]);
}
}
int idoseged;
int idoseged2;
vector<int>::iterator it;
sort(nulla.begin(),nulla.end());
for(int i=0;i<n;i++)
{
if(nulla.size()<0)
{
for()
{
}
break;
}
if(egy.size()<1)
{
for()
{
}
break;
}
if(egy[0]<nulla[0])
{
vala1.push_back(egy[0]);
idoseged=egy[i];
it=egy.begin;
egy.erase(it);
}
else
{
vala0.push_back(nulla[0]);
idoseged=nulla[i];
it=nulla.begin;
nulla.erase(it);
}
if(idoseged!=idoseged2)
{
ans+=vala1.size();
ans+=vala0.size();
}
}
return 0;
}
exit status 1
main.cpp: In function 'int main()':
main.cpp:45:21: error: expected primary-expression before ')' token
45 | for()
| ^
main.cpp:48:17: error: expected primary-expression before 'break'
48 | break;
| ^~~~~
main.cpp:47:22: error: expected ';' before 'break'
47 | }
| ^
| ;
48 | break;
| ~~~~~
main.cpp:48:17: error: expected primary-expression before 'break'
48 | break;
| ^~~~~
main.cpp:47:22: error: expected ')' before 'break'
47 | }
| ^
| )
48 | break;
| ~~~~~
main.cpp:45:20: note: to match this '('
45 | for()
| ^
main.cpp:52:21: error: expected primary-expression before ')' token
52 | for(...