結果

問題 No.1225 I hate I hate Matrix Construction
ユーザー 👑 KazunKazun
提出日時 2020-09-11 22:03:42
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 435 bytes
コンパイル時間 944 ms
コンパイル使用メモリ 86,596 KB
実行使用メモリ 71,064 KB
最終ジャッジ日時 2023-08-27 14:35:37
合計ジャッジ時間 4,808 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 64 ms
71,044 KB
testcase_01 AC 69 ms
70,980 KB
testcase_02 AC 66 ms
70,792 KB
testcase_03 AC 66 ms
70,988 KB
testcase_04 AC 67 ms
70,876 KB
testcase_05 AC 65 ms
70,872 KB
testcase_06 AC 63 ms
70,724 KB
testcase_07 AC 63 ms
70,980 KB
testcase_08 AC 65 ms
70,896 KB
testcase_09 AC 64 ms
70,928 KB
testcase_10 AC 64 ms
70,880 KB
testcase_11 AC 64 ms
70,888 KB
testcase_12 AC 64 ms
70,952 KB
testcase_13 AC 64 ms
71,064 KB
testcase_14 AC 65 ms
71,036 KB
testcase_15 AC 67 ms
70,952 KB
testcase_16 AC 66 ms
71,064 KB
testcase_17 AC 67 ms
71,064 KB
testcase_18 AC 66 ms
71,064 KB
testcase_19 AC 65 ms
71,012 KB
testcase_20 AC 68 ms
70,988 KB
testcase_21 AC 68 ms
70,704 KB
testcase_22 AC 63 ms
70,988 KB
testcase_23 AC 66 ms
70,872 KB
testcase_24 AC 65 ms
70,984 KB
testcase_25 AC 64 ms
70,956 KB
testcase_26 AC 65 ms
70,900 KB
testcase_27 AC 67 ms
70,992 KB
testcase_28 AC 68 ms
71,012 KB
testcase_29 AC 67 ms
70,580 KB
testcase_30 AC 65 ms
70,872 KB
testcase_31 AC 64 ms
70,936 KB
testcase_32 AC 68 ms
70,920 KB
testcase_33 AC 66 ms
70,904 KB
testcase_34 WA -
testcase_35 WA -
testcase_36 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

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

X=[S.count(i) for i in range(N)]
Y=[T.count(j) for j in range(N)]


if X[2]==Y[2]==0:
    print(max(X[1],Y[1]))
elif X[2]*Y[2]!=0:
    print(N*N-X[1]*Y[2])
elif X[2]==0 and Y[2]!=0:
    if Y[2]:
        print(X[1]*Y[2]+Y[1])
    else:
        print(max(X[1],Y[1]))
else:
    if X[2]:
        print(Y[1]*X[2]+X[1])
    else:
        print(max(X[1],Y[1]))
0