結果

問題 No.987 N×Mマス計算(基本)
ユーザー cosmosky
提出日時 2020-03-02 22:54:34
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 537 bytes
コンパイル時間 1,463 ms
コンパイル使用メモリ 168,596 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-10-13 21:21:17
合計ジャッジ時間 2,223 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 13 WA * 5
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;

int main(){
    int n,m;
    string s;
    cin >> n >> m >> s;
    vector<int> b(m);
    for(int i=0;i<m;i++){
        cin >> b.at(i);
    }
    for(int i=0;i<n;i++){
        int a;
        cin >> a;
        for(int j=0;j<m;j++){
            if(s=="+"){
                cout << a+b.at(j);
            }else{
                cout << a*b.at(j);
            }
            if(j==m-1){
                cout << endl;
            }else{
                cout << " ";
            }
        }
    }
}
0