結果

問題 No.990 N×Mマス計算(Kの倍数)
ユーザー convexineqconvexineq
提出日時 2021-05-06 06:18:07
言語 PyPy3
(7.3.15)
結果
RE  
実行時間 -
コード長 318 bytes
コンパイル時間 364 ms
コンパイル使用メモリ 86,988 KB
実行使用メモリ 108,464 KB
最終ジャッジ日時 2023-10-11 23:36:12
合計ジャッジ時間 5,373 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 RE -
testcase_01 AC 95 ms
71,700 KB
testcase_02 AC 94 ms
71,648 KB
testcase_03 RE -
testcase_04 AC 95 ms
72,044 KB
testcase_05 RE -
testcase_06 AC 96 ms
71,700 KB
testcase_07 AC 95 ms
71,960 KB
testcase_08 RE -
testcase_09 RE -
testcase_10 RE -
testcase_11 AC 154 ms
92,408 KB
testcase_12 AC 264 ms
107,012 KB
testcase_13 AC 134 ms
86,176 KB
testcase_14 RE -
testcase_15 RE -
testcase_16 RE -
testcase_17 RE -
testcase_18 AC 263 ms
106,796 KB
testcase_19 AC 171 ms
92,352 KB
testcase_20 RE -
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import Counter
from math import gcd
n,m,k,op,*ab = open(0).read().split()
m,k = int(m),int(k)
a = Counter(gcd(k,int(i)) for i in ab[:m])
b = Counter(gcd(k,int(i)) for i in ab[m:])
print(sum(db[-i%k] for i,v in a.items()) if op == "+" else sum(v*w*(i*j%k==0) for j,w in b.items() for i,v in a.items()))
0