ETFS - Euler Totient Function Sieve
In number theory, the totient phi(n) of a positive integer n is defined to be the number of positive integers less than or equal to n that are coprime to n.
Input
The lonely line in input contains two integers a, b.
Output
Print phi(n) for n from a to b (inclusive).
Example
Input: 1 5 Output: 1 1 2 2 4
Constraints
0 < a < b < 10^14 b - a < 10^5
Python can get AC under half the time limit (for any test case). My total PY3.4 time is 3.23s for 5 input files. Have fun ;-)
hide comments
jmr99:
2018-08-16 16:55:46
nice problem! Last edit: 2018-08-16 21:43:53 |
|
yashraj9892:
2018-04-18 19:38:50
can any one tell me Why am i getting sigbus error
|
|
sanki_hu:
2017-05-17 17:39:19
Thanks Francky , Finally AC . Awesome Problem dude. Rank-28
|
|
sanki_hu:
2017-05-17 15:01:45
@Francky Please check my solution id 19424022 .I have done several optimizations and my algo is also correct but i am getting TLE again and again.
|
|
ashishgup:
2017-03-21 00:58:49
Getting internal error. Please fix it.
|
|
awesomeabhinav:
2016-12-29 13:23:16
My solution id is 18481441, Got AC but need much more faster algorithm. PLS suggest another efficient way to do this problem
|
|
ashish22_dwd:
2016-10-13 15:32:00
Nice Problem.. |
|
ASHUTOSH DWIVEDI:
2016-07-08 15:29:40
AWESOME FRANCKY....... U ALWAYS MAKE NICE QUESTIONS :)
|
|
nightwolf_9197:
2016-05-22 11:16:04
good question but time limit must be constrained to 1 sec
|
|
shivucoder55:
2016-05-01 13:28:07
@Francky .. My solution ID is 16849109 .... It is giving correct answers for all test cases ... But I m getting runtime error (SIGFPE) ... Please give me hint ... Thanks
|
Added by: | Francky |
Date: | 2014-12-29 |
Time limit: | 2s |
Source limit: | 50000B |
Memory limit: | 1536MB |
Cluster: | Cube (Intel G860) |
Languages: | All except: ASM64 |
Resource: | ETF |