/ SeriousOJ /

Record Detail

Accepted


  
# Status Time Cost Memory Cost
#1 Accepted 2ms 496.0 KiB
#2 Accepted 2ms 472.0 KiB
#3 Accepted 2ms 540.0 KiB
#4 Accepted 2ms 492.0 KiB
#5 Accepted 2ms 328.0 KiB
#6 Accepted 2ms 536.0 KiB

Code

#include "bits/stdc++.h"
using namespace std;
typedef long long ll;

int main(){
  int n; cin >> n;
  int ans = 0;
  for (int i = 1; i < n/2; i++){
    if (i*i > n) break;
    ans++;
  }
  for (int i = 1; i < n/2; i++){
    if (i * (i+1) > n) break;
    ans++;
  }
  cout << ans;
}

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:33:15
Judged At
2025-06-13 15:33:15
Judged By
Score
100
Total Time
2ms
Peak Memory
540.0 KiB