ashishranjan2828's blog

By ashishranjan2828, history, 6 years ago, In English

Each node of tree is having values 0 and 1. how can i find the longest path in tree connected by each node having value 1.

Full text and comments »

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

By ashishranjan2828, history, 7 years ago, In English

how to solve this problem

Given three integers x,y and z you need to find the sum of all the numbers formed by having 4 atmost x times , having 5 atmost y times and having 6 atmost z times as a digit.

example say 4, 5, 6 occurs 1 time

The ans for the above example is 4+5+6+45+54+56+65+46+64+456+465+546+564+645+654=3675

Full text and comments »

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

By ashishranjan2828, history, 7 years ago, In English

in array of n +ve integers print the triplets if triplet is formed with the help of distinct integer and also having distinct sum

e.g. input 5 2 4 6 8 9

output 12 14 15 16 17 18 19 21 23

N<=10000

Full text and comments »

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

By ashishranjan2828, history, 7 years ago, In English

how to reduce the weight of edge such that shortest distance between starting node and all nodes remains same as previous

is it by dijkstra's algorithm or something else??

Full text and comments »

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

By ashishranjan2828, history, 7 years ago, In English

how to calculate a^b%mod where b is very much larger than mod

can we do b = b%mod???

e.g. mod = 1000000007

a = 2 b = 1134903170 after this can we do b = 1134903170%mod

Full text and comments »

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

By ashishranjan2828, history, 7 years ago, In English

I'm getting tle with normal divisor algorithm. Is there some extra needed concept required for this problem..

Full text and comments »

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

By ashishranjan2828, history, 7 years ago, In English

http://ideone.com/XwHMrW

my solution is working fine for first test case and for second test answer should be 508 but it is giving 494... i have used lazy propagation concept...

plz help

Full text and comments »

By ashishranjan2828, history, 8 years ago, In English

i hv tried this question with naive ....

but i think it can be done with the help of dp...

any help??

Full text and comments »

By ashishranjan2828, history, 8 years ago, In English

i'm getting TLE with this solution.....

http://ideone.com/8oQrcP

how to compute for lo to hi (0<lo≤hi≤10^18)... for such a large integer ...

is there any way????

Full text and comments »

By ashishranjan2828, history, 8 years ago, In English

problem is http://www.spoj.com/problems/MAX_NUM/

Actually i'm trying this problem for long time but ends up clueless.....

any kind of help..

Full text and comments »

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

By ashishranjan2828, history, 8 years ago, In English

problem is http://www.spoj.com/problems/DIV15

i'm not able to get the bug in my code.... it's giving TLE

Can someone suggest me for the edits in the code

http://ideone.com/6dvkFD // i hv put comments in my code

all testcases are working fine from my side

Full text and comments »

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