結果

問題 No.1910 High Element on Grid
ユーザー ぷらぷら
提出日時 2022-04-22 21:56:21
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 830 bytes
コンパイル時間 1,990 ms
コンパイル使用メモリ 202,532 KB
実行使用メモリ 4,504 KB
最終ジャッジ日時 2023-09-06 08:20:25
合計ジャッジ時間 12,034 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,376 KB
testcase_01 WA -
testcase_02 WA -
testcase_03 AC 1 ms
4,376 KB
testcase_04 AC 1 ms
4,376 KB
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 AC 20 ms
4,376 KB
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 AC 15 ms
4,376 KB
testcase_20 AC 16 ms
4,376 KB
testcase_21 WA -
testcase_22 AC 12 ms
4,380 KB
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 WA -
testcase_28 WA -
testcase_29 WA -
testcase_30 WA -
testcase_31 AC 2 ms
4,380 KB
testcase_32 WA -
testcase_33 AC 26 ms
4,384 KB
testcase_34 WA -
testcase_35 WA -
testcase_36 WA -
testcase_37 WA -
testcase_38 WA -
testcase_39 WA -
testcase_40 WA -
testcase_41 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

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

int main() {
    int H,W;
    cin >> H >> W;
    vector<int>R(H),C(W);
    for(int i = 0; i < H; i++) {
        cin >> R[i];
    }
    for(int i = 0; i < W; i++) {
        cin >> C[i];
    }
    vector<vector<int>>ans(H,vector<int>(W));
    ans[0][0] = 1e9;
    for(int i = 1; i < W; i++) {
        int a = (i+1)*1000;
        for(int j = 0; j < C[i]; j++) {
            ans[j][i] = a+j;
        }
        for(int j = C[i]; j < H; j++) {
            ans[j][i] = a;
        }
    }
    for(int i = 1; i < H; i++) {
        if(R[i] == 1) {
            ans[i][0] = 1;
            continue;
        }
        ans[i][0] = ans[i][W-R[i]];
    }
    for(int i = 0; i < H; i++) {
        for(int j = 0; j < W; j++) {
            cout << ans[i][j] << ((j+1 == W)?"\n":" ");
        }
    }
}
0