結果
| 問題 |
No.1162 Many Quotients hard
|
| ユーザー |
|
| 提出日時 | 2021-06-05 18:24:35 |
| 言語 | Ruby (3.4.1) |
| 結果 |
AC
|
| 実行時間 | 103 ms / 2,000 ms |
| コード長 | 191 bytes |
| コンパイル時間 | 222 ms |
| コンパイル使用メモリ | 7,552 KB |
| 実行使用メモリ | 12,288 KB |
| 最終ジャッジ日時 | 2024-11-21 16:43:35 |
| 合計ジャッジ時間 | 5,722 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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)