結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
7,788 KB
testcase_01 WA -
testcase_02 AC 16 ms
7,788 KB
testcase_03 WA -
testcase_04 AC 16 ms
7,860 KB
testcase_05 AC 17 ms
7,872 KB
testcase_06 AC 16 ms
7,844 KB
testcase_07 AC 15 ms
7,764 KB
testcase_08 AC 16 ms
7,976 KB
testcase_09 AC 16 ms
7,916 KB
testcase_10 WA -
testcase_11 AC 106 ms
15,408 KB
testcase_12 AC 110 ms
15,704 KB
testcase_13 AC 111 ms
15,736 KB
testcase_14 AC 126 ms
16,696 KB
testcase_15 AC 92 ms
14,060 KB
testcase_16 AC 81 ms
13,324 KB
testcase_17 AC 88 ms
14,024 KB
testcase_18 AC 108 ms
15,408 KB
testcase_19 AC 89 ms
14,012 KB
testcase_20 AC 89 ms
13,780 KB
testcase_21 AC 102 ms
14,992 KB
testcase_22 AC 72 ms
12,448 KB
testcase_23 AC 121 ms
16,440 KB
testcase_24 AC 79 ms
13,360 KB
testcase_25 AC 99 ms
14,948 KB
testcase_26 AC 93 ms
14,400 KB
testcase_27 AC 99 ms
14,848 KB
testcase_28 AC 66 ms
12,260 KB
testcase_29 AC 78 ms
13,372 KB
testcase_30 AC 86 ms
13,812 KB
testcase_31 AC 16 ms
7,944 KB
testcase_32 AC 142 ms
18,276 KB
testcase_33 AC 142 ms
18,260 KB
testcase_34 AC 141 ms
18,304 KB
testcase_35 AC 142 ms
18,336 KB
testcase_36 AC 16 ms
8,408 KB
testcase_37 AC 77 ms
13,252 KB
testcase_38 AC 40 ms
10,224 KB
testcase_39 WA -
testcase_40 WA -
testcase_41 WA -
権限があれば一括ダウンロードができます

ソースコード

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); 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