Search found 128 matches

by lbv
Mon Jul 28, 2014 2:03 pm
Forum: Volume 100 (10000-10099)
Topic: 10018 - Reverse and Add
Replies: 169
Views: 17912

Re: 10018 - Reverse and Add

Shahidul.CSE wrote:Why WA with my code?
Try:

Input

Code: Select all

1
123789
Output

Code: Select all

2 1222221
by lbv
Fri Jul 25, 2014 8:13 pm
Forum: Volume 102 (10200-10299)
Topic: 10226 - Hardwood Species
Replies: 121
Views: 38158

Re: 10226 - Hardwood Species

I've modified my code. I haven't figured out how to address all the issues you mentioned but here it is Okay, let's go step by step.. I understand now why \n or spaces shouldn't really be used at the start or end of scanf statements since it ignores whitespace. It's not that it shouldn't be used, i...
by lbv
Fri Jul 25, 2014 7:58 am
Forum: Volume 102 (10200-10299)
Topic: 10226 - Hardwood Species
Replies: 121
Views: 38158

Re: 10226 - Hardwood Species

I'd like to solve it using STL map but I'm having some issues. Your post reminded me of something I know as "the 100% rule". I'm not sure where I picked it up (maybe a book, or a friend, or a teacher...) but I know it's something that has helped me a lot since I started applying it, many years ago ...
by lbv
Thu Jul 24, 2014 11:32 am
Forum: Volume 116 (11600-11699)
Topic: 11624 - Fire!
Replies: 54
Views: 14551

Re: 11624 - Fire!

Why is mine TLE? The general idea behind your approach may be okay, but there's a number of things that make it difficult for an implementation like that to get AC. Your program uses a significant amount of memory unnecesarily. The grid you read from the input, for example, already contains all the...
by lbv
Wed Jul 23, 2014 11:59 pm
Forum: Volume 8 (800-899)
Topic: 820 - Internet Bandwidth
Replies: 43
Views: 20757

Re: 820 - Internet Bandwidth

Hello. I am trying to solve this problem with Edmonds-Karp algorithm Maximun flow but i don't know why i am getting WA. Hi. Check your code in regards to the following information from the problem statement: There might be more than one connection between a pair of nodes -- see the test cases from ...
by lbv
Wed Jul 23, 2014 9:18 pm
Forum: Volume 1 (100-199)
Topic: 105 - The Skyline Problem
Replies: 160
Views: 27839

Re: 105 - The Skyline Problem

just_yousef wrote:A lot of WA,, Please Help :/
Try reading the previous messages from the forums. For example, brianfry713's post from around Mar 19, 2013 has advice that applies to your code.
by lbv
Wed Jul 23, 2014 1:15 pm
Forum: Volume 109 (10900-10999)
Topic: 10954 - Add All
Replies: 80
Views: 27871

Re: 10954 - Add All

sampad74 wrote:i changed my code.. (..)
but got WA again.
Please post the full, latest version of your code. For people wanting to help you, combining code from different posts to keep track of the changes is not exactly fun :).
by lbv
Wed Jul 23, 2014 12:09 pm
Forum: Volume 109 (10900-10999)
Topic: 10954 - Add All
Replies: 80
Views: 27871

Re: 10954 - Add All

I am getting WA.I tested my output,but did not find any mistake.Please,anybody help me.Thanks in advance.Here is my code... I'd suggest you avoid using the "long" type in C/C++, since it behaves differently in different systems. In 32-bit systems it typically has 4-bytes, and in 64-bit systems it h...
by lbv
Wed Jul 23, 2014 2:46 am
Forum: Volume 101 (10100-10199)
Topic: 10114 - Loansome Car Buyer
Replies: 38
Views: 13476

Re: 10114 - Loansome Car Buyer

I've tried all the test cases given in this thread and I get the right answer for all of them. When I submit my code I get a runtime erorr. I've checked it for array index out of bounds and division by zero and I'm pretty sure those errors can't happen. Don't return 1 from main . It should return 0...
by lbv
Tue Jul 22, 2014 11:16 pm
Forum: Volume 108 (10800-10899)
Topic: 10813 - Traditional BINGO
Replies: 28
Views: 9731

Re: 10813 - Traditional BINGO

Shahidul.CSE wrote:Now I have changed my code as bellow: (..)
But my code doesn't work properly.
In this line:

Code: Select all

if(r1==5||r2==5||r3==5||r4==5||r5==5||c1==5||c2==5||c3==5||c4==5||c5||d1==5||d2==5)
what happened to the condition for c5?
by lbv
Tue Jul 22, 2014 9:00 pm
Forum: Volume 108 (10800-10899)
Topic: 10813 - Traditional BINGO
Replies: 28
Views: 9731

Re: 10813 - Traditional BINGO

I am in doubt for some matter in this problem, such as- 1)I didn't understand this, A player may mark the centre FREE SPACE at any time. It means exactly what those words typically mean. That is, a player can mark the centre space at any point in time (before the first turn, after the first turn, a...
by lbv
Mon Jul 21, 2014 6:45 pm
Forum: Volume 4 (400-499)
Topic: 492 - Pig-Latin
Replies: 213
Views: 25693

Re: 492 why RE?

Now,i am getting wrong ans.please,help.thanks in advance.Here is my code.. The \b sequence is intended to be used in output devices that understand it and interpret it in a certain way. The idea is that a string like "fop\bo" appears as "foo". However, a judge bot doesn't work that way, it simply s...
by lbv
Sun Jul 20, 2014 8:21 pm
Forum: Volume 3 (300-399)
Topic: 336 - A Node Too Far
Replies: 121
Views: 39967

Re: 336 WA

For this input why does this input give the output 3 nodes when it should be 13 nodes since 12 is not connected to the others? My AC code does print 13 for that query. If other AC programs print something different, it's probably because the judge's data sets don't contain cases like that (with que...
by lbv
Sun Jul 20, 2014 7:55 pm
Forum: Volume 114 (11400-11499)
Topic: 11402 - Ahoy, Pirates!
Replies: 45
Views: 15550

Re: 11402 - Ahoy, Pirates

I wrote the program based on what is on the link. (..) the program now doesn't give the proper answer, can you tell me where am I wrong. For now, I can see a couple of things that seem a little wonky: Inside the segment tree, I think the stat member should be of size tree_len and not n . Being shor...
by lbv
Sun Jul 20, 2014 10:50 am
Forum: Volume 114 (11400-11499)
Topic: 11402 - Ahoy, Pirates!
Replies: 45
Views: 15550

Re: 11402 - Ahoy, Pirates

Can you tell me what should I exactly search? I read the tutorial on geeksforgeeks.org and topcode.com but I found nothing useful :( I was referring to editorials about this specific problem, not about segment trees in general, but maybe I wasn't very clear, sorry. Anyway, one such editorial that I...

Go to advanced search