結果
| 問題 |
No.1225 I hate I hate Matrix Construction
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2020-09-11 22:44:10 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
AC
|
| 実行時間 | 42 ms / 2,000 ms |
| コード長 | 261 bytes |
| コンパイル時間 | 703 ms |
| コンパイル使用メモリ | 82,176 KB |
| 実行使用メモリ | 52,256 KB |
| 最終ジャッジ日時 | 2024-12-27 17:23:51 |
| 合計ジャッジ時間 | 2,822 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 35 |
ソースコード
N = int(input())
S = list(map(int, input().split()))
T = list(map(int, input().split()))
s = S.count(2)
t = T.count(2)
ans = (s + t) * N - s * t
if s:
x = 0
else:
x = T.count(1)
if t:
y = 0
else:
y = S.count(1)
ans += max(x, y)
print(ans)