10248 - The Integer All-time Champ
Moderator: Board moderators
10248 - The Integer All-time Champ
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
is this correct string length for these three inputs
1 99 ===> length is 99
30 80 ===> length is 76
1 50 ===> length is 66
10248 - The Integer All-time Champs
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?
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?
-
- Guru
- Posts: 724
- Joined: Wed Dec 19, 2001 2:00 am
- Location: Germany
1024 - what
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
- 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
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!
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!
Finally I got AC.
A small mistake in my code
.
Thanks to http://public.carnet.hr/~icanadi/acmcheck/index.php I found easily my mistake!
A small mistake in my code
![:x](./images/smilies/icon_mad.gif)
Thanks to http://public.carnet.hr/~icanadi/acmcheck/index.php I found easily my mistake!
-
- New poster
- Posts: 43
- Joined: Mon Oct 13, 2003 4:54 pm
- Location: Mexico
- Contact:
INPUT
My AC Output
Code: Select all
11 11
11 12
21 31
Code: Select all
11
112
22123024252627282931
-
- Guru
- Posts: 5947
- Joined: Thu Sep 01, 2011 9:09 am
- Location: San Jose, CA, USA
Re: 10248 - The Integer All-time Champs
Something is wrong with the input, this code returns RE
Anyone who can get AC, how do you handle input parsing? What about the cases where m<=0, m>n, or n>=100?
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;
}
Check input and AC output for thousands of problems on uDebug!
Re: 10248 - The Integer All-time Champs
Yep @brianfry713, your code is still judged RE when I try to submit it too.
-
- Guru
- Posts: 5947
- Joined: Thu Sep 01, 2011 9:09 am
- Location: San Jose, CA, USA
Re: 10248 - The Integer All-time Champs
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.
I haven't been able to get AC.
Check input and AC output for thousands of problems on uDebug!
-
- Guru
- Posts: 5947
- Joined: Thu Sep 01, 2011 9:09 am
- Location: San Jose, CA, USA
Re: 10248 - The Integer All-time Champs
The judge's I/O has been fixed.
Check input and AC output for thousands of problems on uDebug!