report VI VI EN
Register | Login
  • HOME
  • PROBLEMSET
  • ROADMAP
  • COMPETITION
  • TOPIC
  • RANKING
  • GUIDE
  • MASHUP
  • ABOUT
  • CONTACT
  • Problem
  • Submit
  • Results
Deleting digits - FlandreOJ: Flandre Online Judge

Deleting digits

Time limit: 1000 ms
Memory limit: 256 MB
Given a positive integer $n$ with $d$ digits, find the largest number possible by removing exactly $k$ digits from the given number. ### Input - The first line contains a positive integer $n$. - The second line contains an integer $k$. ### Output - Print the largest possible integer after removing exactly $k$ digits from the number $n$. This number should not have a leading digit of $0$. ### Constraints - $1 \le d \le 10^5$. - $1 \le k < d$. ### Example Input: ``` 4231 2 ``` Output: ``` 43 ```
Monotonic queue
Nearest position
Subarray minimum
Peak Product
Histogram
Maximum subsequence value
Deleting digits
Electric poles
Planting flowers
Ring road
Prefix minimum
Knee surgery
Topic
Data structure
Rating 1600
Solution (0) Solution