結果

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

ソースコード

diff #

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

int main(){
  int N,M;
  cin>>N>>M;
  char op;
  cin>>op;
  int B[M];
  for (int i=0;i<M;i++){
    cin>>B[i];
  }
  int A[N];
  for (int i=0;i<N;i++){
    cin>>A[i];
  }
  
  if (op=='+'){
    for(int i=0;i<N;i++){
      for(int j=0;j<M;j++){
        cout<<A[i]+B[j]<<" ";
      }
      cout<<endl;
    }
    return 0;
  }
      for(int i=0;i<N;i++){
      for(int j=0;j<M;j++){
        cout<<A[i]*B[j]<<" ";
      }
      cout<<endl;
    }
    return 0;
}
0