← All problemsSign in

Increasing Subsequence

Given n numbers, find whether there exists an increasing subsequence of length k. Input First line of input contains T. T test cases follow. Each test case space separated integers n and k. ith number is (i*i)%10000 (1 Output Output T lines, one for each test case. Every line contains either 0 or 1, depending on whether there exists such a subsequence or not. Example Input: 2 5 6 5 4 Outpu

HINT LADDERno hints yet
L1 Observation
L2 Technique
L3 Approach
L4 Pseudo-code
🔒
L5 Full solution
L5 unlocks only if you insist twice
solution.cppC++17

CodeSearch Tutor

Hints, not spoilers — it won’t hand over the full solution unless you insist.

voice by Sarvam AI

Sign in to chat with the tutor and save your progress.

Sign in to start