Problem p02847 (C++)

Buggy submission (status: Runtime Error):
#include <bits/stdc++.h>
// #include<boost/multiprecision/cpp_int.hpp>
#define fl(i, a, n) for (int i = a; i <= n; i++)
#define pb push_back
#define pob pop_back
#define int long long int
#define ff first
#define ss second
#define pi 3.1415926535898
#define vi vector<int>
#define mi map<int, int>
#define umi unordered_map<int, int>
#define endl "\n"
#define w(x)                                                                   \
  int x;                                                                       \
  cin >> x;                                                                    \
  while (x--)
#define db(x) cout << (#x) << " " << (x) << "\n";
#define ios                                                                    \
  ios_base::sync_with_stdio(0);                                                \
  cin.tie(NULL);                                                               \
  cout.tie(NULL);
using namespace std;
// using namespace boost::multiprecision;
int mod = 1000000007;
int gcd(int a, int b) { return (b == 0) ? a : gcd(b, a % b); }
int lcm(int a, int b) { return (a * b) / gcd(a, b); }
void c_p_c() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
#ifndef ONLINE_JUDGE
  freopen("input.txt", "r", stdin);
  freopen("output.txt", "w", stdout);
#endif
}
int32_t main() {

  ios c_p_c();
  // w(t)
  {
    map<string, int> mp;
    mp["SUN"] = 0;
    mp["MON"] = 1;
    mp["TUE"] = 2;
    mp["WED"] = 3;
    mp["THU"] = 4;
    mp["FRI"] = 5;
    mp["SAT"] = 6;
    string s;
    cin >> s;
    fl(i, 0, s.length() - 1) { s[i] = toupper(s[i]); }
    cout << abs(7 - mp[s]);
  }

  return 0;
}


Fixed submission:
#include <bits/stdc++.h>
// #include<boost/multiprecision/cpp_int.hpp>
#define fl(i, a, n) for (int i = a; i <= n; i++)
#define pb push_back
#define pob pop_back
#define int long long int
#define ff first
#define ss second
#define pi 3.1415926535898
#define vi vector<int>
#define mi map<int, int>
#define umi unordered_map<int, int>
#define endl "\n"
#define w(x)                                                                   \
  int x;                                                                       \
  cin >> x;                                                                    \
  while (x--)
#define db(x) cout << (#x) << " " << (x) << "\n";
#define ios                                                                    \
  ios_base::sync_with_stdio(0);                                                \
  cin.tie(NULL);                                                               \
  cout.tie(NULL);
using namespace std;
// using namespace boost::multiprecision;
int mod = 1000000007;
int gcd(int a, int b) { return (b == 0) ? a : gcd(b, a % b); }
int lcm(int a, int b) { return (a * b) / gcd(a, b); }
void c_p_c() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
#ifndef ONLINE_JUDGE
  freopen("input.txt", "r", stdin);
  freopen("output.txt", "w", stdout);
#endif
}
int32_t main() {

  ios
  // c_p_c();
  // w(t)
  {
    map<string, int> mp;
    mp["SUN"] = 0;
    mp["MON"] = 1;
    mp["TUE"] = 2;
    mp["WED"] = 3;
    mp["THU"] = 4;
    mp["FRI"] = 5;
    mp["SAT"] = 6;
    string s;
    cin >> s;
    fl(i, 0, s.length() - 1) { s[i] = toupper(s[i]); }
    cout << abs(7 - mp[s]);
  }

  return 0;
}