- P34's solution
P34's Solution
- 2025-9-4 21:59:21 @
由 可得 ,直接套公式即可。
#include <bits/stdc++.h>
using namespace std;
int a[112];
int main()
{
long long n;
cin >> n;
long long res = sqrtl(2 * n + 0.25) + 0.49;
if (res * (res + 1) < 2 * n) res++;
cout << res << endl;
return 0;
}