I have problem with that problem http://mirror.codeforces.com/contest/459/problem/E
Could someone please help me to find my fault, it gives wrong answer on test 36
I solved it with dp here is my solution link
Thanks in advance.
# | 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 | 170 |
2 | Um_nik | 162 |
3 | maomao90 | 161 |
4 | atcoder_official | 160 |
5 | djm03178 | 158 |
5 | -is-this-fft- | 158 |
7 | adamant | 154 |
7 | Dominater069 | 154 |
9 | awoo | 152 |
9 | luogu_official | 152 |
I have problem with that problem http://mirror.codeforces.com/contest/459/problem/E
Could someone please help me to find my fault, it gives wrong answer on test 36
I solved it with dp here is my solution link
Thanks in advance.
Name |
---|
your code gives wrong answer for this test: 8 7 1 2 1 2 3 2 3 4 3 4 5 4 4 6 3 6 7 4 7 8 5 pay attention when you sort an array of pairs if first elements were equal it sorts them according to the second element. in your code when two edges have equal wi then it add the edge which has bigger uito the current graph and it may cause problem like the example I told!
i meant w [i] and u [i] in my previous comment which they are equal to v [i].ff and v [i].sf in your code. :)