782 - Contour Painting

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

Moderator: Board moderators

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

Post by Jan » Tue Sep 18, 2007 11:50 am

My code removes trailing spaces. And that's the only difference with your output.
Ami ekhono shopno dekhi...
HomePage

Moha
Experienced poster
Posts: 216
Joined: Tue Aug 31, 2004 1:02 am
Location: Tehran
Contact:

Post by Moha » Tue Sep 18, 2007 9:49 pm

Thank you very much for your help. Because the problem statement says we should print the output in the same format as the input, I thought this line should be removed.

User avatar
zid_adrenalyns
New poster
Posts: 11
Joined: Thu Jun 15, 2006 5:46 pm
Location: Juchitán Oaxaca, México
Contact:

Post by zid_adrenalyns » Wed Sep 19, 2007 1:19 am

Moha, my AC program output for your input
^ is end of line

Code: Select all

  ############^
 #XXXXXXXXXXXX#^
 #X###########X#        #^
 #X#         #X#       #X#^
 #X#  #####  #X#        #^
 #X# #XXXXX# #X#^
 #X# #X####  #X#^
 #X# #X#      #^
 #X# #X####  #X#^
 #X# #XXXXX# #X#^
 #X#  #####  #X#       #^
 #X#         #X#      #X#^
 #X###########X#       #^
 #XXXXXXXXXXXX#^
  ############^
__________^
  ###^
 #XXX#^
 #X#X#^
 #X##^
  #^
__________^
^
^
__________^
^
  XXXXXXXXXX^
  X        X^
  X XXXXXX X^
  X X####X X^
  XXXXXXXXXX^
^
__________^
XXXXXXXXXXXXX#^
X       X######^
XXXXXXXXXXXXXXX#^
____^
^
^
XXXXXXX^
X#####X^
XXXXXXX^
^
__________^
^
       XXXXXXXXXX^
      XXXX#######XX^
      X###  #    ##X^
     X######X#    #XXXXXXX^
     XXXXXXXX#     #######XX^
     X######X#    #XXXXXXX^
      X###  #    ##X^
      XXXX#######XX^
       XXXXXXXXXX^
^
__________^
       ##########^
      #XXXXXXXXXX##^
     #XXXX       XX#^
     #X            X######^
    #X      X      XXXXXXX##^
    #XXXXXXXX             XX#^
    #X      X      XXXXXXX##^
     #X            X######^
     #XXXX       XX#^
      #XXXXXXXXXX##^
       ##########^
__________^
Making simple things simple, making complex things possible!!

Moha
Experienced poster
Posts: 216
Joined: Tue Aug 31, 2004 1:02 am
Location: Tehran
Contact:

Post by Moha » Wed Sep 19, 2007 1:24 am

Yes, thank you very much. I got it. The point is we shouldn't print the trailing space even it exists in the input.

newkid
Learning poster
Posts: 73
Joined: Fri Dec 12, 2008 3:06 am

Re: 782 - Countour Painting

Post by newkid » Wed Jan 14, 2009 4:56 am

Getting lots of WA.. Can anyone help?
Thanks

Code: Select all

 got accepted.. 
 code removed
Last edited by newkid on Wed Jan 14, 2009 6:15 am, edited 1 time in total.
hmm..

newkid
Learning poster
Posts: 73
Joined: Fri Dec 12, 2008 3:06 am

Re: 782 - Countour Painting

Post by newkid » Wed Jan 14, 2009 6:15 am

Stupid mistake... :oops:
did the following without initializing 'col' variable..

Code: Select all

      len = strlen(board[r]);
      col = col < len ? len : col;
hmm..

mdshaonimran
New poster
Posts: 2
Joined: Wed Aug 05, 2009 10:44 am

Re: 782 - Countour Painting

Post by mdshaonimran » Sun Sep 06, 2009 7:53 pm

my code gives me correct outputs for the sample inputs though I'm getting WA.

Code: Select all

got ac. code removed
Last edited by mdshaonimran on Wed Sep 16, 2009 7:27 pm, edited 2 times in total.

mice123456789
New poster
Posts: 12
Joined: Tue Aug 27, 2002 6:09 pm

782 - Countour Painting

Post by mice123456789 » Thu Sep 10, 2009 6:51 pm

Hi,

Can someone help me by giving valid output for the input below?
BTW, should we remove trailing spaces? Thanks in advance :)

Code: Select all

11
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX*
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX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XXXXXXXXXXX
 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX*
 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
__________  

  ASDFGHJKLMXXXX        XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
 XXXXXXXXXXXXXXXXXXSDFXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX*
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
__________  
My output,

Code: Select all

XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX#
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX##
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX#
__________
################################################################################
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX#
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX##
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX#
__________
################################################################################
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX#
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX##
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX#
################################################################################
__________  
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX#
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX##
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX#
################################################################################
__________  
  ##############################################################################
##XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX#
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX##
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX#
###############################################################################
__________  
  ##############################################################################
##XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX#
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX##
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX#
__________  
  XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX#
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX##
XXXXXXXXX          XXXXXXXXXXXXXXXXXXXXX     XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX#
__________
  XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX#
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX##
XXXXXXXXX##########XXXXXXXXXXXXXXXXXXXXX#####XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX#
#########          #####################     ##################################
__________
  XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX#
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX###
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX#
###############################################################################
__________  
  ##############################################################################
##XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX#
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX###
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX#
__________  
  ##############        #######################################################
##ASDFGHJKLMXXXX########XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX#
XXXXXXXXXXXXXXXXXXSDFXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX#########
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX#
__________  

mdshaonimran
New poster
Posts: 2
Joined: Wed Aug 05, 2009 10:44 am

Re: 782 - Countour Painting

Post by mdshaonimran » Thu Sep 10, 2009 8:26 pm

yes, the trailing spaces should be removed. :)

mice123456789
New poster
Posts: 12
Joined: Tue Aug 27, 2002 6:09 pm

Re: 782 - Countour Painting

Post by mice123456789 » Tue Sep 15, 2009 10:33 am

Accepted. Just need to print new line at the end of output and remove trailing spaces :wink:

qwerty
New poster
Posts: 21
Joined: Sun Feb 08, 2009 5:26 pm
Location: Mumbai,India

Re: 782 - Countour Painting

Post by qwerty » Wed Feb 17, 2010 9:57 am

can some tell me the correct output for this input

Code: Select all

6

XXXXXXXXXXXXXX
XXXXXXXXXXXX
XX*
XXXXXXXXXXXX

_________________

XXXXXXXXXXXX
XXXXXXXXXX
XX                                 *
XXXXXXXXXXXXXX
__________________

X
XX
XXX*
XX
X
__________________

xxxxxxxx
   *x
xxxxxxx

_________________
x  x
x  x
x* x
xxxx
____________
xxxx
x   x
x*  x
x   x
____________
PLEASE SOMEONE HELP ME!

mice123456789
New poster
Posts: 12
Joined: Tue Aug 27, 2002 6:09 pm

Re: 782 - Countour Painting

Post by mice123456789 » Fri Feb 26, 2010 2:54 am

Code: Select all

##############
XXXXXXXXXXXXXX#
XXXXXXXXXXXX##
XX##########
XXXXXXXXXXXX#
############
_________________
############
XXXXXXXXXXXX#
XXXXXXXXXX##
XX############
XXXXXXXXXXXXXX#
__________________
#
X#
XX#
XXX#
XX#
X#
__________________

xxxxxxxx
####x
xxxxxxx

_________________
x##x
x##x
x##x
xxxx
____________
xxxx
x###x
x# #x
x# #x
____________

qwerty
New poster
Posts: 21
Joined: Sun Feb 08, 2009 5:26 pm
Location: Mumbai,India

Re: 782 - Countour Painting

Post by qwerty » Mon Mar 01, 2010 3:17 pm

some more help plz.what will be the output of

Code: Select all

4
xxxxxxxx
xx*
xxxxxx
___________

xxxx
x*
xxx
__________
xxxx
x*
xxx

__________

xxxx
x*
xxx

__________




mice123456789
New poster
Posts: 12
Joined: Tue Aug 27, 2002 6:09 pm

Re: 782 - Countour Painting

Post by mice123456789 » Mon Mar 01, 2010 5:15 pm

Code: Select all

xxxxxxxx#
xx######
xxxxxx#
___________
####
xxxx#
x###
xxx#
__________
xxxx#
x###
xxx#
###
__________
####
xxxx#
x###
xxx#
###
__________

qwerty
New poster
Posts: 21
Joined: Sun Feb 08, 2009 5:26 pm
Location: Mumbai,India

Re: 782 - No idea what's wrong

Post by qwerty » Tue Mar 02, 2010 12:25 pm

Can't find any error.Someone help

Code: Select all

ac
Last edited by qwerty on Wed Mar 03, 2010 9:03 am, edited 1 time in total.

Post Reply

Return to “Volume 7 (700-799)”