Problem p02915 (C++)

Buggy submission (status: Runtime Error):
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/detail/standard_policies.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;

typedef long long int ll;
typedef unsigned long long int ull;
typedef tree<int, null_type, less<int>, rb_tree_tag,
             tree_order_statistics_node_update>
    o_set;

#define int ll
#define pb push_back
#define mp make_pair
#define xx first
#define yy second
#define all(a) a.begin(), a.end()
#define vi vector<int>
#define vpi vector<pii>
#define pii pair<int, int>
#define present(DT, val) (DT.find(val) != DT.end())        // for set and map
#define cpresent(DT, val) (find(all(DT), val) != DT.end()) // vectors
#define sd " "
#define nl "\n"
#define input "/home/pollution/Desktop/WorkSpace/C++/Files/input.txt"
#define output "/home/pollution/Desktop/WorkSpace/C++/Files/output1.txt"
#define error "/home/pollution/Desktop/WorkSpace/C++/Files/error.txt"
#define IOS()                                                                  \
  ios_base::sync_with_stdio(false);                                            \
  cin.tie(NULL);                                                               \
  cout.tie(NULL);
#define INF 2e18
#define MOD 1000000007
#define clr(x) memset(x, 0, sizeof(x))
#define init(x, a) memset(x, a, sizeof(x))
#define siz(a) sizeof(a) / sizeof(a[0])
#define out(a)                                                                 \
  for (auto i : a)                                                             \
    cout << i << " ";                                                          \
  cout << "\n"
#define cpy(a, b) memcpy(a, b, sizeof(b))
#define itos(a) to_string(a)
#define ctoi(a) int(a) - 48
#define setd(val, n)                                                           \
  cout << fixed;                                                               \
  cout << setprecision(n) << val << "\n"

ll mod(ll a) { return ((a % MOD) + MOD) % MOD; }

ll fpow(ll base, ll expo) {
  ll res = 1;
  while (expo > 0) {
    if (expo & 1)
      res = (res * base) % MOD;
    base = (base * base) % MOD;
    expo >>= 1;
  }
  return res;
}

ll modinv(ll a) { return mod(fpow(mod(a), MOD - 2)); }

void solve() {
  int n;
  cin >> n;
  cout << pow(n, 3) << nl;
}

signed main() {
  IOS();
#ifndef ONLINE_JUDGE
  freopen(input, "r", stdin);
  freopen(output, "w", stdout);
  freopen(error, "w", stderr);
#endif

  int t = 1;
  // cin>>t;
  while (t--)
    solve();
  return 0;
}


Fixed submission:
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/detail/standard_policies.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;

typedef long long int ll;
typedef unsigned long long int ull;
typedef tree<int, null_type, less<int>, rb_tree_tag,
             tree_order_statistics_node_update>
    o_set;

#define int ll
#define pb push_back
#define mp make_pair
#define xx first
#define yy second
#define all(a) a.begin(), a.end()
#define vi vector<int>
#define vpi vector<pii>
#define pii pair<int, int>
#define present(DT, val) (DT.find(val) != DT.end())        // for set and map
#define cpresent(DT, val) (find(all(DT), val) != DT.end()) // vectors
#define sd " "
#define nl "\n"
#define input "/home/pollution/Desktop/WorkSpace/C++/Files/input.txt"
#define output "/home/pollution/Desktop/WorkSpace/C++/Files/output1.txt"
#define error "/home/pollution/Desktop/WorkSpace/C++/Files/error.txt"
#define IOS()                                                                  \
  ios_base::sync_with_stdio(false);                                            \
  cin.tie(NULL);                                                               \
  cout.tie(NULL);
#define INF 2e18
#define MOD 1000000007
#define clr(x) memset(x, 0, sizeof(x))
#define init(x, a) memset(x, a, sizeof(x))
#define siz(a) sizeof(a) / sizeof(a[0])
#define out(a)                                                                 \
  for (auto i : a)                                                             \
    cout << i << " ";                                                          \
  cout << "\n"
#define cpy(a, b) memcpy(a, b, sizeof(b))
#define itos(a) to_string(a)
#define ctoi(a) int(a) - 48
#define setd(val, n)                                                           \
  cout << fixed;                                                               \
  cout << setprecision(n) << val << "\n"

ll mod(ll a) { return ((a % MOD) + MOD) % MOD; }

ll fpow(ll base, ll expo) {
  ll res = 1;
  while (expo > 0) {
    if (expo & 1)
      res = (res * base) % MOD;
    base = (base * base) % MOD;
    expo >>= 1;
  }
  return res;
}

ll modinv(ll a) { return mod(fpow(mod(a), MOD - 2)); }

void solve() {
  int n;
  cin >> n;
  cout << pow(n, 3) << nl;
}

signed main() {
  IOS();

  int t = 1;
  // cin>>t;
  while (t--)
    solve();
  return 0;
}