結果

問題 No.182 新規性の虜
ユーザー 👑 horiesinitihoriesiniti
提出日時 2016-06-06 11:21:21
言語 Ruby
(3.3.0)
結果
AC  
実行時間 192 ms / 5,000 ms
コード長 247 bytes
コンパイル時間 506 ms
コンパイル使用メモリ 11,216 KB
実行使用メモリ 32,388 KB
最終ジャッジ日時 2023-08-27 11:32:57
合計ジャッジ時間 5,307 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 83 ms
15,180 KB
testcase_01 AC 84 ms
15,168 KB
testcase_02 AC 85 ms
15,300 KB
testcase_03 AC 83 ms
15,192 KB
testcase_04 AC 83 ms
15,172 KB
testcase_05 AC 84 ms
15,136 KB
testcase_06 AC 83 ms
15,192 KB
testcase_07 AC 83 ms
15,320 KB
testcase_08 AC 130 ms
23,940 KB
testcase_09 AC 170 ms
30,760 KB
testcase_10 AC 162 ms
30,088 KB
testcase_11 AC 156 ms
27,760 KB
testcase_12 AC 110 ms
20,152 KB
testcase_13 AC 84 ms
15,176 KB
testcase_14 AC 82 ms
15,236 KB
testcase_15 AC 84 ms
15,212 KB
testcase_16 AC 85 ms
15,216 KB
testcase_17 AC 85 ms
15,320 KB
testcase_18 AC 127 ms
20,580 KB
testcase_19 AC 118 ms
19,440 KB
testcase_20 AC 110 ms
18,436 KB
testcase_21 AC 131 ms
21,276 KB
testcase_22 AC 115 ms
18,864 KB
testcase_23 AC 84 ms
15,212 KB
testcase_24 AC 192 ms
32,388 KB
testcase_25 AC 117 ms
20,268 KB
testcase_26 AC 96 ms
17,024 KB
testcase_27 AC 83 ms
15,108 KB
evil01.txt AC 187 ms
32,828 KB
evil02.txt AC 189 ms
32,676 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.rb:3: warning: assigned but unused variable - n
Syntax OK

ソースコード

diff #

require 'set'
#set1.include?
n=STDIN.gets.to_i
as=STDIN.gets.split(" ")

set1=Set.new()
set2=Set.new()

as.each do |e|
	if set2.include?(e)
		next
	end
	if set1.include?(e)
		set1.delete(e)
		set2.add(e)
	else
		set1.add(e)
	end
end
puts set1.size
0