### HitmanBBa's blog

By HitmanBBa, history, 3 years ago, ,

Hello,

Yesterday I was solving this contest: 2015 Syrian Private Universities Collegiate Programming Contest, then I leave it to sleep.

Today I return to solve the rest of the problems, but I faced strange problem, I asked many friends to open any problem from this contest and they can open them, but for me I have the message in the bottom-right corner :(.

Message: Can't download contest descriptor from external storage. Are you sure you have at least one contest release?

Can any one tell me why this happen to me?

• 0

By HitmanBBa, history, 3 years ago, ,

Hello everyone,

Today while I am proceeding in ladder C from a2oj.com I faced "Statement is not available." in this problem 388A - Fox and Box Accumulation, I hope this will be fixed soon.

Thank you MikeMirzayanov for the great Codeforces and I hope for it to dominate the first place among competitive programming sites all the time.

• +24

By HitmanBBa, 3 years ago, ,

Peace,

In today's contest problem B, I tried to hack this solution 19690271, but all my 4 attempts where unsuccessful, then I decided to automate the hacking process with writing C++ code to try large random input on 2 versions of this code one with long and one with int but unfortunately 30 minutes without any break in the infinite loop which search for the test case, so I will be very thankful to the person who would explain to me why?

• -3

By HitmanBBa, history, 4 years ago, ,

Greetings.

There is any O(N LOG K) algorithm for longest not strictly increasing subsequence?

Example for longest not strictly increasing subsequence:

n = 3
a[] = {1, 1, 1}


Normal O(N LOG K) algorithm will give answer = 1. (Because it's work strictly increasing)

I need modified algorithm to give answer = 3.

• +8

By HitmanBBa, history, 4 years ago, ,

Hello everybody,

I have a really hard problem with Dynamic Programming Bottom-up (table method).

Someone told me I should first do Top-down, then construct the base case, then construct recursion tree, then convert the recursion tree to Directed Acyclic Graph, then do a topological sort on this graph.

But always I get stuck and I can't find the solution.

Can any one help me with good material or write a blog about this like PrinceOfPersia [Algorithm Gym].

• +2

By HitmanBBa, history, 4 years ago, ,

Hi everyone.

I hope you're having a good day.

As you see in the picture when I read double using scanf "%lf" specifier it's ok, but when I'm trying to print double using printf "%lf" specifier, I got zero as result, but when I use "%f" floating-point specifier give me the right result, can any one help me with this problem and tell me why?

My IDE: Code::Blocks 13.12

My compiler: GNU GCC Compiler.

• +7

By HitmanBBa, history, 4 years ago, ,

Hello everyone.

Happy Eid Al Fitr to everyone who is celebrating ^_^.

• +7

By HitmanBBa, history, 4 years ago, ,

Hi everyone.

I think we can spread the science over Codeforces community, by sharing our knowledge and experiences in our blog and in that way we learn and let others learn also :D.

Did you know that [C++] got StringTokenizer like [Java], it's implemented as a function in STL <cstring> called strtok(char * str, char * delimiters) for more information.

• +38

By HitmanBBa, 4 years ago, ,

Hello everyone.

Today, while I'm trying to solve this easy problem 404A - Valera and X,

I write this code 11264735 using cin.tie(0); and ios_base::sync_with_stdio(0); and I got a wrong answer on test 2, but when I removed them from my code 11264741 I got Accepted, why??

• 0

By HitmanBBa, 4 years ago, ,

Hi everybody...

How are you ??

I have learnt a new move in c++ while reading an array, and I would like to share it with you my friends :).

Most of us while reading an array in contest he/she use this move:

int x[100005];
int i;
for(i=0;i<50;i++)
scanf("%d", &x[i]);


We use &x[i] for point to the ith element in the array... look look look we just press shift + 7 and then write x[i]. oh that's make me so tired.

But look at this move...

int x[100005];
int i;
for(i=0;i<50;i++)
scanf("%d", x+i); // I just press x + i only and for the same reason, that's make me comfortable. ^_^


If you got any lazy move like this please share it with us :).

• +13

By HitmanBBa, 4 years ago, ,

I'm junior in computer science major and I've learnt about binary search tree, and when I finished I found there is a lot of trees in computer science, What is the most important trees for competitive programmers?

• -4

By HitmanBBa, 5 years ago, ,

100155A - The New President

I tried with this problem with all my powers ... that's how I tried to solve the problem first I calculated the max from the first column x[i][0] and if there are two max's go to the second column x[i][1] and calculate the max between the two first max's ,, finally print the answer and the round 1 or 2 ...

• 0

By HitmanBBa, 5 years ago, ,

10022450

• +3

By HitmanBBa, 5 years ago, ,

Many Thanks to Codeforces.