967 - Circular
Moderator: Board moderators
967 - Circular
Seems it is the first post of this problem. Circular
Isn't it true that all the valid numbers consist only the digits {1, 3, 5, 7}.
I basically generated all the numbers in the range [100, 1000000) using recursion and checked the validity. But I am getting WA.
Input: 100 999999
Output: 42 Circular Primes.
Is it correct?
Isn't it true that all the valid numbers consist only the digits {1, 3, 5, 7}.
I basically generated all the numbers in the range [100, 1000000) using recursion and checked the validity. But I am getting WA.
Input: 100 999999
Output: 42 Circular Primes.
Is it correct?
-
- Experienced poster
- Posts: 151
- Joined: Tue Nov 16, 2004 7:23 pm
- Location: Norway
- Contact:
oooppsss
ooopss..
I meant to write { 1, 3, 7, 9}.. and not {1, 3, 5, 7}
any other ideas?
[Edit]: got accepted.... made a stupid/silly mistake in printing.
I meant to write { 1, 3, 7, 9}.. and not {1, 3, 5, 7}
any other ideas?
[Edit]: got accepted.... made a stupid/silly mistake in printing.
could someone please help me and tell me what's wrong with this code?
I'm getting WA.It is an easy problem I think so.
I'm getting WA.It is an easy problem I think so.
Code: Select all
removed
Last edited by farzane on Fri Nov 10, 2006 1:14 pm, edited 1 time in total.
I think i can't understand the problem statements .
For 917 we should check the numbers 917, 179 and 791 .
Here 917 isn't prime, 179 is prime and also 791 isn't prime .
So can we call the number 917 be a circular prime ?
For 917 we should check the numbers 917, 179 and 791 .
Here 917 isn't prime, 179 is prime and also 791 isn't prime .
So can we call the number 917 be a circular prime ?
_______________________________________
http://acm.uva.es/problemset/usersnew.php?user=6114
http://acm.uva.es/problemset/usersnew.php?user=6114
-
- New poster
- Posts: 19
- Joined: Sun Jun 18, 2006 4:07 pm
- Contact:
-
- Guru
- Posts: 1080
- Joined: Thu Dec 19, 2002 7:37 pm
I don't think there are any special cases. If you find 42 circular primes between 100 and 1000000, as mentioned above, you have a very good chance that your program is right. Your only worry then is to get the output format right. Have you carefully checked your output for the sample input?
The biggest problem with most problems is not how to solve the problem, but how to not solve what is not the problem.
-
- New poster
- Posts: 19
- Joined: Sun Jun 18, 2006 4:07 pm
- Contact:
Last edited by hamedv on Mon Jul 30, 2007 11:16 am, edited 1 time in total.