結果

問題 No.321 (P,Q)-サンタと街の子供たち
ユーザー fumofumofunifumofumofuni
提出日時 2021-09-14 01:21:23
言語 PyPy3
(7.3.15)
結果
RE  
実行時間 -
コード長 342 bytes
コンパイル時間 395 ms
コンパイル使用メモリ 87,068 KB
実行使用メモリ 79,316 KB
最終ジャッジ日時 2023-09-08 10:08:50
合計ジャッジ時間 9,445 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 RE -
testcase_01 AC 74 ms
71,524 KB
testcase_02 AC 74 ms
71,344 KB
testcase_03 AC 74 ms
71,464 KB
testcase_04 AC 76 ms
71,488 KB
testcase_05 RE -
testcase_06 AC 74 ms
71,432 KB
testcase_07 AC 74 ms
71,260 KB
testcase_08 AC 75 ms
71,412 KB
testcase_09 AC 77 ms
71,540 KB
testcase_10 AC 77 ms
71,428 KB
testcase_11 AC 78 ms
71,464 KB
testcase_12 AC 76 ms
71,564 KB
testcase_13 AC 76 ms
71,644 KB
testcase_14 AC 136 ms
77,804 KB
testcase_15 AC 153 ms
77,520 KB
testcase_16 AC 133 ms
77,548 KB
testcase_17 AC 76 ms
71,604 KB
testcase_18 AC 144 ms
77,908 KB
testcase_19 AC 157 ms
78,052 KB
testcase_20 AC 164 ms
77,784 KB
testcase_21 AC 142 ms
77,460 KB
testcase_22 AC 118 ms
77,652 KB
testcase_23 AC 146 ms
77,732 KB
testcase_24 AC 135 ms
77,616 KB
testcase_25 AC 137 ms
77,728 KB
testcase_26 AC 162 ms
77,856 KB
testcase_27 AC 160 ms
77,908 KB
testcase_28 AC 157 ms
77,940 KB
testcase_29 AC 153 ms
77,512 KB
testcase_30 AC 103 ms
77,024 KB
testcase_31 AC 82 ms
71,368 KB
testcase_32 AC 130 ms
77,624 KB
testcase_33 AC 149 ms
78,016 KB
testcase_34 AC 135 ms
78,008 KB
testcase_35 AC 146 ms
77,712 KB
testcase_36 AC 100 ms
77,008 KB
testcase_37 AC 146 ms
77,784 KB
testcase_38 AC 139 ms
77,752 KB
testcase_39 AC 123 ms
77,912 KB
testcase_40 AC 161 ms
77,792 KB
testcase_41 AC 125 ms
77,972 KB
testcase_42 AC 154 ms
77,976 KB
testcase_43 AC 138 ms
77,776 KB
testcase_44 AC 150 ms
77,856 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import math
P,Q=map(int,input().split())
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