結果
問題 | No.1551 誕生日の三角形 |
ユーザー |
![]() |
提出日時 | 2025-03-20 21:08:22 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 104 ms / 1,000 ms |
コード長 | 423 bytes |
コンパイル時間 | 144 ms |
コンパイル使用メモリ | 82,536 KB |
実行使用メモリ | 80,884 KB |
最終ジャッジ日時 | 2025-03-20 21:09:08 |
合計ジャッジ時間 | 1,822 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 9 |
ソースコード
from decimal import Decimal, getcontext# Set a high precision to handle the floating-point calculations accuratelygetcontext().prec = 100L = int(input())sqrt3 = Decimal(3).sqrt()area = (Decimal(L) ** 2) * sqrt3 / Decimal(36)# Convert to a string and format to remove trailing zerosformatted_area = format(area, 'f').rstrip('0').rstrip('.') if '.' in format(area, 'f') else format(area, 'f')print(formatted_area)