3556 | 2023-02-28 21:57:21 | HorakZsofi | Kert (75 pont) | cpp11 | Compilation error |
include <bits/stdc++.h>
using namespace std;
int main() {
int n, m, sz;
cin>>n>>m>>sz;
int szaml=0;
int szaml2=0;
for(int i=1; i<n+1; i++){
int azon=1;
int az=0;
map<int, int>szin;
for(int j=1; j<m+1; j++){
int a;
cin>>a;
szin[a]++;
if(az==a){
azon++;
}
else{
if(szaml2<azon){
szaml2=azon;
}
azon=1;
az=a;
}
}
if(szaml2<azon){
szaml2=azon;
}
int maxi=0;
for(auto x: szin){
if(maxi<x.second){
maxi=x.second;
}
}
if(maxi>m/2){
szaml++;
}
}
cout<<szaml<<endl<<szaml2;
}
exit status 1
main.cpp:1:1: error: 'include' does not name a type
1 | include <bits/stdc++.h>
| ^~~~~~~
main.cpp: In function 'int main()':
main.cpp:6:9: error: 'cin' was not declared in this scope
6 | cin>>n>>m>>sz;
| ^~~
main.cpp:12:17: error: 'map' was not declared in this scope
12 | map<int, int>szin;
| ^~~
main.cpp:12:21: error: expected primary-expression before 'int'
12 | map<int, int>szin;
| ^~~
main.cpp:16:25: error: 'szin' was not declared in this scope
16 | szin[a]++;
| ^~~~
main.cpp:33:29: error: 'szin' was not declared in this scope
33 | for(auto x: szin){
| ^~~~
main.cpp:42:1: error: 'cout' was not declared in this scope
42 | cout<<szaml<<endl<<szaml2;
| ^~~~
main.cpp:42:14: error: 'endl' was not declared in this scope
42 | cout<<szaml<<endl<<szaml2;
| ...