Submission #1323489

#TimeUsernameProblemLanguageResultExecution timeMemory
1323489Jawad_Akbar_JJOdd-even (IZhO11_oddeven)C++20
0 / 100
0 ms332 KiB
#include <iostream> using namespace std; #define int long long signed main(){ int n; cin>>n; int l = 0, r = 2e9; while (l + 1 < r){ int mid = (l + r) / 2; if ((mid * (mid + 1)) / 2 >= n) r = mid; else l = mid; } cout<<2 * n - r<<'\n'; }
#Verdict Execution timeMemoryGrader output
Fetching results...