結果
問題 |
No.1225 I hate I hate Matrix Construction
|
ユーザー |
|
提出日時 | 2024-05-06 10:12:38 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 43 ms / 2,000 ms |
コード長 | 336 bytes |
コンパイル時間 | 174 ms |
コンパイル使用メモリ | 82,064 KB |
実行使用メモリ | 53,692 KB |
最終ジャッジ日時 | 2024-11-28 16:08:52 |
合計ジャッジ時間 | 3,009 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 35 |
ソースコード
N = int(input()) S = list(map(int, input().split())) T = list(map(int, input().split())) s1 = S.count(1) s2 = S.count(2) t1 = T.count(1) t2 = T.count(2) if s2 == 0 and t2 == 0: print(max(s1, t1)) elif s2 > 0 and t2 > 0: print(s2 * N + t2 * N - s2 * t2) elif s2 == 0: print(t1 + t2 * N) elif t2 == 0: print(s1 + s2 * N)