結果

問題 No.321 (P,Q)-サンタと街の子供たち
ユーザー ああいいああいい
提出日時 2022-03-02 12:01:58
言語 PyPy3
(7.3.15)
結果
RE  
実行時間 -
コード長 310 bytes
コンパイル時間 1,643 ms
コンパイル使用メモリ 86,648 KB
実行使用メモリ 78,704 KB
最終ジャッジ日時 2023-09-23 05:48:29
合計ジャッジ時間 10,627 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 RE -
testcase_01 AC 88 ms
70,904 KB
testcase_02 AC 86 ms
71,208 KB
testcase_03 AC 82 ms
70,984 KB
testcase_04 WA -
testcase_05 RE -
testcase_06 AC 82 ms
71,000 KB
testcase_07 AC 86 ms
70,924 KB
testcase_08 AC 82 ms
71,116 KB
testcase_09 AC 84 ms
70,972 KB
testcase_10 AC 81 ms
71,060 KB
testcase_11 WA -
testcase_12 AC 80 ms
71,268 KB
testcase_13 AC 87 ms
71,160 KB
testcase_14 WA -
testcase_15 AC 154 ms
77,028 KB
testcase_16 AC 129 ms
77,104 KB
testcase_17 AC 87 ms
71,124 KB
testcase_18 AC 134 ms
77,176 KB
testcase_19 WA -
testcase_20 AC 161 ms
77,084 KB
testcase_21 WA -
testcase_22 AC 117 ms
77,116 KB
testcase_23 AC 154 ms
76,760 KB
testcase_24 AC 124 ms
77,048 KB
testcase_25 WA -
testcase_26 AC 166 ms
77,156 KB
testcase_27 WA -
testcase_28 AC 143 ms
77,032 KB
testcase_29 AC 163 ms
77,116 KB
testcase_30 AC 114 ms
76,740 KB
testcase_31 AC 93 ms
70,972 KB
testcase_32 AC 147 ms
77,052 KB
testcase_33 WA -
testcase_34 AC 126 ms
77,148 KB
testcase_35 WA -
testcase_36 AC 111 ms
76,504 KB
testcase_37 AC 148 ms
77,076 KB
testcase_38 AC 141 ms
77,112 KB
testcase_39 WA -
testcase_40 AC 154 ms
77,304 KB
testcase_41 WA -
testcase_42 AC 150 ms
76,980 KB
testcase_43 AC 131 ms
77,144 KB
testcase_44 AC 152 ms
77,272 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

def gcd(a,b):
    if b == 0:return a
    while True:
        r =a % b
        a = b
        b = r
        if r == 0:return a
ans = 0
d = gcd(p,q)
for _ in range(N):
    x,y = map(int,input().split())
    if x % d == 0 and y % d == 0:
        ans += 1
print(ans)
0