# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
551377 | Olympia | Odd-even (IZhO11_oddeven) | C++17 | 2069 ms | 324 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <iostream>
#include <vector>
#include <iomanip>
#include <algorithm>
#include <cassert>
#include <map>
#include <complex>
#include <cmath>
#include <set>
#include <queue>
using namespace std;
#pragma GCC target ("avx2")
#pragma GCC optimization ("O3")
#pragma GCC optimization ("unroll-loops")
int main () {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int64_t n; cin >> n;
int64_t sq = sqrt(n * 2) - 2;
while (sq * (sq + 1)/2 < n) {
sq++;
}
//sq++;
cout << sq * sq + 2 *(n - (sq + 1) * sq/2) << '\n';
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |