結果

問題 No.988 N×Mマス計算(総和)
ユーザー 67oYG9nh2YMmIci67oYG9nh2YMmIci
提出日時 2020-07-21 18:30:24
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 273 ms / 2,000 ms
コード長 383 bytes
コンパイル時間 87 ms
コンパイル使用メモリ 10,928 KB
実行使用メモリ 19,304 KB
最終ジャッジ日時 2023-09-20 12:43:57
合計ジャッジ時間 2,858 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
7,928 KB
testcase_01 AC 15 ms
7,800 KB
testcase_02 AC 15 ms
7,776 KB
testcase_03 AC 15 ms
7,772 KB
testcase_04 AC 16 ms
7,960 KB
testcase_05 AC 16 ms
7,788 KB
testcase_06 AC 16 ms
7,824 KB
testcase_07 AC 16 ms
7,880 KB
testcase_08 AC 16 ms
7,932 KB
testcase_09 AC 15 ms
7,772 KB
testcase_10 AC 104 ms
11,264 KB
testcase_11 AC 65 ms
15,428 KB
testcase_12 AC 187 ms
17,528 KB
testcase_13 AC 76 ms
12,928 KB
testcase_14 AC 65 ms
12,856 KB
testcase_15 AC 134 ms
10,496 KB
testcase_16 AC 185 ms
14,728 KB
testcase_17 AC 225 ms
16,848 KB
testcase_18 AC 71 ms
14,676 KB
testcase_19 AC 184 ms
16,608 KB
testcase_20 AC 273 ms
19,304 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N,M,K=map(int,input().split())
A=[]
B=[i for i in input().split()]
C=0
a=0
b=0
for i in range(N):
    t=int(input())
    A.append(t)
if B[0]=="+":
    for i in range(N):
        a+=A[i]
    for j in range(1,M+1):
        b+=int(B[j])
    C=(M*a)+(N*b)

elif B[0]=="*":
    for i in range(N):
        a += A[i]
    for j in range(1, M + 1):
        b += int(B[j])
    C=a*b
print(C%K)
0