結果

問題 No.1225 I hate I hate Matrix Construction
ユーザー ayaoniayaoni
提出日時 2020-10-17 10:57:51
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 77 ms / 2,000 ms
コード長 556 bytes
コンパイル時間 288 ms
コンパイル使用メモリ 87,156 KB
実行使用メモリ 71,608 KB
最終ジャッジ日時 2023-09-28 07:29:26
合計ジャッジ時間 5,276 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 74 ms
71,352 KB
testcase_01 AC 75 ms
71,348 KB
testcase_02 AC 75 ms
71,252 KB
testcase_03 AC 73 ms
71,368 KB
testcase_04 AC 77 ms
71,360 KB
testcase_05 AC 74 ms
71,320 KB
testcase_06 AC 76 ms
71,424 KB
testcase_07 AC 71 ms
71,144 KB
testcase_08 AC 71 ms
71,232 KB
testcase_09 AC 73 ms
71,356 KB
testcase_10 AC 72 ms
71,468 KB
testcase_11 AC 71 ms
71,580 KB
testcase_12 AC 73 ms
71,580 KB
testcase_13 AC 73 ms
71,120 KB
testcase_14 AC 73 ms
71,460 KB
testcase_15 AC 74 ms
71,544 KB
testcase_16 AC 71 ms
71,580 KB
testcase_17 AC 72 ms
71,316 KB
testcase_18 AC 73 ms
71,408 KB
testcase_19 AC 72 ms
71,576 KB
testcase_20 AC 70 ms
71,596 KB
testcase_21 AC 70 ms
71,296 KB
testcase_22 AC 71 ms
71,508 KB
testcase_23 AC 72 ms
71,300 KB
testcase_24 AC 73 ms
71,408 KB
testcase_25 AC 72 ms
71,392 KB
testcase_26 AC 72 ms
71,276 KB
testcase_27 AC 72 ms
71,352 KB
testcase_28 AC 71 ms
71,464 KB
testcase_29 AC 73 ms
71,408 KB
testcase_30 AC 73 ms
71,088 KB
testcase_31 AC 73 ms
71,460 KB
testcase_32 AC 72 ms
71,260 KB
testcase_33 AC 72 ms
71,608 KB
testcase_34 AC 72 ms
71,212 KB
testcase_35 AC 73 ms
71,552 KB
testcase_36 AC 73 ms
71,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
def I(): return int(sys.stdin.readline().rstrip())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))  #空白あり


N = I()
S = LI()
T = LI()

s0,s1,s2 = 0,0,0
t0,t1,t2 = 0,0,0
for s in S:
    if s == 0:
        s0 += 1
    elif s == 1:
        s1 += 1
    else:
        s2 += 1
for t in T:
    if t == 0:
        t0 += 1
    elif t == 1:
        t1 += 1
    else:
        t2 += 1

if s2 > 0 and t2 > 0:
    print(N*(s2+t2)-s2*t2)
elif s2 > 0:
    print(s1+N*s2)
elif t2 > 0:
    print(t1+N*t2)
else:
    print(max(s1,t1))
0