結果
問題 | No.990 N×Mマス計算(Kの倍数) |
ユーザー | convexineq |
提出日時 | 2021-05-06 06:23:41 |
言語 | PyPy3 (7.3.15) |
結果 |
TLE
|
実行時間 | - |
コード長 | 348 bytes |
コンパイル時間 | 450 ms |
コンパイル使用メモリ | 87,128 KB |
実行使用メモリ | 125,276 KB |
最終ジャッジ日時 | 2023-10-11 23:41:10 |
合計ジャッジ時間 | 6,482 ms |
ジャッジサーバーID (参考情報) |
judge12 / judge15 |
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 92 ms
75,776 KB |
testcase_01 | AC | 98 ms
71,376 KB |
testcase_02 | AC | 106 ms
77,256 KB |
testcase_03 | AC | 96 ms
71,384 KB |
testcase_04 | AC | 93 ms
71,504 KB |
testcase_05 | AC | 96 ms
71,408 KB |
testcase_06 | AC | 94 ms
71,384 KB |
testcase_07 | AC | 105 ms
77,316 KB |
testcase_08 | AC | 94 ms
71,856 KB |
testcase_09 | AC | 96 ms
71,568 KB |
testcase_10 | AC | 163 ms
98,236 KB |
testcase_11 | AC | 141 ms
92,276 KB |
testcase_12 | TLE | - |
testcase_13 | -- | - |
testcase_14 | -- | - |
testcase_15 | -- | - |
testcase_16 | -- | - |
testcase_17 | -- | - |
testcase_18 | -- | - |
testcase_19 | -- | - |
testcase_20 | -- | - |
ソースコード
from collections import Counter import math n,m,k,op,*ab = open(0).read().split() m,k = int(m),int(k) f = math.gcd if op=="x" else lambda x,y:y%x a = Counter(f(k,int(i)) for i in ab[:m]) b = Counter(f(k,int(i)) for i in ab[m:]) print(sum(b[-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()))