結果
問題 |
No.1225 I hate I hate Matrix Construction
|
ユーザー |
|
提出日時 | 2020-09-12 11:09:43 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
AC
|
実行時間 | 32 ms / 2,000 ms |
コード長 | 411 bytes |
コンパイル時間 | 335 ms |
コンパイル使用メモリ | 12,544 KB |
実行使用メモリ | 10,880 KB |
最終ジャッジ日時 | 2024-12-31 11:20:51 |
合計ジャッジ時間 | 2,611 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())) ans = 0 if 2 in s: a = s.count(2) ans += a*n if 2 in t: b = t.count(2) ans += b*(n-a) else: b = s.count(1) ans += b else: a = s.count(1) if 2 in t: b = t.count(2) ans += b*n+t.count(1) else: b = t.count(1) ans += max(a,b) print(ans)