結果

問題 No.321 (P,Q)-サンタと街の子供たち
ユーザー ayaoniayaoni
提出日時 2020-11-26 19:27:59
言語 PyPy3
(7.3.15)
結果
RE  
実行時間 -
コード長 394 bytes
コンパイル時間 283 ms
コンパイル使用メモリ 87,128 KB
実行使用メモリ 79,324 KB
最終ジャッジ日時 2023-10-01 03:28:14
合計ジャッジ時間 7,906 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 RE -
testcase_01 AC 72 ms
71,404 KB
testcase_02 AC 71 ms
71,288 KB
testcase_03 AC 71 ms
71,408 KB
testcase_04 AC 73 ms
71,208 KB
testcase_05 RE -
testcase_06 AC 71 ms
71,396 KB
testcase_07 AC 74 ms
71,188 KB
testcase_08 AC 71 ms
71,484 KB
testcase_09 AC 72 ms
71,408 KB
testcase_10 AC 71 ms
71,236 KB
testcase_11 AC 70 ms
71,240 KB
testcase_12 AC 71 ms
71,328 KB
testcase_13 AC 72 ms
71,780 KB
testcase_14 AC 103 ms
77,116 KB
testcase_15 AC 111 ms
77,312 KB
testcase_16 AC 94 ms
77,224 KB
testcase_17 AC 72 ms
71,240 KB
testcase_18 AC 96 ms
77,436 KB
testcase_19 AC 104 ms
77,408 KB
testcase_20 AC 112 ms
77,136 KB
testcase_21 AC 99 ms
77,180 KB
testcase_22 AC 87 ms
76,828 KB
testcase_23 AC 104 ms
76,856 KB
testcase_24 AC 90 ms
77,284 KB
testcase_25 AC 98 ms
77,000 KB
testcase_26 AC 109 ms
77,400 KB
testcase_27 AC 104 ms
77,404 KB
testcase_28 AC 103 ms
77,400 KB
testcase_29 AC 109 ms
77,020 KB
testcase_30 AC 80 ms
76,948 KB
testcase_31 AC 72 ms
71,136 KB
testcase_32 AC 96 ms
76,804 KB
testcase_33 AC 101 ms
77,064 KB
testcase_34 AC 93 ms
77,048 KB
testcase_35 AC 107 ms
77,392 KB
testcase_36 AC 82 ms
76,492 KB
testcase_37 AC 102 ms
76,852 KB
testcase_38 AC 96 ms
77,248 KB
testcase_39 AC 87 ms
76,396 KB
testcase_40 AC 110 ms
76,996 KB
testcase_41 AC 91 ms
77,332 KB
testcase_42 AC 108 ms
77,060 KB
testcase_43 AC 97 ms
77,288 KB
testcase_44 AC 105 ms
76,912 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
from math import gcd
def I(): return int(sys.stdin.readline().rstrip())
def MI(): return map(int,sys.stdin.readline().rstrip().split())


P,Q = MI()
g = gcd(P,Q)

N = I()
ans = 0
for _ in range(N):
    X,Y = MI()
    if X % g == Y % g == 0:
        if (P//g+Q//g) % 2 == 0:
            if (X//g+Y//g) % 2 == 0:
                ans += 1
        else:
            ans += 1

print(ans)
0