/ SeriousOJ /

Record Detail

Compile Error

foo.c:2:10: fatal error: iostream: No such file or directory
    2 | #include <iostream>
      |          ^~~~~~~~~~
compilation terminated.

Code

#pragma GCC optimize("Ofast")
#include <iostream>
#include <math.h>
#include <cstdint>
using namespace std;
#ifndef ONLINE_JUDGE
#define debug(x) cerr << #x << " = " << x << endl
#else
#define debug(x)
#endif

using ll = long long;
bool check(int n){
    int x = sqrt(n);
    if(x * x == n) return true;
    if(ceil(sqrt(n)) * floor(sqrt(n)) == n) return true;
    return false;
}
void Solve()
{
    int n;
    cin >> n;
    int cnt = 0;
    for(int i=1; i<=n; i++){
        cnt += check(i);
    }
    cout << cnt << endl;
}

int32_t main()
{
    ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
    ll t = 1;
    // cin >> t;
    while (t--)
        Solve();
    return 0;
}

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:40:28
Judged At
2025-06-13 15:40:28
Judged By
Score
0
Total Time
0ms
Peak Memory
0 Bytes