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.
# | User | Rating |
---|---|---|
1 | tourist | 4009 |
2 | jiangly | 3831 |
3 | Radewoosh | 3646 |
4 | jqdai0815 | 3620 |
4 | Benq | 3620 |
6 | orzdevinwang | 3529 |
7 | ecnerwala | 3446 |
8 | Um_nik | 3396 |
9 | gamegame | 3386 |
10 | ksun48 | 3373 |
# | User | Contrib. |
---|---|---|
1 | cry | 164 |
1 | maomao90 | 164 |
3 | Um_nik | 163 |
4 | atcoder_official | 160 |
5 | -is-this-fft- | 158 |
6 | awoo | 157 |
7 | adamant | 156 |
8 | TheScrasse | 154 |
8 | nor | 154 |
10 | Dominater069 | 153 |
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.
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
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
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??
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
I'm getting tle with normal divisor algorithm. Is there some extra needed concept required for this problem..
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
i hv tried this question with naive ....
but i think it can be done with the help of dp...
any help??
i'm getting TLE with this solution.....
how to compute for lo to hi (0<lo≤hi≤10^18)... for such a large integer ...
is there any way????
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..
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
Name |
---|