Problem p02717 (C++) — buggy submission, verdict: Runtime Error

#include <bits/stdc++.h>
using namespace std;

#define fastIO                                                                 \\
  ios::sync_with_stdio(false);                                                 \\
  cin.tie(NULL);                                                               \\
  cout.tie(NULL);
#define asc(s) sort(s.begin(), s.end())
#define des(s) sort(s.rbegin(), s.rend())
#define pb(x) push_back(x)
#define mp(x, y) make_pair(x, y)
#define all(v) v.begin(), v.end()
#define rev(v) reverse(v.begin(), v.end())
#define lower(s) transform(s.begin(), s.end(), s.begin(), ::tolower);
#define upper(s) transform(s.begin(), s.end(), s.begin(), ::toupper);
#define MOD 1000000007
#define PI 3.14159265358979

typedef long long ll;

template <typename TH> void _dbg(const char *sdbg, TH h) {
  cerr << sdbg << "=" << h << "\\n";
}
template <typename TH, typename... TA>
void _dbg(const char *sdbg, TH h, TA... t) {
  while (*sdbg != ',') {
    cerr << *sdbg++;
  }
  cerr << "=" << h << ",";
  _dbg(sdbg + 1, t...);
}

#ifndef ONLINE_JUDGE
#define debug(...) _dbg(#__VA_ARGS__, __VA_ARGS__)
#else
#define debug
#endif

template <class T> T gcd(T a, T b) { return b ? gcd(b, a % b) : a; }

template <class T> T lcm(T a, T b) { return a * b / gcd(a, b); }

vector<string> split(string s) {
  istringstream buf(s);
  istream_iterator<string> beg(buf), end;
  vector<string> list(beg, end);
  return list;
}

bool isvowel(char c) {
  string s = "aeiouAEIOU";
  if (find(s.begin(), s.end(), c) != s.end())
    return true;
  return false;
}

vector<ll> sieve(ll n) {
  vector<bool> prime(n + 1, true);
  prime[0] = prime[1] = 0;

  for (int i = 2; i * i <= n; i++) {
    if (prime[i])
      for (int j = i * i; j <= n; j += i) {
        prime[j] = 0;
      }
  }

  vector<ll> p;

  for (int i = 2; i <= prime.size(); i++)
    if (prime[i])
      p.pb(i);

  return p;
}

bool isprime(int n) {
  for (int i = 2; i * i <= n; i++) {
    if (n % i == 0)
      return false;
  }

  return true && (n != 1);
}

int ncr(ll n, ll r) {
  ll C[r + 1];
  memset(C, 0, sizeof(C));

  C[0] = 1;

  for (ll i = 1; i <= n; i++) {
    for (ll j = min(i, r); j > 0; j--)
      // nCj = (n-1)Cj + (n-1)C(j-1);
      C[j] = (C[j] + C[j - 1]) % MOD;
  }

  return C[r];
}

bool special(string s) {
  for (int i = 0; i < s.size(); i++) {
    if (s[i] == ' ')
      continue;

    if (s[i] == '#')
      return true;

    else
      return false;
  }
  return false;
}

vector<ll> ans;

bool cmp(string &a, string &b) {
  return (a.size() < b.size()) || (a.size() == b.size() && a < b);
}

void solve() {
  int a, b, c;
  cin >> a >> b >> c;

  swap(a, b);
  swap(a, c);

  cout << a << ' ' << b << ' ' << c;
}

int main() {
  fastIO
      // #ifndef ONLINE_JUDGE
      //     freopen("in.txt", "rt", stdin);
      //     freopen("out.txt", "wt", stdout);
      // #endif

      int t = 1;
  // cin >> t;

  for (int i = 1; i <= t; i++) {
    solve();
  }

  return 0;
}

Error: WA

Fixed submission:

#include <bits/stdc++.h>
using namespace std;

#define fastIO                                                                 \\
  ios::sync_with_stdio(false);                                                 \\
  cin.tie(NULL);                                                               \\
  cout.tie(NULL);
#define asc(s) sort(s.begin(), s.end())
#define des(s) sort(s.rbegin(), s.rend())
#define pb(x) push_back(x)
#define mp(x, y) make_pair(x, y)
#define all(v) v.begin(), v.end()
#define rev(v) reverse(v.begin(), v.end())
#define lower(s) transform(s.begin(), s.end(), s.begin(), ::tolower);
#define upper(s) transform(s.begin(), s.end(), s.begin(), ::toupper);
#define MOD 1000000007
#define PI 3.14159265358979

typedef long long ll;

template <typename TH> void _dbg(const char *sdbg, TH h) {
  cerr << sdbg << "=" << h << "\\n";
}
template <typename TH, typename... TA>
void _dbg(const char *sdbg, TH h, TA... t) {
  while (*sdbg != ',') {
    cerr << *sdbg++;
  }
  cerr << "=" << h << ",";
  _dbg(sdbg + 1, t...);
}

#ifndef ONLINE_JUDGE
#define debug(...) _dbg(#__VA_ARGS__, __VA_ARGS__)
#else
#define debug
#endif

template <class T> T gcd(T a, T b) { return b ? gcd(b, a % b) : a; }

template <class T> T lcm(T a, T b) { return a * b / gcd(a, b); }

vector<string> split(string s) {
  istringstream buf(s);
  istream_iterator<string> beg(buf), end;
  vector<string> list(beg, end);
  return list;
}

bool isvowel(char c) {
  string s = "aeiouAEIOU";
  if (find(s.begin(), s.end(), c) != s.end())
    return true;
  return false;
}

vector<ll> sieve(ll n) {
  vector<bool> prime(n + 1, true);
  prime[0] = prime[1] = 0;

  for (int i = 2; i * i <= n; i++) {
    if (prime[i])
      for (int j = i * i; j <= n; j += i) {
        prime[j] = 0;
      }
  }

  vector<ll> p;

  for (int i = 2; i <= prime.size(); i++)
    if (prime[i])
      p.pb(i);

  return p;
}

bool isprime(int n) {
  for (int i = 2; i * i <= n; i++) {
    if (n % i == 0)
      return false;
  }

  return true && (n != 1);
}

int ncr(ll n, ll r) {
  ll C[r + 1];
  memset(C, 0, sizeof(C));

  C[0] = 1;

  for (ll i = 1; i <= n; i++) {
    for (ll j = min(i, r); j > 0; j--)
      // nCj = (n-1)Cj + (n-1)C(j-1);
      C[j] = (C[j] + C[j - 1]) % MOD;
  }

  return C[r];
}

bool special(string s) {
  for (int i = 0; i < s.size(); i++) {
    if (s[i] == ' ')
      continue;

    if (s[i] == '#')
      return true;

    else
      return false;
  }
  return false;
}

vector<ll> ans;

bool cmp(string &a, string &b) {
  return (a.size() < b.size()) || (a.size() == b.size() && a < b);
}

void solve() {
  int a, b, c;
  cin >> a >> b >> c;

  swap(a, b);
  swap(a, c);

  cout << a << ' ' << b << ' ' << c;
}

int main() {
  fastIO
#ifndef ONLINE_JUDGE
      freopen("in.txt", "rt", stdin);
  freopen("out.txt", "wt", stdout);
#endif

  int t = 1;
  // cin >> t;

  for (int i = 1; i <= t; i++) {
    solve();
  }

  return 0;
}