Hi, I've been trying to solve 315-Networks but seem to keep getting WA
Also I can't seem to understand why it fails on some sample cases here.
Thanks in advance.
#include <iostream>
#include <string>
#include <cctype>
#include <algorithm>
#include <sstream>
#include <vector>
#include <string ...
Search found 21 matches
- Thu Mar 12, 2015 6:39 am
- Forum: Volume 3 (300-399)
- Topic: 315 - Network
- Replies: 68
- Views: 33343
- Fri Oct 17, 2014 11:03 am
- Forum: Volume 9 (900-999)
- Topic: 929 - Number Maze
- Replies: 92
- Views: 55184
Re: 929 - Number Maze
Hi. This is my first implementation of dijkstra's algorithm and it keeps telling me that I am getting TLE.
Can anyone help and tell me why?
#include <iostream>
#include <algorithm>
#include <fstream>
#include <vector>
#include <string>
#include <sstream>
#include <numeric>
#include <queue ...
Can anyone help and tell me why?
#include <iostream>
#include <algorithm>
#include <fstream>
#include <vector>
#include <string>
#include <sstream>
#include <numeric>
#include <queue ...
- Fri Aug 22, 2014 12:47 am
- Forum: Volume 5 (500-599)
- Topic: 573 - The Snail
- Replies: 45
- Views: 27908
Re: 573 - The Snail
Thanks a lot but would you know why it also fails on test cases?
- Thu Aug 21, 2014 12:11 pm
- Forum: Volume 5 (500-599)
- Topic: 573 - The Snail
- Replies: 45
- Views: 27908
Re: 573 - The Snail
Thanks again lighted. But I was wondering why?
- Wed Aug 20, 2014 1:02 pm
- Forum: Volume 5 (500-599)
- Topic: 573 - The Snail
- Replies: 45
- Views: 27908
Re: 573 - The Snail
Hi a friend asked me to check his code and was wondering why it was wrong. I tried but could not find fault in it. Can you guys help?
#include <iostream>
#include <cmath>
using namespace std;
int main(){
double h, u, d, f;
cin >> h >> u >> d >> f;
if ((h == 0) || !(1 <= h <= 100) || !(1 <= u ...
#include <iostream>
#include <cmath>
using namespace std;
int main(){
double h, u, d, f;
cin >> h >> u >> d >> f;
if ((h == 0) || !(1 <= h <= 100) || !(1 <= u ...
- Tue Jul 29, 2014 2:09 pm
- Forum: Volume 101 (10100-10199)
- Topic: 10107 - What is the Median?
- Replies: 74
- Views: 31459
Re: 10107 - What is the Median?
I tweaked the solution and you are indeed right. The nth element is not saved. Thank you very much for the help
. I got AC now.
On a side note, how come it works on my Mac, same thing occurs on some "compile errors" that occur in UVA but not in my mac

On a side note, how come it works on my Mac, same thing occurs on some "compile errors" that occur in UVA but not in my mac
- Tue Jul 29, 2014 2:06 pm
- Forum: Volume 101 (10100-10199)
- Topic: 10107 - What is the Median?
- Replies: 74
- Views: 31459
Re: 10107 - What is the Median?
I do apologize. While the correct output appears on my laptop apparently it does not work in online compilers. Would you have any idea why?
As for why I chose nth_element above sort is because
1. I want to learn it
2. It was recommended in a book for this problem
As for why I chose nth_element above sort is because
1. I want to learn it
2. It was recommended in a book for this problem
- Tue Jul 29, 2014 11:32 am
- Forum: Volume 101 (10100-10199)
- Topic: 10107 - What is the Median?
- Replies: 74
- Views: 31459
Re: 10107 - What is the Median?
It does work along those test cases. I edited it a bit since i noticed that I forgot to print a newline. It still however still get WC.
Please help. Thanks in advance
Please help. Thanks in advance
Code: Select all
Removed after AC
- Tue Jul 29, 2014 8:51 am
- Forum: Volume 101 (10100-10199)
- Topic: 10107 - What is the Median?
- Replies: 74
- Views: 31459
- Wed Jul 23, 2014 12:44 pm
- Forum: Volume 100 (10000-10099)
- Topic: 10038 - Jolly Jumpers
- Replies: 445
- Views: 152668
Re: 10038 - Jolly Jumpers
I've tried about every test case I can find here but it still says WA.
Can anyone help?
Can anyone help?
Code: Select all
thank you so much for the help :) Got AC
- Wed Jul 23, 2014 12:43 pm
- Forum: Volume 108 (10800-10899)
- Topic: 10819 - Trouble of 13-Dots
- Replies: 67
- Views: 61120
Re: 10819 - Trouble of 13-Dots
I took your suggestion and attempted to do it. It still shows the wrong answer. Can you please help?
Thanks
Code: Select all
Removed
- Wed Jul 23, 2014 7:13 am
- Forum: Volume 108 (10800-10899)
- Topic: 10819 - Trouble of 13-Dots
- Replies: 67
- Views: 61120
Re: 10819 - Trouble of 13-Dots
Thank you for the advice but I honestly have no idea on how to code that..
I do not understand how to set keep[1][901] to 2 and keep[1][902] to 0.
Can you please expound?
Thanks
I do not understand how to set keep[1][901] to 2 and keep[1][902] to 0.
Can you please expound?
Thanks
- Sun Jul 20, 2014 12:31 pm
- Forum: Volume 108 (10800-10899)
- Topic: 10819 - Trouble of 13-Dots
- Replies: 67
- Views: 61120
Re: 10819 - Trouble of 13-Dots
I cannot seem to figure out why it fails on test case:
1801 3
901 2
901 2
200 1
Can anyone help?
1801 3
Code: Select all
901 2
200 1
Can anyone help?
Code: Select all
Removed
- Sun Jul 13, 2014 4:24 pm
- Forum: Volume 101 (10100-10199)
- Topic: 10130 - SuperSale
- Replies: 76
- Views: 35472
Re: 10130 - SuperSales
Thank you so much
. Its amazing how one small mistake can be so frustrating.
Thank you again

Thank you again
- Sat Jul 12, 2014 10:59 pm
- Forum: Volume 101 (10100-10199)
- Topic: 10130 - SuperSale
- Replies: 76
- Views: 35472
Re: 10130 - SuperSales
Thanks a lot
But now it gives me WA.
