結果
| 問題 |
No.648 お や す み
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2017-09-18 15:58:03 |
| 言語 | Ruby (3.4.1) |
| 結果 |
AC
|
| 実行時間 | 89 ms / 2,000 ms |
| コード長 | 251 bytes |
| コンパイル時間 | 335 ms |
| コンパイル使用メモリ | 7,552 KB |
| 実行使用メモリ | 12,416 KB |
| 最終ジャッジ日時 | 2024-09-13 20:42:40 |
| 合計ジャッジ時間 | 10,116 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 84 |
コンパイルメッセージ
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=8*gets.to_i+1
q=n.isqrt
if q**2!=n||q%2==0
puts :NO
else
puts :YES
p q-1>>1
end