/ SeriousOJ /

Record Detail

Accepted


  
# Status Time Cost Memory Cost
#1 Accepted 5ms 5.02 MiB
#2 Accepted 5ms 5.02 MiB
#3 Accepted 6ms 5.02 MiB
#4 Accepted 10ms 5.02 MiB
#5 Accepted 7ms 5.062 MiB
#6 Accepted 6ms 5.02 MiB

Code

#include<bits/stdc++.h>
#define ll long long 
#define py cout<<"YES"<<endl
#define pn cout<<"NO"<<endl
#define pe cout<<endl
#define av vector<int>a(n)
#define ai for(auto &i:a)cin>>i
#define ao for(auto i:a)cout<<i<<" " 
#define mod 1000000007
using namespace std; 

bool prime(int n)
{
    if(n<2) return false;
    if(n<=3) return true;
    if(n%2==0) return false; 
    for(int i=3; i*i<=n; i+=2)
        if(n%i==0) return false;
    return true;
}

ll bigmod(ll b,ll p)
{
 if(p==0)   return 1;
 ll x=bigmod(b,p/2);
 x=(x*x)%mod;
 if(p%2==1) x=(x*b)%mod;
 return x;
}

vector<int>adj[200005];
int vis[200005];
void DFS(int node)
{
    vis[node]=1;
    for(ll i=0; i<adj[node].size(); i++)
    {
        if(vis[adj[node][i]]==0) 
          DFS(adj[node][i]);
    }
}

int main()
{
    ios_base::sync_with_stdio(0);   cin.tie(0);     cout.tie(0);
    
      ll n;    cin>>n; 
      ll c=0; 
      for(int i=1; i*i<=n; i++)
      {
         c++;
        if(i*(i+1)<=n) c++;
      }
      cout<<c<<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:48:47
Judged At
2025-06-13 15:48:47
Judged By
Score
100
Total Time
10ms
Peak Memory
5.062 MiB