結果

問題 No.528 10^9と10^9+7と回文
ユーザー ciel
提出日時 2017-06-13 22:05:11
言語 Ruby
(3.4.1)
結果
AC  
実行時間 103 ms / 1,000 ms
コード長 118 bytes
コンパイル時間 138 ms
コンパイル使用メモリ 7,552 KB
実行使用メモリ 12,800 KB
最終ジャッジ日時 2024-07-23 18:34:21
合計ジャッジ時間 3,722 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 28
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.rb:5: warning: `*' interpreted as argument prefix
Syntax OK

ソースコード

diff #

s=gets.chomp
n=s.size
m=-~n/2
a=n/2
p *[0,7].map{|d|(s[0,m].to_i+10**a-1-(s[0,a].reverse>s[m..-1] ? 1 : 0))%(d+10**9)}
0