結果
| 問題 | No.1047 Zero (Novice) |
| コンテスト | |
| ユーザー |
horiesiniti
|
| 提出日時 | 2023-02-04 19:15:30 |
| 言語 | Ruby (4.0.1) |
| 結果 |
AC
|
| 実行時間 | 69 ms / 2,000 ms |
| コード長 | 133 bytes |
| 記録 | |
| コンパイル時間 | 379 ms |
| コンパイル使用メモリ | 9,088 KB |
| 実行使用メモリ | 15,104 KB |
| 最終ジャッジ日時 | 2026-03-24 23:52:26 |
| 合計ジャッジ時間 | 2,536 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge1_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 17 |
コンパイルメッセージ
Main.rb:11: warning: ambiguous first argument; put parentheses or a space even after `-` operator Syntax OK
ソースコード
a,b=gets.split(" ").map{|e|e.to_i}
n=b
ans=1
if a==-1 || b==0 then
while n!=0 do
n=a*n+b
ans+=1
end
puts ans
else
puts -1
end
horiesiniti