#include <bits/stdc++.h> using namespace std; set<string> rzeczy; int pa, pb, pc; int main() { ios_base::sync_with_stdio(false); cin.tie(nullptr); int ile; cin>>ile; for(int i=0; i<ile; i++) { string rzyt; cin>>rzyt; rzeczy.emplace(rzyt); pa+=rzyt=="5A" ? 1 : 0; pb+=rzyt=="5B" ? 1 : 0; pc+=rzyt=="5C" ? 1 : 0; } if(rzeczy.size()==15 && pa>=2 && pb>=2 && pc>=2) { cout<<"TAK"; } else { cout<<"NIE"; } return 0; }
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 | #include <bits/stdc++.h> using namespace std; set<string> rzeczy; int pa, pb, pc; int main() { ios_base::sync_with_stdio(false); cin.tie(nullptr); int ile; cin>>ile; for(int i=0; i<ile; i++) { string rzyt; cin>>rzyt; rzeczy.emplace(rzyt); pa+=rzyt=="5A" ? 1 : 0; pb+=rzyt=="5B" ? 1 : 0; pc+=rzyt=="5C" ? 1 : 0; } if(rzeczy.size()==15 && pa>=2 && pb>=2 && pc>=2) { cout<<"TAK"; } else { cout<<"NIE"; } return 0; } |