結果

問題 No.321 (P,Q)-サンタと街の子供たち
ユーザー fumofumofunifumofumofuni
提出日時 2021-09-14 01:22:10
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 377 bytes
コンパイル時間 995 ms
コンパイル使用メモリ 86,688 KB
実行使用メモリ 77,988 KB
最終ジャッジ日時 2023-09-08 10:09:40
合計ジャッジ時間 7,928 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 70 ms
71,268 KB
testcase_02 AC 68 ms
71,168 KB
testcase_03 AC 70 ms
71,248 KB
testcase_04 AC 71 ms
71,248 KB
testcase_05 WA -
testcase_06 AC 70 ms
71,396 KB
testcase_07 AC 69 ms
71,332 KB
testcase_08 AC 69 ms
71,284 KB
testcase_09 AC 70 ms
71,360 KB
testcase_10 AC 70 ms
71,424 KB
testcase_11 AC 70 ms
71,180 KB
testcase_12 AC 70 ms
71,188 KB
testcase_13 AC 72 ms
71,248 KB
testcase_14 AC 138 ms
77,700 KB
testcase_15 AC 147 ms
77,320 KB
testcase_16 AC 122 ms
77,304 KB
testcase_17 AC 71 ms
71,080 KB
testcase_18 AC 135 ms
77,564 KB
testcase_19 AC 145 ms
77,708 KB
testcase_20 AC 155 ms
77,660 KB
testcase_21 AC 138 ms
77,292 KB
testcase_22 AC 112 ms
77,460 KB
testcase_23 AC 138 ms
77,424 KB
testcase_24 AC 124 ms
77,592 KB
testcase_25 AC 130 ms
77,448 KB
testcase_26 AC 156 ms
77,448 KB
testcase_27 AC 149 ms
77,444 KB
testcase_28 AC 145 ms
77,604 KB
testcase_29 AC 145 ms
77,504 KB
testcase_30 AC 97 ms
76,776 KB
testcase_31 AC 80 ms
71,360 KB
testcase_32 AC 124 ms
77,244 KB
testcase_33 AC 144 ms
77,624 KB
testcase_34 AC 130 ms
77,760 KB
testcase_35 AC 145 ms
77,356 KB
testcase_36 AC 97 ms
76,784 KB
testcase_37 AC 142 ms
77,452 KB
testcase_38 AC 144 ms
77,452 KB
testcase_39 AC 126 ms
77,216 KB
testcase_40 AC 167 ms
77,416 KB
testcase_41 AC 121 ms
77,576 KB
testcase_42 AC 148 ms
77,780 KB
testcase_43 AC 133 ms
77,520 KB
testcase_44 AC 146 ms
77,988 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import math
P,Q=map(int,input().split())
if P+Q==0:
    print(0)
    exit()
N=int(input())
res=0
g=math.gcd(P,Q)
P//=g
Q//=g
for i in range(N):
    X,Y=map(int,input().split())
    X=abs(X)
    Y=abs(Y)
    if X%g==0 and Y%g==0:
        X//=g
        Y//=g
        if P%2 and Q%2:
            if (X+Y)%2==0:
                res+=1
        else:
            res+=1
print(res)


0