結果

問題 No.1225 I hate I hate Matrix Construction
ユーザー marroncastlemarroncastle
提出日時 2020-09-11 21:42:47
言語 Python3
(3.11.6 + numpy 1.26.0 + scipy 1.11.3)
結果
AC  
実行時間 19 ms / 2,000 ms
コード長 332 bytes
コンパイル時間 304 ms
コンパイル使用メモリ 10,692 KB
実行使用メモリ 8,664 KB
最終ジャッジ日時 2023-08-27 13:19:07
合計ジャッジ時間 2,305 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 19 ms
8,520 KB
testcase_01 AC 18 ms
8,524 KB
testcase_02 AC 18 ms
8,596 KB
testcase_03 AC 18 ms
8,480 KB
testcase_04 AC 18 ms
8,572 KB
testcase_05 AC 18 ms
8,468 KB
testcase_06 AC 19 ms
8,508 KB
testcase_07 AC 19 ms
8,532 KB
testcase_08 AC 19 ms
8,528 KB
testcase_09 AC 19 ms
8,492 KB
testcase_10 AC 19 ms
8,544 KB
testcase_11 AC 19 ms
8,620 KB
testcase_12 AC 18 ms
8,476 KB
testcase_13 AC 18 ms
8,520 KB
testcase_14 AC 18 ms
8,524 KB
testcase_15 AC 18 ms
8,544 KB
testcase_16 AC 19 ms
8,504 KB
testcase_17 AC 19 ms
8,584 KB
testcase_18 AC 18 ms
8,664 KB
testcase_19 AC 19 ms
8,536 KB
testcase_20 AC 18 ms
8,564 KB
testcase_21 AC 19 ms
8,564 KB
testcase_22 AC 19 ms
8,528 KB
testcase_23 AC 19 ms
8,488 KB
testcase_24 AC 19 ms
8,568 KB
testcase_25 AC 18 ms
8,664 KB
testcase_26 AC 18 ms
8,612 KB
testcase_27 AC 19 ms
8,596 KB
testcase_28 AC 19 ms
8,488 KB
testcase_29 AC 18 ms
8,504 KB
testcase_30 AC 18 ms
8,532 KB
testcase_31 AC 18 ms
8,536 KB
testcase_32 AC 19 ms
8,464 KB
testcase_33 AC 18 ms
8,580 KB
testcase_34 AC 18 ms
8,508 KB
testcase_35 AC 19 ms
8,544 KB
testcase_36 AC 19 ms
8,500 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
S = list(map(int, input().split()))
T = list(map(int, input().split()))
from collections import Counter
cs = Counter(S)
ct = Counter(T)
if cs[2]>0:
  if ct[2]>0:
    print(ct[2]*N+cs[2]*N-ct[2]*cs[2])
  else:
    print(cs[2]*N+cs[1])
else:
  if ct[2]>0:
    print(ct[2]*N+ct[1])
  else:
    print(max(cs[1],ct[1]))
0