Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- using namespace std;
- #define int long long
- void out(vector<int> a) {
- for (int i = 0; i<a.size(); ++i) cout << a[i] << " ";
- cout << "\n";
- return;
- }
- signed main() {
- ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
- cout << fixed << setprecision(20);
- //freopen("input.txt", "r", stdin);
- //freopen("output.txt", "w", stdout);
- string s;
- map<char, int> mp;
- cin >> s;
- for (int i = 0; i<s.size(); i++) ++mp[s[i]];
- if (mp.size() == 1) {
- cout << "Impossible";
- return 0;
- }
- if (s.size() % 2 == 0) {
- if (s.size() % 4 == 0) cout << 1;
- else cout << 2;
- }
- else cout << 2;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement