結果
問題 | No.987 N×Mマス計算(基本) |
ユーザー |
|
提出日時 | 2020-02-14 21:24:56 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 3 ms / 2,000 ms |
コード長 | 666 bytes |
コンパイル時間 | 1,555 ms |
コンパイル使用メモリ | 172,740 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2024-10-06 10:29:59 |
合計ジャッジ時間 | 2,245 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 18 |
ソースコード
#include <bits/stdc++.h> using namespace std; using ll = long long; int main() { cin.tie(nullptr); ios::sync_with_stdio(false); int n, m; cin >> n >> m; char op; cin >> op; vector< vector<ll> > ans(n + 1, vector<ll>(m + 1)); for (int i = 0; i < m; ++i) { cin >> ans[0][i + 1]; } for (int i = 0; i < n; ++i) { cin >> ans[i + 1][0]; } for (int i = 1; i <= n; ++i) { for (int j = 1; j <= m; ++j) { if (op == '+') ans[i][j] = ans[0][j] + ans[i][0]; else ans[i][j] = ans[0][j] * ans[i][0]; cout << ans[i][j] << " \n"[j == m]; } } return 0; }