結果

問題 No.1225 I hate I hate Matrix Construction
ユーザー laneguelanegue
提出日時 2020-09-11 21:57:27
言語 Ruby
(3.3.0)
結果
WA  
実行時間 -
コード長 330 bytes
コンパイル時間 233 ms
コンパイル使用メモリ 11,248 KB
実行使用メモリ 15,344 KB
最終ジャッジ日時 2023-08-27 14:20:04
合計ジャッジ時間 5,042 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 76 ms
15,040 KB
testcase_01 AC 77 ms
15,036 KB
testcase_02 AC 72 ms
15,188 KB
testcase_03 AC 74 ms
15,204 KB
testcase_04 AC 80 ms
15,116 KB
testcase_05 AC 83 ms
15,344 KB
testcase_06 AC 76 ms
15,144 KB
testcase_07 AC 76 ms
15,144 KB
testcase_08 AC 75 ms
15,144 KB
testcase_09 AC 73 ms
15,184 KB
testcase_10 AC 72 ms
15,140 KB
testcase_11 AC 76 ms
15,308 KB
testcase_12 AC 75 ms
15,132 KB
testcase_13 AC 74 ms
15,116 KB
testcase_14 AC 75 ms
14,996 KB
testcase_15 WA -
testcase_16 WA -
testcase_17 AC 72 ms
15,076 KB
testcase_18 AC 76 ms
15,096 KB
testcase_19 WA -
testcase_20 WA -
testcase_21 AC 74 ms
15,116 KB
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 AC 71 ms
15,100 KB
testcase_26 WA -
testcase_27 AC 77 ms
15,280 KB
testcase_28 AC 76 ms
15,280 KB
testcase_29 AC 75 ms
15,112 KB
testcase_30 AC 76 ms
15,224 KB
testcase_31 WA -
testcase_32 WA -
testcase_33 AC 75 ms
15,080 KB
testcase_34 WA -
testcase_35 WA -
testcase_36 WA -
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

N=gets.to_i
S=gets.split.map(&:to_i)
T=gets.split.map(&:to_i)
s=S.group_by{|i|i}
t=T.group_by{|i|i}
3.times{|i|
    s[i] ||= []
    t[i] ||= []
}
s2 = s[2].size
t2 = t[2].size
s1 = t2.even? ? s[1].size : s[0].size
t1 = s2.even? ? t[1].size : t[0].size
warn [s1,s2,t1,t2].inspect
r=0
r+=s2*N
r+=t2*N
r-=s2*t2
r+=[s1,t1].max
puts r
0