結果

問題 No.1991 Secret Garden
ユーザー lam6er
提出日時 2025-04-15 21:21:12
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 205 bytes
コンパイル時間 163 ms
コンパイル使用メモリ 82,140 KB
実行使用メモリ 54,128 KB
最終ジャッジ日時 2025-04-15 21:26:55
合計ジャッジ時間 1,649 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 3 WA * 19
権限があれば一括ダウンロードができます

ソースコード

diff #

import math

N = int(input())

k = int((math.sqrt(8 * N + 1) - 1) // 2)
remaining = N - k * (k + 1) // 2

if remaining == 0:
    m = 0
else:
    m = (remaining + k) // (k + 1)

ans = N - (k + m)
print(ans)
0