結果

問題 No.988 N×Mマス計算(総和)
ユーザー nohakai3nohakai3
提出日時 2022-07-24 17:50:45
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 265 ms / 2,000 ms
コード長 266 bytes
コンパイル時間 135 ms
コンパイル使用メモリ 10,632 KB
実行使用メモリ 23,988 KB
最終ジャッジ日時 2023-09-20 17:39:46
合計ジャッジ時間 3,891 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
7,864 KB
testcase_01 AC 17 ms
7,836 KB
testcase_02 AC 16 ms
7,824 KB
testcase_03 AC 16 ms
7,856 KB
testcase_04 AC 15 ms
7,832 KB
testcase_05 AC 15 ms
7,884 KB
testcase_06 AC 16 ms
7,924 KB
testcase_07 AC 15 ms
7,860 KB
testcase_08 AC 15 ms
7,844 KB
testcase_09 AC 15 ms
7,812 KB
testcase_10 AC 96 ms
11,984 KB
testcase_11 AC 68 ms
18,768 KB
testcase_12 AC 181 ms
21,800 KB
testcase_13 AC 75 ms
15,372 KB
testcase_14 AC 66 ms
14,964 KB
testcase_15 AC 129 ms
10,532 KB
testcase_16 AC 180 ms
17,352 KB
testcase_17 AC 213 ms
20,260 KB
testcase_18 AC 72 ms
18,036 KB
testcase_19 AC 178 ms
20,536 KB
testcase_20 AC 265 ms
23,988 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n,m,k=map(int,input().split())
l1=list(map(str,input().split()))
l2=[]
for i in range(n):
    s=int(input())
    l2.append(s)

l4=l1[1:]

l3=[]
for x in l4:
    l3.append(int(x))

if l1[0]=="+":
    print((m*sum(l2)+n*sum(l3))%k)
else:
    print((sum(l2)*sum(l3))%k)
0