結果
| 問題 |
No.990 N×Mマス計算(Kの倍数)
|
| コンテスト | |
| ユーザー |
convexineq
|
| 提出日時 | 2021-05-06 07:47:07 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 298 bytes |
| コンパイル時間 | 221 ms |
| コンパイル使用メモリ | 82,232 KB |
| 実行使用メモリ | 109,520 KB |
| 最終ジャッジ日時 | 2024-09-14 00:43:31 |
| 合計ジャッジ時間 | 4,474 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 8 TLE * 1 -- * 10 |
ソースコード
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=="+"])
convexineq