Skip to main content
added 9 characters in body
Source Link
ETHproductions
  • 50.1k
  • 30
  • 27
  • You may assume that -9 ≤ x, n ≤ +9.
  • You may assume that x ≠ 0, for the sake of avoiding 0 ' 0, 0 ' -1, etc.
  • You may assume that 1e-4 ≤ |x ' n| ≤ 1e9.
  • The output must be precise to at least 3 significant digits for the given test cases.
  • Input/output may be taken/given in any standard format.
  • You may assume that -9 ≤ x, n ≤ +9.
  • You may assume that x ≠ 0, for the sake of avoiding 0 ' 0, 0 ' -1, etc.
  • You may assume that 1e-4 ≤ |x ' n| ≤ 1e9.
  • The output must be precise to 3 significant digits for the given test cases.
  • Input/output may be taken/given in any standard format.
  • You may assume that -9 ≤ x, n ≤ +9.
  • You may assume that x ≠ 0, for the sake of avoiding 0 ' 0, 0 ' -1, etc.
  • You may assume that 1e-4 ≤ |x ' n| ≤ 1e9.
  • The output must be precise to at least 3 significant digits for the given test cases.
  • Input/output may be taken/given in any standard format.
further cherry-pick test cases
Source Link
ETHproductions
  • 50.1k
  • 30
  • 27
x, n -> output
1, 0 -> 1
3.14159, 0 -> 1
-9, 0 -> -1
57, 1 -> 57
-1.23456, 1 -> -1.23456
1, 2 -> 1
4, 2 -> 16
-5, 2 -> -25
1.4142, 2 -> 1.99996
-4, 3 -> -64
-60.1, 64 -> -465560.0001
-9, 9 -> -387420489
0.1, 4 -> 0.0001
1, -1 -> 1
-3, -1 -> -0.33333
5, -2 -> 0.04
2, -5 -> 0.03125
2.71828, -9 -> 0.0001234
1, 0.5 -> 1
4, 0.5 -> 2
-2, 0.5 -> -1.41421
2, -0.5 -> 0.7071
3.8236, -1.6702 -> 0.10645
0.1, -9 -> 1000000000
x, n -> output
1, 0 -> 1
3.14159, 0 -> 1
-9, 0 -> -1
5, 1 -> 5
-1.23456, 1 -> -1.23456
1, 2 -> 1
4, 2 -> 16
-5, 2 -> -25
1.4142, 2 -> 1.99996
-4, 3 -> -64
-6, 6 -> -46556
-9, 9 -> -387420489
0.1, 4 -> 0.0001
1, -1 -> 1
-3, -1 -> -0.33333
5, -2 -> 0.04
2, -5 -> 0.03125
2.71828, -9 -> 0.0001234
1, 0.5 -> 1
4, 0.5 -> 2
-2, 0.5 -> -1.41421
2, -0.5 -> 0.7071
3.8236, -1.6702 -> 0.10645
0.1, -9 -> 1000000000
x, n -> output
1, 0 -> 1
3.14159, 0 -> 1
-9, 0 -> -1
7, 1 -> 7
-1.23456, 1 -> -1.23456
5, 2 -> 25
-4, 3 -> -64
0.1, 4 -> 0.0001
-9, 9 -> -387420489
1, -1 -> 1
-3, -1 -> -0.33333
5, -2 -> 0.04
2.71828, -9 -> 0.0001234
4, 0.5 -> 2
-2, 0.5 -> -1.41421
2, -0.5 -> 0.7071
3.8236, -1.6702 -> 0.10645
0.1, -9 -> 1000000000
removed many test cases
Source Link
ETHproductions
  • 50.1k
  • 30
  • 27
  • You may assume that -9 ≤ x, n ≤ +9.
  • You may assume that x ≠ 0, for the sake of avoiding 0 ' 0, 0 ' -1, etc.
  • You may assume that 1e-4 ≤ |x ' n| ≤ 1e9.
  • The output must be precise to 3 significant digits for the given test cases.
  • Input/output may be taken/given in any standard format.
x, n -> output
1, 0 -> 1
3.14159, 0 -> 1
9, 0 -> 1
-1, 0 -> -1
-9, 0 -> -1
1, 1 -> 1
9, 1 -> 9
-15, 1 -> -15
-1.23456, 1 -> -1.23456
-9, 1 -> -9
4, 2 -> 16
3, 2 -> 9
2, 2 -> 4
1, 2 -> 1
-1, 2 -> -1
-24, 2 -> -416
-35, 2 -> -925
1.4142, 2 -> 1.99996
-4, 3 -> -64
-6, 56 -> -777646556
-9, 9 -> -387420489
9, 9 -> 387420489
0.1, 4 -> 0.0001
1, -1 -> 1
2, -1 -> 0.5
3, -1 -> 0.33333
-3, -1 -> -0.33333
5, -2 -> 0.04
2, -5 -> 0.03125
2.71828, -9 -> 0.0001234
1, 0.5 -> 1
2, 0.5 -> 1.41421
4, 0.5 -> 2
-2, 0.5 -> -1.41421
-4, 0.5 -> -2
2, -0.5 -> 0.7071
3.8236, -1.6702 -> 0.10645
0.1, -9 -> 1000000000
  • You may assume that -9 ≤ x, n ≤ +9.
  • You may assume that x ≠ 0, for the sake of avoiding 0 ' 0, 0 ' -1, etc.
  • You may assume that 1e-4 ≤ |x ' n| ≤ 1e9.
  • The output must be precise to 3 significant digits.
  • Input/output may be taken/given in any standard format.
x, n -> output
1, 0 -> 1
3.14159, 0 -> 1
9, 0 -> 1
-1, 0 -> -1
-9, 0 -> -1
1, 1 -> 1
9, 1 -> 9
-1, 1 -> -1
-1.23456, 1 -> -1.23456
-9, 1 -> -9
4, 2 -> 16
3, 2 -> 9
2, 2 -> 4
1, 2 -> 1
-1, 2 -> -1
-2, 2 -> -4
-3, 2 -> -9
1.4142, 2 -> 1.99996
-4, 3 -> -64
-6, 5 -> -7776
-9, 9 -> -387420489
9, 9 -> 387420489
0.1, 4 -> 0.0001
1, -1 -> 1
2, -1 -> 0.5
3, -1 -> 0.33333
-3, -1 -> -0.33333
5, -2 -> 0.04
2, -5 -> 0.03125
2.71828, -9 -> 0.0001234
1, 0.5 -> 1
2, 0.5 -> 1.41421
4, 0.5 -> 2
-2, 0.5 -> -1.41421
-4, 0.5 -> -2
2, -0.5 -> 0.7071
3.8236, -1.6702 -> 0.10645
0.1, -9 -> 1000000000
  • You may assume that -9 ≤ x, n ≤ +9.
  • You may assume that x ≠ 0, for the sake of avoiding 0 ' 0, 0 ' -1, etc.
  • You may assume that 1e-4 ≤ |x ' n| ≤ 1e9.
  • The output must be precise to 3 significant digits for the given test cases.
  • Input/output may be taken/given in any standard format.
x, n -> output
1, 0 -> 1
3.14159, 0 -> 1
-9, 0 -> -1
5, 1 -> 5
-1.23456, 1 -> -1.23456
1, 2 -> 1
4, 2 -> 16
-5, 2 -> -25
1.4142, 2 -> 1.99996
-4, 3 -> -64
-6, 6 -> -46556
-9, 9 -> -387420489
0.1, 4 -> 0.0001
1, -1 -> 1
-3, -1 -> -0.33333
5, -2 -> 0.04
2, -5 -> 0.03125
2.71828, -9 -> 0.0001234
1, 0.5 -> 1
4, 0.5 -> 2
-2, 0.5 -> -1.41421
2, -0.5 -> 0.7071
3.8236, -1.6702 -> 0.10645
0.1, -9 -> 1000000000
Source Link
ETHproductions
  • 50.1k
  • 30
  • 27
Loading