結果

問題 No.988 N×Mマス計算(総和)
ユーザー rkyiolklorkyiolklo
提出日時 2020-04-21 09:57:53
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 271 ms / 2,000 ms
コード長 251 bytes
コンパイル時間 86 ms
コンパイル使用メモリ 10,604 KB
実行使用メモリ 23,204 KB
最終ジャッジ日時 2023-09-20 12:23:36
合計ジャッジ時間 2,833 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
7,812 KB
testcase_01 AC 15 ms
7,956 KB
testcase_02 AC 16 ms
8,004 KB
testcase_03 AC 16 ms
7,908 KB
testcase_04 AC 16 ms
7,856 KB
testcase_05 AC 15 ms
7,848 KB
testcase_06 AC 16 ms
7,848 KB
testcase_07 AC 15 ms
7,780 KB
testcase_08 AC 15 ms
7,960 KB
testcase_09 AC 16 ms
7,860 KB
testcase_10 AC 99 ms
11,852 KB
testcase_11 AC 74 ms
18,180 KB
testcase_12 AC 186 ms
21,032 KB
testcase_13 AC 78 ms
14,720 KB
testcase_14 AC 69 ms
14,708 KB
testcase_15 AC 125 ms
10,428 KB
testcase_16 AC 177 ms
17,188 KB
testcase_17 AC 217 ms
19,672 KB
testcase_18 AC 78 ms
17,104 KB
testcase_19 AC 181 ms
19,860 KB
testcase_20 AC 271 ms
23,204 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n,m,k=map(int,input().split())
c=list(map(str,input().split()))
a=[0]*(n)
for i in range(n):
    a[i]=int(input())
op=c[0]
b=[0]*m
for i in range(m):
    b[i]=int(c[i+1])
if op=='+':
    print((sum(a)*m+sum(b)*n)%k)
else:
    print(sum(a)*sum(b)%k)   
0