Time Exceeded
Code
#include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
int cnt = 1;
for (int i = 2; i <= n; i++)
{
int x = sqrt(i);
if (x * x == i || x * (x + 1) == i) cnt++;
}
cout << cnt;
}
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 16:18:05
- Judged At
- 2025-06-13 16:18:05
- Judged By
- Score
- 80
- Total Time
- ≥1099ms
- Peak Memory
- ≥536.0 KiB