HitmanBBa's blog

By HitmanBBa, history, 8 years ago, In English

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?

Full text and comments »

  • Vote: I like it
  • 0
  • Vote: I do not like it

By HitmanBBa, history, 8 years ago, In English

Hello everyone,

Today while I am proceeding in ladder C from a2oj.com I faced "Statement is not available." in this problem 388A - Лиса и коробки, 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.

Full text and comments »

  • Vote: I like it
  • +24
  • Vote: I do not like it

By HitmanBBa, 8 years ago, In English

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?

Full text and comments »

Tags c++
  • Vote: I like it
  • -3
  • Vote: I do not like it

By HitmanBBa, history, 8 years ago, In English

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.

Thanks in advance.

Full text and comments »

Tags lis, dp
  • Vote: I like it
  • +8
  • Vote: I do not like it

By HitmanBBa, history, 9 years ago, In English

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].

Thanks in advance :D.

Full text and comments »

  • Vote: I like it
  • +2
  • Vote: I do not like it

By HitmanBBa, history, 9 years ago, In English

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.

Thanks in advance :D

Full text and comments »

  • Vote: I like it
  • +7
  • Vote: I do not like it

By HitmanBBa, history, 9 years ago, In English

Hello everyone.

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

Full text and comments »

  • Vote: I like it
  • +7
  • Vote: I do not like it

By HitmanBBa, history, 9 years ago, In English

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.

I will start with something simple and I hope it will help you Codeforces members :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.

Full text and comments »

  • Vote: I like it
  • +38
  • Vote: I do not like it

By HitmanBBa, 9 years ago, In English

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??

Full text and comments »

Tags c++
  • Vote: I like it
  • 0
  • Vote: I do not like it

By HitmanBBa, 9 years ago, In English

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 :).

Full text and comments »

Tags c++
  • Vote: I like it
  • +13
  • Vote: I do not like it

By HitmanBBa, 9 years ago, In English

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?

Full text and comments »

  • Vote: I like it
  • -4
  • Vote: I do not like it

By HitmanBBa, 9 years ago, In English

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 ...

If I miss any thing please help me .. :)

Full text and comments »

  • Vote: I like it
  • 0
  • Vote: I do not like it

By HitmanBBa, 9 years ago, In English

What is the complexity of this Code... Order of what?? please help me.

10022450

Full text and comments »

  • Vote: I like it
  • +3
  • Vote: I do not like it

By HitmanBBa, 9 years ago, In English

Many Thanks to Codeforces.

Full text and comments »

  • Vote: I like it
  • -23
  • Vote: I do not like it