結果
問題 |
No.1200 お菓子配り-3
|
ユーザー |
![]() |
提出日時 | 2020-08-28 22:04:43 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 491 bytes |
コンパイル時間 | 216 ms |
コンパイル使用メモリ | 82,268 KB |
実行使用メモリ | 76,512 KB |
最終ジャッジ日時 | 2024-11-14 14:56:37 |
合計ジャッジ時間 | 25,730 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 29 WA * 2 |
ソースコード
for _ in range(int(input())): x, y = map(int, input().split()) if x < y: x, y = y, x p = x + y q = x - y d = 1 ans = 0 while d * d <= q: if q % d == 0: d2 = q // d for s, t in ([(d, d2), (d2, d)] if d != d2 else [(d, d2)]): s += 2 if p % s == 0: bc = p // s if bc & 1 == t & 1 and bc > t: ans += 1 d += 1 print(ans)