ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 2102. Michael and Cryptography

WA47
Posted by German 27 Feb 2017 14:20
1) Find the prime numbers up to 10,000,100 (Sieve of Eratosthenes)
2) if the sum is equal to 19 degrees, then the residue is prime to check
What can you advise?
Re: WA47
Posted by ToadMonster 27 Feb 2017 19:06
1) Up to 10M? 2M is enough. sqrt( 10^18 / 2^18) ~= 1.5M

2)
"Yes" precondition: N > 1
"Yes" condition: sum is 20 and residue is 1
"Yes" condition: sum is 19 and residue>1 and residue is prime

Could you show please code?
Re: WA47
Posted by German 27 Feb 2017 19:36

AC

Edited by author 09.03.2017 18:16
Re: WA47
Posted by ToadMonster 28 Feb 2017 20:20
> if (kol == 20){

It's suspicious a bit. Please try test (2^20)*3, expected answer is No
Re: WA47
Posted by German 1 Mar 2017 12:59
3145728
No
20^20 * 3^1 sum 21

if I understand condition of the problem:
3^1*5^1*7^2*11^1*17^12*23^3 answer is "Yes" ?



Edited by author 01.03.2017 13:26
Re: WA47
Posted by PO 7 Dec 2018 17:07
@German, yes, but 3^1*5^1*7^2*11^1*17^12*23^3 =5.7312663087627849373395 × 10^22 > 10 ^ 18 - , max allowed. see https://www.wolframalpha.com/input/?i=3%5E1*5%5E1*7%5E2*11%5E1*17%5E12*23%5E3

Edited by author 07.12.2018 17:07

Edited by author 07.12.2018 17:07