Please subscribe to the official Codeforces channel in Telegram via the link https://t.me/codeforces_official. ×

### rumman_sust's blog

By rumman_sust, history, 8 years ago,

UPD: I just solved Robert Hood from Kattis online judge. After spending almost a week I've understood the process of rotating calipers. It feels really great to learn a new problem solving technique. I recommend everyone to read this book and visit this site (provided by SuprDewd) for umderstanding rotating calipers technique. Here you can find a basic implementation of rotating calipers for finding diameter of a convex polygon. Also don't forget to look at SuprDewd's comment. Thank you all for helping and encouraging me all the time :)

• +43

By rumman_sust, history, 9 years ago,

Recently our team has practiced Tehran Regional contest 2014. We solved 7 problems. But I want to discuss some problems we couldn't solve. Problem E Antennas (Uva Live 7016) and Problem I Robot Race (Uva live 7020). You can discuss about those problems here if you want :)

Best regards.

• +11

By rumman_sust, history, 9 years ago,

I've found an interesting problem in hackerrank. But couldn't solve it. I've tried so many ways, but no one can pass the time limit. That's why I've decided to seek some help from you guys :) Here is the problem link. If anyone have an idea to solve it, please share your thoughts :)

UPD: Solved it with mo's algorithm + binary index tree. Thanks for the hint mkirsche :)

• +5

By rumman_sust, 9 years ago,

Recently in a national contest I've found an interesting problem. Given an array of N elements and Q queries with a range . You've to find how many numbers have the highest frequency in that range? That means if the maximum frequency is , then how many numbers have in that range?

Let's call the i'th element of the array is and for each query the range is .

I can't find any feasible solution. I think this problem can be solved using Square Root RMQ with complexity per query. But couldn't find a way. How to solve this type of problem with RMQ? Any idea or hints?

UPD: Mo's algorithm is really cool :D

• +25

By rumman_sust, 9 years ago,

If we want to know a variable's type id or compare two variables' type ids are same or not, here is a keyword "typeid" in C++.

#include <bits/stdc++.h>
using namespace std;

int main()
{
int intvar;
long long longlongvar;
bool boolvar;

cout<<"Type name of int: "<<typeid(int).name()<<"\n";
cout<<"Type name of intvar: "<<typeid(intvar).name()<<"\n\n";
cout<<"Type name of long long: "<<typeid(long long).name()<<"\n";
cout<<"Type name of longlongvar: "<<typeid(longlongvar).name()<<"\n\n";
cout<<"Type name of bool: "<<typeid(bool).name()<<"\n";
cout<<"Type name of boolvar: "<<typeid(boolvar).name()<<"\n\n";

return 0;
}



This code shows:

Type name of int: i
Type name of intvar: i

Type name of long long: x
Type name of longlongvar: x

Type name of bool: b
Type name of boolvar: b



"i" for integer, "x" for long long and "b" for bool.

• +16

By rumman_sust, 10 years ago,

How can I find the minimum cost max-flow in a graph where the capacity of an edge have a lower and upper bound (UPD: Edge have a capacity within a range [l,r])?

UPD: FLOW (not capacity) of an edge have a lower and upper bound

• -4

By rumman_sust, 10 years ago,

I recently heard about plug dp (I don't know what it means). When I tried to solve this problem, I read some Chinese blog where they mentioned plug dp. Can any one inform me about plug dp or how to solve this problem? Thanks in advance. :)

• 0

By rumman_sust, 10 years ago,

I want to know about monotonous queue. I google it, but found nothing(may be i'm not good at searching!). :( Can any one describe it or give me some idea and information about it? It will be really appreciable. Thanks in advance. :)

• 0

By rumman_sust, 11 years ago,

I am trying to solve this problem so many times but I can't figure out how to solve this within 2.00 second(Time limit). I really need help cause I am being frustrated about this problem.

Problem summary : Given an array find the smallest sub-array whose summation is greater or equal than X and output the length of the smallest sub-array.

1 <= Array size <= 500000, -10^9 <= A[i] <= 10^9 and -10^9 <= X <= 10^9.

Can any one give me some hints about how to solve this type of problem less than O(n^2) complexity and within 2.00 second(Time limit).