結果
| 問題 | No.1162 Many Quotients hard |
| ユーザー |
|
| 提出日時 | 2021-06-05 18:24:35 |
| 言語 | Ruby (4.0.2) |
| 結果 |
AC
|
| 実行時間 | 55 ms / 2,000 ms |
| コード長 | 191 bytes |
| 記録 | |
| コンパイル時間 | 453 ms |
| コンパイル使用メモリ | 9,216 KB |
| 実行使用メモリ | 14,976 KB |
| 最終ジャッジ日時 | 2026-05-15 20:17:19 |
| 合計ジャッジ時間 | 4,215 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 42 |
コンパイルメッセージ
Syntax OK
ソースコード
class Integer def isqrt return 0 if self<=0 return 1 if self<4 # 1 x,y=0,self while x!=y&&x+1!=y x,y=y,(self/y+y)/2 end x end end n=gets.to_i s=n.isqrt p 2*s-(n/s==s ? 1 : 0)