#include #include #include using namespace std; int main() { int N; cin >> N; int* buffer = new int[N]; for (int i = 0; i < N; i++) { string A; cin >> A; buffer[i] = stoi(A); } int maxCount = 0; int count = 0; unordered_map foundNumbers; for (int i = 0; i < N; i++) { if (foundNumbers.find(buffer[i]) == foundNumbers.end()) { foundNumbers[buffer[i]] = 0; count++; } else { if (maxCount < count) maxCount = count; count = 0; foundNumbers.clear(); } } if (maxCount < count) maxCount = count; cout << maxCount << endl; return 0; }