結果
問題 | No.1225 I hate I hate Matrix Construction |
ユーザー |
![]() |
提出日時 | 2020-09-12 19:13:57 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 42 ms / 2,000 ms |
コード長 | 472 bytes |
コンパイル時間 | 473 ms |
コンパイル使用メモリ | 82,128 KB |
実行使用メモリ | 54,444 KB |
最終ジャッジ日時 | 2025-01-02 13:15:05 |
合計ジャッジ時間 | 3,306 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 35 |
ソースコード
import sys input=sys.stdin.readline def I(): return int(input()) def MI(): return map(int, input().split()) def LI(): return list(map(int, input().split())) def main(): mod=10**9+7 N=I() S=LI() T=LI() s2=S.count(2) t2=T.count(2) ans=s2*N + t2*N - (s2*t2) s1=S.count(1) t1=T.count(1) if s2!=0: t1=0 if t2!=0: s1=0 ans+=max(s1,t1) print(ans) main()