There are black points on coordinate plane. The
-th black point(they're numbered in 1-based) is on
in the beginning.
Then events happens. There are two types of event:
In the end, output y-coordinates of all the black points.
If you use std::set to store elements, you can use its member function std::set::lower_bound to find the iterator of the least element which is greater than or equal to the element you pass. The time complexity of std::set::lower_bound is where
is the number of elements in that std::set. Do not use std::lower_bound on std::set.
You can refer to the following code.
set<int> s; /* insert some elements into s */ int x = 5; set<int>::iterator it; /* (1) good */ it = s.lower_bound(x); /* (2) bad */ it = lower_bound(s.begin(), s.end(), x);
The first line contains two integers and
– the number of black points and the number of events.
Then lines follow. The
-th line contains an integer
– the type of the
-th event. If
is equal to 1, then two integers
and
follow. Otherwise three integers
and
follow.
It's guaranteed that:
After the events, output y-coordinates of all the black points and print a newline('\n') character.