結果

問題 No.1225 I hate I hate Matrix Construction
コンテスト
ユーザー rlangevin
提出日時 2023-01-24 01:04:47
言語 PyPy3
(7.3.17)
コンパイル:
pypy3 -mpy_compile _filename_
実行:
pypy3 _filename_
結果
AC  
実行時間 27 ms / 2,000 ms
コード長 249 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 183 ms
コンパイル使用メモリ 85,200 KB
実行使用メモリ 54,180 KB
最終ジャッジ日時 2026-03-12 03:47:57
合計ジャッジ時間 2,484 ms
ジャッジサーバーID
(参考情報)
judge3_0 / judge1_1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
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()))
s2 = S.count(2)
t2 = T.count(2)
cnt = 0
if not s2:
    cnt = max(cnt, T.count(1))
if not t2:
    cnt = max(cnt, S.count(1))
print((s2 + t2) * N - s2 * t2 + cnt)
0