結果

問題 No.1225 I hate I hate Matrix Construction
ユーザー zkouzkou
提出日時 2020-09-11 21:29:30
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 417 bytes
コンパイル時間 257 ms
コンパイル使用メモリ 87,100 KB
実行使用メモリ 71,580 KB
最終ジャッジ日時 2023-08-27 10:17:22
合計ジャッジ時間 4,348 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 71 ms
71,224 KB
testcase_01 AC 73 ms
71,556 KB
testcase_02 AC 71 ms
71,332 KB
testcase_03 AC 72 ms
71,332 KB
testcase_04 AC 76 ms
71,492 KB
testcase_05 AC 72 ms
71,252 KB
testcase_06 AC 70 ms
71,292 KB
testcase_07 AC 70 ms
71,404 KB
testcase_08 AC 71 ms
71,144 KB
testcase_09 AC 71 ms
71,136 KB
testcase_10 AC 72 ms
71,432 KB
testcase_11 AC 72 ms
71,496 KB
testcase_12 AC 72 ms
71,484 KB
testcase_13 AC 71 ms
71,580 KB
testcase_14 AC 71 ms
71,140 KB
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 AC 71 ms
71,260 KB
testcase_25 AC 70 ms
71,576 KB
testcase_26 AC 72 ms
71,308 KB
testcase_27 AC 71 ms
71,436 KB
testcase_28 AC 73 ms
71,528 KB
testcase_29 AC 74 ms
71,500 KB
testcase_30 AC 74 ms
71,316 KB
testcase_31 AC 72 ms
71,560 KB
testcase_32 AC 71 ms
71,332 KB
testcase_33 AC 73 ms
71,308 KB
testcase_34 AC 72 ms
71,340 KB
testcase_35 AC 74 ms
71,140 KB
testcase_36 AC 73 ms
71,292 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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 in Ss and 2 not in Ts:
    Ss, Ts = Ts, Ss
    s = Ss.count(2)
    print(s * N + Ss.count(1))
else:
    print(max(Ss.count(1), Ts.count(1)))
0