You are not logged in. Please login at www.codechef.com to post your questions!

×

WA in WSITES01(Blocked Sites)

I solved the question using trie and set, however got WA on two cases in subtask 2. Here is the solution. If someone could point out the error or provide certain test case(s), it would be great help. Thanks in advance.

This question is marked "community wiki".

asked 19 May, 03:23

devilhector's gravatar image

3★devilhector
384
accept rate: 14%

edited 19 May, 04:21


input:

4 + google + googld - goog - googles

output:

-1

link

answered 19 May, 10:47

hikarico's gravatar image

5★hikarico
2413
accept rate: 28%

I misunderstood the question. Thanks!

(19 May, 15:46) devilhector3★

https://www.codechef.com/viewsolution/13633491

i am getting WA in two test case ...plz help me ..

link

answered 19 May, 11:37

sidd845's gravatar image

2★sidd845
1
accept rate: 0%

input

3
+ google
+ googld
- googles

output should be

1
googles

but you're outputing

1
google
(19 May, 21:31) hikarico5★

@hikarico Why isnt the answer for the above test case "googles"?

link

answered 19 May, 16:40

mayank_code's gravatar image

3★mayank_code
1
accept rate: 0%

If you write just googles then goog will be missing.

(19 May, 16:44) shraeyas3★

@devilhector can you explain me if you understood the above test case. Even I have those 2 test cases wrong.

(19 May, 20:42) mayank_code3★

You need to block all minuses. Answer is -1 because there's no way to block goog without blocking google and googld

(19 May, 21:26) hikarico5★

@mayank_code you need to answer prefixes that block all '-' but are not prefixes of any '+' or unblocked sites.

(20 May, 03:31) devilhector3★

I am getting WA.Can anyone post what is wrong in my solution.Here is my solution.If someone could point out the error or provide certain test case(s), it would be great help. Thanks in advance.

link

answered 19 May, 22:53

jayaprakash21's gravatar image

3★jayaprakash21
11
accept rate: 0%

add spaces in the testcase then it gives right answer. 4 + a
+ ab + abc - acde

(20 May, 12:22) jayaprakash213★

Noted, thanks for indicating that. Will come up with fresh test case soon :)

(20 May, 12:44) vijju1233★

can you please check mine .. its passing all the above test cases .. please let me know where it went wrong. i made two seperate arrays for blocked and unblocked and then solved this one.. solution

link

answered 20 May, 01:28

code_harsh's gravatar image

2★code_harsh
1
accept rate: 0%

My code passes all cases except 2. Can someone please explain what i have done wrong. I used a very naive approach of sorting the strings and applying binary search to find the closest +ve string ... my_solution: https://www.codechef.com/viewsolution/13495612

link

answered 20 May, 10:17

dnmehta's gravatar image

4★dnmehta
1
accept rate: 0%

toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported
  • mathemetical formulas in Latex between $ symbol

Tags:

×667
×18

Asked: 19 May, 03:23

Seen: 380 times

Last updated: 20 May, 12:44