結果

問題 No.987 N×Mマス計算(基本)
ユーザー Ryuki87241978Ryuki87241978
提出日時 2022-02-02 10:21:48
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 1,135 bytes
コンパイル時間 3,732 ms
コンパイル使用メモリ 202,552 KB
実行使用メモリ 4,384 KB
最終ジャッジ日時 2023-09-02 02:41:54
合計ジャッジ時間 4,660 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

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

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

}
0