| 2024 USACO.Guide Informatics Tournament |
|---|
| Закончено |
In the vibrant town of Numerica, where numbers ruled the marketplace, a clever mathematician named Alaric presented a challenge. Traders were tasked with finding the longest stretch of numbers in an array, but here's the catch – they could only use up to three different numbers in that stretch. It was like a numerical puzzle, a quest to uncover the magic of the longest subarray with just three types of numbers.
As traders delved into Numerica, each subarray they discovered was a chapter in their adventure, revealing the delicate dance of numbers within Alaric's constraints. The goal was simple yet intriguing: for an array $$$A$$$ find the longest subarray with at most three different numbers, and earn the admiration of the entire marketplace.
Output a single integer representing the length of the longest subarray where traders, armed with arrays, successfully unravel the numerical puzzle presented by Alaric.
7 1 4 2 1 9 1 10
4
| Название |
|---|


