結果

問題 No.1225 I hate I hate Matrix Construction
ユーザー hirayuu_yc
提出日時 2023-07-15 09:05:41
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 41 ms / 2,000 ms
コード長 285 bytes
コンパイル時間 180 ms
コンパイル使用メモリ 82,304 KB
実行使用メモリ 52,352 KB
最終ジャッジ日時 2024-09-16 17:17:10
合計ジャッジ時間 3,150 ms
ジャッジサーバーID
(参考情報)
judge5 / judge6
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 35
権限があれば一括ダウンロードができます

ソースコード

diff #

N=int(input())
S=list(map(int,input().split()))
T=list(map(int,input().split()))
if 2 in S and 2 in T:
	print((S.count(2)+T.count(2))*N-S.count(2)*T.count(2))
elif 2 not in S and 2 not in T:
	print(max(S.count(1),T.count(1)))
else:
	if 2 in T:
		S,T=T,S
	print(S.count(2)*N+S.count(1))
0