Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <cstdio>
- #include <iostream>
- #include <algorithm>
- using namespace std;
- int liczbaLiczb, poprawne;
- int liczby[1000001];
- int main()
- {
- ios_base::sync_with_stdio(0);
- cin>>liczbaLiczb;
- for (int i=0; i<liczbaLiczb; i++)
- {
- cin>>liczby[i];
- }
- sort(liczby,liczby+liczbaLiczb);
- for (int i=0; i<liczbaLiczb; i++)
- {
- if (liczby[i]!=i+1) poprawne++;
- }
- if (poprawne>0) cout<<"NIE";
- else cout<<"TAK";
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement