結果

問題 No.321 (P,Q)-サンタと街の子供たち
ユーザー ああいいああいい
提出日時 2022-03-02 12:02:44
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 380 bytes
コンパイル時間 554 ms
コンパイル使用メモリ 87,076 KB
実行使用メモリ 77,552 KB
最終ジャッジ日時 2023-09-23 05:48:46
合計ジャッジ時間 8,150 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 73 ms
71,196 KB
testcase_01 AC 73 ms
71,404 KB
testcase_02 AC 74 ms
71,388 KB
testcase_03 AC 74 ms
71,236 KB
testcase_04 WA -
testcase_05 AC 75 ms
71,028 KB
testcase_06 AC 74 ms
71,268 KB
testcase_07 AC 76 ms
71,012 KB
testcase_08 AC 76 ms
71,316 KB
testcase_09 AC 75 ms
71,068 KB
testcase_10 AC 76 ms
71,064 KB
testcase_11 WA -
testcase_12 AC 75 ms
71,328 KB
testcase_13 AC 76 ms
71,392 KB
testcase_14 WA -
testcase_15 AC 144 ms
77,196 KB
testcase_16 AC 117 ms
77,272 KB
testcase_17 AC 75 ms
71,308 KB
testcase_18 AC 124 ms
77,280 KB
testcase_19 WA -
testcase_20 AC 146 ms
77,252 KB
testcase_21 WA -
testcase_22 AC 108 ms
77,232 KB
testcase_23 AC 136 ms
77,076 KB
testcase_24 AC 112 ms
77,204 KB
testcase_25 WA -
testcase_26 AC 142 ms
77,324 KB
testcase_27 WA -
testcase_28 AC 133 ms
77,284 KB
testcase_29 AC 144 ms
77,272 KB
testcase_30 AC 100 ms
76,460 KB
testcase_31 AC 84 ms
71,252 KB
testcase_32 AC 121 ms
77,316 KB
testcase_33 WA -
testcase_34 AC 116 ms
77,320 KB
testcase_35 WA -
testcase_36 AC 99 ms
76,860 KB
testcase_37 AC 126 ms
77,352 KB
testcase_38 AC 125 ms
77,408 KB
testcase_39 WA -
testcase_40 AC 146 ms
77,380 KB
testcase_41 WA -
testcase_42 AC 137 ms
77,248 KB
testcase_43 AC 121 ms
77,364 KB
testcase_44 AC 134 ms
77,232 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 d == 0:
        if x == 0 and y == 0:ans += 1
        continue
    if x % d == 0 and y % d == 0:
        ans += 1
print(ans)
0