using System; using System.IO; using System.Linq; using System.Collections.Generic; using System.Text; public class Program { public void Proc() { int[] inpt = Reader.ReadLine().Split(' ').Select(a => int.Parse(a)).ToArray(); int q = inpt[0]; int k = inpt[1]; StringBuilder ans = new StringBuilder(); for (int i = 0; i < q; i++) { long[] tmp = Reader.ReadLine().Split(' ').Select(a => long.Parse(a)).ToArray(); if(tmp[0]==1) { long num = tmp[1]; int idx = GetIdx(0, this.Lst.Count, num); this.Lst.Insert(idx, num); } else { if(this.Lst.Count Lst = new List(); private int GetIdx(int min, int max, long num) { if(this.Lst.Count<=0) { return 0; } int mid = (max + min) / 2; if(max-min<=1) { if (num < this.Lst[min]) { return min; } else { return max; } } if(this.Lst[mid]==num) { return mid; } else if(this.Lst[mid]