結果

問題 No.432 占い(Easy)
ユーザー maimai
提出日時 2016-10-14 22:29:13
言語 Ruby
(3.3.0)
結果
AC  
実行時間 309 ms / 2,000 ms
コード長 234 bytes
コンパイル時間 623 ms
コンパイル使用メモリ 11,388 KB
実行使用メモリ 16,116 KB
最終ジャッジ日時 2023-08-14 10:59:51
合計ジャッジ時間 5,082 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 69 ms
15,112 KB
testcase_01 AC 70 ms
15,260 KB
testcase_02 AC 72 ms
15,164 KB
testcase_03 AC 72 ms
15,104 KB
testcase_04 AC 71 ms
15,200 KB
testcase_05 AC 69 ms
15,012 KB
testcase_06 AC 69 ms
15,280 KB
testcase_07 AC 73 ms
15,112 KB
testcase_08 AC 73 ms
15,168 KB
testcase_09 AC 70 ms
15,272 KB
testcase_10 AC 70 ms
15,204 KB
testcase_11 AC 94 ms
15,324 KB
testcase_12 AC 309 ms
15,804 KB
testcase_13 AC 305 ms
16,116 KB
testcase_14 AC 94 ms
15,320 KB
testcase_15 AC 68 ms
15,084 KB
testcase_16 AC 67 ms
15,052 KB
testcase_17 AC 290 ms
15,900 KB
testcase_18 AC 180 ms
15,264 KB
testcase_19 AC 139 ms
15,404 KB
testcase_20 AC 101 ms
15,416 KB
testcase_21 AC 109 ms
15,380 KB
testcase_22 AC 73 ms
15,208 KB
testcase_23 AC 74 ms
15,096 KB
testcase_24 AC 73 ms
15,136 KB
testcase_25 AC 69 ms
15,100 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

def solve(q)
    return q if q.size==1
    r=""
    q.chars.inject{|l,c|
        k = l.to_i+c.to_i
        r << (10<=k ? (k%10)+1 : k).to_s
        l=c
    }
    return solve(r)
end


gets.to_i.times{|i|
    puts solve(gets.chomp)
}
0