Submission #551388

# Submission time Handle Problem Language Result Execution time Memory
551388 2022-04-20T14:34:15 Z Olympia Odd-even (IZhO11_oddeven) C++17
0 / 100
0 ms 212 KB
#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 = (1 + sqrt(1 + 8 * n)) / 2;
    cout << sq * sq + 2 * (n - (sq + 1) * sq / 2) << '\n';
}

Compilation message

oddeven.cpp:15: warning: ignoring '#pragma GCC optimization' [-Wunknown-pragmas]
   15 | #pragma GCC optimization ("O3")
      | 
oddeven.cpp:16: warning: ignoring '#pragma GCC optimization' [-Wunknown-pragmas]
   16 | #pragma GCC optimization ("unroll-loops")
      |
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -