結果

問題 No.2358 xy+yz+zx=N
ユーザー convexineqconvexineq
提出日時 2023-06-23 23:04:04
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 270 ms / 2,000 ms
コード長 323 bytes
コンパイル時間 299 ms
コンパイル使用メモリ 86,872 KB
実行使用メモリ 83,996 KB
最終ジャッジ日時 2023-09-14 10:15:28
合計ジャッジ時間 4,479 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 199 ms
76,536 KB
testcase_01 AC 192 ms
76,252 KB
testcase_02 AC 204 ms
76,632 KB
testcase_03 AC 203 ms
76,660 KB
testcase_04 AC 195 ms
76,644 KB
testcase_05 AC 195 ms
76,412 KB
testcase_06 AC 192 ms
76,568 KB
testcase_07 AC 188 ms
77,352 KB
testcase_08 AC 270 ms
83,328 KB
testcase_09 AC 265 ms
83,996 KB
testcase_10 AC 253 ms
80,056 KB
testcase_11 AC 261 ms
80,396 KB
testcase_12 AC 250 ms
79,004 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
m = 4000
r = []
for x in range(0,m):
    for y in range(x,m):
        if x==y==0: continue
        p = n - x*y
        q = x+y
        if p%q: continue
        z = p//q
        if z < y: break
        r += list(set([(x,y,z),(y,z,x),(z,x,y),(z,y,x),(y,x,z),(x,z,y)]))
print(len(r))
for i in r:
    print(*i)
0