Problem p02880 (C++)

Buggy submission (status: Runtime Error):
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); i++)
#define For(i, start, end) for (i64 i = start; i < end; i++)
#define newline std::cout << '\n';
#define newlinedx(num)                                                         \
  for (int i = 0; i < num; i++)                                                \
    std::cout << '\n';
using namespace std;
typedef long long ll;
typedef unsigned long ul;

using i8 = int8_t;
using u8 = uint8_t;
using i16 = int16_t;
using u16 = uint16_t;
using i32 = int32_t;
using u32 = uint32_t;
using i64 = int64_t;
using u64 = uint64_t;
using f32 = float;
using f64 = double;
using ui = uint64_t;

//----------------library in this time--------------------------------
template <class T> T gcd(const T a, const T b) {
  return (b == 0) ? a : gcd(b, a % b);
}
template <class T> T lcm(const T a, const T b) { return a * b / gcd(a, b); }
template <class T> inline T ave(const T a, const T b) { return (a + b) / 2.0f; }

long long squareTwo(const long long a, const long long b) {
  return (b == 1) ? a : squareTwo(a * 2, b - 1);
}

template <class T> inline T Max(const T a, const T b) {
  return (a >= b) ? a : b;
}

template <class T> inline T Min(const T a, const T b) {
  return (a <= b) ? a : b;
}

//------------------------main function-------------------------------
void Main() {
  int N;
  cin >> N;
  for (int i = 1; i * i < N; i--)
    if (N % i == 0 && N / i < 10) {
      cout << "Yes" << endl;
      return;
    }
  cout << "No" << endl;
}

//--------------------------------------------------------------------
int main() {
  std::cin.tie(nullptr);
  std::ios_base::sync_with_stdio(false);
  std::cout << std::fixed << std::setprecision(10);

  Main();
  return 0;
}

Fixed submission:
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); i++)
#define For(i, start, end) for (i64 i = start; i < end; i++)
#define newline std::cout << '\n';
#define newlinedx(num)                                                         \
  for (int i = 0; i < num; i++)                                                \
    std::cout << '\n';
using namespace std;
typedef long long ll;
typedef unsigned long ul;

using i8 = int8_t;
using u8 = uint8_t;
using i16 = int16_t;
using u16 = uint16_t;
using i32 = int32_t;
using u32 = uint32_t;
using i64 = int64_t;
using u64 = uint64_t;
using f32 = float;
using f64 = double;
using ui = uint64_t;

//----------------library in this time--------------------------------
template <class T> T gcd(const T a, const T b) {
  return (b == 0) ? a : gcd(b, a % b);
}
template <class T> T lcm(const T a, const T b) { return a * b / gcd(a, b); }
template <class T> inline T ave(const T a, const T b) { return (a + b) / 2.0f; }

long long squareTwo(const long long a, const long long b) {
  return (b == 1) ? a : squareTwo(a * 2, b - 1);
}

template <class T> inline T Max(const T a, const T b) {
  return (a >= b) ? a : b;
}

template <class T> inline T Min(const T a, const T b) {
  return (a <= b) ? a : b;
}

//------------------------main function-------------------------------
void Main() {
  int N;
  cin >> N;
  for (int i = 1; i * i <= N; i++)
    if (N % i == 0 && N / i < 10) {
      cout << "Yes" << endl;
      return;
    }
  cout << "No" << endl;
}

//--------------------------------------------------------------------
int main() {
  std::cin.tie(nullptr);
  std::ios_base::sync_with_stdio(false);
  std::cout << std::fixed << std::setprecision(10);

  Main();
  return 0;
}