/ SeriousOJ /

Record Detail

Compile Error

foo.c:2:9: fatal error: bits/stdc++.h: No such file or directory
    2 | #include<bits/stdc++.h>
      |         ^~~~~~~~~~~~~~~
compilation terminated.

Code

#define ll long long
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp> 
using namespace std;
using namespace __gnu_pbds;
#define ordered_set tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update> 
std::string toBinaryString(long long num) {
std::bitset<64> binary(num);
return binary.to_string();
}
long long binaryToLongLong(const std::string& binary) {
std::bitset<64> binarySet(binary);
return static_cast<long long>(binarySet.to_ullong());
}
bool compareByFirst(const std::pair<ll, ll>& a, const std::pair<ll, ll>& b) {
return a.first < b.first; // Ascending order by the first element
}
int main(){
ios::sync_with_stdio(false);
cin.tie(nullptr);
    long long t;
    t=1;
    while(t--){
        long long n;
        cin>>n;
        ll x=sqrt(n);
        ll z=x*(x+1);
        ll ans=1;
        if(n==1)
        cout<<1<<endl;
        else if(n==2)
        {
            cout<<2<<endl;
        }
        else if(n==3)
        cout<<2<<endl;
        else if(n==4)
        {
            cout<<3<<endl;
        }
        else if(n==5)
        cout<<3<<endl;
        else if(z==n){
            ans++;
            ans+=(x-1)*2;
            cout<<ans<<endl;
        }
        else 
        {
            ans+=(x-1)*2;
            
            cout<<ans<<endl;
        }
    }
}

Information

Submit By
Type
Submission
Problem
P1191 A. Balanced Product
Contest
Brain Booster #10
Language
C99 (GCC 13.2.0)
Submit At
2025-06-13 15:57:00
Judged At
2025-06-13 15:57:00
Judged By
Score
0
Total Time
0ms
Peak Memory
0 Bytes