結果

問題 No.1910 High Element on Grid
ユーザー pockynypockyny
提出日時 2023-01-28 15:48:19
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 26 ms / 2,000 ms
コード長 585 bytes
コンパイル時間 834 ms
コンパイル使用メモリ 69,384 KB
実行使用メモリ 5,464 KB
最終ジャッジ日時 2023-09-11 04:41:31
合計ジャッジ時間 11,040 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,380 KB
testcase_01 AC 1 ms
4,384 KB
testcase_02 AC 1 ms
4,384 KB
testcase_03 AC 2 ms
4,380 KB
testcase_04 AC 2 ms
4,384 KB
testcase_05 AC 2 ms
4,380 KB
testcase_06 AC 1 ms
4,384 KB
testcase_07 AC 2 ms
4,380 KB
testcase_08 AC 2 ms
4,384 KB
testcase_09 AC 1 ms
4,384 KB
testcase_10 AC 1 ms
4,384 KB
testcase_11 AC 19 ms
5,148 KB
testcase_12 AC 20 ms
5,124 KB
testcase_13 AC 20 ms
5,172 KB
testcase_14 AC 23 ms
5,328 KB
testcase_15 AC 16 ms
4,664 KB
testcase_16 AC 14 ms
4,796 KB
testcase_17 AC 15 ms
4,760 KB
testcase_18 AC 20 ms
5,152 KB
testcase_19 AC 16 ms
4,848 KB
testcase_20 AC 16 ms
4,732 KB
testcase_21 AC 18 ms
4,816 KB
testcase_22 AC 13 ms
4,768 KB
testcase_23 AC 21 ms
5,012 KB
testcase_24 AC 14 ms
4,744 KB
testcase_25 AC 18 ms
5,124 KB
testcase_26 AC 16 ms
5,076 KB
testcase_27 AC 18 ms
4,772 KB
testcase_28 AC 12 ms
4,724 KB
testcase_29 AC 14 ms
4,736 KB
testcase_30 AC 16 ms
5,024 KB
testcase_31 AC 1 ms
4,388 KB
testcase_32 AC 26 ms
5,320 KB
testcase_33 AC 26 ms
5,444 KB
testcase_34 AC 26 ms
5,336 KB
testcase_35 AC 26 ms
5,464 KB
testcase_36 AC 2 ms
4,384 KB
testcase_37 AC 13 ms
4,384 KB
testcase_38 AC 7 ms
4,744 KB
testcase_39 AC 6 ms
4,380 KB
testcase_40 AC 3 ms
4,384 KB
testcase_41 AC 8 ms
5,128 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>

using namespace std;
int r[1010],c[1010],a[1010][1010];
int main(){
    int i,j,h,w; cin >> h >> w;
    for(i=0;i<h;i++) cin >> r[i];
    for(j=0;j<w;j++) cin >> c[j];
    a[0][0] = 1000000000;
    for(i=1;i<h;i++){
        for(j=1;j<w;j++) a[i][j] = i*w + j;
    }
    for(i=1;i<h;i++){
        if(r[i]<w) a[i][0] = a[i][w - r[i]];
        else a[i][0] = 1;
    }
    for(j=1;j<w;j++){
        if(c[j]<h) a[0][j] = a[h - c[j]][j];
        else a[0][j] = 1;
    }
    for(i=0;i<h;i++){
        for(j=0;j<w;j++) cout << a[i][j] << " ";
        cout << "\n";
    }
}
0