結果
問題 |
No.987 N×Mマス計算(基本)
|
ユーザー |
|
提出日時 | 2020-04-03 14:53:47 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 3 ms / 2,000 ms |
コード長 | 634 bytes |
コンパイル時間 | 1,519 ms |
コンパイル使用メモリ | 168,468 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-07-03 00:42:54 |
合計ジャッジ時間 | 2,584 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 18 |
ソースコード
#include <bits/stdc++.h> #define rep(i,n) for(int i=0;i<n;i++) using namespace std; typedef long long ll; typedef pair<int,int> P; const ll INF = 1e15; const int MOD = 1000000007; int main(){ int n,m; cin >> n >> m; vector<ll> b(m); vector<ll> a(n); char op; cin >> op; rep(i,m) cin >> b[i]; rep(i,n) cin >> a[i]; rep(i,n){ rep(j,m){ if(op =='+') cout << a[i]+b[j] << " "; if(op =='*') cout << a[i]*b[j] << " "; } cout << endl; } return 0; }