結果
問題 |
No.1225 I hate I hate Matrix Construction
|
ユーザー |
|
提出日時 | 2021-02-24 02:21:26 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 44 ms / 2,000 ms |
コード長 | 254 bytes |
コンパイル時間 | 307 ms |
コンパイル使用メモリ | 82,272 KB |
実行使用メモリ | 55,436 KB |
最終ジャッジ日時 | 2024-09-22 21:31:34 |
合計ジャッジ時間 | 2,985 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 35 |
ソースコード
from collections import * N=int(input()) S=list(map(int, input().split())) T=list(map(int, input().split())) CS=Counter(S) CT=Counter(T) if CS[2]>0: CT[1]=0 if CT[2]>0: CS[1]=0 res=0 res+=N**2-(N-CS[2])*(N-CT[2]) res+=max(CS[1],CT[1]) print(res)