結果

問題 No.2125 Inverse Sum
ユーザー flygonflygon
提出日時 2022-11-18 23:29:20
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 370 bytes
コンパイル時間 177 ms
コンパイル使用メモリ 81,632 KB
実行使用メモリ 70,896 KB
最終ジャッジ日時 2023-10-20 08:28:01
合計ジャッジ時間 2,597 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 38 ms
53,376 KB
testcase_01 AC 38 ms
53,576 KB
testcase_02 AC 39 ms
53,576 KB
testcase_03 AC 38 ms
53,576 KB
testcase_04 AC 38 ms
53,576 KB
testcase_05 WA -
testcase_06 AC 41 ms
57,280 KB
testcase_07 AC 40 ms
57,280 KB
testcase_08 AC 41 ms
57,280 KB
testcase_09 AC 43 ms
57,280 KB
testcase_10 AC 40 ms
57,280 KB
testcase_11 WA -
testcase_12 AC 38 ms
53,576 KB
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 AC 41 ms
57,280 KB
testcase_24 WA -
testcase_25 AC 40 ms
57,280 KB
testcase_26 AC 38 ms
53,376 KB
testcase_27 WA -
testcase_28 WA -
testcase_29 WA -
testcase_30 AC 38 ms
53,576 KB
testcase_31 WA -
testcase_32 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

p,q = map(int,input().split())

def fact(n):
  l = set()
  for i in range(1,int(pow(n,0.5))+1):
    if n % i == 0:
      l.add(i)
      l.add(n//i)
  return l


f = fact(q)

qq = q*q

ans = set()
for i in f:
  j = qq//i
  i += q
  j += q
  if i % p == 0 and j % p == 0:  
    ans.add((i//p, j//p))
    ans.add((j//p,i//p))

print(len(ans))
for i, j in ans:
  print(i,j)
0