結果
| 問題 |
No.3301 Make Right Triangle
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2025-10-05 14:48:22 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
AC
|
| 実行時間 | 164 ms / 2,000 ms |
| コード長 | 395 bytes |
| コンパイル時間 | 354 ms |
| コンパイル使用メモリ | 82,360 KB |
| 実行使用メモリ | 77,836 KB |
| 最終ジャッジ日時 | 2025-10-05 14:48:35 |
| 合計ジャッジ時間 | 6,313 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 9 |
ソースコード
from sys import stdin
def input():
return stdin.readline().rstrip("\n")
def solve(l):
if l % 2 == 0:
m = l // 2
n = 1
else:
n = l // 2
m = n + 1
a = m**2 - n**2
b = 2 * m * n
c = m**2 + n**2
assert l in (a, b, c)
return a, b, c
case_t = 1
case_t = int(input())
for _ in [None] * case_t:
l = int(input())
print(*solve(l))