/ SeriousOJ /

Record Detail

Accepted


  
# Status Time Cost Memory Cost
#1 Accepted 1ms 320.0 KiB
#2 Accepted 1ms 488.0 KiB
#3 Accepted 1ms 568.0 KiB
#4 Accepted 1ms 392.0 KiB
#5 Accepted 1ms 532.0 KiB
#6 Accepted 1ms 324.0 KiB

Code

// Author: Shawn Das Shachin-->(shawn_das)

#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
#define pb push_back
#define mod 1000000007
#define srt(v) sort(v.begin(),v.end())
#define rsrt(v) sort(v.rbegin(),v.rend())
#define OPTIMIZE_IO ios::sync_with_stdio(false); cin.tie(nullptr);
#define setbit(x) __builtin_popcount(x);
#define printp(v) { for(auto &it : v) std::cout << it.first << " " << it.second << std::endl; }
#define printarr(arr) { for(auto &it : arr) std::cout << it << " "; std::cout << std::endl; }

void solve() {
    ll n;
    cin>>n;

    ll ans=0;
    for(ll i=1; i*i<=n; i++){
        if(i*i<=n){
            ans++;
        }
        if((i*(i+1))<=n) ans++;
    }
    cout<<ans<<endl;

}

int main() {
    OPTIMIZE_IO;
    int t=1;
    //  cin>>t;
    while(t--){
        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 16:03:25
Judged At
2025-06-13 16:03:25
Judged By
Score
100
Total Time
1ms
Peak Memory
568.0 KiB