結果

問題 No.1225 I hate I hate Matrix Construction
ユーザー 👑 H20H20
提出日時 2021-08-19 09:10:06
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 36 ms / 2,000 ms
コード長 314 bytes
コンパイル時間 308 ms
コンパイル使用メモリ 82,040 KB
実行使用メモリ 53,900 KB
最終ジャッジ日時 2024-04-20 11:15:11
合計ジャッジ時間 3,210 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 33 ms
52,952 KB
testcase_01 AC 35 ms
52,456 KB
testcase_02 AC 33 ms
52,140 KB
testcase_03 AC 35 ms
53,136 KB
testcase_04 AC 35 ms
52,376 KB
testcase_05 AC 33 ms
52,596 KB
testcase_06 AC 33 ms
53,384 KB
testcase_07 AC 33 ms
53,804 KB
testcase_08 AC 32 ms
52,612 KB
testcase_09 AC 36 ms
53,260 KB
testcase_10 AC 36 ms
53,608 KB
testcase_11 AC 36 ms
52,396 KB
testcase_12 AC 35 ms
53,548 KB
testcase_13 AC 34 ms
52,024 KB
testcase_14 AC 36 ms
52,616 KB
testcase_15 AC 34 ms
53,008 KB
testcase_16 AC 35 ms
52,436 KB
testcase_17 AC 33 ms
53,828 KB
testcase_18 AC 33 ms
52,336 KB
testcase_19 AC 34 ms
52,452 KB
testcase_20 AC 32 ms
52,904 KB
testcase_21 AC 31 ms
53,248 KB
testcase_22 AC 33 ms
53,632 KB
testcase_23 AC 34 ms
52,400 KB
testcase_24 AC 35 ms
53,900 KB
testcase_25 AC 33 ms
52,544 KB
testcase_26 AC 33 ms
52,268 KB
testcase_27 AC 32 ms
52,888 KB
testcase_28 AC 33 ms
53,652 KB
testcase_29 AC 32 ms
53,620 KB
testcase_30 AC 34 ms
52,552 KB
testcase_31 AC 32 ms
53,076 KB
testcase_32 AC 33 ms
52,824 KB
testcase_33 AC 34 ms
53,040 KB
testcase_34 AC 34 ms
53,128 KB
testcase_35 AC 35 ms
52,484 KB
testcase_36 AC 33 ms
52,880 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
S = list(map(int,input().split()))
T = list(map(int,input().split()))
s2 = S.count(2)
t2 = T.count(2)
ssum = 0
tsum = 0
for s in S:
    if s==1:
        ssum+=max(1,t2)
    if s==2:
        ssum+=N
for t in T:
    if t==1:
        tsum+=max(1,s2)
    if t==2:
        tsum+=N
print(max(ssum,tsum))
0