problem: Link On Spoj
Code: My Code
Approach: I am using Bibartite graph and got WA and I don't know why!!
problem: Link On Spoj
Code: My Code
Approach: I am using Bibartite graph and got WA and I don't know why!!
| # | User | Rating |
|---|---|---|
| 1 | Benq | 3792 |
| 2 | VivaciousAubergine | 3647 |
| 3 | Kevin114514 | 3603 |
| 4 | jiangly | 3583 |
| 5 | turmax | 3559 |
| 6 | tourist | 3541 |
| 7 | strapple | 3515 |
| 8 | ksun48 | 3461 |
| 9 | dXqwq | 3436 |
| 10 | Otomachi_Una | 3413 |
| # | User | Contrib. |
|---|---|---|
| 1 | Qingyu | 157 |
| 2 | adamant | 153 |
| 3 | Um_nik | 147 |
| 3 | Proof_by_QED | 147 |
| 5 | Dominater069 | 145 |
| 6 | errorgorn | 142 |
| 7 | cry | 139 |
| 8 | YuukiS | 135 |
| 9 | TheScrasse | 134 |
| 10 | chromate00 | 133 |
| Name |
|---|



Two errors: First, On lines 45-46, you have
what this loop does is copy the vector to a new variable
iand clear the contents ofi. To modify the actual adj vector you needSecond, on line 49 you initialize
edgesto sizem + 1, but then in your for loop you push back (x, y) pairs to the end of the vector, so now you have an edge vector of length2m + 1and when you iterate over all the edges at the end, you always include an edge pair (0, 0) which isn't right.Fixing those two errors gets AC.