結果

問題 No.987 N×Mマス計算(基本)
ユーザー Ryuki87241978Ryuki87241978
提出日時 2022-01-05 12:57:12
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
RE  
実行時間 -
コード長 968 bytes
コンパイル時間 1,587 ms
コンパイル使用メモリ 164,976 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-04-23 17:08:26
合計ジャッジ時間 2,936 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
6,816 KB
testcase_01 AC 2 ms
6,944 KB
testcase_02 RE -
testcase_03 RE -
testcase_04 WA -
testcase_05 AC 2 ms
6,944 KB
testcase_06 AC 2 ms
6,944 KB
testcase_07 WA -
testcase_08 WA -
testcase_09 AC 1 ms
6,944 KB
testcase_10 RE -
testcase_11 AC 3 ms
6,940 KB
testcase_12 RE -
testcase_13 AC 2 ms
6,940 KB
testcase_14 AC 2 ms
6,940 KB
testcase_15 RE -
testcase_16 RE -
testcase_17 RE -
testcase_18 AC 3 ms
6,940 KB
testcase_19 AC 3 ms
6,940 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
#include <vector>
#include <iostream>
#include <map>
#include <string>
#include <cmath>
#include <algorithm>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
using ll = long long;
using P = pair<int, int>;

int main() {
    
    int N,M;
    char op;
    cin >> N >> M >> op;
    vector<ll> A(M);
    vector<ll> B(M);
    rep(i,M) {
        cin >> A[i];
    }
    rep(i,N) {
        cin >> B[i];
    }
    
    rep(i,N) {
        rep(j,M) {
            if(op == '+') {
                if(j == M-1) {
                    cout << A[j] + B[i];
                }
                else {
                    cout << A[j] + B[i] << " ";
                }
            }
            else {
                if(j == M-1) {
                    cout << A[j] * B[i];
                }
                else {
                    cout << A[j] * B[i] << " ";
                }
            }
        }
        cout << endl;
    }
    
}
0