結果
| 問題 |
No.987 N×Mマス計算(基本)
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2020-11-02 23:39:22 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 4 ms / 2,000 ms |
| コード長 | 700 bytes |
| コンパイル時間 | 716 ms |
| コンパイル使用メモリ | 94,972 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-07-22 08:21:49 |
| 合計ジャッジ時間 | 1,483 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 18 |
ソースコード
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <queue>
#include <cmath>
#include <climits>
#include <iomanip>
#include <set>
#include <map>
using namespace std;
typedef long long ll;
int main(){
ll n,m;
cin >> n >> m;
char op;
cin >> op;
vector<ll> a(m);
vector<ll> b(n);
for(int i = 0;i < m;i++)cin >> a[i];
for(int j = 0;j < n;j++)cin >> b[j];
for(int i = 0;i < n;i++){
for(int j = 0;j < m - 1;j++){
if(op == '+')cout << b[i] + a[j] << " ";
else cout << b[i] * a[j] << " ";
}
if(op == '+')cout << b[i] + a[m - 1] << endl;
else cout << b[i] * a[m - 1] << endl;
}
}