Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <vector>
- #include <algorithm>
- using namespace std;
- int n=0;
- long long suma_1=0,suma_2=0;
- bool stop=1;
- int main()
- {
- cin>>n;
- vector<int>k(n);
- for(int i=0;i<n;i++)
- {
- cin>>k[i];
- }
- if(n%2==1)
- {
- cout<<"NIE";
- stop=0;
- }
- if(stop){
- sort(k.begin(),k.end());
- for(int i=0;i<n;i++)
- {
- if(i%2==0)
- {
- suma_1+=k.at(i);
- }
- else suma_2+=k[i];
- }
- if(suma_1==suma_2)
- cout<<"TAK";
- else cout<<"NIE";
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement