/ SeriousOJ /

Record Detail

Accepted


  
# Status Time Cost Memory Cost
#1 Accepted 3ms 1.152 MiB
#2 Accepted 2ms 1.152 MiB
#3 Accepted 2ms 1.152 MiB
#4 Accepted 2ms 1.152 MiB
#5 Accepted 2ms 1.152 MiB
#6 Accepted 2ms 1.152 MiB

Code

#ifndef LOCAL
#include <bits/stdc++.h>
#define debug(...)
#endif

using namespace std;
#define int long long
#define cinv(v) for (auto &it:v) cin>>it;
#define coutv(v) for (auto &it:v) cout<< it<<' '; cout<<'\n';

const int N = 10000;
vector<int> v{1};

void shelby() {
    int n;
    cin >> n;
    cout << lower_bound(v.begin(), v.end(), n) - v.begin() + 1 << '\n';
}

signed main() {
    cin.tie(0)->sync_with_stdio(0);
    // set<int> st;
    // for (int i = 1; i <= N; ++i) {
    //     st.insert(i * i);
    //     st.insert(i * (i + 1));
    // }
    // vector<int> v = {st.begin(), st.end()};
    // vector<int> diff;
    // for (int i = 1; i < v.size(); ++i) diff.push_back(v[i] - v[i - 1]);
    // debug(st);
    for (int i = 2; v.back() < 1e9; ++i) {
        v.push_back(v.back() + i);
        v.push_back(v.back() + i);
    }
    int t = 1;
    // cin >> t;
    for (int _ = 1; _ <= t; ++_) {
        // cout << "Case " << _ << ": ";
        shelby();
    }
}

Information

Submit By
Type
Submission
Problem
P1191 A. Balanced Product
Contest
Brain Booster #10
Language
C++17 (G++ 13.2.0)
Submit At
2025-06-13 15:39:28
Judged At
2025-06-13 15:39:28
Judged By
Score
100
Total Time
3ms
Peak Memory
1.152 MiB