結果

問題 No.988 N×Mマス計算(総和)
ユーザー DrumatoDrumato
提出日時 2020-02-14 22:12:38
言語 Python3
(3.11.6 + numpy 1.26.0 + scipy 1.11.3)
結果
AC  
実行時間 254 ms / 2,000 ms
コード長 348 bytes
コンパイル時間 93 ms
コンパイル使用メモリ 10,644 KB
実行使用メモリ 19,204 KB
最終ジャッジ日時 2023-09-20 11:58:26
合計ジャッジ時間 2,703 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
7,876 KB
testcase_01 AC 16 ms
7,784 KB
testcase_02 AC 15 ms
7,924 KB
testcase_03 AC 15 ms
7,876 KB
testcase_04 AC 16 ms
7,940 KB
testcase_05 AC 15 ms
7,924 KB
testcase_06 AC 16 ms
7,808 KB
testcase_07 AC 15 ms
7,784 KB
testcase_08 AC 15 ms
7,812 KB
testcase_09 AC 15 ms
7,924 KB
testcase_10 AC 84 ms
10,512 KB
testcase_11 AC 50 ms
18,208 KB
testcase_12 AC 146 ms
18,608 KB
testcase_13 AC 71 ms
14,176 KB
testcase_14 AC 52 ms
14,180 KB
testcase_15 AC 121 ms
10,500 KB
testcase_16 AC 169 ms
14,492 KB
testcase_17 AC 204 ms
16,568 KB
testcase_18 AC 55 ms
16,776 KB
testcase_19 AC 168 ms
17,360 KB
testcase_20 AC 254 ms
19,204 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n, m, k = map(int, input().split())
op, *b = input().split()
b = [int(x) for x in b]
a = [int(input()) for _ in range(n)]

res = 0
if op == '+':
    for be in b:
        res += be * n
    for ae in a:
        res += ae * m
else:
    res = 0
    aa = sum(a)
    bb = sum(b)
    #for ae in a:
        #res += ae * bb
    res = aa * bb

print(res % k)
0