結果

問題 No.2358 xy+yz+zx=N
ユーザー とろちゃとろちゃ
提出日時 2023-06-23 22:47:04
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 1,014 bytes
コンパイル時間 305 ms
コンパイル使用メモリ 87,172 KB
実行使用メモリ 78,652 KB
最終ジャッジ日時 2023-09-14 10:14:41
合計ジャッジ時間 7,346 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 72 ms
71,436 KB
testcase_01 AC 72 ms
71,620 KB
testcase_02 AC 76 ms
76,068 KB
testcase_03 AC 73 ms
71,376 KB
testcase_04 WA -
testcase_05 AC 73 ms
71,504 KB
testcase_06 AC 93 ms
76,864 KB
testcase_07 TLE -
testcase_08 TLE -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

# import pypyjit;pypyjit.set_param("max_unroll_recursion=-1")
# from bisect import *
# from collections import *
# from heapq import *
from itertools import *

# from math import *
# from datetime import *
# from decimal import*
# from string import ascii_lowercase,ascii_uppercase
# import numpy as np
import sys
import os

# sys.setrecursionlimit(10**6)
INF = 10**18
MOD = 998244353
# MOD = 10**9 + 7
File = open("input.txt", "r") if os.path.exists("input.txt") else sys.stdin


def input():
    return File.readline()[:-1]


# ///////////////////////////////////////////////////////////////////////////


N = int(input())
ans = set()
for x in range(N + 1):
    for y in range(x + 1, N + 1):
        if x * y > N:
            continue
        try:
            z = (N - x * y) / (x + y)
        except:
            continue
        if z.is_integer() and z >= 0:
            ans.add((x, y, int(z)))

for i in list(ans):
    for j in permutations(i):
        ans.add(j)

print(len(ans))
for i in ans:
    print(*i)
0