#include <bits/stdc++.h> #define pb push_back #define N 1000007 //1e6 + 7 using namespace std; typedef long long ll; typedef pair<int,int> pii; typedef pair<ll, ll> pll; int main(){ ios_base::sync_with_stdio(0); cin.tie(0); int n; unordered_set<string> a; unordered_map<string, int> b; cin>>n; for(int i=0; i<n; i++){ string s; cin>>s; a.insert(s); b[s]++; } if(a.size() == 15 && b["5A"]>=2 && b["5B"]>=2 && b["5C"]>=2) cout<<"TAK"; else cout<<"NIE"; }
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 | #include <bits/stdc++.h> #define pb push_back #define N 1000007 //1e6 + 7 using namespace std; typedef long long ll; typedef pair<int,int> pii; typedef pair<ll, ll> pll; int main(){ ios_base::sync_with_stdio(0); cin.tie(0); int n; unordered_set<string> a; unordered_map<string, int> b; cin>>n; for(int i=0; i<n; i++){ string s; cin>>s; a.insert(s); b[s]++; } if(a.size() == 15 && b["5A"]>=2 && b["5B"]>=2 && b["5C"]>=2) cout<<"TAK"; else cout<<"NIE"; } |