結果

問題 No.2358 xy+yz+zx=N
ユーザー やでな@競プロやでな@競プロ
提出日時 2023-10-09 14:55:15
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 673 bytes
コンパイル時間 338 ms
コンパイル使用メモリ 87,128 KB
実行使用メモリ 83,640 KB
最終ジャッジ日時 2023-10-09 14:55:20
合計ジャッジ時間 5,052 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 72 ms
72,040 KB
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 AC 181 ms
79,116 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())

ans = 0
lis = []

for x in range(int(n**(0.5))+2):
    for y in range(x,int(n**(0.5))+2):
        ue = n-x*y
        if ue >= 0:
            shita = x+y
            if x == y == 0:
                continue
            if (n-x*y)%(x+y) == 0:
                z = (n-(x*y))//(x+y)
                if x <= y <= z:
                    #print(x,y,z)
                    ans += 1
                    lis.append([x,y,z])
                    lis.append([x,z,y])
                    lis.append([y,x,z])
                    lis.append([y,z,x])
                    lis.append([z,x,y])
                    lis.append([z,y,x])
print(6*ans)
for li in lis:
    print(*li)
0