結果
問題 | No.691 E869120 and Constructing Array 5 |
ユーザー |
![]() |
提出日時 | 2025-04-15 23:37:54 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 674 bytes |
コンパイル時間 | 627 ms |
コンパイル使用メモリ | 81,676 KB |
実行使用メモリ | 83,764 KB |
最終ジャッジ日時 | 2025-04-15 23:39:32 |
合計ジャッジ時間 | 17,067 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | WA * 27 |
ソースコード
import sys from decimal import Decimal, getcontext getcontext().prec = 50 # High precision to handle up to 15 decimal places accurately def solve(): Q = int(sys.stdin.readline()) for _ in range(Q): p_str = sys.stdin.readline().strip() p = Decimal(p_str) # Check if a single element works e_single = (p ** 2).quantize(Decimal('1'), rounding='ROUND_HALF_UP') error = abs(e_single.sqrt() - p) if error <= Decimal('1e-10'): print(f"1 {e_single}") else: # Use three elements as in the fourth sample print("3 10000000 15000000 20000000") if __name__ == "__main__": solve()