結果

問題 No.987 N×Mマス計算(基本)
ユーザー h1guchh1guch
提出日時 2020-02-28 21:47:20
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 3 ms / 2,000 ms
コード長 913 bytes
コンパイル時間 1,523 ms
コンパイル使用メモリ 164,664 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-04-21 18:17:13
合計ジャッジ時間 2,245 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
6,812 KB
testcase_01 AC 2 ms
6,940 KB
testcase_02 AC 2 ms
6,940 KB
testcase_03 AC 2 ms
6,944 KB
testcase_04 AC 2 ms
6,948 KB
testcase_05 AC 2 ms
6,944 KB
testcase_06 AC 2 ms
6,944 KB
testcase_07 AC 2 ms
6,940 KB
testcase_08 AC 2 ms
6,940 KB
testcase_09 AC 2 ms
6,940 KB
testcase_10 AC 2 ms
6,940 KB
testcase_11 AC 2 ms
6,944 KB
testcase_12 AC 3 ms
6,940 KB
testcase_13 AC 2 ms
6,940 KB
testcase_14 AC 1 ms
6,944 KB
testcase_15 AC 2 ms
6,944 KB
testcase_16 AC 3 ms
6,940 KB
testcase_17 AC 2 ms
6,944 KB
testcase_18 AC 3 ms
6,940 KB
testcase_19 AC 3 ms
6,940 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp:21:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
   21 | main()
      | ^~~~

ソースコード

diff #

#include<bits/stdc++.h>

#define rep(i,n) for(int i=0;i<n;i++)
#define FOR(i,a,b) for(int i=a;i<b;i++)
#define each(it,v) for(auto &it : v)
#define all(v) (v).begin(),(v).end()

using namespace std;
using ll = long long;
using vi = vector<int>;
using vll = vector<ll>;
using Pii = pair<int,int>;
using Pll = pair<ll,ll>;
using vpii = vector<Pii>;
using vpll = vector<Pll>;

const ll mod=1e9+7;
const int intINF=INT_MAX;
const ll  longINF=LONG_LONG_MAX;

main()
{
        int n,m; cin>>n>>m;
        long a[n+1][m+1]={};
        char op; cin>>op;
        if(op=='+')a[0][0]=0;
        else a[0][0]=1;
        rep(i,m)cin>>a[0][i+1];
        rep(i,n)cin>>a[i+1][0];

        if(a[0][0])FOR(i,1,n+1)FOR(j,1,m+1)a[i][j]=a[0][j]*a[i][0];
        else FOR(i,1,n+1)FOR(j,1,m+1)a[i][j]=a[0][j]+a[i][0];
        FOR(i,1,n+1)
        {
                FOR(j,1,m+1)cout<<a[i][j]<<" ";
                cout<<endl;
        }
}
0