333 - Recognizing Good ISBNs
Moderator: Board moderators
-
- Experienced poster
- Posts: 103
- Joined: Tue Mar 25, 2008 11:00 pm
- Location: IUT-OIC, DHAKA, BANGLADESH
- Contact:
Wa, 333 - Recognizing Good ISBNs - Need more In/Output sampl
I am a stupid......today,,,i tried again this problem.within 15 minit.I solved and got AC........my previous code was very poor.....and I misunderstood the problem..For thos who are getting WA.
1. X appers only in the 10 th position.other wise it is invalid...10 th X is =10,,,others X is same to garbage and deal like other garbage character.
2.remove the initial and trailing spaces and tabs to printf the actuall string.
3.start finding sum1 and sum2 from the first occurance of a digit.
4.after scanning, if any garbage character is found before the number of valid digit is 10,,,the isbn is invalid.
5.and finally checkout if sum2 is of % 11 or not.
here are the things..if i mistake something ,let me know...
if anyone yet getting WA....contack with me,.....I will send him my source code.
kbr_iut@iut-dhaka.edu
1. X appers only in the 10 th position.other wise it is invalid...10 th X is =10,,,others X is same to garbage and deal like other garbage character.
2.remove the initial and trailing spaces and tabs to printf the actuall string.
3.start finding sum1 and sum2 from the first occurance of a digit.
4.after scanning, if any garbage character is found before the number of valid digit is 10,,,the isbn is invalid.
5.and finally checkout if sum2 is of % 11 or not.
here are the things..if i mistake something ,let me know...
if anyone yet getting WA....contack with me,.....I will send him my source code.
kbr_iut@iut-dhaka.edu
Last edited by kbr_iut on Thu Jul 10, 2008 4:51 am, edited 3 times in total.
It is tough to become a good programmer.
It is more tough to become a good person.
I am trying both...............................
It is more tough to become a good person.
I am trying both...............................
Re: 333 - Recognizing Good ISBNs - Need more In/Output samples
Try the cases...
Input:
Output:
Hope these help.
Input:
Code: Select all
0-1-3-1-6-2-9-5-9-X
013152447X
Code: Select all
0-1-3-1-6-2-9-5-9-X is correct.
013152447X is correct.
Ami ekhono shopno dekhi...
HomePage
HomePage
-
- Experienced poster
- Posts: 103
- Joined: Tue Mar 25, 2008 11:00 pm
- Location: IUT-OIC, DHAKA, BANGLADESH
- Contact:
Re: 333 - Recognizing Good ISBNs - Need more In/Output samples
recoded and got AC
Last edited by kbr_iut on Mon Sep 29, 2008 12:58 am, edited 1 time in total.
It is tough to become a good programmer.
It is more tough to become a good person.
I am trying both...............................
It is more tough to become a good person.
I am trying both...............................
Re: 333 - Recognizing Good ISBNs - Need more In/Output samples
Try the cases.
Input:
Output:
Input:
Code: Select all
0-89237-010- 6 TEST
<S><S><T><S>0823025713<T><T><S>
Code: Select all
0-89237-010- 6 TEST is correct.
<S><S><T><S>0823025713<T><T><S> is correct.
Ami ekhono shopno dekhi...
HomePage
HomePage
-
- Experienced poster
- Posts: 103
- Joined: Tue Mar 25, 2008 11:00 pm
- Location: IUT-OIC, DHAKA, BANGLADESH
- Contact:
Re: 333 - Recognizing Good ISBNs - Need more In/Output samples
Got AC.
Last edited by kbr_iut on Mon Sep 29, 2008 12:55 am, edited 1 time in total.
It is tough to become a good programmer.
It is more tough to become a good person.
I am trying both...............................
It is more tough to become a good person.
I am trying both...............................
Re: 333 - Recognizing Good ISBNs - Need more In/Output samples
Dear Jan Vi,
You gave I/O for,
INPUT :
OUTPUT :
I also agree with this.
But one thing I don't understand, I find different result in here for this I/O :
http://www.uvatoolkit.com/problemssolve.php
And for this output once I became a sufferer.
Can you please explain ?
You gave I/O for,
INPUT :
Code: Select all
0-89237-010- 6 TEST
<S><S><T><S>0823025713<T><T><S>
Code: Select all
0-89237-010- 6 TEST is correct.
<S><S><T><S>0823025713<T><T><S> is correct.
But one thing I don't understand, I find different result in here for this I/O :
http://www.uvatoolkit.com/problemssolve.php
And for this output once I became a sufferer.
Can you please explain ?
Re: 333 - Recognizing Good ISBNs - Need more In/Output samples
May be there are no such cases.
Ami ekhono shopno dekhi...
HomePage
HomePage
Re: 333 - Recognizing Good ISBNs - Need more In/Output samples
But if there are no such cases then it would have show the message "No output!" with the cross sign.
Besides, I ignored this case and got wrong answer ! So there must be such input.
Am I making any wrong ??? I think I must . . .
Besides, I ignored this case and got wrong answer ! So there must be such input.
Am I making any wrong ??? I think I must . . .
-
- Experienced poster
- Posts: 103
- Joined: Tue Mar 25, 2008 11:00 pm
- Location: IUT-OIC, DHAKA, BANGLADESH
- Contact:
Re: 333 - Recognizing Good ISBNs my AC code gives another...
but for the above input my AC code gives different output.
output
but uvatoolkit gives this output
actually why this is happening? can anyone tell? (of course there is not such test case...)
output
Code: Select all
0-89237-010- 6 TEST is incorrect.
<S><S><T><S>0823025713<T><T><S> is correct.
Code: Select all
0-89237-010- 6 TEST is incorrect.
<S><S><T><S>0823025713<T><T><S> is incorrect.
It is tough to become a good programmer.
It is more tough to become a good person.
I am trying both...............................
It is more tough to become a good person.
I am trying both...............................
Re: 333 - Recognizing Good ISBNs - Need more In/Output samples
I will explain the problem because there's too many confusions:
Sorry about my poor English.
1.- A valid ISBN can't be separated by spaces.
2.- A valid ISBN can ONLY have hyphens, digits and X for the LAST digit (hyphens can appears at anywhere, include at before any digit and after any digit). If it has any other character (include space) it's an invalid ISBN.
I hope it will help you.
Obviously my AC code follow this rules, if any other AC code doesn't follow the same rules it's because the judge doesn't contemplate this cases...
Sorry about my poor English.
1.- A valid ISBN can't be separated by spaces.
it only says that the input have spaces "before" and "after" the ISBN candidate.The input data for this problem will contain one candidate ISBN per line of input, perhaps preceded and/or followed by additional spaces.
2.- A valid ISBN can ONLY have hyphens, digits and X for the LAST digit (hyphens can appears at anywhere, include at before any digit and after any digit). If it has any other character (include space) it's an invalid ISBN.
the candidate may contain ILLEGAL characters, not a valid ISBN, and if it's an illegal character it's not valid!! (illegal can't be the same as "garbage")No line will contain more than 80 characters, but the candidate ISBN may contain illegal characters, and more or fewer than the required 10 digits. Valid ISBNs may include hyphens at arbitrary locations. The end of file marks the end of the input data.
I hope it will help you.
Obviously my AC code follow this rules, if any other AC code doesn't follow the same rules it's because the judge doesn't contemplate this cases...
-
- Experienced poster
- Posts: 136
- Joined: Sat Nov 29, 2008 8:01 am
- Location: narayangong,bangladesh.
- Contact:
333 - Recognizing Good ISBN- Need more In/Output samples
Can someone give me some critical i/o.
what is the output for
[blank]
(space)is incorrect. or
is incorrect.
and what will be answer of
0-89237-010- 6 TEST
<S><S><T><S>0823025713<T><T><S>
correct or incorrect???
what is the output for
[blank]
(space)is incorrect. or
is incorrect.
and what will be answer of
0-89237-010- 6 TEST
<S><S><T><S>0823025713<T><T><S>
correct or incorrect???
Life is more complicated than algorithm.
http://felix-halim.net/uva/hunting.php?id=32359
For Hints: http://salimsazzad.wordpress.com
http://felix-halim.net/uva/hunting.php?id=32359
For Hints: http://salimsazzad.wordpress.com
-
- Learning poster
- Posts: 76
- Joined: Mon Jul 21, 2008 8:50 am
- Location: SUST,SYLHET,BANGLADESH.
- Contact:
Re: 333 - Recognizing Good ISBNs
0-89237-010-6 test
0-89237-010-6 TEST
output:
correct
incorrect
this are the output frm http://www.uvatoolkit.com/problemssolve.php
but i dont understand why?? problem statement dont say that case matters or this kind of input(with alphabet except X as 10th number) can be correct. from previous thread someone's AC out put for this input
0-89237-010-6 TEST
output:
correct
so i think a valid isbn only can contain hipen ,digits and can have X as 10th number. am i wrong.
im so confused..
![:x](./images/smilies/icon_mad.gif)
0-89237-010-6 TEST
output:
correct
incorrect
this are the output frm http://www.uvatoolkit.com/problemssolve.php
but i dont understand why?? problem statement dont say that case matters or this kind of input(with alphabet except X as 10th number) can be correct. from previous thread someone's AC out put for this input
0-89237-010-6 TEST
output:
correct
so i think a valid isbn only can contain hipen ,digits and can have X as 10th number. am i wrong.
![:o](./images/smilies/icon_eek.gif)
![:o](./images/smilies/icon_eek.gif)
im so confused..
![:x](./images/smilies/icon_mad.gif)
![:x](./images/smilies/icon_mad.gif)
![:x](./images/smilies/icon_mad.gif)
Heal The World
-
- Learning poster
- Posts: 76
- Joined: Mon Jul 21, 2008 8:50 am
- Location: SUST,SYLHET,BANGLADESH.
- Contact:
Re: 333 - Recognizing Good ISBNs - i was right
just got AC. i was right abt the validity of isbn.
i gave output incorrect if any alphabet is found.
and there is no alpahabet in the input set i think. because it gives different output in different AC codes for alphabet.so i think a valid isbn only can contain hipen ,digits and can have X as 10th number
i gave output incorrect if any alphabet is found.
Heal The World
Re: 333 - Recognizing Good ISBNs
My AC code says "incorrect" for this two inputscalicratis19 wrote:0-89237-010-6 test
0-89237-010-6 TEST
output:
correct
incorrect
this are the output frm http://www.uvatoolkit.com/problemssolve.php
but i dont understand why?? problem statement dont say that case matters or this kind of input(with alphabet except X as 10th number) can be correct. from previous thread someone's AC out put for this input
0-89237-010-6 TEST
output:
correct
so i think a valid isbn only can contain hipen ,digits and can have X as 10th number. am i wrong.![]()
![]()
im so confused..![]()
![]()
-
- Learning poster
- Posts: 76
- Joined: Mon Jul 21, 2008 8:50 am
- Location: SUST,SYLHET,BANGLADESH.
- Contact:
Re: 333 - Recognizing Good ISBNs - Need more In/Output samples
i think there is no input like this in judge input.
Heal The World