結果

問題 No.395 永遠の17歳
ユーザー betit0919betit0919
提出日時 2020-06-21 10:13:21
言語 Ruby
(3.3.0)
結果
AC  
実行時間 80 ms / 1,000 ms
コード長 152 bytes
コンパイル時間 39 ms
コンパイル使用メモリ 11,396 KB
実行使用メモリ 15,288 KB
最終ジャッジ日時 2023-09-16 18:10:18
合計ジャッジ時間 2,424 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 80 ms
15,032 KB
testcase_01 AC 80 ms
15,016 KB
testcase_02 AC 73 ms
15,228 KB
testcase_03 AC 76 ms
15,068 KB
testcase_04 AC 74 ms
15,036 KB
testcase_05 AC 76 ms
15,128 KB
testcase_06 AC 76 ms
15,128 KB
testcase_07 AC 76 ms
15,128 KB
testcase_08 AC 77 ms
15,076 KB
testcase_09 AC 75 ms
15,076 KB
testcase_10 AC 75 ms
15,288 KB
testcase_11 AC 72 ms
15,144 KB
testcase_12 AC 73 ms
15,288 KB
testcase_13 AC 78 ms
15,040 KB
testcase_14 AC 77 ms
15,136 KB
testcase_15 AC 77 ms
15,132 KB
testcase_16 AC 75 ms
15,036 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.rb:13: warning: ambiguous first argument; put parentheses or a space even after `-' operator
Syntax OK

ソースコード

diff #

a=gets.to_i

if a>=17
  p a-7
else
  ans=nil
  (2..30).each do |i|
    ans=i if(a.to_s(i)=='17')
  end
  if(ans)
    puts ans
  else
    p -1
  end
end
0