Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Problem B. Unique set Input file: standard input Output file: standard output Time limit: 2 seconds Memory limit: 256 megabytes Anton has an array a
Problem B. Unique set Input file: standard input Output file: standard output Time limit: 2 seconds Memory limit: 256 megabytes Anton has an array a of size n, where the value of each element is in the range from 1 to k (inclusively). Anton wants to know: is there any segment of size k, containing all the values from 1 to k? If there is such segment, you should print the beginning position of this segment (elements are enumerated from 1). Otherwise, print - 1. If there are different possible answers, then print the minimum value. Input The first line contains two integers n and k (1
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started