結果

問題 No.987 N×Mマス計算(基本)
ユーザー LV3zJigVW57oPGyLV3zJigVW57oPGy
提出日時 2022-11-13 17:31:50
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 757 bytes
コンパイル時間 1,354 ms
コンパイル使用メモリ 148,652 KB
実行使用メモリ 4,352 KB
最終ジャッジ日時 2023-10-13 01:51:34
合計ジャッジ時間 2,758 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <bits/stdc++.h> 
using namespace std;
#include <stdio.h>
#include <iomanip>
#include <iostream>
#include <string>
#include <algorithm>

int main(){
  int a, b;
  cin >> a >> b;
  vector<vector<int>> vec(a, vector<int>(b));
  char tasu;
  cin >> tasu;
  vector<int> vec1(b);
  vector<int> vec2(a);
  for(int i=0;i<b;i++){
   cin >> vec1.at(i);
  }
  for(int i=0;i<a;i++){
    cin >> vec2.at(i);
  }
  for(int i=0;i<a;i++){
    for(int k=0;k<b;k++){
      if(tasu=='+'){
      vec.at(i).at(k)=vec1.at(k)+vec2.at(i);
      }
      else if(tasu=='*'){
      vec.at(i).at(k)=vec1.at(k)*vec2.at(i);
      }
     if(k==0){
     cout << vec.at(i).at(k);
     }
      else cout << " " <<vec.at(i).at(k);
    }
   if(i==a-1) {}
   else cout << endl;
  }
}
  
0