結果

問題 No.988 N×Mマス計算(総和)
ユーザー hiragnhiragn
提出日時 2022-11-10 22:23:37
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 221 ms / 2,000 ms
コード長 328 bytes
コンパイル時間 94 ms
コンパイル使用メモリ 10,600 KB
実行使用メモリ 23,120 KB
最終ジャッジ日時 2023-10-01 05:48:26
合計ジャッジ時間 3,370 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
7,716 KB
testcase_01 AC 16 ms
7,740 KB
testcase_02 AC 16 ms
7,908 KB
testcase_03 AC 16 ms
7,908 KB
testcase_04 AC 16 ms
7,780 KB
testcase_05 AC 16 ms
7,784 KB
testcase_06 AC 15 ms
7,748 KB
testcase_07 AC 16 ms
7,760 KB
testcase_08 AC 16 ms
7,740 KB
testcase_09 AC 15 ms
7,784 KB
testcase_10 AC 89 ms
12,216 KB
testcase_11 AC 47 ms
19,000 KB
testcase_12 AC 152 ms
21,272 KB
testcase_13 AC 60 ms
15,208 KB
testcase_14 AC 52 ms
14,992 KB
testcase_15 AC 112 ms
10,628 KB
testcase_16 AC 149 ms
17,492 KB
testcase_17 AC 178 ms
19,788 KB
testcase_18 AC 53 ms
17,924 KB
testcase_19 AC 146 ms
19,984 KB
testcase_20 AC 221 ms
23,120 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def main():
    n, m, k = map(int, input().split())
    arr = input().split()
    op = arr[0]
    b = list(map(int, arr[1:]))
    a = [int(input()) for _ in range(n)]

    if op == '*':
        print((sum(a) % k) * (sum(b) % k) % k)
    else:
        print((sum(a) * m + sum(b) * n) % k)


if __name__ == "__main__":
    main()
0