HCI '16 - Pi Digits

View as PDF

Submit solution

Points: 30
Time limit: 10.0s
Memory limit: 64M

Authors:
Problem type

Calculate \pi to N digits. That's all. :) (really)

Input Specification

N: Number of digits of \pi to compute

Output Specification

A single line containing N non-space separated digits of \pi, with no decimal point. Do not round the last digit, just truncate it.

Constraints

Subtask 1 [20%]

N = 800

Subtask 2 [20%]

N = 5\,000

Subtask 3 [60%]

N = 10\,000\,000

Sample Input

5

Sample Output

31415

Comments


  • 4
    passman300  commented on Jan. 16, 2022, 2:56 p.m. edited

    Probably need "chudnovsky algorithm".