alphacademy-cpp/hf2/hf6/3.cpp

58 lines
1.2 KiB
C++
Raw Permalink Normal View History

2022-11-22 17:59:11 +00:00
#include <bits/stdc++.h>
#include <iostream>
using namespace std;
int returnVecMax(vector<int> a) {
2022-11-25 22:37:53 +00:00
int out = a[0];
2022-11-22 17:59:11 +00:00
int index = 0;
for (int i =1; i < a.size(); i++) {
2022-11-25 22:37:53 +00:00
if (a[i] > out) {
out = a[i];
2022-11-22 17:59:11 +00:00
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
2022-11-25 22:37:53 +00:00
vector<vector <bool>> tanarok(m, vector <bool> (n, 0));
vector<int> tantargyak(m);
2022-11-22 17:59:11 +00:00
for (int i = 0; i < o; i++) {
2022-11-25 22:37:53 +00:00
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;
}
2022-11-22 17:59:11 +00:00
2022-11-25 22:37:53 +00:00
cout<<endl<<endl;
for (int i = 0 ; i < m; i++) {
cout<<tantargyak[i]<<' ';
2022-11-22 17:59:11 +00:00
}
2022-11-25 22:37:53 +00:00
cout<<endl<<returnVecMax(tantargyak);
2022-11-22 17:59:11 +00:00
}