Language: C++

、#include <bits/stdc++.h>
using namespace std;
typedef long long lint;
typedef unsigned long long ulint;
typedef pair<int, int> pii;
typedef pair<lint, lint> pll;
#define endl '\n'
#define next next_
#define fst first
#define sed second
#define pb push_back
#define mp make_pair
#define rint register int
#define newline putchar('\n')
#define leave_space puthchar(' ')
#define all(x) (x).begin(), (x).end()
#define reveal(x) cerr << #x << " = " << (x) << endl
#define rep(it, f, e) for (rint it = f; it <= e; ++it)
#define per(it, f, e) for (rint it = f; it >= e; --it)
const int MAXN = 5e5 + 20;
char s[MAXN], t[MAXN];
int n, fail1[MAXN], fail2[MAXN];
inline void getfail(int fail[], char S[]) {
	int j = fail[0] = -1;
	rep (i, 1, n - 1) {
		while(j >= 0 && S[i] != S[j]) j = fail[j];
		fail[i + 1] = ++j;
	}
}
inline bool check_cyc1(int x) {
	return fail1[x] == 0 || x % (x - fail1[x]);
}
inline bool check_cyc2(int x) {
	if (x == 0) return false;
	return fail2[x] == 0 || x % (x - fail2[x]);
}
int main() {
	scanf("%s", s);
	n = strlen(s);
	memcpy(t, s, sizeof(t));
	reverse(t, t + n);
	getfail(fail1, s);
	getfail(fail2, t);
	//int res = check_cyc1(n) ? 1 : 2;
	int flag = check_cyc1(n) ? 1 : 2, ans = 0;
	bool f = true;
	for (int i = 1; i < n; ++i) 
		if (s[i] != s[i - 1]) { f = false; break; }
	if (f) flag = n;
	cout << flag << '\n';
	if (flag != 2) { cout << 1; return 0; }
	for (int i = 0; i < n; ++i) {
		int tmp = n - i - 1;
		if (check_cyc1(i + 1) && check_cyc2(tmp)) ++ans;
	}
	cout << ans;
	/*bool flag = true;
	rep (i, 1, n - 1) {
		if (s[i] != s[i - 1]) {
			flag = false;
			break;
		}
	}
	if (flag) {
		cout << n << endl;
		cout << 1 << endl;
	} else if (res == 1) {
		cout << 1 << endl;
		cout << 1 << endl;
	} else {
		int ans = 0;
		rep (i, 0, n - 1) {
			ans += (check_cyc1(i + 1) && check_cyc2(n - i - 1));
		}
		cout << 2 << endl;
		cout << ans << endl;
	}*/ 
	return 0;
}

Compiler output:
a.cc:1:1: error: extended character 、 is not valid in an identifier
    1 | 、#include <bits/stdc++.h>
      | ^
a.cc:1:3: error: stray '#' in program
    1 | 、#include <bits/stdc++.h>
      |   ^
a.cc:1:1: error: '\U00003001' does not name a type
    1 | 、#include <bits/stdc++.h>
      | ^~
a.cc:5:9: error: 'pair' does not name a type
    5 | typedef pair<int, int> pii;
      |         ^~~~
a.cc:6:9: error: 'pair' does not name a type
    6 | typedef pair<lint, lint> pll;
      |         ^~~~
a.cc: In function 'void getfail(int*, char*)':
a.cc:25:14: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
   25 |         rep (i, 1, n - 1) {
      |              ^
a.cc:18:33: note: in definition of macro 'rep'
   18 | #define rep(it, f, e) for (rint it = f; it <= e; ++it)
      |                                 ^~
a.cc: In function 'int main()':
a.cc:38:9: error: 'scanf' was not declared in this scope
   38 |         scanf("%s", s);
      |         ^~~~~
a.cc:39:13: error: 'strlen' was not declared in this scope
   39 |         n = strlen(s);
      |             ^~~~~~
a.cc:1:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
  +++ |+#include <cstring>
    1 | 、#include <bits/stdc++.h>
a.cc:40:9: error: 'memcpy' was not declared in this scope
   40 |         memcpy(t, s, sizeof(t));
      |         ^~~~~~
a.cc:40:9: note: 'memcpy' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
a.cc:41:9: error: 'reverse' was not declared in this scope
   41 |         reverse(t, t + n);
      |         ^~~~~~~
a.cc:50:9: error: 'cout' was not declared in this scope
   50 |         cout << flag << '\n';
      |         ^~~~