結果
問題 | No.987 N×Mマス計算(基本) |
ユーザー |
![]() |
提出日時 | 2022-02-02 10:28:11 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 3 ms / 2,000 ms |
コード長 | 1,063 bytes |
コンパイル時間 | 2,001 ms |
コンパイル使用メモリ | 196,700 KB |
最終ジャッジ日時 | 2025-01-27 18:22:49 |
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 18 |
ソースコード
#include <bits/stdc++.h> #include <vector> #include <iostream> #include <map> #include <string> #include <cmath> #include <algorithm> #include <queue> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define repe(i,x,n) for(int i=x; i<(n); ++i) using ll = long long; using P = pair<int, int>; #define pai 3.1415926535897932384 #define INF 100100100 #define _GLIBCXX_DEBUG int main() { ll N,M; char S; cin >> N >> M >> S; vector<ll> A(N); vector<ll> B(M); rep(i,M) { cin >> B[i]; } rep(i,N) { cin >> A[i]; } if(S == '+') { rep(i,N)rep(j,M) { if(j == M-1) { cout << A[i]+B[j] << endl; } else { cout << A[i]+B[j] << " "; } } return 0; } else { rep(i,N)rep(j,M) { if(j == M-1) { cout << A[i]*B[j] << endl; } else { cout << A[i]*B[j] << " "; } } return 0; } }