This repository has been archived on 2022-01-12. You can view files and clone it, but cannot push or open issues or pull requests.
2020-07-25 20:17:26 +00:00
|
|
|
#include <bits/stdc++.h>
|
|
|
|
using namespace std;
|
|
|
|
|
|
|
|
int main() {
|
|
|
|
ifstream cin("whereami.in");
|
|
|
|
ofstream cout("whereami.out");
|
|
|
|
|
|
|
|
int N;
|
|
|
|
cin >> N;
|
|
|
|
string S;
|
|
|
|
cin >> S;
|
|
|
|
|
|
|
|
for (int K = 1; K <= N; ++K) {
|
|
|
|
bool good = true;
|
|
|
|
|
|
|
|
for (int a = 0; a <= N - K; ++a) {
|
|
|
|
for (int b = 0; b <= N - K; ++b) {
|
|
|
|
if (a == b) continue;
|
|
|
|
|
|
|
|
bool string_equal = true;
|
|
|
|
for (int i = 0; i <= K - 1; ++i) {
|
|
|
|
if (S[a + i] != S[b + i]) string_equal = false;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (string_equal) good = false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (good) {
|
|
|
|
cout << K;
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
}
|
2020-07-11 23:09:51 +00:00
|
|
|
}
|