結果

問題 No.2358 xy+yz+zx=N
ユーザー nikoro256nikoro256
提出日時 2023-06-23 22:31:56
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 581 bytes
コンパイル時間 324 ms
コンパイル使用メモリ 86,852 KB
実行使用メモリ 88,524 KB
最終ジャッジ日時 2023-09-14 10:13:05
合計ジャッジ時間 4,961 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 72 ms
71,280 KB
testcase_01 AC 76 ms
71,252 KB
testcase_02 AC 73 ms
71,352 KB
testcase_03 WA -
testcase_04 AC 72 ms
71,360 KB
testcase_05 WA -
testcase_06 AC 79 ms
71,648 KB
testcase_07 AC 112 ms
77,504 KB
testcase_08 AC 517 ms
87,580 KB
testcase_09 AC 520 ms
88,524 KB
testcase_10 AC 494 ms
81,692 KB
testcase_11 AC 503 ms
82,364 KB
testcase_12 AC 402 ms
79,384 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import math
N=int(input())
lis=[]
for x in range(math.ceil(math.sqrt(N))):
    for y in range(x,math.ceil(math.sqrt(N))):
        if x==0 and y==0:
            continue
        #print(x,y)
        z=-1
        if (N-x*y)>0 and (N-x*y)/(x+y)%1==0:
            z=(N-x*y)//(x+y)
        elif N-x*y==0:
            z=0
        if z!=-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))
lis=set(lis)
print(len(lis))
for l in lis:
    print(*l)
0