/ SeriousOJ /

Record Detail

Accepted


  
# Status Time Cost Memory Cost
#1 Accepted 1ms 376.0 KiB
#2 Accepted 1ms 348.0 KiB
#3 Accepted 1ms 536.0 KiB
#4 Accepted 1ms 320.0 KiB
#5 Accepted 1ms 336.0 KiB
#6 Accepted 1ms 532.0 KiB

Code

/*
 * Name : Md. Fahmidur Rahman Nafi
 * Date : 2025-06-13   Time : 20:31:54
 */

#include <bits/stdc++.h>
using namespace std;
#define endl '\n'
#define ll long long
#define ld long double
#define ull unsigned long long
#define lcm(a,b) ((a*b)/__gcd(a,b))
#define debug(x) cout << "Debug : " << x << endl;
const double PI = 2 * acos(0.0);
const int MOD = 1000000007;

int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(0);

    int n;
    cin >> n;

    int cnt = 0;
    ll i = 1;
    while (i <= n){
        if (i * i <= n)
            cnt++;
        else
            break;
        if (i * (i + 1) <= n)
            cnt++;
        else
            break;
        ++i;
    }   
    
    cout << cnt << endl;
}

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:37:29
Judged At
2025-06-13 15:37:29
Judged By
Score
100
Total Time
1ms
Peak Memory
536.0 KiB