結果

問題 No.1626 三角形の構築
ユーザー tamatotamato
提出日時 2021-07-23 22:56:21
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 897 bytes
コンパイル時間 524 ms
コンパイル使用メモリ 82,572 KB
実行使用メモリ 82,748 KB
最終ジャッジ日時 2024-04-20 15:57:17
合計ジャッジ時間 11,252 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 39 ms
65,780 KB
testcase_01 TLE -
testcase_02 AC 41 ms
59,976 KB
testcase_03 AC 48 ms
60,256 KB
testcase_04 AC 47 ms
59,848 KB
testcase_05 AC 46 ms
58,872 KB
testcase_06 AC 45 ms
59,552 KB
testcase_07 TLE -
testcase_08 TLE -
testcase_09 TLE -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
testcase_26 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

mod = 1000000007
eps = 10**-9
M = 10**6


def main():
    import sys
    input = sys.stdin.readline

    for _ in range(int(input())):
        S, T = map(int, input().split())
        if T & 1:
            print(0)
            continue
        t = T // 2
        U = S * S // t
        ans = []
        for A in range(1, M):
            if A ** 3 > U:
                break
            if U % A:
                continue
            for B in range(A, M):
                if A * B * B > U:
                    break
                if U % (A * B) == 0:
                    C = U // (A * B)
                    a = t - A
                    b = t - B
                    c = t - C
                    if a + b + c == T and a < b + c:
                        ans.append((a, b, c))
        print(len(ans))
        for a, b, c in ans:
            print(a, b, c)


if __name__ == '__main__':
    main()
0