Codeforces celebrates 10 years! We are pleased to announce the crowdfunding-campaign. Congratulate us by the link https://codeforces.com/10years. ×

### SupaHotFire's blog

By SupaHotFire, history, 5 months ago, ,

let's say we have an array={9,1,7,4,5} and I want to query what is the nearest bigger element to the left and to the right of the index I'm querying for example the nearest bigger element for 5 is 7 (it doesn't have bigger element to the right because it's the last element)and for 1 is 7 to the right and 9 to the left .

I think it needs some data structure(to make it nlog(n) instead of n^2) so if someone can provide some code it would be better and thanks in advance

• -11

By SupaHotFire, history, 5 months ago, ,

I did solve this problem for a set with binary searching in a BIT but for multiset I don't know how to solve it for example if the multiset elements are 3 3 3 my solution will only see the last element because BIT is a prefix sum and BIT array would be BIT[3]=3 so binary searching with query is not giving a correct answer because I'm looking for a certain value not a range using binarysearch

• 0

By SupaHotFire, history, 8 months ago, ,

I always thought writing this
ios_base::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
Will make cin/cout nearly as fast as printf/scanf
But yesterday I sloved a problem that got Tle using cout/cin then when I changed it to printf and scanf it was 5 times faster ?!
Doesn't ios_base::sync_with_stdio(false); make cout/cin nearly as fast as printf/scanf ?
Edit : as kyrillos said it's only way slower when dealing with doubles and that was the reason

• -21

By SupaHotFire, history, 10 months ago, ,

so many times contestants perform way less than what they could do at their best and I wanted to know why focus differs from times to times for so long but I couldn't find the reason

searching the web all I found was eating healthy food, sleeping well .. etc but analyzing myself for about one year those weren't the reasons ..

of course I don't mean that I want others to tell me what's my problem(why sometimes I just have so much brain energy and sometimes not) they aren't doctors there could be a lot of reasons for that and it's hard to determine it

but maybe someone could share his experience on why he started to have better focus than before and I don't mean why his rate is higher than before I'm just talking about the focus and brain energy

• +12

By SupaHotFire, history, 13 months ago, ,

we all enjoy participating codeforces rounds (I guess) but sometimes for example I have exams and putting my focus into a contest will make it hard to study or do anything that needs focus ... ofcourse in that case the solution is very simple I shouldn't participate in any round but I just can't control myself xD and I think some people are like that too.

so maybe if codeforces will allow any account to ban himself from participating cf rounds for amount of days he can choose.

if I have exams and I just ban myself for 2 weeks until exams are over that would be better ..everytime I see a contest it just feels so bad to not participate in it :/ eventhough I should focus in something else .

• -35

By SupaHotFire, history, 15 months ago, ,

I'm wondering why we can filter solutions with submission time,solution time ..etc

But we can't filter solutions with what programming language is used :\

I'm learning kotlin which isn't that good for problem solving but I'm still interested to see how some users use it So what do you guys think about this ?