結果
| 問題 |
No.1180 無限和
|
| コンテスト | |
| ユーザー |
lam6er
|
| 提出日時 | 2025-03-20 19:00:30 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
AC
|
| 実行時間 | 346 ms / 1,000 ms |
| コード長 | 996 bytes |
| コンパイル時間 | 166 ms |
| コンパイル使用メモリ | 82,092 KB |
| 実行使用メモリ | 82,640 KB |
| 最終ジャッジ日時 | 2025-03-20 19:01:46 |
| 合計ジャッジ時間 | 14,419 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 40 |
ソースコード
import decimal
def main():
n = int(input())
# Set a high precision to handle large exponents accurately
decimal.getcontext().prec = 2000
# Pi as a string with 1000 decimal places (truncated here for brevity)
pi_str = '3.14159265358979323846264338327950288419716939937510582097494459230781640628620899862803482534211706798214808651328230664709384460955058223172535940812848111745028410270193852110555964462294895493038196442881097566593344612847564823378678316527120190914564856692346034861045432664821339360726024914127372458700660631558817488152092096282925409171536436789259036001133053054882046652138414695194151160943305727036575959195309218611738193261179310511854807446237996274956735188575272489122793818301194912'
pi = decimal.Decimal(pi_str)
value = (pi ** 2) / decimal.Decimal(6)
s = (value ** n) / decimal.Decimal(n)
# Extract the integer part
integer_part = s // 1
print(f"{integer_part}")
if __name__ == "__main__":
main()
lam6er