結果

問題 No.1225 I hate I hate Matrix Construction
コンテスト
ユーザー hirayuu_yc
提出日時 2023-07-15 09:05:41
言語 PyPy3
(7.3.23 + ACL)
コンパイル:
pypy3 -mpy_compile _filename_
実行:
pypy3 _filename_
結果
AC  
実行時間 67 ms / 2,000 ms
+ 523µs
コード長 285 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 238 ms
コンパイル使用メモリ 96,104 KB
実行使用メモリ 79,360 KB
最終ジャッジ日時 2026-08-29 00:34:58
合計ジャッジ時間 4,616 ms
ジャッジサーバーID
(参考情報)
judge3_0 / judge2_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 35
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

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