Search found 128 matches

by lbv
Sat Jul 19, 2014 9:27 pm
Forum: Volume 100 (10000-10099)
Topic: 10032 - Tug of War
Replies: 91
Views: 31500

Re: 10032 - Tug of War

This code gives correct ans to all this inputs but still i get WA when i Submit can anyone find me a critical input or tell me what is wrong with it? Trying to figure out what is wrong with that code would be quite a feat; one that is out of my reach, I'm afraid. I suggest trying to simplify it. Yo...
by lbv
Sat Jul 19, 2014 9:08 pm
Forum: Volume 114 (11400-11499)
Topic: 11402 - Ahoy, Pirates!
Replies: 45
Views: 14983

Re: 11402 - Ahoy, Pirates

I used segment tree, O(n log n) building, and maximum O(2 log n) = O(log n) for each query or update. here is my code and i get TLE can you tell me what should I change? Using a segment tree does little good if you still do loops proportional to the size of the underlying array for every operation:...
by lbv
Sat Jul 19, 2014 12:21 am
Forum: Volume 104 (10400-10499)
Topic: 10432 - Polygon Inside A Circle
Replies: 62
Views: 19682

Re: 10432 - Polygon Inside A Circle

my answers are correct, but i get runtime error, if somebody could get me started The method your program uses to read input is too inflexible, which is often an issue in problems from UVa's archives. What does your program do if a test case contains spaces at the beginning of the line, or at the e...
by lbv
Thu Jul 17, 2014 9:56 pm
Forum: Volume 117 (11700-11799)
Topic: 11733 - Airports
Replies: 23
Views: 7148

Re: 11733 - Airports

Why TLE :( :( Your union-find implementation seems slow, turning your program's complexity to O(NM) per test case, which is very high. Try a different implementation; one with path compression, for example. Also try: Input 1 8 5 15 3 1 45 8 2 25 5 8 8 3 4 15 6 2 8 Output Case #1: 106 6
by lbv
Thu Jul 17, 2014 11:48 am
Forum: Volume 119 (11900-11999)
Topic: 11995 - I Can Guess the Data Structure!
Replies: 60
Views: 6317

Re: 11995 - I Can Guess the Data Structure!

Bad Boy wrote:I have got runtime error :-s dont know why, please help me....
Try the test case posted here:
http://acm.uva.es/board/viewtopic.php?f ... 30#p369509
by lbv
Tue Jul 15, 2014 9:26 pm
Forum: Volume 103 (10300-10399)
Topic: 10340 - All in All
Replies: 129
Views: 30690

Re: Why having WA with UVa 10340- All in All

I changed my code as below. Now I am getting output "NO" for input "aa a" but even WA. I added another condition that when length of sub sequence is greater than main sequence, then print NO. Notice that the output from your program should match the expected output exactly . The strings "NO" and "N...
by lbv
Tue Jul 08, 2014 2:04 am
Forum: Volume 116 (11600-11699)
Topic: 11635 - Hotel booking
Replies: 39
Views: 10728

Re: 11635--Hotel Booking

My code passes all test cases of this thread, but I still get WA. (..) Any critical testcases greatly appreciated. You may try: Input 9 6 4 8 2 3 6 5 8 1 6 476 7 5 49 2 9 488 5 4 151 5 8 537 2 7 367 1 6 509 6 7 430 6 4 2 4 1 6 11 5 2 328 6 3 249 3 5 150 5 4 501 5 1 220 3 5 520 4 1 378 3 2 116 4 1 4...
by lbv
Sun Jun 29, 2014 11:23 pm
Forum: Volume 105 (10500-10599)
Topic: 10530 - Guessing Game
Replies: 57
Views: 27136

Re: 10530 - Guessing Game

jddantes wrote:Hello, why is mine WA? I've been having the same outputs as those posted before
You may try:

Input

Code: Select all

7
too high
1
too low
6
too high
6
right on
1
too low
3
too high
10
too high
1
right on
0
Output

Code: Select all

Stan is dishonest
Stan is dishonest
by lbv
Sat Jun 28, 2014 9:27 pm
Forum: Volume 101 (10100-10199)
Topic: 10189 - Minesweeper
Replies: 418
Views: 64075

Re: 10189 - Minesweeper

double_zero wrote:Somebody Please Help Me, I Don't Know Why I Get Wrong Answer
I suggest you always start by taking the time to read the previous messages in the forums. Check for example the message posted by brianfry713 around Nov 14, 2013, which is relevant to your program.
by lbv
Sat Jun 28, 2014 9:05 pm
Forum: Volume 1 (100-199)
Topic: 161 - Traffic Lights
Replies: 28
Views: 3749

Re: P161 - Traffic Lights - Test Data

MEGADEEN wrote:I tested my program with the test cases mentioned previously and mine seem to be correct but I keep on getting WA. Can someone please help me?
Try:

Input

Code: Select all

68 36 31 69 67 62 35 35 43 37 30 0
0 0 0
Output

Code: Select all

05:00:00
by lbv
Fri Jun 27, 2014 8:31 pm
Forum: Volume 1 (100-199)
Topic: 119 - Greedy Gift Givers
Replies: 145
Views: 24212

Re: 119 Why WA??

when money given to 0 it becomes 0? I'm afraid I don't understand this question, but see if the comments below help. what happens 0 given to anyone? If 0 money is given (as with laura in the sample), that 0 is divided by the number of people to give gifts to, and that result is added to the "net wo...
by lbv
Wed Jun 25, 2014 3:45 am
Forum: Volume 106 (10600-10699)
Topic: 10696 - f91
Replies: 21
Views: 9505

Re: 10696 - f91 Java TLE

ATTN: Java IO wizards I got TLE for this problem but can't think of anything that would make my submission any faster. (..) I'm definitely not a "Java IO wizard", but I used to code in Java some years ago for programming competitions, and something that I learned with time is how some of the things...
by lbv
Tue Jun 24, 2014 6:03 pm
Forum: Volume 4 (400-499)
Topic: 401 - Palindromes
Replies: 196
Views: 29721

Re: 401-Palindromes Why getting WA

blackheartadhar wrote:Now I'm getting Compile error! :(
I have just submitted the latest code you posted as-is, and got AC. Maybe you submitted the wrong file? Or forgot to comment the freopen lines?
by lbv
Mon Jun 23, 2014 9:33 pm
Forum: Volume 115 (11500-11599)
Topic: 11559 - Event Planning
Replies: 29
Views: 8972

Re: 11559 Event planning

Test cases passed why WA? Your code doesn't pass the sample cases from the problem statement—if it appears otherwise in your system, it may be a coincidence. Try configuring your compiler to show you all possible warnings, as that can help you catch subtle bugs. For example, I received the followin...
by lbv
Mon Jun 23, 2014 9:15 pm
Forum: Volume 4 (400-499)
Topic: 401 - Palindromes
Replies: 196
Views: 29721

Re: 401-Palindromes Why getting WA

blackheartadhar wrote:Getting WA! Please help.
From the output specification: In addition, after each output line, you must print an empty line. There are no exceptions for the last test case.

In addition, try the cases:

Input

Code: Select all

3QE
Z55
Output

Code: Select all

3QE -- is not a palindrome.

Z55 -- is not a palindrome.

Go to advanced search