fork(1) download
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3.  
  4. const int N = 26;
  5.  
  6. int C[N];
  7. string s;
  8.  
  9. int main()
  10. {
  11. cin >> s;
  12. for (char c: s) {
  13. ++C[c - 'a'];
  14. }
  15. bool p = true;
  16. for (int i = 0; i < N; ++i) {
  17. if (C[i] == 0) {
  18. p = false;
  19. break;
  20. }
  21. }
  22. if (!p) {
  23. cout << "NIE" << endl;
  24. return 0;
  25. }
  26. p = true;
  27. for (int i = 1; i < N; ++i) {
  28. if (C[i - 1] != C[i]) {
  29. p = false;
  30. break;
  31. }
  32. }
  33. if (p) {
  34. cout << "PANGRAM PERFEKCYJNY" << endl;
  35. } else {
  36. cout << "PANGRAM" << endl;
  37. }
  38. return 0;
  39. }
Success #stdin #stdout 0s 15232KB
stdin
aabccddefghhijjkllmnnopqrrstuuvwwxxyyz
stdout
PANGRAM