10248 - The Integer All-time Champ

All about problems in Volume 102. 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
ante
New poster
Posts: 8
Joined: Wed Mar 20, 2002 2:00 am

10248 - The Integer All-time Champ

Post by ante »

Hi !
is this correct string length for these three inputs

1 99 ===> length is 99
30 80 ===> length is 76
1 50 ===> length is 66
Ustaad
New poster
Posts: 4
Joined: Tue Feb 05, 2002 2:00 am

Post by Ustaad »

Hi

My "Accepted" solution gives a 65-length solution for the case 1 50.

1 50
11012013014019494847394629452844383736273526251834241733231622150

I think the other inputs give correct solutions.

Hope this helps !:)

Ustaad
Google
New poster
Posts: 4
Joined: Wed Sep 18, 2002 5:32 pm

10248 - The Integer All-time Champs

Post by Google »

I think this is a truly special problem.
Can anybody give some hints about it?
I really have no idea about how to solve it, should I use greedy method or search?
Or is there any special algorithm for it?
Adrian Kuegel
Guru
Posts: 724
Joined: Wed Dec 19, 2001 2:00 am
Location: Germany

Post by Adrian Kuegel »

You can solve it with a kind of greedy. It has something to do with the number of digits you can append at the beginning of a string to build a new unused number.
Fred
New poster
Posts: 1
Joined: Tue Nov 05, 2002 9:19 pm
Contact:

1024 - what

Post by Fred »

I have tryed solving this problem with a simple algortithm.

- I verify if the number is already on the lis
- if not, i add it using the minimum number of algarisms possible.

It was wrong...
The mistake is not relationed to multiple inputs.

With 1 99 as argument, it generates the following string:

998897796695594493392291190878685848382818076757473727170656463626160545352515043424140323130212010

It has 99 algarisms.

I don
Emilio
Experienced poster
Posts: 163
Joined: Sun Oct 17, 2004 8:31 pm
Location: Murcia, Spain

Post by Emilio »

Hello there!

I have tried this problem and have got a lot of WAs. I have maked 5 different codes, the main strategy is search a number didn't use even in the list of numbers, this number is linked with other digits to make new numbers haven't used even, and then all these pieces are linked, I only search to make numbers of two digits, when all the two digits number are maked then I add the 1 digit numbers lacked. This is a brief explanation, I have maked some different codes as already said. In other approachs I add digits to one unique piece, over this I build the whole list of digits and I add at the begining and at the end. I have tried these methods in a lot of different ways, and with different ways to search and to start (with some number each time), and get the same results.
My method is a bit of greedy like.
Could anyone give me some good hint, method or some input/output?

Thanks in advance!
Emilio
Experienced poster
Posts: 163
Joined: Sun Oct 17, 2004 8:31 pm
Location: Murcia, Spain

Post by Emilio »

Finally I got AC.
A small mistake in my code :x .
Thanks to http://public.carnet.hr/~icanadi/acmcheck/index.php I found easily my mistake!
lord_burgos
New poster
Posts: 43
Joined: Mon Oct 13, 2003 4:54 pm
Location: Mexico
Contact:

Post by lord_burgos »

INPUT

Code: Select all

11 11
11 12
21 31
My AC Output

Code: Select all

11
112
22123024252627282931
brianfry713
Guru
Posts: 5947
Joined: Thu Sep 01, 2011 9:09 am
Location: San Jose, CA, USA

Re: 10248 - The Integer All-time Champs

Post by brianfry713 »

Something is wrong with the input, this code returns RE

Code: Select all

#include <stdio.h>

int main(void) {
  int m, n;
  while(scanf("%d%d", &m, &n)==2)
    if(m<=0||m>n||n>=100) return 1;
  return 0;
}
Anyone who can get AC, how do you handle input parsing? What about the cases where m<=0, m>n, or n>=100?
Check input and AC output for thousands of problems on uDebug!
yleewei
New poster
Posts: 1
Joined: Wed Mar 27, 2013 10:00 am

Re: 10248 - The Integer All-time Champs

Post by yleewei »

Yep @brianfry713, your code is still judged RE when I try to submit it too.
brianfry713
Guru
Posts: 5947
Joined: Thu Sep 01, 2011 9:09 am
Location: San Jose, CA, USA

Re: 10248 - The Integer All-time Champs

Post by brianfry713 »

I made a few more submissions, and I believe there is a case where m<0 and a case where m>n. There is not a case where n>=100.
I haven't been able to get AC.
Check input and AC output for thousands of problems on uDebug!
brianfry713
Guru
Posts: 5947
Joined: Thu Sep 01, 2011 9:09 am
Location: San Jose, CA, USA

Re: 10248 - The Integer All-time Champs

Post by brianfry713 »

The judge's I/O has been fixed.
Check input and AC output for thousands of problems on uDebug!
Post Reply

Return to “Volume 102 (10200-10299)”