/ SeriousOJ /

Record Detail

Time Exceeded


  
# Status Time Cost Memory Cost
#1 Time Exceeded ≥1115ms ≥158.262 MiB
#2 Time Exceeded ≥1116ms ≥158.336 MiB

Code

/*
 *   BISMILLAHIR RAHMANIR RAHIM
 *   ==========================
 *
 *   Submitted By: SAKLAN
 *   North East University Bangladesh
 */

#include <bits/stdc++.h>
using namespace std;

#define ll long long
#define ld long double
#define  cinv(v)  for(auto &i:v) cin >> i;
#define  vi   vector<int>
#define  vii  vector<ll>
#define mod 1000000000
#define  cout(v)  for(auto e:v) cout << e << sp;
#define srt(v) sort(v.begin(),v.end())
#define rsrt(v) sort(v.rbegin(),v.rend())
#define yes cout<<"YES\n"
#define no cout<<"NO\n"
#define endl '\n'
#define start long long t; cin >> t; while(t--)
#define saklan ios::sync_with_stdio(0); cin.tie(0);

void solve() {
    ll n;
    cin >> n;
    unordered_set<ll> s;
    for (ll a = 1; ; a++) {
        ll x = a * a;
        if (x > n) break;
        s.insert(x);
        if (a * (a + 1) <= n)
            s.insert(a * (a + 1));
    }
    cout << s.size() << endl;
}



int main() {
    saklan
    #ifndef ONLINE_JUDGE
        freopen("input.txt", "r", stdin);
    #endif
    solve();
    return 0;
}

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 17:07:24
Judged At
2025-06-13 17:07:24
Judged By
Score
0
Total Time
≥1116ms
Peak Memory
≥158.336 MiB