結果

問題 No.432 占い(Easy)
ユーザー 👑 horiesinitihoriesiniti
提出日時 2018-03-11 19:22:50
言語 Ruby
(3.3.0)
結果
AC  
実行時間 152 ms / 2,000 ms
コード長 238 bytes
コンパイル時間 207 ms
コンパイル使用メモリ 11,280 KB
実行使用メモリ 23,072 KB
最終ジャッジ日時 2023-08-05 02:29:45
合計ジャッジ時間 4,057 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 80 ms
15,052 KB
testcase_01 AC 79 ms
15,160 KB
testcase_02 AC 81 ms
15,196 KB
testcase_03 AC 81 ms
15,100 KB
testcase_04 AC 81 ms
15,136 KB
testcase_05 AC 81 ms
15,096 KB
testcase_06 AC 83 ms
15,172 KB
testcase_07 AC 80 ms
15,060 KB
testcase_08 AC 80 ms
15,296 KB
testcase_09 AC 86 ms
15,428 KB
testcase_10 AC 82 ms
15,036 KB
testcase_11 AC 90 ms
16,280 KB
testcase_12 AC 152 ms
23,068 KB
testcase_13 AC 151 ms
23,072 KB
testcase_14 AC 90 ms
16,208 KB
testcase_15 AC 82 ms
15,160 KB
testcase_16 AC 80 ms
15,036 KB
testcase_17 AC 141 ms
23,032 KB
testcase_18 AC 119 ms
19,608 KB
testcase_19 AC 107 ms
18,216 KB
testcase_20 AC 94 ms
16,588 KB
testcase_21 AC 95 ms
16,876 KB
testcase_22 AC 85 ms
15,320 KB
testcase_23 AC 85 ms
15,296 KB
testcase_24 AC 87 ms
15,196 KB
testcase_25 AC 89 ms
15,264 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

def f(xs)
	res=[]
	e=xs.shift
	while xs.empty? == false
		e2=e+xs[0]
		e2=e2%10+1 if(e2>=10)
		res<<e2
		e=xs.shift
	end
	return res
end
gets.to_i.times{
	xs=gets.chomp.split("").map{|e| e.to_i}
	while xs.size>1
		xs=f(xs)
	end
	p xs[0]
}
0