/ SeriousOJ /

Record Detail

Accepted


  
# Status Time Cost Memory Cost
#1 Accepted 2ms 540.0 KiB
#2 Accepted 1ms 540.0 KiB
#3 Accepted 1ms 540.0 KiB
#4 Accepted 2ms 540.0 KiB
#5 Accepted 1ms 540.0 KiB
#6 Accepted 2ms 540.0 KiB

Code

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

#ifdef LOCAL
#include "debug.h"
#else
#define dbg(...) 42
#endif

#define int long long

signed main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);

    int n;
    cin >> n;

    int res = 0;
    for (int i = 1; i <= 1e5; i++) {
        if (i * (i + 1) <= n) {
            res++;
        }
        if (i * i <= n) {
            res++;
        }
    }

    cout << res << '\n';

    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 15:32:10
Judged At
2025-06-13 15:32:10
Judged By
Score
100
Total Time
2ms
Peak Memory
540.0 KiB