Problem Link ,my code here Why I got WA? Please anyone can explain?
# | 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 | nor | 150 |
Problem Link ,my code here Why I got WA? Please anyone can explain?
Name |
---|
Have you tried the following:
98% of WAs and REs can be resolved this way. People here don't have the time to delve into every code posted here, it's much harder to debug somebody else's code and being able to debug your own code is a valuable skill. It is also a very routine process that can be learned much faster than problem solving and algorithms.
Also, the ideone link is missing ':' in the URL.
Sir, I agree with this process...but many a time it becomes very hard to generate test cases like when the input is a graph ....what to do then?
Generating graphs is not that bad: if I want a connected graph, I usually generate a tree and then randomly add edges until I have the desired number of edges. It may be a bit tedious, but it's not too bad. If you have trouble implementing it fast, I suggest preparing a small library for that. Or use existing libraries, but don't ask me for recommendations because I haven't used any.
If you have something more difficult, like a graph with some special property or something, I would generate inputs randomly until an input has the required property. Remember that you don't need anything super fancy or fast, you don't need uniform distribution or anything like that. Just a quick-and-dirty program that might reasonably generate any small input if you run it a few thousand times.
You might be interested in jngen.h. If you've used testlib.h in Polygon before, it's the same syntax for most of the functions. In particular, with this library it becomes really easy to add extra modifiers like guaranteeing connected, acyclic, etc.