結果
問題 | No.1225 I hate I hate Matrix Construction |
ユーザー |
|
提出日時 | 2020-09-11 21:30:38 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
AC
|
実行時間 | 36 ms / 2,000 ms |
コード長 | 417 bytes |
コンパイル時間 | 189 ms |
コンパイル使用メモリ | 12,288 KB |
実行使用メモリ | 10,752 KB |
最終ジャッジ日時 | 2024-12-27 02:58:21 |
合計ジャッジ時間 | 2,370 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 35 |
ソースコード
N = int(input())Ss = list(map(int, input().split()))Ts = list(map(int, input().split()))if 2 in Ss and 2 in Ts:s = Ss.count(2)t = Ts.count(2)print(s * N + t * N - s * t)elif 2 in Ss and 2 not in Ts:s = Ss.count(2)print(s * N + Ss.count(1))elif 2 not in Ss and 2 in Ts:Ss, Ts = Ts, Sss = Ss.count(2)print(s * N + Ss.count(1))else:print(max(Ss.count(1), Ts.count(1)))