From b2dfcfd0754d4fa5b83cc39702e18a08735d929b Mon Sep 17 00:00:00 2001 From: kaoplo Date: Fri, 25 Nov 2022 23:37:53 +0100 Subject: [PATCH] aaaaaaaaaaaa --- hf2/hf6/3.cpp | 48 +++++++++++++++++++++++++--------- hf2/hf6/3attempt2.cpp | 61 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 97 insertions(+), 12 deletions(-) create mode 100644 hf2/hf6/3attempt2.cpp 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<