結果
問題 |
No.648 お や す み
|
ユーザー |
|
提出日時 | 2023-01-03 20:44:10 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 316 bytes |
コンパイル時間 | 206 ms |
コンパイル使用メモリ | 82,104 KB |
実行使用メモリ | 54,232 KB |
最終ジャッジ日時 | 2024-11-27 02:23:29 |
合計ジャッジ時間 | 4,652 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 53 WA * 31 |
ソースコード
import sys input = sys.stdin.readline n = int(input()) l = 0 r = 2 * 10**9 + 1 for _ in range(50): mid = (l + r) // 2 if mid * (mid + 1) == 2 * n: print("YES") exit() elif mid * (mid + 1) < 2 * n: l = mid else: r = mid print("YES" if r * (r + 1) == 2 * n else "NO")