제출 #1127877

#제출 시각아이디문제언어결과실행 시간메모리
1127877Chinguun홀-짝 수열 (IZhO11_oddeven)C++20
0 / 100
1 ms392 KiB
#include <bits/stdc++.h> using namespace std; #define int long long #define ff first #define ss second #define pb push_back #define meta int tm = (tl + tr) / 2, x = i * 2 + 1, y = x + 1 const int N = 2e5 + 7; const int oo = 1e9; const int mod = 1e9 + 7; typedef pair<int, int> pii; typedef vector<int> vi; typedef vector<pii> vii; int a, l, r = oo; signed main() { ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); cin >> a; while (l < r) { int m = (l + r) / 2; if (m * (m + 1) / 2 < a) l = m + 1; else r = m; } r--; cout << a * 2 - r - 1; return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...