結果

問題 No.938 賢人を探せ
ユーザー 小野寺健小野寺健
提出日時 2021-11-08 18:20:48
言語 Ruby
(3.3.0)
結果
AC  
実行時間 159 ms / 2,000 ms
コード長 194 bytes
コンパイル時間 107 ms
コンパイル使用メモリ 7,552 KB
実行使用メモリ 18,236 KB
最終ジャッジ日時 2024-04-28 04:28:53
合計ジャッジ時間 4,384 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 159 ms
18,236 KB
testcase_01 AC 89 ms
12,160 KB
testcase_02 AC 91 ms
12,160 KB
testcase_03 AC 91 ms
12,032 KB
testcase_04 AC 89 ms
12,032 KB
testcase_05 AC 88 ms
12,032 KB
testcase_06 AC 88 ms
12,288 KB
testcase_07 AC 86 ms
12,160 KB
testcase_08 AC 135 ms
14,992 KB
testcase_09 AC 135 ms
14,924 KB
testcase_10 AC 89 ms
12,032 KB
testcase_11 AC 144 ms
15,016 KB
testcase_12 AC 137 ms
14,500 KB
testcase_13 AC 140 ms
14,448 KB
testcase_14 AC 139 ms
14,520 KB
testcase_15 AC 136 ms
14,372 KB
testcase_16 AC 135 ms
14,244 KB
testcase_17 AC 131 ms
14,352 KB
testcase_18 AC 136 ms
14,480 KB
testcase_19 AC 136 ms
14,404 KB
testcase_20 AC 135 ms
14,480 KB
testcase_21 AC 138 ms
14,228 KB
testcase_22 AC 158 ms
18,048 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

N = gets.to_i

hashA = {}
hashB = {}

N.times {
	a, b = gets.strip.split(" ")
	hashA[a] = true
	hashB.delete(a) if hashB.include?(a) 
	hashB[b] = true if not hashA.include?(b)
}

puts hashB.keys
0