結果

問題 No.1225 I hate I hate Matrix Construction
ユーザー matrie
提出日時 2021-01-13 09:30:53
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 32 ms / 2,000 ms
コード長 201 bytes
コンパイル時間 252 ms
コンパイル使用メモリ 12,416 KB
実行使用メモリ 10,752 KB
最終ジャッジ日時 2024-11-22 01:17:18
合計ジャッジ時間 2,572 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 35
権限があれば一括ダウンロードができます

ソースコード

diff #

n=int(input())
S=list(map(int,input().split()))
T=list(map(int,input().split()))
s=t=u=v=0
for i,j in zip(S,T):
	s+=(i==1)+(i==2)*n
	t+=(j==1)+(j==2)*n
	u+=(i==2)
	v+=(j==2)
print(max(s,t,(u+v)*n-u*v))
0