10789 - Prime Frequency
Moderator: Board moderators
-
- New poster
- Posts: 21
- Joined: Sat Sep 25, 2004 3:35 am
- Location: Oaxaca de Ju
- Contact:
10789 - Wrong Answer
This problem is driving me mad! Those who had got it accepted, how did you read the input?
In a part of my code, I do the following cast
[cpp]
u = (int)cadena[j];
cout << (char)j;
[/cpp]
Is this valid? Would it produce the right output?
In a part of my code, I do the following cast
[cpp]
u = (int)cadena[j];
cout << (char)j;
[/cpp]
Is this valid? Would it produce the right output?
-
- Experienced poster
- Posts: 131
- Joined: Sat Jul 17, 2004 4:09 am
- Location: Lima, Per
-
- New poster
- Posts: 28
- Joined: Tue Aug 03, 2004 8:11 pm
- Contact:
10789 - Prime Frequency
i don't understand ... where to be wrong?
[cpp]
//---------------------------------------------------------------------------
//---------------------------------------------------------------------------
[/cpp]
thanks ... for help
[cpp]
//---------------------------------------------------------------------------
//---------------------------------------------------------------------------
[/cpp]
thanks ... for help
Last edited by schindlersp on Thu Dec 16, 2004 12:22 am, edited 1 time in total.
-
- New poster
- Posts: 21
- Joined: Sat Sep 25, 2004 3:35 am
- Location: Oaxaca de Ju
- Contact:
Thank you!
Yes, the problem was with the output. Why
[cpp] putchar(j); [/cpp]
works while
[cpp] cout << (char) j; [/cpp]
does not? I really would like to know.
[cpp] putchar(j); [/cpp]
works while
[cpp] cout << (char) j; [/cpp]
does not? I really would like to know.
-
- Experienced poster
- Posts: 131
- Joined: Sat Jul 17, 2004 4:09 am
- Location: Lima, Per
Hi
Try this input
[cpp]
10
oieurfndskjbnz000000157986216nvknMANC
idufjdklmvlkue342494832674921487
76583hjfkshgkiKJDNHFKJSkjsdnksi
iutioerniIHGFSDHuyeuiu735982347kkj
nnvnvnnv
a
0
A
0001AA
BBNAaaa9
[/cpp]
Output
[cpp]
Case 1: 16k
Case 2: 234789dklu
Case 3: JKhijs
Case 4: 37Hek
Case 5: nv
Case 6: empty
Case 7: empty
Case 8: empty
Case 9: 0A
Case 10: Ba
[/cpp]
If you want, send me your input file and I will send you my output for it.![:wink:](./images/smilies/icon_wink.gif)
Try this input
[cpp]
10
oieurfndskjbnz000000157986216nvknMANC
idufjdklmvlkue342494832674921487
76583hjfkshgkiKJDNHFKJSkjsdnksi
iutioerniIHGFSDHuyeuiu735982347kkj
nnvnvnnv
a
0
A
0001AA
BBNAaaa9
[/cpp]
Output
[cpp]
Case 1: 16k
Case 2: 234789dklu
Case 3: JKhijs
Case 4: 37Hek
Case 5: nv
Case 6: empty
Case 7: empty
Case 8: empty
Case 9: 0A
Case 10: Ba
[/cpp]
If you want, send me your input file and I will send you my output for it.
![:wink:](./images/smilies/icon_wink.gif)
-
- New poster
- Posts: 28
- Joined: Tue Aug 03, 2004 8:11 pm
- Contact:
thanks Antonio OCampo but i don't get find my err
look my input
thanks ...[/code]
look my input
has critical input??
16
oieurfndskjbnz000000157986216nvknMANC
idufjdklmvlkue342494832674921487
76583hjfkshgkiKJDNHFKJSkjsdnksi
iutioerniIHGFSDHuyeuiu735982347kkj
nnvnvnnv
a
0
A
0001AA
BBNAaaa9
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAaasdiufhushfusdhfsiudfhsdghfygfsugfudsfjknhddifuygufgdufgsdfugsdufgjkbfidug
0a0a0a0a0a0a0a0a0a0a0a0a0a0a0000000000000000000000000000000000000000
aaAAaA000010
AAAZZZzzzzzzzBbBb
123456duahshidhaysdguasgdasuydguasgduasgduasgfuvdgucvdaugcvaducvdgcvsdycvysdgvcysdgvcysdvcgyvdcgyvdycvsygdcvsygdvcygdvsygvcygsdvcygsvdcygvsdygcvsyvc123456
dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddaaaffffffffffffeeeeeeeeeeeeeee
Case 1: 16k
Case 2: 234789dklu
Case 3: JKhijs
Case 4: 37Hek
Case 5: nv
Case 6: empty
Case 7: empty
Case 8: empty
Case 9: 0A
Case 10: Ba
Case 11: Aadgjksy
Case 12: empty
Case 13: 0Aa
Case 14: ABZbz
Case 15: 123456acdh
Case 16: a
![:o](./images/smilies/icon_eek.gif)
thanks ...[/code]
-
- Guru
- Posts: 584
- Joined: Thu Jun 19, 2003 3:48 am
- Location: Sanok, Poland
- Contact:
-
- New poster
- Posts: 28
- Joined: Tue Aug 03, 2004 8:11 pm
- Contact:
10789 ac
Thanks i get AC
no problem with my code
isPrime() don't work ..
while ( retorno && (d*d < n) ) // in my isPrime 9 is prime
no problem with my code
![:oops:](./images/smilies/icon_redface.gif)
isPrime() don't work ..
while ( retorno && (d*d < n) ) // in my isPrime 9 is prime
-
- Experienced poster
- Posts: 131
- Joined: Sat Jul 17, 2004 4:09 am
- Location: Lima, Per
-
- Learning poster
- Posts: 57
- Joined: Fri Oct 10, 2003 11:01 pm
- Location: in front of PC
- Contact:
Extremely Srry for posting wrong code...
Last edited by I LIKE GN on Thu Aug 18, 2005 3:13 pm, edited 1 time in total.
There are two tragedies in life one is to lose your hearts' desire and another is to gain it --- GBS.
-
- Learning poster
- Posts: 57
- Joined: Fri Oct 10, 2003 11:01 pm
- Location: in front of PC
- Contact:
Please Help
hello wook
really ur advice worked (but strange my vcc 6.0 worked with the previous code)
so thank UUUUU!!!!!!!
really ur advice worked (but strange my vcc 6.0 worked with the previous code)
so thank UUUUU!!!!!!!
Last edited by I LIKE GN on Thu Aug 18, 2005 3:11 pm, edited 1 time in total.
There are two tragedies in life one is to lose your hearts' desire and another is to gain it --- GBS.