結果

問題 No.1225 I hate I hate Matrix Construction
ユーザー Kude
提出日時 2020-09-11 22:11:39
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 42 ms / 2,000 ms
コード長 297 bytes
コンパイル時間 219 ms
コンパイル使用メモリ 82,048 KB
実行使用メモリ 52,480 KB
最終ジャッジ日時 2024-12-27 14:52:17
合計ジャッジ時間 3,100 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 35
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
s = list(map(int, input().split()))
t = list(map(int, input().split()))
ans = 0
cnt2_s = s.count(2)
cnt2_t = t.count(2)
ans += cnt2_s * n + cnt2_t * n - cnt2_s * cnt2_t
cnt1_s = 0 if cnt2_t else s.count(1)
cnt1_t = 0 if cnt2_s else t.count(1)
ans += max(cnt1_s, cnt1_t)
print(ans)
0