Search found 11 matches
- Fri Sep 20, 2013 9:45 pm
- Forum: Volume 101 (10100-10199)
- Topic: 10171 - Meeting Prof. Miguel...
- Replies: 68
- Views: 24116
Re: 10171 - Meeting Prof. Miguel
I highly doubt it's the bford. I've tried to code the SSSP part using roy-floyd, bford and now dijkstra as you've suggested (just to be on the safe side). The verdict is still WA. The new code: #include <cstdio> #include <cstring> #include <string> #include <iostream> #include <queue> #include <vect...
- Fri Sep 20, 2013 7:01 pm
- Forum: Volume 111 (11100-11199)
- Topic: 11167 - Monkeys in the Emei Mountain
- Replies: 30
- Views: 15409
Re: 11167 - Monkeys in the Emei Mountain
Can anyone help me figure out why do I get WA?? It works on every test I try. Can anyone take a look at my output formatting? Maybe there's a mistake there I can't see... Thank you in advance! #include <cstdio> #include <vector> #include <bitset> #include <algorithm> #include <cstring> #define NMAX ...
- Fri Sep 20, 2013 1:45 pm
- Forum: Volume 101 (10100-10199)
- Topic: 10171 - Meeting Prof. Miguel...
- Replies: 68
- Views: 24116
Re: 10171 - Meeting Prof. Miguel
Could anyone take a look at my source code or give me some more tests? I'm passing all the test cases on those 4 pages in the forum, but I still manage to get WA. I've checked for everything I could think of (multiple edges between nodes, self loops, 0 cost edges etc). Thank you! #include <cstdio> #...
- Fri Sep 20, 2013 2:48 am
- Forum: Bugs and suggestions
- Topic: 334 - Identifying Concurrent Events.. PE!!
- Replies: 10
- Views: 10071
Re: 334 - Identifying Concurrent Events.. PE!!
I have followed the advice in this thread, but I would still get PE. However, if I don't put a "\n" after the last testcase, I receive WA. I suspect it's supposed to be PE again. Can someone take a look at my code and tell me if there's anything strange? Thanks in advance! #include <cstdio> #include...
- Thu Sep 19, 2013 10:38 pm
- Forum: Volume 104 (10400-10499)
- Topic: 10449 - Traffic
- Replies: 58
- Views: 21784
Re: 10449 - Traffic
It makes so much more sense now (for some reason I didn't pay attention to the ^ 3 and the example test cases weren't revealing). I got accepted changing the cost of the edge accordingly.
@brianfry: Thank you!
@brianfry: Thank you!
- Thu Sep 19, 2013 3:45 pm
- Forum: Volume 104 (10400-10499)
- Topic: 10449 - Traffic
- Replies: 58
- Views: 21784
Re: 10449 - Traffic
Could anyone clarify how can a negative cycle exist in this problem? I find the statement quite confusing. Assuming we have a negative cycle with nodes x1 -> x2 -> ... xk -> x1, the sum of all edges on the cycles is val[x2] - val[x1] + val[x3] - val[x2] + ... val[xk] - val[x(k-1)] + val[x1] - val[xk...
- Tue Sep 17, 2013 4:54 pm
- Forum: Volume 113 (11300-11399)
- Topic: 11396 - Claw Decomposition
- Replies: 12
- Views: 4491
Re: 11396 - Claw Decomposition
I got accepted with a bipartite check algorithm, but I'm still rather unsure about the correctness of the algorithm. Logically, in order to prove that a solution exists iff the graph is bipartite, one would have to show that: I) if the graph is bipartite, we can indeed construct a solution II) if th...
- Mon Aug 12, 2013 3:05 am
- Forum: Volume 1 (100-199)
- Topic: 195 - Anagram
- Replies: 242
- Views: 26689
Re: 195 - Anagram
#include <cstring> #include <algorithm> #include <iostream> #include <string> #include <cstdio> using namespace std; int t, n; string A; bool cmp(char x, char y) { if (tolower(x) == tolower(y)) return isupper(x); return tolower(x) < tolower(y); } int main() { //freopen("input", "r", stdin); cin >> ...
- Sun Aug 11, 2013 8:02 pm
- Forum: Volume 4 (400-499)
- Topic: 401 - Palindromes
- Replies: 196
- Views: 31440
Re: 401 Palindromes WA help!!!
#include <cstdio> #include <iostream> #include <string> #define NMAX 255 using namespace std; char rev[NMAX]; int n; string A, B; void prep() { rev['E'] = '3'; rev['J'] = 'L'; rev['L'] = 'J'; rev['S'] = '2'; rev['Z'] = '5'; rev['2'] = 'S'; rev['3'] = 'E'; rev['5'] = 'Z'; } int main() { //freopen("i...
- Sat Aug 10, 2013 12:30 am
- Forum: Volume 101 (10100-10199)
- Topic: 10141 - Request for Proposal
- Replies: 44
- Views: 15841
Re: 10141 - Request for Proposal
Sorry about that. I have left it unintentionally. I usually comment it before submitting ; so this is not the issue
- Fri Aug 09, 2013 7:34 pm
- Forum: Volume 101 (10100-10199)
- Topic: 10141 - Request for Proposal
- Replies: 44
- Views: 15841
Re: 10141 - Request for Proposal
#include <cstdio> #include <cstring> #include <vector> #include <algorithm> #include <iostream> #include <map> #include <string> #define mp make_pair #define LMAX 85 #define NMAX 1005 using namespace std; int n, p, r, no, res_no; char A[NMAX][LMAX]; char name[LMAX], word[LMAX], res_name[LMAX]; doub...