結果
| 問題 |
No.648 お や す み
|
| コンテスト | |
| ユーザー |
👑 Kazun
|
| 提出日時 | 2020-06-10 15:06:25 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
AC
|
| 実行時間 | 39 ms / 2,000 ms |
| コード長 | 237 bytes |
| コンパイル時間 | 208 ms |
| コンパイル使用メモリ | 82,432 KB |
| 実行使用メモリ | 52,608 KB |
| 最終ジャッジ日時 | 2024-06-23 05:46:18 |
| 合計ジャッジ時間 | 4,627 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 84 |
ソースコード
from math import sqrt
import sys
def f(n):
return (n*(n+1))//2
N=int(input())
d=int((sqrt(8*N+1)-1)/2)
for h in range(max(0,d-3),d+4):
if f(h)==N:
print("YES")
print(h)
sys.exit()
print("NO")
Kazun