結果

問題 No.1200 お菓子配り-3
ユーザー KudeKude
提出日時 2020-08-28 22:01:29
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 491 bytes
コンパイル時間 376 ms
コンパイル使用メモリ 82,432 KB
実行使用メモリ 76,416 KB
最終ジャッジ日時 2024-04-26 22:56:21
合計ジャッジ時間 25,912 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 39 ms
51,712 KB
testcase_01 AC 44 ms
57,472 KB
testcase_02 AC 48 ms
57,856 KB
testcase_03 AC 49 ms
57,856 KB
testcase_04 AC 48 ms
57,856 KB
testcase_05 AC 49 ms
58,624 KB
testcase_06 AC 47 ms
58,496 KB
testcase_07 AC 72 ms
60,800 KB
testcase_08 AC 76 ms
61,440 KB
testcase_09 AC 70 ms
60,800 KB
testcase_10 AC 70 ms
60,928 KB
testcase_11 AC 70 ms
61,568 KB
testcase_12 AC 228 ms
69,120 KB
testcase_13 AC 230 ms
69,376 KB
testcase_14 AC 231 ms
68,864 KB
testcase_15 AC 233 ms
69,248 KB
testcase_16 AC 229 ms
68,736 KB
testcase_17 AC 646 ms
74,624 KB
testcase_18 AC 957 ms
76,032 KB
testcase_19 AC 264 ms
69,632 KB
testcase_20 AC 1,766 ms
76,416 KB
testcase_21 AC 1,663 ms
76,288 KB
testcase_22 AC 1,944 ms
76,416 KB
testcase_23 AC 1,672 ms
76,160 KB
testcase_24 AC 1,647 ms
75,904 KB
testcase_25 AC 1,640 ms
76,288 KB
testcase_26 AC 1,756 ms
76,288 KB
testcase_27 AC 40 ms
51,712 KB
testcase_28 AC 1,327 ms
76,416 KB
testcase_29 AC 3,566 ms
76,032 KB
testcase_30 AC 3,562 ms
75,904 KB
testcase_31 WA -
testcase_32 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

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)]):
                bc = p // (s + 2)
                if p % (s + 2) == 0 and bc & 1 == t & 1 and bc > t:
                    #print(s, t, p, q)
                    ans += 1
        d += 1
    print(ans)
0