結果
| 問題 |
No.1047 Zero (Novice)
|
| コンテスト | |
| ユーザー |
horiesiniti
|
| 提出日時 | 2023-02-04 19:15:30 |
| 言語 | Ruby (3.4.1) |
| 結果 |
AC
|
| 実行時間 | 81 ms / 2,000 ms |
| コード長 | 133 bytes |
| コンパイル時間 | 453 ms |
| コンパイル使用メモリ | 7,424 KB |
| 実行使用メモリ | 12,416 KB |
| 最終ジャッジ日時 | 2024-07-03 15:53:10 |
| 合計ジャッジ時間 | 3,150 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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