code_hackadeep's blog

By code_hackadeep, history, 3 years ago, In English

Hello everyone , Please help me out by commenting your approaches/solutions of this problem which was asked in Hackwithinfy contest yesterday.Any Discussion will be appreciated .

Problem 1 :

You are given a number N .You have to find the total number of positive integer pair (A,B) such that following conditions satisfies:

  1. A,B <= N
  2. A^B <= X
  3. A+B is divisible by D

Since the total number of pairs can be large return the answer modulo 10^9+7.

NOTE : X , D was not given in problem statement it was just given in the conditions.

Input Format

N X D

Constraints :

1 <= N <= 10^9

1 <= X <= 10^9

1 <= D <= 10^4

Sample Input

4 3 2

Sample Output

6

Explanation There are 6 pairs {(1,1),(1,3),(2,2),3,1),(3,3),(4,4)} which satisfy the condition .

test case for debugging : 100 121 2 answer will be 4778 .

Full text and comments »

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

By code_hackadeep, history, 4 years ago, In English

Hey guys i want to know is there any people on codeforces that submit his solution with the approach he have done in his code...somewhat like editorial of his code. Reason why i am asking it :-> Because sometimes i cant solve the problem even after watching the editorial then i look the solution of others someimes i cant understand approach done by users so...i thought is there any account on codeforces that submits his solution with commenting the approach he have done. Thank u if u give answer to it :)

Full text and comments »

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