/** @kutbilimone **/
#include <bits/stdc++.h>
using namespace std;
#define endl '\n'
#define all(x) x.begin(),x.end()
#define int long long
signed main(){
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
int n;
cin >> n;
cout << 2*n - floor( (1.0+ sqrt(8.0*n-7.0))/2.0 );
return 0;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
364 KB |
Output is correct |
2 |
Correct |
0 ms |
364 KB |
Output is correct |
3 |
Correct |
0 ms |
364 KB |
Output is correct |
4 |
Incorrect |
1 ms |
364 KB |
Output isn't correct |
5 |
Halted |
0 ms |
0 KB |
- |