/ SeriousOJ /

Record Detail

Compile Error

foo.cc: In function 'void solve()':
foo.cc:32:16: error: return-statement with a value, in function returning 'void' [-fpermissive]
   32 |         return 0;
      |                ^

Code

/*
 *   BISMILLAHIR RAHMANIR RAHIM
 *   ==========================
 *
 *   Submitted By: SAKLAN
 *   North East University Bangladesh
 */

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

#define ll long long
#define ld long double
#define  cinv(v)  for(auto &i:v) cin >> i;
#define  vi   vector<int>
#define  vii  vector<ll>
#define mod 1000000000
#define  cout(v)  for(auto e:v) cout << e << sp;
#define srt(v) sort(v.begin(),v.end())
#define rsrt(v) sort(v.rbegin(),v.rend())
#define yes cout<<"YES\n"
#define no cout<<"NO\n"
#define endl '\n'
#define start long long t; cin >> t; while(t--)
#define saklan ios::sync_with_stdio(0); cin.tie(0);

void solve() {
    ll n;
    cin >> n;
    if(n==1){
        cout << 0 << endl;
        return 0;
    }
    ll a = sqrt(n);
    ll b = sqrt(4 * n + 1);
    ll res = a + (b - 1) / 2;
    cout << res << endl;
}




int main() {
    saklan
    #ifndef ONLINE_JUDGE
        freopen("input.txt", "r", stdin);
    #endif
    solve();
    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 17:18:59
Judged At
2025-06-13 17:18:59
Judged By
Score
0
Total Time
0ms
Peak Memory
0 Bytes