alphacademy-cpp/hf2/hf6/3.cpp
2022-11-25 23:37:53 +01:00

58 lines
1.2 KiB
C++

#include <bits/stdc++.h>
#include <iostream>
using namespace std;
int returnVecMax(vector<int> a) {
int out = a[0];
int index = 0;
for (int i =1; i < a.size(); i++) {
if (a[i] > out) {
out = a[i];
index = i;
}
}
return index;
}
int main () {
int o, n, m, t, h;
cin >> o >> n >> m >> t >> h; //orak szama, tantargyak szama, egy sorszama, egy nap sorszama
int ts, tts, nap, ora; // tanar sorszam, tanitott tantargy sorszam, nap, ora
vector<vector <bool>> tanarok(m, vector <bool> (n, 0));
vector<int> tantargyak(m);
for (int i = 0; i < o; i++) {
cin>>ts>>tts>>nap>>ora;
cout<<endl<<"aaaa"<<tts<< ' ' << ts<<endl;
tanarok[tts][ts] = true;
//cout<<endl<<i<<endl;
cout<<tanarok[tts][ts]<<endl;
}
int count = 0;
for (int i = 0; i < n; i++) {
for (int j = 0; j < m; j++) {
if (tanarok[i][j]) {
count++;
}
}
tantargyak[i] = count;
count = 0;
}
for (int i = 0; i < m; i++) {
for (int j = 0; j < n; j++) {
cout<<tanarok[i][j]<< ' ';
}
cout<<endl;
}
cout<<endl<<endl;
for (int i = 0 ; i < m; i++) {
cout<<tantargyak[i]<<' ';
}
cout<<endl<<returnVecMax(tantargyak);
}