[BOJ 6815] Cool Numbers
View as PDF
Submit solution
Assembly, Awk, C, C++, Java, Pascal, Perl, Python, Sed, Text
Points:
1
Time limit:
1.0s
Memory limit:
128M
Problem types
Allowed languages
Eric likes interesting numbers like 64. It turns out that 64 is both a square and a cube, since 64 = 82 and 64 = 43. Eric calls these numbers cool.</p>
Write a program that helps Eric figure out how many integers in a given range are cool.
입력 형식
On the first line of input, you are given an integer a such that a ≥ 1 and a ≤ 108. On the second line of input, you are given an integer b such that a ≤ b and b ≤ 108.
출력 형식
The output should be the number of cool numbers in the range a to b (inclusively: that is, a and b would count as cool numbers in the range if they were actually cool).
예제 입력 1
1
100
예제 출력 1
2
예제 입력 2
100
1000
예제 출력 2
1
Comments