結果

問題 No.1910 High Element on Grid
ユーザー HYEA LEEHYEA LEE
提出日時 2021-11-08 16:59:36
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 141 ms / 2,000 ms
コード長 711 bytes
コンパイル時間 256 ms
コンパイル使用メモリ 10,864 KB
実行使用メモリ 18,440 KB
最終ジャッジ日時 2023-09-04 19:12:06
合計ジャッジ時間 9,426 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
7,852 KB
testcase_01 AC 17 ms
7,864 KB
testcase_02 AC 16 ms
7,852 KB
testcase_03 AC 16 ms
7,792 KB
testcase_04 AC 16 ms
7,972 KB
testcase_05 AC 15 ms
7,828 KB
testcase_06 AC 16 ms
7,804 KB
testcase_07 AC 16 ms
7,840 KB
testcase_08 AC 16 ms
7,792 KB
testcase_09 AC 16 ms
7,776 KB
testcase_10 AC 16 ms
7,856 KB
testcase_11 AC 105 ms
15,460 KB
testcase_12 AC 109 ms
15,688 KB
testcase_13 AC 109 ms
15,696 KB
testcase_14 AC 125 ms
16,752 KB
testcase_15 AC 89 ms
14,116 KB
testcase_16 AC 81 ms
13,248 KB
testcase_17 AC 87 ms
13,968 KB
testcase_18 AC 106 ms
15,480 KB
testcase_19 AC 87 ms
14,136 KB
testcase_20 AC 88 ms
13,868 KB
testcase_21 AC 102 ms
15,096 KB
testcase_22 AC 71 ms
12,524 KB
testcase_23 AC 116 ms
16,196 KB
testcase_24 AC 78 ms
13,360 KB
testcase_25 AC 99 ms
14,904 KB
testcase_26 AC 91 ms
14,372 KB
testcase_27 AC 97 ms
14,932 KB
testcase_28 AC 66 ms
12,196 KB
testcase_29 AC 78 ms
13,228 KB
testcase_30 AC 86 ms
13,824 KB
testcase_31 AC 16 ms
7,856 KB
testcase_32 AC 141 ms
18,360 KB
testcase_33 AC 141 ms
18,376 KB
testcase_34 AC 141 ms
18,440 KB
testcase_35 AC 141 ms
18,376 KB
testcase_36 AC 17 ms
8,328 KB
testcase_37 AC 77 ms
12,988 KB
testcase_38 AC 39 ms
10,188 KB
testcase_39 AC 39 ms
10,232 KB
testcase_40 AC 20 ms
8,640 KB
testcase_41 AC 46 ms
10,792 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys

def inp(N, f, t):
    x = sys.stdin.readline()
    assert x[-1] == '\n'
    a = x.split()
    assert all('0' == v or not v.startswith('0') for v in a)
    *a, = map(int, a)
    assert len(a) == N
    assert all(f<=v<=t for v in a)
    return a

def eof():
    assert sys.stdin.readline() == ''

def solve(R, C):
    H, W = len(R), len(C)
    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] = 10**9
    eof()
    return V

def main():
    H, W = inp(2, 1, 500)
    R = inp(H, 1, W)
    C = inp(W, 1, H)
    for x in solve(R, C):
        print(*x)

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