結果

問題 No.988 N×Mマス計算(総和)
ユーザー minimamu21
提出日時 2020-03-27 04:17:54
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 627 bytes
コンパイル時間 1,295 ms
コンパイル使用メモリ 169,404 KB
実行使用メモリ 813,812 KB
最終ジャッジ日時 2024-07-06 07:39:00
合計ジャッジ時間 4,200 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 4 WA * 4 RE * 1 MLE * 1 -- * 9
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
#define rep(i,n) for (int i=0; i<(n); ++i)
using namespace std;
using ll=long long;
int main(){
    int n,m,k;
    cin>>n>>m>>k;
    string op;
    cin>>op;
    vector<int>a(n);
    vector<int>b(m);
    ll c[n][m];
    ll sum=0;
    rep(i,m){
        cin>>b[i];
    }
    rep(i,n){
        cin>>a[i];
    }
    rep(i,n){
        rep(j,m){
            if(op=="+"){
                c[i][j]=(ll)a[i]+b[j];
            }
            else{
                c[i][j]=(ll)a[i]*b[j];
            }
        }
    }
    rep(i,n){
        rep(j,m){
            sum+=c[i][j];
        }
    }
    cout<<sum%k<<endl;
}
0