aaaaaaaaaaaa

This commit is contained in:
kaoplo 2022-11-25 23:37:53 +01:00
parent cad8519840
commit b2dfcfd075
2 changed files with 97 additions and 12 deletions

View file

@ -3,11 +3,11 @@
using namespace std; using namespace std;
int returnVecMax(vector<int> a) { int returnVecMax(vector<int> a) {
int max = a[0]; int out = a[0];
int index = 0; int index = 0;
for (int i =1; i < a.size(); i++) { for (int i =1; i < a.size(); i++) {
if (a[i] > max) { if (a[i] > out) {
max = a[i]; out = a[i];
index = i; index = i;
} }
} }
@ -19,16 +19,40 @@ int main () {
cin >> o >> n >> m >> t >> h; //orak szama, tantargyak szama, egy sorszama, egy nap sorszama 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 int ts, tts, nap, ora; // tanar sorszam, tanitott tantargy sorszam, nap, ora
vector<int> tantargyElofordulas(n); vector<vector <bool>> tanarok(m, vector <bool> (n, 0));
vector<int> tantargyak(m);
for (int i = 0; i < o; i++) { for (int i = 0; i < o; i++) {
cin>>ts>>tts>>nap>>ora; cin>>ts>>tts>>nap>>ora;
ts; cout<<endl<<"aaaa"<<tts<< ' ' << ts<<endl;
tantargyElofordulas[ts] += 1; 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);
} }
// for (int i = 0; i < tantargyElofordulas.size(); i++) {
// cout<<tantargyElofordulas[i]<<endl;
// }
cout<<returnVecMax(tantargyElofordulas) + 1;
}

61
hf2/hf6/3attempt2.cpp Normal file
View file

@ -0,0 +1,61 @@
#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;
n +=1;
m +=1;
int ts, tts, nap, ora;
vector <vector <bool>> tan (m, vector<bool>(n));
vector <int> 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<<tan[i][j]<<' ';
// }
// cout<<endl;
// }
// cout<<endl;
// for (int i = 0 ; i < m; i++) {
// cout<<legtobb[i]<< ' ';
// }
// cout<<endl;
cout<<returnVecMax(legtobb);
}