結果

問題 No.1225 I hate I hate Matrix Construction
コンテスト
ユーザー uni_python
提出日時 2020-09-12 19:13:57
言語 PyPy3
(8.0.0 + ACL)
コンパイル:
pypy3 -mpy_compile _filename_
実行:
pypy3 _filename_
結果
AC  
実行時間 25 ms / 2,000 ms
+ 10µs
コード長 472 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 308 ms
コンパイル使用メモリ 81,640 KB
実行使用メモリ 56,448 KB
最終ジャッジ日時 2026-10-10 06:44:50
合計ジャッジ時間 3,072 ms
ジャッジサーバーID
(参考情報)
judge1_0 / judge3_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 35
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

import sys
input=sys.stdin.readline
def I(): return int(input())
def MI(): return map(int, input().split())
def LI(): return list(map(int, input().split()))

def main():
    mod=10**9+7
    N=I()
    S=LI()
    T=LI()
    
    s2=S.count(2)
    t2=T.count(2)
    
    ans=s2*N + t2*N - (s2*t2)
    
    s1=S.count(1)
    t1=T.count(1)
    
    if s2!=0:
        t1=0
        
    if t2!=0:
        s1=0
    
    ans+=max(s1,t1)
    
    print(ans)
    

    
    


main()
0