結果
| 問題 | No.1047 Zero (Novice) |
| コンテスト | |
| ユーザー |
horiesiniti
|
| 提出日時 | 2023-02-04 19:15:30 |
| 言語 | Ruby (4.0.2) |
| 結果 |
AC
|
| 実行時間 | 49 ms / 2,000 ms |
| + 937µs | |
| コード長 | 133 bytes |
| 記録 | |
| コンパイル時間 | 474 ms |
| コンパイル使用メモリ | 8,832 KB |
| 実行使用メモリ | 14,592 KB |
| 最終ジャッジ日時 | 2026-08-05 04:43:49 |
| 合計ジャッジ時間 | 3,183 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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