結果
| 問題 | No.1225 I hate I hate Matrix Construction |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2020-09-11 21:39:03 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 297 bytes |
| 記録 | |
| コンパイル時間 | 305 ms |
| コンパイル使用メモリ | 82,304 KB |
| 実行使用メモリ | 52,224 KB |
| 最終ジャッジ日時 | 2024-12-27 07:33:20 |
| 合計ジャッジ時間 | 3,286 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 32 WA * 3 |
ソースコード
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:
print(n ** 2)
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)))