結果

問題 No.987 N×Mマス計算(基本)
ユーザー tokutaro
提出日時 2020-03-21 06:25:50
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 555 bytes
コンパイル時間 628 ms
コンパイル使用メモリ 70,220 KB
実行使用メモリ 6,824 KB
最終ジャッジ日時 2024-12-17 17:17:09
合計ジャッジ時間 1,289 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 13 WA * 5
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <vector>
#define REP(i, n) for (int i = 0; i < n; i++)
using namespace std;

int main() {
    int N, M;
    cin >> N >> M;
    string op;
    cin >> op;
    vector<int> yoko;
    REP(i, M) {
        int j;
        cin >> j;
        yoko.push_back(j);
    }
    REP(i, N) {
        int k;
        cin >> k;
        REP(j, M) {
            if (op == "*") cout << k * yoko.at(j);
            else if (op == "+") cout << k + yoko.at(j);
            if (j < M - 1) cout << " ";
        }
        cout << endl;
    }
    return 0;
}
0