結果

問題 No.987 N×Mマス計算(基本)
ユーザー Baplisca
提出日時 2020-03-31 23:58:36
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 10 ms / 2,000 ms
コード長 1,341 bytes
コンパイル時間 1,913 ms
コンパイル使用メモリ 196,048 KB
最終ジャッジ日時 2025-01-09 11:23:34
ジャッジサーバーID
(参考情報)
judge1 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 18
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;

//#define int long long
#define ll long long
#define all(v) (v).begin(), (v).end()
#define rep(i,n) for(int i=0;i<n;++i)
#define rep1(i,n) for(int i=1;i<n;++i)
#define FOR(i, m, n) for(int i = m; i < n; i++)
#define EPS (1e-7)
#define gearup ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
typedef pair<ll, ll> P;
typedef vector<ll> vl;
typedef vector<vector<ll> > vvl;
typedef vector<vector<vector<ll> > > vvvl;
ll MOD = 1000000007;
const long long L_INF = 1LL << 60;
const int INF = 2147483647; // 2^31-1
const double PI = acos(-1);
//cout<<fixed<<setprecision(10);

template<class T> inline bool chmin(T& a, T b) {if (a > b) {a = b;return true;}return false;}
template<class T> inline bool chmax(T& a, T b) {if (a < b) {a = b;return true;}return false;}
template<class T> void debug(T v){rep(i,v.size()) cout<<v[i]<<" ";cout<<endl;}

signed main()
{   
    gearup;
    int n,m; cin >> n >> m;
    char c; cin >> c;
    vector<ll> a(n),b(m);
    rep(i,m) cin >> b[i];
    rep(i,n) cin >> a[i];
    rep(i,n){
        rep(j,m){
            if(c == '+'){
                if(j!=0) cout << " ";
                cout << a[i] + b[j];
            }
            else{
                if(j!=0) cout << " ";
                cout << a[i] * b[j];
            }
        }
        cout << endl;
    }
}
0