結果

問題 No.990 N×Mマス計算(Kの倍数)
ユーザー rkyiolklorkyiolklo
提出日時 2020-04-21 10:28:30
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 366 bytes
コンパイル時間 472 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 56,500 KB
最終ジャッジ日時 2024-04-16 18:02:42
合計ジャッジ時間 11,084 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 541 ms
49,076 KB
testcase_01 WA -
testcase_02 WA -
testcase_03 AC 548 ms
43,508 KB
testcase_04 AC 550 ms
44,196 KB
testcase_05 AC 536 ms
43,104 KB
testcase_06 AC 546 ms
43,960 KB
testcase_07 WA -
testcase_08 AC 546 ms
44,016 KB
testcase_09 AC 543 ms
43,784 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 #

N, M, K = map(int, input().split())
op, *B = input().split()
A = [int(input())%K for _ in range(N)]
b = list(map(int, B))
import numpy as np
B = [0]*M
for i in range(M):
    B[i]=b[i]%K


if op=='+':
    cnt=0
    for i in range(N):
        cnt+=max(0,B.count(K-A[i]))
else:
    cnt=(N-(max(0,A.count(0))))*(M-(max(0,B.count(0))))
    cnt=N*M-cnt
        
print(cnt)
0