結果

問題 No.91 赤、緑、青の石
ユーザー 👑 horiesinitihoriesiniti
提出日時 2017-06-25 14:23:42
言語 Ruby
(3.3.0)
結果
AC  
実行時間 81 ms / 5,000 ms
コード長 374 bytes
コンパイル時間 42 ms
コンパイル使用メモリ 11,392 KB
実行使用メモリ 15,312 KB
最終ジャッジ日時 2023-09-06 12:29:55
合計ジャッジ時間 3,777 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 81 ms
15,092 KB
testcase_01 AC 80 ms
15,128 KB
testcase_02 AC 79 ms
15,048 KB
testcase_03 AC 78 ms
15,104 KB
testcase_04 AC 78 ms
15,144 KB
testcase_05 AC 78 ms
15,104 KB
testcase_06 AC 78 ms
15,132 KB
testcase_07 AC 78 ms
15,160 KB
testcase_08 AC 78 ms
15,160 KB
testcase_09 AC 77 ms
15,160 KB
testcase_10 AC 78 ms
15,052 KB
testcase_11 AC 78 ms
15,216 KB
testcase_12 AC 77 ms
15,104 KB
testcase_13 AC 76 ms
15,096 KB
testcase_14 AC 73 ms
15,100 KB
testcase_15 AC 77 ms
15,104 KB
testcase_16 AC 73 ms
15,104 KB
testcase_17 AC 73 ms
15,212 KB
testcase_18 AC 76 ms
15,008 KB
testcase_19 AC 76 ms
15,296 KB
testcase_20 AC 72 ms
15,156 KB
testcase_21 AC 77 ms
15,152 KB
testcase_22 AC 74 ms
15,156 KB
testcase_23 AC 72 ms
15,152 KB
testcase_24 AC 73 ms
15,152 KB
testcase_25 AC 79 ms
15,008 KB
testcase_26 AC 76 ms
15,312 KB
testcase_27 AC 75 ms
15,148 KB
testcase_28 AC 75 ms
15,104 KB
testcase_29 AC 73 ms
15,160 KB
testcase_30 AC 74 ms
15,112 KB
testcase_31 AC 77 ms
15,144 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

a=gets.split.map{|e| e.to_i}.sort
ans=a[0]
a[2]=a[2]-a[0]
a[1]=a[1]-a[0]

b=(a[2]-a[1])/2
if a[1]<=b then
	ans=ans+a[1]
	a[2]=a[2]-a[1]*3
	ans=ans+a[2]/5
else
	a[2]=a[2]-b*2-b
	ans=ans+b
	a[1]=a[1]-b
	#puts "a" ,ans,a[1],a[2],"b"
	if a[2]==a[1]+1 then
		ans=ans+(a[2]-1)/2
	else
		if a[1]%2==1 then
			ans=ans+a[1]/2
		else
			ans=ans+((a[1]/2)/2)*2
		end
	end
end
puts ans
0