結果

問題 No.2358 xy+yz+zx=N
ユーザー Nikkuniku029Nikkuniku029
提出日時 2023-06-24 11:09:01
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 517 bytes
コンパイル時間 270 ms
コンパイル使用メモリ 87,212 KB
実行使用メモリ 85,728 KB
最終ジャッジ日時 2023-09-14 10:18:37
合計ジャッジ時間 3,697 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 79 ms
71,264 KB
testcase_01 AC 74 ms
71,176 KB
testcase_02 AC 76 ms
71,384 KB
testcase_03 WA -
testcase_04 AC 77 ms
71,492 KB
testcase_05 AC 81 ms
71,228 KB
testcase_06 AC 80 ms
76,000 KB
testcase_07 AC 103 ms
77,480 KB
testcase_08 AC 331 ms
85,176 KB
testcase_09 AC 334 ms
85,728 KB
testcase_10 AC 296 ms
80,696 KB
testcase_11 AC 306 ms
81,800 KB
testcase_12 AC 251 ms
79,120 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
S = set()
for x in range(N):
    if x**2 > N:
        break
    for y in range(N):
        if y**2 > N:
            break
        if x == 0 and y == 0:
            continue
        if (N-x*y) % (x+y) == 0:
            z = (N-x*y)//(x+y)
            if z >= 0:
                S.add((x, y, z))
                S.add((x, z, y))
                S.add((y, x, z))
                S.add((y, z, x))
                S.add((z, y, x))
                S.add((z, x, y))


print(len(S))
for c in S:
    print(*c)
0