nagyon sok minden

This commit is contained in:
kaoplo 2023-03-02 14:58:39 +01:00
parent 10713a7fef
commit ff65c57b4c
14 changed files with 222 additions and 0 deletions

BIN
quito/11.2 Executable file

Binary file not shown.

33
quito/11.2.cpp Normal file
View file

@ -0,0 +1,33 @@
#include <bits/stdc++.h>
using namespace std;
int main () {
int o, n, m, t, h;
cin >> o >> n >> m >> t >> h;
int ts, tts, nap, ora;
vector<vector<bool>> v(m+1, vector<bool>(n+1));
for (int i = 0; i < o; i++) {
cin >> ts >> tts >> nap >> ora;
v[tts][ts] = true;
}
int out;
int max =0;
for (int i =0; i < n+1; i++) {
int counter = 0;
for (int j = 0; j < m+1; j++) {
//cout<<v[i][j]<<" ";
if (v[i][j]) counter++;
}
if (counter > max) {
max = counter;
out = i;
}
//cout<<endl;
}
cout<<out;
}

BIN
quito/12.5 Executable file

Binary file not shown.

35
quito/12.5.cpp Normal file
View file

@ -0,0 +1,35 @@
#include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
vector<pair<string, string>>allatok(n);
set<string>kaja;
set<string> out;
for (int i =0; i < n ;i++) {
cin >> allatok[i].first;
//cout<<"s";
cin >> allatok[i].second;
kaja.insert(allatok[i].first);
}
for (int i = 0; i < n;i++) {
if (kaja.count(allatok[i].second)) {
//cout<<endl<<allatok[i].second<< " is in the set: "<<kaja.count(allatok[i].second);
out.insert(allatok[i].first);
}
}
cout<<out.size()<<endl;
for (string x : out) {
cout<<x<<endl;
}
}

BIN
quito/12.6 Executable file

Binary file not shown.

22
quito/12.6.cpp Normal file
View file

@ -0,0 +1,22 @@
#include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
vector<string> sorrend(n);
set<string> users;
for (int i = 0; i < n; i++) {
cin >> sorrend[i];
}
cout<<endl;
for (int i = sorrend.size()-1; i >= 0; i--) {
if (!users.count(sorrend[i])) {
cout<<sorrend[i]<<endl;
users.insert(sorrend[i]);
}
}
}

BIN
quito/13.1 Executable file

Binary file not shown.

37
quito/13.1.cpp Normal file
View file

@ -0,0 +1,37 @@
#include <bits/stdc++.h>
using namespace std;
int main() {
int n, m;
cin >> n;
set<string> store1;
set<string> store2;
set<string> out;
for (int i = 0; i < n; i++) {
string temp;
cin >> temp;
store1.insert(temp);
}
cin >> m;
for (int i = 0; i < m; i++) {
string temp;
cin >> temp;
store2.insert(temp);
}
for (string x : store1) {
if (!store2.count(x)) {
out.insert(x);
}
}
for (string x : store2) {
if (!store1.count(x)) {
out.insert(x);
}
}
cout<<out.size()<<endl;
for (string x : out) {
cout<<x<<endl;
}
}

BIN
quito/13.2 Executable file

Binary file not shown.

13
quito/13.2.cpp Normal file
View file

@ -0,0 +1,13 @@
#include <bits/stdc++.h>
using namespace std;
int main() {
string input;
cin >> input;
for (char i = 'a'; i <= 'z'; i++) {
cout<<input + i<<' ';
}
}

BIN
quito/13.5 Executable file

Binary file not shown.

36
quito/13.5.cpp Normal file
View file

@ -0,0 +1,36 @@
#include <bits/stdc++.h>
using namespace std;
int main() {
int n, m;
cin >> n >> m;
map<string, int> languages;
map<string, int> appearance;
for (int i = 0; i < n+m; i++) {
int cnt;
string lang;
cin >> cnt;
getline(cin, lang);
lang = lang.substr(1);
languages[lang] = cnt;
appearance[lang] += 1;
}
int max = 0, min = 100000;
string maxname = "NINCS", minname = "NINCS";
for (auto p : languages) {
if (appearance[p.first] == 2 && p.second > max) {
max = p.second;
maxname = p.first;
}
if (appearance[p.first] == 2 && p.second < min) {
min = p.second;
minname = p.first;
}
}
cout<<minname<<endl<<maxname;
}

BIN
quito/13.6 Executable file

Binary file not shown.

46
quito/13.6.cpp Normal file
View file

@ -0,0 +1,46 @@
#include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
set<long>hatvanyok;
set<long>hasznalt;
long a = 2;
for (int i =0; i < 30; i++) {
hatvanyok.insert(a);
a = a * 2;
//cout<<a<< " ";
}
//cout<< endl;
// for (int x : hatvanyok) {
// cout<<x<<" ";
// }
//cout<<endl;
vector<int> szamok(n);
for (int i = 0; i < n; i++) {
cin >> szamok[i];
}
int out = 0;
for (int i = 0; i < n; i++) {
for (int j = i+1; j < n; j++) {
if (!hasznalt.count(szamok[i] + szamok[j])) {
if (hatvanyok.count(szamok[i] + szamok[j])) {
out++;
hasznalt.insert(szamok[i] + szamok[j]);
}
} else {
out++;
}
}
}
cout<<out;
}