結果

問題 No.1225 I hate I hate Matrix Construction
ユーザー 👑 KazunKazun
提出日時 2020-09-11 22:11:03
言語 PyPy3
(7.3.13)
結果
AC  
実行時間 73 ms / 2,000 ms
コード長 329 bytes
コンパイル時間 1,334 ms
コンパイル使用メモリ 86,212 KB
実行使用メモリ 71,128 KB
最終ジャッジ日時 2023-08-27 14:53:04
合計ジャッジ時間 4,873 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 67 ms
70,900 KB
testcase_01 AC 68 ms
71,064 KB
testcase_02 AC 66 ms
71,128 KB
testcase_03 AC 67 ms
71,120 KB
testcase_04 AC 72 ms
71,020 KB
testcase_05 AC 69 ms
70,996 KB
testcase_06 AC 68 ms
70,676 KB
testcase_07 AC 67 ms
70,884 KB
testcase_08 AC 68 ms
70,896 KB
testcase_09 AC 68 ms
71,088 KB
testcase_10 AC 70 ms
71,068 KB
testcase_11 AC 69 ms
70,900 KB
testcase_12 AC 69 ms
71,088 KB
testcase_13 AC 68 ms
71,088 KB
testcase_14 AC 69 ms
71,020 KB
testcase_15 AC 69 ms
71,124 KB
testcase_16 AC 68 ms
71,084 KB
testcase_17 AC 70 ms
70,852 KB
testcase_18 AC 69 ms
70,700 KB
testcase_19 AC 68 ms
70,896 KB
testcase_20 AC 68 ms
70,896 KB
testcase_21 AC 68 ms
70,800 KB
testcase_22 AC 69 ms
71,068 KB
testcase_23 AC 70 ms
71,040 KB
testcase_24 AC 69 ms
71,080 KB
testcase_25 AC 71 ms
70,672 KB
testcase_26 AC 70 ms
71,028 KB
testcase_27 AC 72 ms
70,956 KB
testcase_28 AC 71 ms
71,072 KB
testcase_29 AC 69 ms
71,032 KB
testcase_30 AC 70 ms
71,016 KB
testcase_31 AC 69 ms
71,028 KB
testcase_32 AC 72 ms
71,084 KB
testcase_33 AC 71 ms
71,004 KB
testcase_34 AC 70 ms
71,024 KB
testcase_35 AC 73 ms
71,016 KB
testcase_36 AC 69 ms
71,104 KB
権限があれば一括ダウンロードができます

ソースコード

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-X[0])*(N-Y[0])-X[1]*Y[1])
elif X[2]==0 and Y[2]!=0:
    print(N*Y[2]+Y[1])
else:
    print(N*X[2]+X[1])
0