結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 41 ms
51,584 KB
testcase_01 AC 45 ms
57,472 KB
testcase_02 AC 49 ms
58,240 KB
testcase_03 AC 48 ms
58,496 KB
testcase_04 AC 48 ms
58,368 KB
testcase_05 AC 51 ms
58,368 KB
testcase_06 AC 50 ms
58,496 KB
testcase_07 AC 71 ms
61,056 KB
testcase_08 AC 77 ms
62,720 KB
testcase_09 AC 71 ms
60,672 KB
testcase_10 AC 73 ms
61,184 KB
testcase_11 AC 70 ms
61,568 KB
testcase_12 AC 237 ms
69,760 KB
testcase_13 AC 230 ms
68,608 KB
testcase_14 AC 230 ms
68,736 KB
testcase_15 AC 234 ms
68,864 KB
testcase_16 AC 230 ms
68,864 KB
testcase_17 AC 687 ms
76,032 KB
testcase_18 AC 922 ms
76,032 KB
testcase_19 AC 260 ms
69,120 KB
testcase_20 AC 1,766 ms
76,160 KB
testcase_21 AC 1,664 ms
76,160 KB
testcase_22 AC 1,927 ms
76,032 KB
testcase_23 AC 1,670 ms
76,032 KB
testcase_24 AC 1,726 ms
76,208 KB
testcase_25 AC 1,643 ms
75,904 KB
testcase_26 AC 1,749 ms
75,904 KB
testcase_27 AC 40 ms
51,456 KB
testcase_28 AC 1,324 ms
76,032 KB
testcase_29 AC 3,596 ms
75,904 KB
testcase_30 AC 3,619 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)]):
                s += 2
                if p % s == 0:
                    bc = p // s
                    if bc & 1 == t & 1 and bc > t:
                        ans += 1
        d += 1
    print(ans)
0