|
|
"Nikolay thinks an integer is interesting if it is a prime number. However, Asya thinks an integer is interesting if the amount of its positive divisors is a prime number " If it so, "Nikolay and Asya are happy when their tastes about some integer are common." How come it can be true, prime number is a number which does not have divisors except for 1 and itself, but it says ,in Asya sentence, that "amount of its positive divisors is a prime number ",Does it mean 1 and the number given ? Can somebody explain it to me and the sample given below the problem , please It means that all numbers, which are interesting to Nikolay, are also interesting to Asya, but there are some numbers, which are interested to Asya only. For example, in first sample: 3,5,6,7 are interested to both, 4 is interested only to Asya. And yes, surely divisors of some number include 1 and this number. Edited by author 06.08.2016 21:02 How can the number 6 be of interest to Nicholas if it is not prime? L=p^(q-1),p and q prima numbers. Used Sieve to generate primes till 10^6, and then used those primes to generate larger primes. counted all such numbers satisfying L <= p^(q-1) <=R where p & q are primes (q>2). Subtracted it from R-L+1 How to optimize? Remember that you shouldn't check prime numbers (They call an integer satisfying if they both consider or do not consider this integer to be interesting) What is the test #85 ? Edited by author 01.09.2016 22:25 I implemented that but I have WA 5. What's in this test? I don't know, maybe double check if your numbers are exactly in range of [a, b]? And if they're long, not int? I implemented it too, but still have WA 27... Please, help me found a bug... What's wrong here: -- Thanks in advance. Edited by author 19.03.2016 19:43 Edited by author 20.03.2016 15:53 For max test, your answer ends in 3. But it's actually 8. Can you give the right answer on that test? Uh, i just did? I guess i didn't make it clear enough. Anyways, there you go. 2 1000000000000 999999921288 UPD: it's fine, and congrats~ Edited by author 20.03.2016 16:06 Sorry for bother, I just wanted to clarify. :) Now I corrected a mistake and got AC. 1000 100000000000 99999971585 10 100 86 17 500 476 |
|
|