結果

問題 No.1225 I hate I hate Matrix Construction
ユーザー c-yanc-yan
提出日時 2020-09-11 22:06:43
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 361 bytes
コンパイル時間 72 ms
コンパイル使用メモリ 10,776 KB
実行使用メモリ 10,004 KB
最終ジャッジ日時 2023-08-27 14:41:22
合計ジャッジ時間 2,141 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
7,788 KB
testcase_01 WA -
testcase_02 AC 18 ms
7,800 KB
testcase_03 WA -
testcase_04 AC 19 ms
9,592 KB
testcase_05 AC 17 ms
7,900 KB
testcase_06 AC 17 ms
8,660 KB
testcase_07 WA -
testcase_08 AC 17 ms
8,448 KB
testcase_09 AC 18 ms
8,732 KB
testcase_10 AC 18 ms
8,500 KB
testcase_11 AC 20 ms
9,712 KB
testcase_12 AC 18 ms
9,104 KB
testcase_13 WA -
testcase_14 WA -
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 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 AC 16 ms
7,856 KB
testcase_28 WA -
testcase_29 WA -
testcase_30 WA -
testcase_31 WA -
testcase_32 WA -
testcase_33 WA -
testcase_34 AC 19 ms
9,732 KB
testcase_35 AC 20 ms
9,900 KB
testcase_36 AC 17 ms
8,448 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
S = list(map(int, input().split()))
T = list(map(int, input().split()))

m = [[0] * N for _ in range(N)]

s1 = S.count(1)
t1 = T.count(1)
s2 = S.count(2)
t2 = T.count(2)

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