結果

問題 No.988 N×Mマス計算(総和)
コンテスト
ユーザー cologne
提出日時 2025-11-25 17:54:06
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 97 ms / 2,000 ms
コード長 366 bytes
コンパイル時間 455 ms
コンパイル使用メモリ 82,720 KB
実行使用メモリ 96,168 KB
最終ジャッジ日時 2025-11-25 17:54:10
合計ジャッジ時間 3,372 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 19
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code


import sys


def input(): return sys.stdin.readline().rstrip('\n')


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

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


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