552 - Filling the Gaps

All about problems in Volume 5. If there is a thread about your problem, please use it. If not, create one with its number in the subject.

Moderator: Board moderators

Post Reply
Larry
Guru
Posts: 647
Joined: Wed Jun 26, 2002 10:12 pm
Location: Hong Kong and New York City
Contact:

552 - Filling the Gaps

Post by Larry » Mon Dec 16, 2002 3:43 pm

Am I misinterpreting the problem? Can someone post
some sample please?

By the way, how is 0 0 handled? Should we print out "YES 0" like it said in the sample?

titid_gede
Experienced poster
Posts: 187
Joined: Wed Dec 11, 2002 2:03 pm
Location: Mount Papandayan, Garut

552 - filling the gaps

Post by titid_gede » Sat Mar 06, 2004 7:25 pm

You program has to check for a number of cases:
1. Whether the pattern of *'s is different for all words in the set and:
2. Compute the number of words obtained by replacing the *'s by 0's and 1's.
i cant' get what is the meaning of point 1. what is the meaning of pattern of *'s is different for all words in the set.
and how's about in sample input output, is in the last line of our output we must write "YES 0" ?

thanks.
-titid gede-
Kalo mau kaya, buat apa sekolah?

Larry
Guru
Posts: 647
Joined: Wed Jun 26, 2002 10:12 pm
Location: Hong Kong and New York City
Contact:

Post by Larry » Mon Jun 28, 2004 9:58 am

1.
Whether the pattern of *'s is different for all words in the set and:
2.
Compute the number of words obtained by replacing the *'s by 0's and 1's.
Can someone explain part 1?

Andrew Neitsch
New poster
Posts: 43
Joined: Fri Jun 25, 2004 9:37 pm

Post by Andrew Neitsch » Mon Jun 28, 2004 5:31 pm

0 0 results in a "YES 0".

Part 1: Read in the strings. Replace all the 1's with 0's. If there are any duplicate strings, print "NO".

Input:
3 3
10*
*0*
*00
4 3
1100
1101
110*
3 3
10*
*0*
*00
5 4
00010
1111*
***10
11*10
4 3
1100
1101
110*
2 4
1*
*1
**
11
1 3
0
1
*
0 0

Ouput:
YES 4
NO
YES 4
YES 9
NO
YES 4
NO
YES 0

Larry
Guru
Posts: 647
Joined: Wed Jun 26, 2002 10:12 pm
Location: Hong Kong and New York City
Contact:

Post by Larry » Mon Jun 28, 2004 9:03 pm

Thanks for explaining part 1, I got AC with minor changes.. :D

Raziel
New poster
Posts: 7
Joined: Fri Oct 15, 2004 3:43 pm
Contact:

Post by Raziel » Fri Oct 15, 2004 3:53 pm

The words will not be longer than 15 symbols.
There is no telling about number of words on input does that mean it may be all combinations of 15 symbol word for a total of 32767 words on imput?
Wheel weaves as the wheel wishes ...

lesss
New poster
Posts: 2
Joined: Wed May 10, 2006 11:08 am
Contact:

552 - Help me plz!!!

Post by lesss » Wed May 10, 2006 11:19 am

Hello, Users!!
I'm from Russia and my english isn't good. +)
Now is a time to make some homeworks in University. In my university there are the tasks from this website. I must make programm, but a have a lot of problems with my task. Please help me. Can you send me sourses or ideas of sourses please? I will be very happy, if you could help me.
Thanks +)

Darko
Guru
Posts: 580
Joined: Fri Nov 11, 2005 9:34 am
Location: Calgary, Canada

Post by Darko » Wed May 10, 2006 8:41 pm

That will not get you anywhere...

What you do is - try to come up with the solution yourself. Then if you can't, you post what you got so far. Then, maybe, you get a hint or two. repeat the process until you get the solution.

After you know what to do, try to implement it (code it). Again, if you get stuck (but really stuck), post what you have so far and what's not working. And then you might get some help.

Sending a coded solution to someone is not helping. I know, everyone says it, but you'll understand it when the final exam comes :)

Darko

lesss
New poster
Posts: 2
Joined: Wed May 10, 2006 11:08 am
Contact:

fuck

Post by lesss » Mon May 15, 2006 10:30 am

[insulting message deleted by moderator]

Dave
New poster
Posts: 5
Joined: Sat May 06, 2006 9:57 am
Location: England, My Chair

Post by Dave » Tue May 16, 2006 9:38 pm

I am pretty much a begginer, if you go to the link in my signiture below they numbers are to the easy problems.

User avatar
warenix
New poster
Posts: 5
Joined: Sun Aug 12, 2007 1:17 pm

Post by warenix » Thu Oct 18, 2007 5:57 am

I get "YES 8" for my WA program.
I am doing all possible replacements of * by 0 and 1 to the word, and check whether the new string has appeared before. Then Output how many new string were found.

Can you explain why this input set will give an output "YES 9"?

Input
5 4
00010
1111*
***10
11*10
Output
YES 9

Jan
Guru
Posts: 1334
Joined: Wed Jun 22, 2005 10:58 pm
Location: Dhaka, Bangladesh
Contact:

Post by Jan » Thu Oct 18, 2007 5:10 pm

The 9 strings are..

Code: Select all

00010
00110
01010
01110
10010
10110
11010
11110
11111
Hope it helps.
Ami ekhono shopno dekhi...
HomePage

metaphysis
Experienced poster
Posts: 139
Joined: Wed May 18, 2011 3:04 pm

Re: 552 - Filling the Gaps

Post by metaphysis » Thu May 11, 2017 1:05 am

At first, I was warried about the test cases may be large, but after submitted the code and got AC, I realized the number of test cases is small.

Post Reply

Return to “Volume 5 (500-599)”