結果

問題 No.1910 High Element on Grid
ユーザー cologne
提出日時 2022-04-22 23:42:33
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 200 ms / 2,000 ms
コード長 401 bytes
コンパイル時間 481 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 20,736 KB
最終ジャッジ日時 2024-06-24 05:14:52
合計ジャッジ時間 9,712 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 41
権限があれば一括ダウンロードができます

ソースコード

diff #

def main():
    H, W = map(int, input().split())
    *R, = map(int, input().split())
    *C, = map(int, input().split())

    V = [[i * W + j + 1 for j in range(W)] for i in range(H)]
    for i in range(1, H):
        V[i][0] = V[i][W - R[i]]
    for i in range(1, W):
        V[0][i] = V[H - C[i]][i]
    V[0][0] = V[-1][-1]

    for x in V:
        print(*x)


if __name__ == '__main__':
    main()
0