結果

問題 No.682 Average
ユーザー mizocodermizocoder
提出日時 2018-07-01 21:39:21
言語 Ruby
(3.3.0)
結果
WA  
実行時間 -
コード長 282 bytes
コンパイル時間 109 ms
コンパイル使用メモリ 11,284 KB
実行使用メモリ 15,336 KB
最終ジャッジ日時 2023-09-13 16:40:41
合計ジャッジ時間 2,226 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 83 ms
15,180 KB
testcase_01 AC 82 ms
15,156 KB
testcase_02 AC 83 ms
15,148 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 AC 85 ms
15,268 KB
testcase_06 AC 84 ms
15,264 KB
testcase_07 AC 83 ms
15,156 KB
testcase_08 AC 83 ms
15,096 KB
testcase_09 AC 83 ms
15,288 KB
testcase_10 WA -
testcase_11 AC 85 ms
15,176 KB
testcase_12 AC 83 ms
15,248 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

a , b = gets.split.map(&:to_i)

surplus = (3 - (a+b)%3) % 3		# 求める数は、3で割った余りがいくつの数?

a-surplus == 0 ? zero = 1 : zero = 0
a = ((a-surplus)/3 + 1) * 3		# a以上の3の倍数
b = (b-surplus)/3*3			# b以下の3の倍数

print (b-a)/3 + 1 + zero
0