結果

問題 No.1225 I hate I hate Matrix Construction
ユーザー chielochielo
提出日時 2020-09-11 21:43:31
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 74 ms / 2,000 ms
コード長 350 bytes
コンパイル時間 270 ms
コンパイル使用メモリ 87,176 KB
実行使用メモリ 71,552 KB
最終ジャッジ日時 2023-08-27 13:37:45
合計ジャッジ時間 4,379 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 69 ms
71,240 KB
testcase_01 AC 67 ms
71,332 KB
testcase_02 AC 67 ms
71,208 KB
testcase_03 AC 69 ms
71,376 KB
testcase_04 AC 74 ms
71,348 KB
testcase_05 AC 69 ms
71,148 KB
testcase_06 AC 67 ms
71,280 KB
testcase_07 AC 69 ms
71,188 KB
testcase_08 AC 67 ms
71,400 KB
testcase_09 AC 67 ms
71,160 KB
testcase_10 AC 67 ms
71,240 KB
testcase_11 AC 67 ms
71,256 KB
testcase_12 AC 69 ms
71,172 KB
testcase_13 AC 66 ms
71,260 KB
testcase_14 AC 65 ms
71,356 KB
testcase_15 AC 65 ms
71,360 KB
testcase_16 AC 65 ms
71,380 KB
testcase_17 AC 65 ms
71,312 KB
testcase_18 AC 69 ms
71,336 KB
testcase_19 AC 68 ms
71,544 KB
testcase_20 AC 69 ms
71,400 KB
testcase_21 AC 66 ms
71,160 KB
testcase_22 AC 67 ms
71,260 KB
testcase_23 AC 67 ms
71,352 KB
testcase_24 AC 68 ms
71,268 KB
testcase_25 AC 69 ms
71,356 KB
testcase_26 AC 71 ms
71,240 KB
testcase_27 AC 67 ms
71,200 KB
testcase_28 AC 67 ms
71,028 KB
testcase_29 AC 67 ms
70,964 KB
testcase_30 AC 68 ms
71,352 KB
testcase_31 AC 68 ms
71,160 KB
testcase_32 AC 68 ms
71,552 KB
testcase_33 AC 67 ms
71,540 KB
testcase_34 AC 68 ms
71,152 KB
testcase_35 AC 66 ms
71,068 KB
testcase_36 AC 64 ms
71,024 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
tina = 2 in a
tinb = 2 in b
if tina and tinb:
    u = a.count(2)
    v = b.count(2)
    print(u * n + v * n - u * v)
elif tina:
    print(a.count(2) * n + a.count(1))
elif tinb:
    print(b.count(2) * n + b.count(1))
else:
    print(max(a.count(1), b.count(1)))
0