## 10650 - Determinate Prime

Moderator: Board moderators

New poster
Posts: 42
Joined: Sun Jul 31, 2005 2:07 am
Contact:

### 10650 ???

for input

1 100

output

3 5 7
47 53 59

are all clear to me, but

3 7 11
3 11 19
.
.
5 11 17 23 29
.
.
which are in the interval [1 100]...??

the problem description is too short, isn't it ? or may be the samples are responsible
to describe all...
For clarity check out the sample input and output
ok then.. well done, but this time, .. Just the problem title and
some sample should do... Hah Hah

1. should I find the sets totally distinct from each other....
then why 3 5 7 and not 3 7 11 ??
2. should I choose the first set lexicographycally ... ??
then why not 41 47 53 59
3. or should I ignore this problem ?? when more than 25% people goes ok...

little joey
Guru
Posts: 1080
Joined: Thu Dec 19, 2002 7:37 pm
Maybe you overlooked the word 'consecutive'?
3 7 11 are not consecutive (they are the 2nd 4th and 5th prime, resp.).

Martin Macko
A great helper
Posts: 481
Joined: Sun Jun 19, 2005 1:18 am
Location: European Union (Slovak Republic)

### Re: 10650 ???

Nazmul Quader Zinnuree wrote:ok then.. well done, but this time, .. Just the problem title
and some sample should do... Hah Hah
Try to read the problem statement more carefully
Problem statement wrote: If three or more consecutive primes are uni-distance they are called Determinate Primes. Your task is to print all the Determinate Prime sets between two integers (inclusive).
In the future, if there is already a topic for the problem you have a question to, try to use it. E.g. for 10650 there were two topics already:
http://online-judge.uva.es/board/viewtopic.php?t=8332 and http://online-judge.uva.es/board/viewtopic.php?t=5577

New poster
Posts: 42
Joined: Sun Jul 31, 2005 2:07 am
Contact:
Oh..
I'm really sorry for that...
I overlooked and overspoke.....
Thanks a lot!

sclo
Guru
Posts: 519
Joined: Mon Jan 23, 2006 10:45 pm
Contact:
For each test case you have to print all the Determinate Primes between x and y
It never says x <= y in the problem statement, so we need to read very carefully.

Przemek D.
New poster
Posts: 3
Joined: Mon Apr 03, 2006 10:56 pm
Location: Born: Poland, Lives: Great Britain
Tried few times, got WA, but now got AC. The BUG was that my prog went past the array of precalc sets But few more tips for people getting WA. I hope it will help.

1. Sorting is by the first element of the sequence, the number of primes in seq is not important, so for example it can go like this:
p1, p2, p3
p4, p5, p6, p7
p8, p9, p10

2. If there is no sequence in the interval print nothing (NO newline).

3. And (one more time ) try these cases:

255 270
200 268
250 270

first and second case - nothing, third : 251 257 263 269
I think this prob should have more sample input cases "for clarity"
I hate problems with "weird" inputs or outputs...
If you are looking for easy problems, try the ones I solved . If I had solved them it means they are easy since I am a newbie
http://acm.uva.es/problemset/usersjudge.php?user=40821

Ankur Jaiswal
New poster
Posts: 31
Joined: Sat Apr 01, 2006 6:24 am
Contact:
I am getting 181 sequences instead of 162.
They are :

Code: Select all

``````3 5 7
47 53 59
151 157 163
167 173 179
199 211 223
251 257 263
257 263 269
367 373 379
557 563 569
587 593 599
601 607 613
647 653 659
727 733 739
941 947 953
971 977 983
1097 1103 1109
1117 1123 1129
1181 1187 1193
1217 1223 1229
1361 1367 1373
1499 1511 1523
1741 1747 1753
1747 1753 1759
1901 1907 1913
2281 2287 2293
2411 2417 2423
2671 2677 2683
2897 2903 2909
2957 2963 2969
3301 3307 3313
3307 3313 3319
3631 3637 3643
3727 3733 3739
4007 4013 4019
4397 4409 4421
4451 4457 4463
4591 4597 4603
4651 4657 4663
4679 4691 4703
4987 4993 4999
5101 5107 5113
5107 5113 5119
5297 5303 5309
5381 5387 5393
5387 5393 5399
5557 5563 5569
5801 5807 5813
6067 6073 6079
6257 6263 6269
6311 6317 6323
6317 6323 6329
6361 6367 6373
6367 6373 6379
6857 6863 6869
6971 6977 6983
7517 7523 7529
7577 7583 7589
7817 7823 7829
7829 7841 7853
8111 8117 8123
8707 8713 8719
8741 8747 8753
9391 9397 9403
9467 9473 9479
9859 9871 9883
10247 10253 10259
10601 10607 10613
10651 10657 10663
10847 10853 10859
11287 11299 11311
11399 11411 11423
11491 11497 11503
11719 11731 11743
11801 11807 11813
11897 11903 11909
11927 11933 11939
12491 12497 12503
12541 12547 12553
12577 12583 12589
12641 12647 12653
12647 12653 12659
12829 12841 12853
12967 12973 12979
13037 13043 13049
13171 13177 13183
13451 13457 13463
13457 13463 13469
14537 14543 14549
14741 14747 14753
14747 14753 14759
15149 15161 15173
15187 15193 15199
15307 15313 15319
15461 15467 15473
15761 15767 15773
15791 15797 15803
15797 15803 15809
15901 15907 15913
15907 15913 15919
16091 16097 16103
16217 16223 16229
16421 16427 16433
16481 16487 16493
16561 16567 16573
16607 16619 16631
16763 16787 16811
16931 16937 16943
16981 16987 16993
17041 17047 17053
17321 17327 17333
17419 17431 17443
17471 17477 17483
17477 17483 17489
17839 17851 17863
18211 18217 18223
18217 18223 18229
18329 18341 18353
18427 18433 18439
18719 18731 18743
19457 19463 19469
19471 19477 19483
19477 19483 19489
19571 19577 19583
19597 19603 19609
19727 19739 19751
19937 19949 19961
20101 20107 20113
20117 20123 20129
20149 20161 20173
20183 20201 20219
20341 20347 20353
20509 20521 20533
20719 20731 20743
21157 21163 21169
21649 21661 21673
21893 21911 21929
21991 21997 22003
22039 22051 22063
22067 22073 22079
22247 22259 22271
22441 22447 22453
23321 23327 23333
23327 23333 23339
23761 23767 23773
23789 23801 23813
23887 23893 23899
24071 24077 24083
24091 24097 24103
24407 24413 24419
24671 24677 24683
25373 25391 25409
25457 25463 25469
25609 25621 25633
25667 25673 25679
26029 26041 26053
26171 26177 26183
26177 26183 26189
26387 26393 26399
26687 26693 26699
26717 26723 26729
26981 26987 26993
27061 27067 27073
27767 27773 27779
28057 28069 28081
28591 28597 28603
28921 28927 28933
29167 29173 29179
29251 29269 29287
29327 29333 29339
29587 29599 29611
29867 29873 29879
30047 30059 30071
30091 30097 30103
30097 30103 30109
30307 30313 30319
30431 30449 30467
30631 30637 30643
30637 30643 30649
30971 30977 30983
31039 31051 31063
31321 31327 31333
``````
Can nebd tell which of them are wrong?
I cant find anyone wrong.

Pregunt
New poster
Posts: 7
Joined: Thu Jun 16, 2005 8:17 am
Location: M
Contact:
Ankur Jaiswal: Maybe you must write
13451 13457 13463 13469
13451 13457 13463
13457 13463 13469

Moha
Experienced poster
Posts: 216
Joined: Tue Aug 31, 2004 1:02 am
Location: Tehran
Contact:
I passed all of these testcases but still WA, can anybody send some input and output.

CodeMaker
Experienced poster
Posts: 183
Joined: Thu Nov 11, 2004 12:35 pm
This is the correct output for my posted input in my 1st post...

Code: Select all

``````10247 10253 10259
10601 10607 10613
10651 10657 10663
10847 10853 10859
11287 11299 11311
11399 11411 11423
11491 11497 11503
11719 11731 11743
11801 11807 11813
11897 11903 11909
11927 11933 11939
12491 12497 12503
12541 12547 12553
12577 12583 12589
12641 12647 12653 12659
12829 12841 12853
12967 12973 12979
13037 13043 13049
13171 13177 13183
13451 13457 13463 13469
14537 14543 14549
14741 14747 14753 14759
15149 15161 15173
15187 15193 15199
15307 15313 15319
15461 15467 15473
15761 15767 15773
15791 15797 15803 15809
15901 15907 15913 15919
16091 16097 16103
16217 16223 16229
16421 16427 16433
16481 16487 16493
16561 16567 16573
16607 16619 16631
16763 16787 16811
16931 16937 16943
16981 16987 16993
17041 17047 17053
17321 17327 17333
17419 17431 17443
17471 17477 17483 17489
17839 17851 17863
18211 18217 18223 18229
18329 18341 18353
18427 18433 18439
18719 18731 18743
19457 19463 19469
19471 19477 19483 19489
19571 19577 19583
19597 19603 19609
19727 19739 19751
19937 19949 19961
20101 20107 20113
20117 20123 20129
20149 20161 20173
20183 20201 20219
20341 20347 20353
20509 20521 20533
20719 20731 20743
21157 21163 21169
21649 21661 21673
21893 21911 21929
21991 21997 22003
22039 22051 22063
22067 22073 22079
22247 22259 22271
22441 22447 22453
23321 23327 23333 23339
23761 23767 23773
23789 23801 23813
23887 23893 23899
24071 24077 24083
24091 24097 24103
24407 24413 24419
24671 24677 24683
25373 25391 25409
25457 25463 25469
25609 25621 25633
25667 25673 25679
26029 26041 26053
26171 26177 26183 26189
26387 26393 26399
26687 26693 26699
26717 26723 26729
26981 26987 26993
27061 27067 27073
27767 27773 27779
28057 28069 28081
28591 28597 28603
28921 28927 28933
29167 29173 29179
29251 29269 29287
29327 29333 29339
29587 29599 29611
29867 29873 29879
30047 30059 30071
30091 30097 30103 30109
30307 30313 30319
30431 30449 30467
30631 30637 30643 30649
30971 30977 30983
31039 31051 31063
31321 31327 31333
3 5 7
47 53 59
557 563 569
587 593 599
601 607 613
647 653 659
727 733 739
941 947 953
971 977 983
557 563 569
587 593 599
601 607 613
647 653 659
727 733 739
941 947 953
971 977 983
10247 10253 10259
10601 10607 10613
10651 10657 10663
10847 10853 10859
11287 11299 11311
11399 11411 11423
11491 11497 11503
11719 11731 11743
11801 11807 11813
11897 11903 11909
11927 11933 11939
12491 12497 12503
12541 12547 12553
12577 12583 12589
12641 12647 12653 12659
12829 12841 12853
12967 12973 12979
13037 13043 13049
13171 13177 13183
13451 13457 13463 13469
14537 14543 14549
14741 14747 14753 14759
15149 15161 15173
15187 15193 15199
15307 15313 15319
15461 15467 15473
15761 15767 15773
15791 15797 15803 15809
15901 15907 15913 15919
16091 16097 16103
16217 16223 16229
16421 16427 16433
16481 16487 16493
16561 16567 16573
16607 16619 16631
16763 16787 16811
16931 16937 16943
16981 16987 16993
17041 17047 17053
17321 17327 17333
17419 17431 17443
17471 17477 17483 17489
17839 17851 17863
18211 18217 18223 18229
18329 18341 18353
18427 18433 18439
18719 18731 18743
19457 19463 19469
19471 19477 19483 19489
19571 19577 19583
19597 19603 19609
19727 19739 19751
19937 19949 19961
20101 20107 20113
20117 20123 20129
20149 20161 20173
20183 20201 20219
20341 20347 20353
20509 20521 20533
20719 20731 20743
21157 21163 21169
21649 21661 21673
21893 21911 21929
21991 21997 22003
22039 22051 22063
22067 22073 22079
22247 22259 22271
22441 22447 22453
23321 23327 23333 23339
23761 23767 23773
23789 23801 23813
23887 23893 23899
24071 24077 24083
24091 24097 24103
24407 24413 24419
24671 24677 24683
25373 25391 25409
25457 25463 25469
25609 25621 25633
25667 25673 25679
26029 26041 26053
26171 26177 26183 26189
26387 26393 26399
26687 26693 26699
26717 26723 26729
26981 26987 26993
27061 27067 27073
27767 27773 27779
28057 28069 28081
28591 28597 28603
28921 28927 28933
29167 29173 29179
29251 29269 29287
29327 29333 29339
29587 29599 29611
29867 29873 29879
30047 30059 30071
30091 30097 30103 30109
30307 30313 30319
30431 30449 30467
30631 30637 30643 30649
30971 30977 30983
31039 31051 31063
31321 31327 31333
32077 32083 32089
151 157 163
167 173 179
151 157 163
167 173 179
199 211 223
251 257 263 269
367 373 379
557 563 569
587 593 599
601 607 613
647 653 659
727 733 739
941 947 953
151 157 163
167 173 179
199 211 223
251 257 263 269
367 373 379
557 563 569
587 593 599
601 607 613
647 653 659
727 733 739
367 373 379
557 563 569
587 593 599
601 607 613
647 653 659
727 733 739
``````
Jalal : AIUB SPARKS

Martin Macko
A great helper
Posts: 481
Joined: Sun Jun 19, 2005 1:18 am
Location: European Union (Slovak Republic)
Moha wrote:I passed all of these testcases but still WA, can anybody send some input and output.
Have you also tried the test cases posted in the other thread?

Martin Macko
A great helper
Posts: 481
Joined: Sun Jun 19, 2005 1:18 am
Location: European Union (Slovak Republic)
CodeMaker wrote:This is the correct output for my posted input in my 1st post...

Moha
Experienced poster
Posts: 216
Joined: Tue Aug 31, 2004 1:02 am
Location: Tehran
Contact:
Yes, Actually it was so weird! After changing my code speed, Try to calculate all of sequences(that 162's) at the beginning and then printing them, I got it. I gon't change my sterategy for producing the sequences. But I had got WA, before that! Anyway I got it!

Mushfiqur Rahman
Learning poster
Posts: 56
Joined: Tue Jun 13, 2006 5:18 pm
Contact:
I couldn't understood where's the problem with my code. I think it's ok. Please anybody check ( who has got AC) it for some tricky I/O.

I would be grateful to you.

Code: Select all

``````Removed After Accepted.  :D  :D  :D
``````
Last edited by Mushfiqur Rahman on Mon Oct 09, 2006 7:47 pm, edited 1 time in total.

monishcse_sust
New poster
Posts: 1
Joined: Sun Oct 08, 2006 6:13 am

### input for 10650

check ur code for the following input

7816 7870
0 0

my AC output :
7817 7823 7829
7829 7841 7853

I hope it will help u.