結果
問題 | No.1225 I hate I hate Matrix Construction |
ユーザー |
![]() |
提出日時 | 2020-09-11 21:36:38 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
AC
|
実行時間 | 39 ms / 2,000 ms |
コード長 | 299 bytes |
コンパイル時間 | 315 ms |
コンパイル使用メモリ | 12,288 KB |
実行使用メモリ | 10,624 KB |
最終ジャッジ日時 | 2024-12-27 06:17:55 |
合計ジャッジ時間 | 3,244 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 35 |
ソースコード
from collections import Counter as C N = int(input()) S = C([int(a) for a in input().split()]) T = C([int(a) for a in input().split()]) ans = N * N - (N - S[2]) * (N - T[2]) if S[2] == T[2] == 0: ans += max(S[1], T[1]) elif S[2] == 0: ans += T[1] elif T[2] == 0: ans += S[1] print(ans)