結果

問題 No.987 N×Mマス計算(基本)
ユーザー hanachanXhanachanX
提出日時 2020-04-12 12:16:46
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 3 ms / 2,000 ms
コード長 1,202 bytes
コンパイル時間 2,783 ms
コンパイル使用メモリ 180,904 KB
実行使用メモリ 4,348 KB
最終ジャッジ日時 2023-10-22 00:58:48
合計ジャッジ時間 3,230 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,348 KB
testcase_01 AC 2 ms
4,348 KB
testcase_02 AC 3 ms
4,348 KB
testcase_03 AC 2 ms
4,348 KB
testcase_04 AC 2 ms
4,348 KB
testcase_05 AC 2 ms
4,348 KB
testcase_06 AC 3 ms
4,348 KB
testcase_07 AC 3 ms
4,348 KB
testcase_08 AC 1 ms
4,348 KB
testcase_09 AC 2 ms
4,348 KB
testcase_10 AC 2 ms
4,348 KB
testcase_11 AC 2 ms
4,348 KB
testcase_12 AC 3 ms
4,348 KB
testcase_13 AC 3 ms
4,348 KB
testcase_14 AC 2 ms
4,348 KB
testcase_15 AC 2 ms
4,348 KB
testcase_16 AC 3 ms
4,348 KB
testcase_17 AC 3 ms
4,348 KB
testcase_18 AC 2 ms
4,348 KB
testcase_19 AC 3 ms
4,348 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#pragma GCC optimize("O3")
#pragma GCC target("avx")
#include <bits/stdc++.h>
#define rep(i ,n) for(int i=0;i<(int)(n);++i)
#define repr(i ,n) for(int i=n;i>(int)(n);--i)
#define rep1(i ,n) for(int i=1;i<=(int)(n);++i)
#define ALL(a) a.begin(), a.end()
#define SORT(a) sort(ALL(a))
#define bit_check(bit, i) ((bit>>(i)) & 1)
#define PRINT(x) printf("%d\n",(x));
using namespace std;
typedef long long int int64;
typedef unsigned long long uint64;
template<class T> using V = vector<T>;
using I = int;
using VI = V<I>;
const int INF = 2e9;
const int64 MOD = 1e9 + 7;

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;}

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