diff --git a/hf2/hf6/3.cpp b/hf2/hf6/3.cpp index a94836f..3cd3812 100644 --- a/hf2/hf6/3.cpp +++ b/hf2/hf6/3.cpp @@ -3,11 +3,11 @@ using namespace std; int returnVecMax(vector a) { - int max = a[0]; + int out = a[0]; int index = 0; for (int i =1; i < a.size(); i++) { - if (a[i] > max) { - max = a[i]; + if (a[i] > out) { + out = a[i]; index = i; } } @@ -19,16 +19,40 @@ int main () { 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 tantargyElofordulas(n); + vector> tanarok(m, vector (n, 0)); + vector tantargyak(m); for (int i = 0; i < o; i++) { - cin >> ts >>tts>>nap>>ora; - ts; - tantargyElofordulas[ts] += 1; - + cin>>ts>>tts>>nap>>ora; + cout< +#include +using namespace std; + +int returnVecMax(vector 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; + n +=1; + m +=1; + int ts, tts, nap, ora; + + vector > tan (m, vector(n)); + vector legtobb(m); + + + for (int i = 1; i <= o; i++) { + cin >> ts >> tts >> nap >> ora; + + tan[tts][ts] = 1; + + } + + for (int i = 0; i < n; i++) { + for (int j = 0 ; j < m; j++) { + if (tan[i][j]) { + legtobb[i] += 1; + + } + } + } + + + //debug + // for (int i = 0 ; i < m; i++) { + // for (int j = 0; j < n; j++) { + // cout<