結果
| 問題 |
No.1225 I hate I hate Matrix Construction
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2020-09-11 21:43:31 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
AC
|
| 実行時間 | 51 ms / 2,000 ms |
| コード長 | 350 bytes |
| コンパイル時間 | 445 ms |
| コンパイル使用メモリ | 82,176 KB |
| 実行使用メモリ | 52,096 KB |
| 最終ジャッジ日時 | 2024-12-27 10:29:49 |
| 合計ジャッジ時間 | 3,277 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 35 |
ソースコード
n = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
tina = 2 in a
tinb = 2 in b
if tina and tinb:
u = a.count(2)
v = b.count(2)
print(u * n + v * n - u * v)
elif tina:
print(a.count(2) * n + a.count(1))
elif tinb:
print(b.count(2) * n + b.count(1))
else:
print(max(a.count(1), b.count(1)))