Giải pháp: Thông thường, khi bạn phải xử lý các vấn đề liên quan đến chuỗi phép quay, một sẽ thay tiếp nhau các chuỗi với chính nó để đơn giản hóa tác vụ. Sau đó, trình tự tối thiểu của chiều dài n là yêu cầu. Như của đơn đặt hàng được xác định theo lệnh của các chuỗi hậu tố-mặc dù có là một tuyến tính giải pháp trình bày trong [10]-hậu tố mảng là một gimmick dễ dàng có thể giải quyết vấn đề ngay lập tức. Vấn đề 2: mảng (trại huấn luyện năm 2004) Xem xét một mảng c1c2... cn bao gồm n (1 ≤ n ≤ 30 000)) các yếu tố từ tập hợp {A, B}. Tiếp nhau các mảng với chính nó và có được một loạt các độ dài 2n. Đối với một chỉ số k (1≤k≤2n) xem xét các subsequences độ dài tại hầu hết n kết thúc vào vị trí k, và trong số này cho s(k) là nhỏ nhất lexicographic subsequence. Xác định k chỉ số cho s(k) đó là dài nhất. Gợi ý: Để X và Y đặt cược hai mảng như được định nghĩa trước đây và «o» các nhà điều hành nối. Trong vấn đề này, bạn sẽ xem xét rằng X > X o Y. Giải pháp: Tìm kiếm subsequence là sự quay lexicographic nhỏ nhất của các mảng nhất định. Biểu thị bởi Sik
đang được dịch, vui lòng đợi..