Advertisement
Guest User

Untitled

a guest
Feb 16th, 2019
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.72 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3.  
  4. #define int long long
  5.  
  6. void out(vector<int> a) {
  7. for (int i = 0; i<a.size(); ++i) cout << a[i] << " ";
  8. cout << "\n";
  9. return;
  10. }
  11.  
  12. signed main() {
  13. ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
  14. cout << fixed << setprecision(20);
  15. //freopen("input.txt", "r", stdin);
  16. //freopen("output.txt", "w", stdout);
  17.  
  18. string s;
  19. map<char, int> mp;
  20. cin >> s;
  21.  
  22. for (int i = 0; i<s.size(); i++) ++mp[s[i]];
  23. if (mp.size() == 1) {
  24. cout << "Impossible";
  25. return 0;
  26. }
  27. if (s.size() % 2 == 0) {
  28. if (s.size() % 3 == 0) cout << 2;
  29. else cout << 1;
  30. }
  31. else cout << 2;
  32.  
  33. return 0;
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement