結果
問題 | No.987 N×Mマス計算(基本) |
ユーザー | masa_ahe |
提出日時 | 2020-02-14 21:29:12 |
言語 | C++11 (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 3 ms / 2,000 ms |
コード長 | 584 bytes |
コンパイル時間 | 1,722 ms |
コンパイル使用メモリ | 159,860 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-10-06 10:40:24 |
合計ジャッジ時間 | 2,458 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 18 |
ソースコード
#include<bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<int,int> P; int main(){ int n,m; cin>>n>>m; vector<ll>a(n),b(m); char op; bool add=false; cin>>op; if(op=='+')add=true; for(int i=0;i<m;i++)cin>>b[i]; for(int i=0;i<n;i++)cin>>a[i]; for(int i=0;i<n;i++){ for(int j=0;j<m;j++){ if(add)cout<<a[i]+b[j]<<" "; else cout<<a[i]*b[j]<<" "; } cout<<endl; } return 0; }