#P2293. [HNOI2004] 高精度开根

    ID: 1263 远端评测题 3500ms 125MiB 尝试: 0 已通过: 0 难度: 8 上传者: 标签>高精度2004各省省选湖南O2优化

[HNOI2004] 高精度开根

Description

Xiaohua's team is developing a high-precision scientific computing software suite. Some simple parts such as high-precision addition/subtraction and multiplication/division have already been completed. The remaining part, assigned to Xiaohua, is computing the high-precision real mm-th root.

Because taking the root of a rational number may produce an irrational number, this task is quite challenging. For now, we only implement the first step: take an integer-order root of a natural number, obtain a non-negative root, and ignore the fractional part of the result—just truncate it to an integer.

Given the input specifying the degree of the root and the integer to be rooted, the program should compute the truncated non-negative root.

Input Format

The input consists of two lines, each containing an integer, with no extra spaces.

  • The first line contains a positive integer mm, the degree of the root.
  • The second line contains an integer nn, the number to take the root of.

Output Format

Output a single line containing one number: the truncated result of the root.

3
1000000000

1000

Hint

[Constraints]

For all testdata: 0n1010000,1m500 \le n \le 10^{10000}, 1 \le m \le 50.

Translated by ChatGPT 5