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

#include <bits/stdc++.h>
#define vi vector<int>
#define vvi vector<vector<int>>
#define vl vector<ll>
#define vvl vector<vector<ll>>
#define vb vector<bool>
#define vc vector<char>
#define vs vector<string>
using ll = long long;
using ld = long double;
#define int ll
#define INF 1e9
#define EPS 0.0000000001
#define rep(i, n) for (int i = 0; i < n; i++)
#define loop(i, s, n) for (int i = s; i < n; i++)
#define all(in) in.begin(), in.end()
template <class T, class S> void cmin(T &a, const S &b) {
  if (a > b)
    a = b;
}
template <class T, class S> void cmax(T &a, const S &b) {
  if (a < b)
    a = b;
}
#define MAX 9999999
int dx[] = {0, 0, 1, -1};
int dy[] = {1, -1, 0, 0};
int W, H;
bool inrange(int x, int y) { return (0 <= x && x < W) && (0 <= y && y < H); }
using namespace std;
typedef pair<int, int> pii;
typedef pair<int, pii> piii;
#define MP make_pair
signed main() {
  int n;
  cin >> n;
  vector<int> vvataarne(n);
  rep(i, n) cin >> vvataarne[i];
  vector<int> kitikuyarou(n);
  rep(i, n) cin >> kitikuyarou[i];
  set<int> vvhaAORIkaiwanotourist;
  rep(i, n) vvhaAORIkaiwanotourist.insert(kitikuyarou[i]);
  if (vvhaAORIkaiwanotourist.size() == n)
    return puts("Yes") * 0;
  map<int, int> vvhasinntyokukaiwainotourist;
  rep(i, n) vvhasinntyokukaiwainotourist[kitikuyarou[i]]++;
  int safe = INF;
  puts("No");
  rep(i, n) {
    if (i)
      cout << " ";
    cout << kitikuyarou[i];
  }
  cout << endl;
  rep(i, n) {
    if (i)
      cout << " ";
    if (vvhasinntyokukaiwainotourist[vvataarne[i]])
      cout << kitikuyarou[i];
    else
      cout << vvataarne[i];
  }
  cout << endl;
}


Error: 0

Fixed submission:

#include <bits/stdc++.h>
#define vi vector<int>
#define vvi vector<vector<int>>
#define vl vector<ll>
#define vvl vector<vector<ll>>
#define vb vector<bool>
#define vc vector<char>
#define vs vector<string>
using ll = long long;
using ld = long double;
#define int ll
#define INF 1e9
#define EPS 0.0000000001
#define rep(i, n) for (int i = 0; i < n; i++)
#define loop(i, s, n) for (int i = s; i < n; i++)
#define all(in) in.begin(), in.end()
template <class T, class S> void cmin(T &a, const S &b) {
  if (a > b)
    a = b;
}
template <class T, class S> void cmax(T &a, const S &b) {
  if (a < b)
    a = b;
}
#define MAX 9999999
int dx[] = {0, 0, 1, -1};
int dy[] = {1, -1, 0, 0};
int W, H;
bool inrange(int x, int y) { return (0 <= x && x < W) && (0 <= y && y < H); }
using namespace std;
typedef pair<int, int> pii;
typedef pair<int, pii> piii;
#define MP make_pair
signed main() {
  int n;
  cin >> n;
  vector<int> vvataarne(n);
  rep(i, n) cin >> vvataarne[i];
  vector<int> kitikuyarou(n);
  rep(i, n) cin >> kitikuyarou[i];
  set<int> vvhaAORIkaiwanotourist;
  rep(i, n) vvhaAORIkaiwanotourist.insert(kitikuyarou[i]);
  if (vvhaAORIkaiwanotourist.size() == n)
    return puts("Yes") * 0;
  map<int, int> vvhasinntyokukaiwainotourist;
  rep(i, n) vvhasinntyokukaiwainotourist[kitikuyarou[i]]++;
  int safe = INF;
  puts("No");
  rep(i, n) {
    if (i)
      cout << " ";
    cout << kitikuyarou[i];
  }
  cout << endl;
  assert(safe != INF);
  rep(i, n) {
    if (i)
      cout << " ";
    if (vvhasinntyokukaiwainotourist[vvataarne[i]])
      cout << kitikuyarou[i];
    else
      cout << vvataarne[i];
  }
  cout << endl;
}