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 | 3985 |
2 | jiangly | 3814 |
3 | jqdai0815 | 3682 |
4 | Benq | 3529 |
5 | orzdevinwang | 3526 |
6 | ksun48 | 3517 |
7 | Radewoosh | 3410 |
8 | hos.lyric | 3399 |
9 | ecnerwala | 3392 |
9 | Um_nik | 3392 |
# | User | Contrib. |
---|---|---|
1 | cry | 169 |
2 | maomao90 | 162 |
2 | Um_nik | 162 |
4 | atcoder_official | 161 |
5 | djm03178 | 158 |
6 | -is-this-fft- | 157 |
7 | adamant | 155 |
8 | awoo | 154 |
8 | Dominater069 | 154 |
10 | luogu_official | 150 |
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 |
---|