結果
| 問題 | 
                            No.1225 I hate I hate Matrix Construction
                             | 
                    
| コンテスト | |
| ユーザー | 
                             | 
                    
| 提出日時 | 2020-09-11 22:16:53 | 
| 言語 | PyPy3  (7.3.15)  | 
                    
| 結果 | 
                             
                                AC
                                 
                             
                            
                         | 
                    
| 実行時間 | 55 ms / 2,000 ms | 
| コード長 | 323 bytes | 
| コンパイル時間 | 534 ms | 
| コンパイル使用メモリ | 82,048 KB | 
| 実行使用メモリ | 52,096 KB | 
| 最終ジャッジ日時 | 2024-12-27 15:05:53 | 
| 合計ジャッジ時間 | 3,669 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge5 / judge2 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 2 | 
| other | AC * 35 | 
ソースコード
n=int(input())
s=list(map(int,input().split()))
t=list(map(int,input().split()))
if s.count(2)>0 and t.count(2):
    print(s.count(2)*n+t.count(2)*n-s.count(2)*t.count(2))
elif s.count(2)>0:
    print(s.count(2)*n+s.count(1))
elif t.count(2)>0:
    print(t.count(2)*n+t.count(1))
else:
    print(max(s.count(1),t.count(1)))