## 10442 - Basic

Moderator: Board moderators

RuiFerreira
New poster
Posts: 23
Joined: Mon Dec 16, 2002 8:01 pm
Location: Portugal
Contact:

### 10442 - Basic

this is as "basic" problem... but probably with crazy input!

can you give me some more sample input?

I also got some questions...

what is the output to the next input?

7
123
5
12#123#12#123#
15#aaa
2##
#145##145#15#145#
12#123# 15#abc#

no
no
yes
no
no
yes
no
Please visit my webpage!! I've got a lot of UVA statistics scripts
http://www.fe.up.pt/~ei01081/scripts/

cytse
Learning poster
Posts: 67
Joined: Mon Sep 16, 2002 2:47 pm
Location: Hong Kong
Contact:
yes
yes
no
no
no
no
no

I think you misunderstood the problem. Why do you think that a number start with # is valid?

zsepi
Learning poster
Posts: 51
Joined: Thu Sep 26, 2002 7:43 pm
Location: Easton, PA, USA

### understanding of the problem

just a question, which I hope would clarify the problem (donno if it's just me, but I am confused by the description of the problem): what should be the output for the following input?

Code: Select all

``````3
123##2#01001#
10#456##3#1210#
9#456##2#1210#``````
my guess would be

Code: Select all

``````yes
yes
no``````
let me know if I am right or wrong please! thanx in advance!
Dealing with failure is easy: Work hard to improve.
Success is also easy to handle: You've solved the wrong problem. Work hard to improve.

gvcormac
Problemsetter & Reviewer
Posts: 194
Joined: Fri Mar 15, 2002 2:00 am
Contact:

### Re: understanding of the problem

zsepi wrote:just a question, which I hope would clarify the problem (donno if it's just me, but I am confused by the description of the problem): what should be the output for the following input?

Code: Select all

``````3
123##2#01001#
10#456##3#1210#
9#456##2#1210#``````
my guess would be

Code: Select all

``````yes
yes
no``````
let me know if I am right or wrong please! thanx in advance!
The correct answer for the above input is:

no
no
no

The first one is invalid because no number can begin with 123##
The second one in invalid because base 456 is not between 2 and 16, and also because you need a double # after the 3.
The third is invalid for the same reasons as the second. In addition the
digit 2 is not allowed in a base 2 number.

zsepi
Learning poster
Posts: 51
Joined: Thu Sep 26, 2002 7:43 pm
Location: Easton, PA, USA
thanks,
though I just feel even more confused - I thought I got the rules, but it seems I did not
in the standard input, the answer for the case 2#101##123# is yes - why? isn't there supposed to be only one number per line? or can you join additional number in the form _number_ (base#digits#)#_number_? because if that's the case, then 10#456##3#1210# should be yes (first number: 456 in base 10 and 1210 in base 3)
I just wanna know if that is possible to have more than one number on a line... and base 10 could be specified, right?
Dealing with failure is easy: Work hard to improve.
Success is also easy to handle: You've solved the wrong problem. Work hard to improve.

gvcormac
Problemsetter & Reviewer
Posts: 194
Joined: Fri Mar 15, 2002 2:00 am
Contact:
zsepi wrote:thanks,
though I just feel even more confused - I thought I got the rules, but it seems I did not
in the standard input, the answer for the case 2#101##123# is yes - why? isn't there supposed to be only one number per line? or can you join additional number in the form _number_ (base#digits#)#_number_? because if that's the case, then 10#456##3#1210# should be yes (first number: 456 in base 10 and 1210 in base 3)
I just wanna know if that is possible to have more than one number on a line... and base 10 could be specified, right?
2#101# is the number 5 - 101 base 2

2#101##123# is 123 base 5 - a base (2#101# followed by
a sequence of base 5 digits enclosed in # (#123#)

RuiFerreira
New poster
Posts: 23
Joined: Mon Dec 16, 2002 8:01 pm
Location: Portugal
Contact:
I've really misunderstood the problem... Now It works just fine, for every input in this topic... but I keep getting WA...
Please visit my webpage!! I've got a lot of UVA statistics scripts
http://www.fe.up.pt/~ei01081/scripts/

ditrix
New poster
Posts: 33
Joined: Sat Mar 01, 2003 12:38 am
Location: Paris
I've just got accepted this problem and I tell you :

"The test data is really very tricky!"
@+!
DitriX

marthapfhui
New poster
Posts: 7
Joined: Sat Mar 10, 2007 7:03 pm
I am puzzled for many WA. Would someone kindly please check with my I/O?

Input:

Code: Select all

``````25
2#10##111111111#
2#10##10##10##111111111#
2#101##20##16##12345abcdf#
2#101##20##11##12345a#
2#101##20##11##12345ab#
2#101##20##17##12345ab#
2#101##20##0##12345ab#
2#101##20##2##101#
2#101##20###2##101#
16#f##e##d##c##b##a##2##10##101##10##11##14##101#
16#f##e##d##c##b##a##2##10##101##10##11##24##abc#
16#f##0e##d##0c##b##0a##2##10##101##10##11##24##abc#
16#f##0e##d##0c##b##0a##2##10##101##10##11##24##000#
2#11##11##11##11##11##11##11##11##11##11##11##11##11##11##11#
2#11##11##11##11##11##11##11##11##11##11##11##11##11##11###
2#10##
2##
#2#
2#2#
002#000#
2#0001##1#
0
00
123
1a
``````
Output:

Code: Select all

``````yes
yes
yes
yes
no
no
no
yes
no
yes
yes
yes
yes
yes
no
no
no
no
no
yes
no
yes
yes
yes
no
``````
Also, any special cases to be catered? Thanks a lot

Jan
Guru
Posts: 1334
Joined: Wed Jun 22, 2005 10:58 pm
Contact:
Your cases are correct. But there can be overflow problem. Check the cases...

Input:

Code: Select all

``````2
16#100000002##100001#
16#1020``````
Output:

Code: Select all

``````no
no``````
Hope these help.