/ SeriousOJ /

Record Detail

Accepted


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

Code

#include <bits/stdc++.h>
//#include <ext/pb_ds/assoc_container.hpp>
//#include <ext/pb_ds/tree_policy.hpp>
//using namespace __gnu_pbds;
//#include <utility> 
#define ll long long
#define endl "\n"
using namespace std;
//struct cmp { bool operator()(const ll &a, const ll &b) const { return a < b; }};
//#define ordered_set tree<ll, null_type,cmp,rb_tree_tag, tree_order_statistics_node_update>
// st.find_by_order(index) gives the k-th smallest element (0-based index)
// st.order_of_key(x) gives the number of elements strictly less than x
#define sp(x) fixed << setprecision(x)
//int fx[]={+0,+0,+1,-1,-1,+1,-1,+1};   // Kings Move 
//int fy[]={-1,+1,+0,+0,+1,+1,-1,-1};
// auto it = mp.find(x);if (it != mp.end())
//priority_queue<pair<ll, ll>,vector<pair<ll,ll>>,greater<pair<ll,ll>>> pq;
//sort(vec.begin(), vec.end(),greater<int>());
//vector<bool> isPrime(limit + 1, true);
#define memo(a,b) memset(a,b,sizeof(a))




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


ll n; cin>>n;
ll cnt=0;
for(ll i=1;i<=n;i++)
{
    if(i*i<=n) cnt++;
    if(i*(i+1)<+n) cnt++;
    
    if(i*i>=n) break;
}
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:36:18
Judged At
2025-06-13 15:36:18
Judged By
Score
100
Total Time
1ms
Peak Memory
536.0 KiB