Nearest smaller
AlgoSearch ·
AlgoSearch
Please provide a summary of a competitive programming problem.
All nearest smaller values
AlgoSearch
Your summary has been paraphrased as follows:
Given an array A of integers, for each element A[i] in the array, find the index of the nearest smaller element to the left of A[i]. If there is no smaller element to the left, output -1.
Codeforces949B (0.75)
You are given an array of size n containing numbers from 1 to n. Each number is located at index 2i-1 in the array. Starting with the number in the last non-empty cell of the array, you need to move each number to the nearest empty cell to the left. Write a program to determine the number at a given index x after performing this operation.
Codeforces1512A (0.73)
Given an array a of n positive integers, find and return the index of the element that is different from all other elements in the array a.
Codeforces803B (0.72)
Given an array of integers, find the distance from each element to the nearest zero element in the array.
Codeforces1416A (0.72)
You are given an array a of length n containing integers from 1 to n. Find the minimum number that appears in all subsegments of a with length k, for each k from 1 to n. If there is no such number, output −1.
Codeforces1479A (0.71)
Given an array a of length n, find any index k (1≤k≤n) where ak is smaller than its neighboring elements ak−1 and ak+1 (if they exist). We are only given the length of the array initially and can make up to 100 queries to obtain the value of any element in the array.