結果

問題 No.1458 Segment Function
ユーザー kotatsugamekotatsugame
提出日時 2021-03-31 21:19:36
言語 Ruby
(3.3.0)
結果
WA  
実行時間 -
コード長 200 bytes
コンパイル時間 249 ms
コンパイル使用メモリ 7,552 KB
実行使用メモリ 13,952 KB
最終ジャッジ日時 2024-05-09 04:43:57
合計ジャッジ時間 11,654 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 88 ms
12,160 KB
testcase_01 AC 91 ms
12,288 KB
testcase_02 AC 90 ms
12,288 KB
testcase_03 AC 94 ms
12,288 KB
testcase_04 AC 90 ms
12,160 KB
testcase_05 AC 91 ms
12,288 KB
testcase_06 AC 92 ms
12,160 KB
testcase_07 AC 92 ms
12,160 KB
testcase_08 AC 529 ms
13,440 KB
testcase_09 AC 534 ms
13,312 KB
testcase_10 AC 529 ms
13,440 KB
testcase_11 AC 531 ms
13,312 KB
testcase_12 AC 529 ms
13,440 KB
testcase_13 AC 146 ms
13,184 KB
testcase_14 AC 146 ms
13,312 KB
testcase_15 AC 145 ms
13,184 KB
testcase_16 AC 146 ms
13,184 KB
testcase_17 AC 147 ms
13,056 KB
testcase_18 AC 572 ms
13,824 KB
testcase_19 AC 571 ms
13,952 KB
testcase_20 AC 573 ms
13,824 KB
testcase_21 AC 569 ms
13,952 KB
testcase_22 AC 568 ms
13,824 KB
testcase_23 AC 94 ms
12,160 KB
testcase_24 WA -
testcase_25 AC 92 ms
12,160 KB
testcase_26 AC 256 ms
13,824 KB
testcase_27 AC 255 ms
13,824 KB
testcase_28 WA -
testcase_29 WA -
testcase_30 WA -
testcase_31 AC 120 ms
13,184 KB
testcase_32 AC 533 ms
13,440 KB
testcase_33 AC 531 ms
13,312 KB
testcase_34 AC 530 ms
13,440 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

def f(x)
	if x<0
		1+f(-x)
	else
		ret=0
		x.to_s.bytes{|c|
			ret+=[6,2,5,5,4,5,6,4,7,6][c-48]
		}
		ret
	end
end
x,n=gets.split.map &:to_i
while n>0
	n-=1
	y=f(x)
	if x==y
		break
	end
	x=y
end
p y
0