結果

問題 No.1910 High Element on Grid
ユーザー HYEA LEEHYEA LEE
提出日時 2021-11-08 17:01:31
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 139 ms / 2,000 ms
コード長 745 bytes
コンパイル時間 274 ms
コンパイル使用メモリ 10,916 KB
実行使用メモリ 18,328 KB
最終ジャッジ日時 2023-09-04 19:13:16
合計ジャッジ時間 10,025 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
7,896 KB
testcase_01 AC 16 ms
7,784 KB
testcase_02 AC 16 ms
7,832 KB
testcase_03 AC 15 ms
7,788 KB
testcase_04 AC 16 ms
7,832 KB
testcase_05 AC 17 ms
7,764 KB
testcase_06 AC 16 ms
7,800 KB
testcase_07 AC 16 ms
7,792 KB
testcase_08 AC 16 ms
7,892 KB
testcase_09 AC 16 ms
7,848 KB
testcase_10 AC 16 ms
7,984 KB
testcase_11 AC 103 ms
15,396 KB
testcase_12 AC 107 ms
15,668 KB
testcase_13 AC 106 ms
15,740 KB
testcase_14 AC 122 ms
16,660 KB
testcase_15 AC 88 ms
14,000 KB
testcase_16 AC 79 ms
13,244 KB
testcase_17 AC 86 ms
13,956 KB
testcase_18 AC 105 ms
15,428 KB
testcase_19 AC 86 ms
14,136 KB
testcase_20 AC 86 ms
13,960 KB
testcase_21 AC 100 ms
15,068 KB
testcase_22 AC 70 ms
12,472 KB
testcase_23 AC 113 ms
16,124 KB
testcase_24 AC 77 ms
13,284 KB
testcase_25 AC 97 ms
14,832 KB
testcase_26 AC 91 ms
14,348 KB
testcase_27 AC 95 ms
14,960 KB
testcase_28 AC 64 ms
12,324 KB
testcase_29 AC 77 ms
13,304 KB
testcase_30 AC 83 ms
13,892 KB
testcase_31 AC 16 ms
7,928 KB
testcase_32 AC 138 ms
18,264 KB
testcase_33 AC 137 ms
18,328 KB
testcase_34 AC 138 ms
18,188 KB
testcase_35 AC 139 ms
18,212 KB
testcase_36 AC 17 ms
8,452 KB
testcase_37 AC 75 ms
13,220 KB
testcase_38 AC 38 ms
10,212 KB
testcase_39 AC 39 ms
10,140 KB
testcase_40 AC 21 ms
8,632 KB
testcase_41 AC 46 ms
10,772 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 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); assert R[0] == 1
    C = inp(W, 1, H); assert C[0] == 1
    for x in solve(R, C):
        print(*x)

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