結果

問題 No.1225 I hate I hate Matrix Construction
ユーザー 👑 KazunKazun
提出日時 2020-09-11 22:07:31
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 321 bytes
コンパイル時間 1,129 ms
コンパイル使用メモリ 86,744 KB
実行使用メモリ 71,472 KB
最終ジャッジ日時 2023-08-27 14:43:19
合計ジャッジ時間 5,607 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 75 ms
71,004 KB
testcase_01 AC 78 ms
71,416 KB
testcase_02 AC 78 ms
71,284 KB
testcase_03 AC 78 ms
71,244 KB
testcase_04 AC 77 ms
71,184 KB
testcase_05 AC 79 ms
71,420 KB
testcase_06 AC 80 ms
71,416 KB
testcase_07 AC 79 ms
71,300 KB
testcase_08 AC 78 ms
71,012 KB
testcase_09 AC 78 ms
71,308 KB
testcase_10 AC 77 ms
71,284 KB
testcase_11 AC 78 ms
71,304 KB
testcase_12 AC 77 ms
71,000 KB
testcase_13 AC 78 ms
71,124 KB
testcase_14 AC 79 ms
71,400 KB
testcase_15 AC 79 ms
71,132 KB
testcase_16 AC 77 ms
71,300 KB
testcase_17 AC 78 ms
71,000 KB
testcase_18 AC 78 ms
71,004 KB
testcase_19 AC 77 ms
71,468 KB
testcase_20 AC 78 ms
71,128 KB
testcase_21 AC 78 ms
71,440 KB
testcase_22 AC 77 ms
71,364 KB
testcase_23 AC 80 ms
71,452 KB
testcase_24 AC 78 ms
71,412 KB
testcase_25 AC 79 ms
71,472 KB
testcase_26 AC 78 ms
71,268 KB
testcase_27 AC 76 ms
71,344 KB
testcase_28 AC 78 ms
71,324 KB
testcase_29 AC 76 ms
71,412 KB
testcase_30 AC 78 ms
71,168 KB
testcase_31 AC 80 ms
71,312 KB
testcase_32 AC 79 ms
71,440 KB
testcase_33 AC 78 ms
71,224 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:
    print(X[1]*Y[2]+Y[1])
else:
    print(Y[1]*X[2]+X[1])
0