Search found 128 matches

by lbv
Fri Feb 15, 2013 12:46 am
Forum: Volume 1 (100-199)
Topic: 195 - Anagram
Replies: 242
Views: 24501

Re: 195 - Anagram

What annoys me is if there are similar characters in next_permutation, it seems to skip them It doesn't skip them. It's just that next_permutation works by calculating the next permutation in lexicographical order. If you initially feed it a string that is not the lexicographically lowest permutati...
by lbv
Thu Feb 14, 2013 5:06 pm
Forum: Volume 100 (10000-10099)
Topic: 10004 - Bicoloring
Replies: 93
Views: 28371

Re: 10004-Bicoloring

I don't understand why I am getting WA. can anyone help me? I think you should initialize soti inside the bfs function, or it could be used with a "garbage" value in it, with unpredictable results. Try to configure your compiler to show you all warnings, it can help you catch this type of bugs. Whe...
by lbv
Thu Feb 14, 2013 6:25 am
Forum: Volume 119 (11900-11999)
Topic: 11947 - Cancer or Scorpio
Replies: 18
Views: 3991

Re: 11947 - Cancer or Scorpio

ok_woei wrote:I keep getting WA for the problem. Can't really see where is the bug. Please help.
Check the spelling of pisces.
by lbv
Wed Feb 13, 2013 7:03 pm
Forum: Volume 116 (11600-11699)
Topic: 11635 - Hotel booking
Replies: 39
Views: 10728

Re: 11635--Hotel Booking

what's the bottleneck of my prog? I'm geting TLE. Doing a quick profile of your code, it seems that most of the time is spent inside the spfa function (about 86% of the total runtime), but I wouldn't call it a bottleneck, it's more of a problem with the complexity of your algorithm. If I understand...
by lbv
Tue Feb 12, 2013 11:13 pm
Forum: Volume 1 (100-199)
Topic: 195 - Anagram
Replies: 242
Views: 24501

Re: 195 - Anagram

WA ... I'm not sure anymore with the hacks I've tried to work around :\ Did you check your program against the sample cases given in the problem statement? Using a custom comparison method in next_permutation seems unnecessary. The order in which you generate the permutations don't have much import...
by lbv
Mon Feb 11, 2013 12:11 am
Forum: Volume 114 (11400-11499)
Topic: 11404 - Palindromic Subsequence
Replies: 25
Views: 13555

Re: 11404 - Palindromic Subsequence

I am getting WA. My code matches with all the inputs from the forum. Try these: Input kfclbckibbibjccbej hoiqftxkudvytoyityrq dcbadbaddcccbbbcccbadcd effcgefbhbefcdigiaiidhgieg fjvewlqunhflqvrehansfbctxkacdl jglkniogmnhpjinhbiinjbcfdcnplh Output bcibbicb qtyoytq dcabcccbbbcccbacd eghdiiaiidhge felf...
by lbv
Wed Feb 06, 2013 12:40 pm
Forum: Volume 7 (700-799)
Topic: 727 - Equation
Replies: 156
Views: 33440

Re: 727 Equation TLE

getting RE, please find the code at http://ideone.com/yvuQZE It seems that it's possible that your oper stack gets cleared under some circumstances when it shouldn't, causing the while at line 41 to be skipped (because the stack is empty), but then you pop from oper anyway (line 46), which causes a...
by lbv
Mon Feb 04, 2013 9:04 am
Forum: Volume 100 (10000-10099)
Topic: 10004 - Bicoloring
Replies: 93
Views: 28371

Re: 10004 - Bicoloring

I cant understand why am I getting a WA here,seems to be an easy problem, I have tried this many times checked manually on many test cases but still getting WA.. Make sure you clear your queue at the beginning of each test case, or previous data can affect the results. Check for example: 3 3 1 0 2 ...

Go to advanced search