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 | 3993 |
2 | jiangly | 3743 |
3 | orzdevinwang | 3707 |
4 | Radewoosh | 3627 |
5 | jqdai0815 | 3620 |
6 | Benq | 3564 |
7 | Kevin114514 | 3443 |
8 | ksun48 | 3434 |
9 | Rewinding | 3397 |
10 | Um_nik | 3396 |
# | User | Contrib. |
---|---|---|
1 | cry | 167 |
2 | Um_nik | 163 |
3 | maomao90 | 162 |
3 | atcoder_official | 162 |
5 | adamant | 159 |
6 | -is-this-fft- | 158 |
7 | awoo | 156 |
8 | TheScrasse | 154 |
9 | Dominater069 | 153 |
10 | nor | 152 |
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 |
---|