結果
問題 |
No.3301 Make Right Triangle
|
ユーザー |
|
提出日時 | 2025-10-05 16:25:46 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
AC
|
実行時間 | 886 ms / 2,000 ms |
コード長 | 320 bytes |
コンパイル時間 | 156 ms |
コンパイル使用メモリ | 12,032 KB |
実行使用メモリ | 10,368 KB |
最終ジャッジ日時 | 2025-10-05 16:26:31 |
合計ジャッジ時間 | 12,987 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 9 |
ソースコード
import math T = int(input()) for _ in range(T): L = int(input()) Lsq = math.isqrt(L) ans = [0,0,0] if L % 2 == 0: m,n = L//2, 1 ans = [m**2 - n**2, L, m**2 + n**2] else: x = (L**2 - 1)//2 ans = [L, x, x+1] if ans[0]**2 + ans[1]**2 == ans[2]**2: print(*ans) else: print("It is wrong anser")