結果

問題 No.648  お や す み 
コンテスト
ユーザー ciel
提出日時 2017-10-06 01:10:05
言語 PyPy2
(7.3.15)
結果
RE  
実行時間 -
コード長 566 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 342 ms
コンパイル使用メモリ 77,352 KB
最終ジャッジ日時 2025-12-04 00:40:05
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other RE * 84
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#!/usr/bin/env python
import sys,ctypes
if sys.platform.startswith('linux'):
	libm=ctypes.cdll.LoadLibrary('libm.so.6')
	libc=ctypes.cdll.LoadLibrary('libc.so.6')
elif sys.platform=='darwin':
	libm=ctypes.cdll.LoadLibrary('libSystem.dylib')
	libc=libm
elif sys.platform=='win32':
	libm=ctypes.cdll.LoadLibrary('msvcr120.dll')
	libc=libm
else:
	raise ImportError

libm.sqrtl.restype=ctypes.c_longdouble
n=ctypes.c_longdouble()
z=int(sys.stdin.readline())*8+1
libc.sscanf(str(z),'%Lf',ctypes.byref(n))
n=libm.sqrtl(n)
q=int(n)
print('NO' if q*q<z else 'YES\n%d'%(q/2))
0