/ SeriousOJ /

Record Detail

Accepted


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

Code

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

#define  ll  long long

int main(){
    int tc = 1;
    //cin >> tc;
    while(tc--){
        int n;
        cin >> n;
        ll sq = sqrt(n);
        ll cn = sq - 1;
        cn *= 2;
        if(sq * sq <= n) cn++;
        if(sq * (sq + 1) <= n) cn++;
        cout << cn << 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:38:36
Judged At
2025-06-13 15:38:36
Judged By
Score
100
Total Time
2ms
Peak Memory
540.0 KiB