結果

問題 No.1225 I hate I hate Matrix Construction
ユーザー toyuzukotoyuzuko
提出日時 2020-10-01 22:16:58
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 73 ms / 2,000 ms
コード長 661 bytes
コンパイル時間 88 ms
コンパイル使用メモリ 10,936 KB
実行使用メモリ 10,372 KB
最終ジャッジ日時 2023-09-21 11:10:30
合計ジャッジ時間 3,471 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
7,784 KB
testcase_01 AC 16 ms
7,828 KB
testcase_02 AC 16 ms
7,792 KB
testcase_03 AC 16 ms
7,804 KB
testcase_04 AC 68 ms
9,708 KB
testcase_05 AC 19 ms
8,256 KB
testcase_06 AC 29 ms
8,604 KB
testcase_07 AC 19 ms
8,224 KB
testcase_08 AC 25 ms
8,212 KB
testcase_09 AC 32 ms
8,980 KB
testcase_10 AC 35 ms
8,604 KB
testcase_11 AC 73 ms
9,892 KB
testcase_12 AC 41 ms
9,092 KB
testcase_13 AC 20 ms
8,228 KB
testcase_14 AC 17 ms
7,792 KB
testcase_15 AC 33 ms
9,192 KB
testcase_16 AC 32 ms
9,080 KB
testcase_17 AC 44 ms
9,676 KB
testcase_18 AC 55 ms
10,372 KB
testcase_19 AC 27 ms
8,864 KB
testcase_20 AC 23 ms
8,580 KB
testcase_21 AC 33 ms
9,260 KB
testcase_22 AC 28 ms
8,752 KB
testcase_23 AC 29 ms
8,904 KB
testcase_24 AC 26 ms
8,588 KB
testcase_25 AC 38 ms
9,348 KB
testcase_26 AC 25 ms
8,592 KB
testcase_27 AC 16 ms
7,836 KB
testcase_28 AC 33 ms
9,528 KB
testcase_29 AC 29 ms
8,876 KB
testcase_30 AC 33 ms
9,424 KB
testcase_31 AC 46 ms
9,776 KB
testcase_32 AC 54 ms
10,084 KB
testcase_33 AC 29 ms
8,764 KB
testcase_34 AC 39 ms
10,212 KB
testcase_35 AC 52 ms
9,872 KB
testcase_36 AC 26 ms
8,836 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
S = list(map(int, input().split()))
T = list(map(int, input().split()))

A = [[0 for j in range(N)] for i in range(N)]

for i in range(N):
    if S[i] == 2:
        for j in range(N):
            A[i][j] = 1

for j in range(N):
    if T[j] == 2:
        for i in range(N):
            A[i][j] = 1

s = 0
t = 0

for i in range(N):
    if S[i] == 1:
        for j in range(N):
            if A[i][j] == 1:
                break
        else:
            s += 1

for j in range(N):
    if T[j] == 1:
        for i in range(N):
            if A[i][j] == 1:
                break
        else:
            t += 1

print(max(s, t) + sum(map(sum, A)))
0