結果
問題 | No.1157 Many Quotients easy |
ユーザー |
|
提出日時 | 2021-06-05 18:24:47 |
言語 | Ruby (3.4.1) |
結果 |
AC
|
実行時間 | 93 ms / 2,000 ms |
コード長 | 191 bytes |
コンパイル時間 | 246 ms |
コンパイル使用メモリ | 7,552 KB |
実行使用メモリ | 12,288 KB |
最終ジャッジ日時 | 2024-11-21 16:43:47 |
合計ジャッジ時間 | 3,597 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 22 |
コンパイルメッセージ
Syntax OK
ソースコード
class Integerdef isqrtreturn 0 if self<=0return 1 if self<4 # 1x,y=0,selfwhile x!=y&&x+1!=yx,y=y,(self/y+y)/2endxendendn=gets.to_is=n.isqrtp 2*s-(n/s==s ? 1 : 0)