結果

問題 No.990 N×Mマス計算(Kの倍数)
ユーザー convexineqconvexineq
提出日時 2021-05-06 07:47:07
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 298 bytes
コンパイル時間 279 ms
コンパイル使用メモリ 87,144 KB
実行使用メモリ 77,324 KB
最終ジャッジ日時 2023-10-12 00:50:42
合計ジャッジ時間 5,168 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 85 ms
76,408 KB
testcase_01 AC 86 ms
71,572 KB
testcase_02 AC 90 ms
71,668 KB
testcase_03 AC 91 ms
77,324 KB
testcase_04 AC 86 ms
71,488 KB
testcase_05 AC 91 ms
77,164 KB
testcase_06 AC 84 ms
71,812 KB
testcase_07 AC 84 ms
71,840 KB
testcase_08 AC 91 ms
77,232 KB
testcase_09 AC 91 ms
77,068 KB
testcase_10 TLE -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import Counter as C
import math
n,m,k,o,*A = open(0).read().split()
m,k,*A = map(int,[m,k]+A)
f = lambda x:[math.gcd(k,x),x%k][o=="+"]
a = C(map(f,A[:m])).items()
b = C(map(f,A[m:]))
print([sum(v*w*(i*j%k==0) for j,w in b.items() for i,v in a),sum(v*b[-i%k] for i,v in a)][o=="+"])
0