結果

問題 No.1390 Get together
ユーザー yuruhiyayuruhiya
提出日時 2021-02-12 22:31:20
言語 Ruby
(3.3.0)
結果
WA  
実行時間 -
コード長 221 bytes
コンパイル時間 113 ms
コンパイル使用メモリ 11,560 KB
実行使用メモリ 45,876 KB
最終ジャッジ日時 2023-09-27 05:11:13
合計ジャッジ時間 13,220 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 130 ms
25,164 KB
testcase_01 AC 128 ms
24,932 KB
testcase_02 AC 125 ms
25,148 KB
testcase_03 AC 137 ms
26,084 KB
testcase_04 AC 131 ms
25,752 KB
testcase_05 WA -
testcase_06 AC 133 ms
25,880 KB
testcase_07 WA -
testcase_08 AC 136 ms
25,924 KB
testcase_09 AC 138 ms
26,068 KB
testcase_10 AC 126 ms
25,068 KB
testcase_11 AC 128 ms
25,164 KB
testcase_12 AC 128 ms
25,056 KB
testcase_13 WA -
testcase_14 AC 127 ms
25,108 KB
testcase_15 AC 130 ms
24,932 KB
testcase_16 WA -
testcase_17 AC 580 ms
39,588 KB
testcase_18 AC 518 ms
44,652 KB
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 AC 597 ms
39,352 KB
testcase_26 WA -
testcase_27 WA -
testcase_28 AC 608 ms
39,428 KB
testcase_29 WA -
testcase_30 WA -
testcase_31 WA -
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.rb:1: warning: assigned but unused variable - m
Syntax OK

ソースコード

diff #

n, m = gets.split.map(&:to_i)
b, c = (1..n).map { gets.split.map(&:to_i) }.transpose
d = (0..200_000).map { [] }
(0...n).each { |i| d[c[i]] << b[i] }
puts d.reject(&:empty?).sum { |a| a.size - a.tally.map { _1[1] }.max }
0