結果

問題 No.1910 High Element on Grid
ユーザー HYEA LEE
提出日時 2021-11-08 16:50:51
言語 C++17(clang)
(17.0.6 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 592 bytes
コンパイル時間 4,409 ms
コンパイル使用メモリ 165,344 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-06-22 16:55:02
合計ジャッジ時間 9,941 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample WA * 1
other AC * 1 WA * 40
権限があれば一括ダウンロードができます

ソースコード

diff #

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

vector<vector<int>> solve(vector<int> R, vector<int> C)
{
    int H = R.size(), W = C.size();
    vector<vector<int>> V(H, vector<int>(W));
    int tp = 0; for(auto&x: V) for(auto&y:x) y = ++tp;
    for(int i=1; i<H; ++i) V[i][0] = V[i][W-R[i]];
    for(int i=1; i<W; ++i) V[0][i] = V[H-C[i]][i];
    return V;
}

int main()
{
    int H, W; cin >> H >> W;
    vector<int> R(H), C(W);
    for(int&x: R) cin >> x;
    for(int&x: C) cin >> x;
    for(auto x: solve(R, C))
    {
        for(auto y: x) cout << y << " ";
        cout << endl;
    }
}
0