結果

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

ソースコード

diff #

#include <bits/stdc++.h>

using namespace std;

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int N, M;
  cin >> N >> M;
  char op;
  cin >> op;
  vector<int64_t> B(M);
  for (int64_t &b : B) {
    cin >> b;
  }
  for (int i = 0; i < N; i++) {
    int64_t a;
    cin >> a;
    for (int64_t &b : B) {
      int64_t c = 0;
      if (op == '+') c = a + b;
      if (op == '*') c = a * b;
      cout << c << (b == B.back() ? '\n' : ' ');
    }
  }
  return 0;
}
0