alexjercan/bugnet huggingface dataset:
Problem p02717 (C++) — buggy submission, verdict: Runtime Error

#include <bits/stdc++.h>

#define maxn 10005
#define INF 0x3f3f3f3f
#define mod 1000000007
typedef long long ll;
using namespace std;

void slove() {
  int a, b, c;
  cin >> a >> b >> c;
  swap(a, b);
  swap(a, c);
  cout << a << ' ' << b << ' ' << c << '\\n';
}

int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);

  /*while (cin >> t)*/
  slove();

  return 0;
}

Error: WA

Fixed submission:

#include <bits/stdc++.h>

#define maxn 10005
#define INF 0x3f3f3f3f
#define mod 1000000007
typedef long long ll;
using namespace std;

void slove() {
  int a, b, c;
  cin >> a >> b >> c;
  swap(a, b);
  swap(a, c);
  cout << a << ' ' << b << ' ' << c << '\\n';
}

int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
#ifdef ONLINE_JUDGE
#else
  freopen("C:\\\\Users\\\\Fish_Brother\\\\Desktop\\\\in", "r", stdin);
  freopen("C:\\\\Users\\\\Fish_Brother\\\\Desktop\\\\out", "w", stdout);
#endif
  /*while (cin >> t)*/
  slove();

  return 0;
}
Problem p02717 (C++) — buggy submission, verdict: Runtime Error

#include <bits/stdc++.h>
#define TASK "task"

using namespace std;

void rwFile() {
  freopen(TASK ".in", "r", stdin);
  freopen(TASK ".out", "w", stdout);
}

void solveA() {
  int x, y, z;
  cin >> x >> y >> z;
  cout << z << ' ' << x << ' ' << y;
}

int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(nullptr);
  cout.tie(nullptr);
  /// rwFile();
  solveA();
}


Error: WA

Fixed submission:

#include <bits/stdc++.h>
#define TASK "task"

using namespace std;

void rwFile() {
  freopen(TASK ".in", "r", stdin);
  freopen(TASK ".out", "w", stdout);
}

void solveA() {
  int x, y, z;
  cin >> x >> y >> z;
  cout << z << ' ' << x << ' ' << y;
}

int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(nullptr);
  cout.tie(nullptr);
  rwFile();
  solveA();
}
Problem p02717 (C++) — buggy submission, verdict: Runtime Error

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

typedef unsigned long long ull;
typedef long long ll;
typedef double db;

const ll mod = 1e9 + 7;
const db eps = 1e-9;

#define mp make_pair
#define pb push_back
#define endl "\\n"
#define deb(x) cout << #x << " " << x << endl

int main() {
  ios_base ::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);

  ll a, b, c;
  cin >> a >> b >> c;
  swap(a, b);
  swap(a, c);
  cout << a << " " << b << " " << c;

  return 0;
}

Error: WA

Fixed submission:

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

typedef unsigned long long ull;
typedef long long ll;
typedef double db;

const ll mod = 1e9 + 7;
const db eps = 1e-9;

#define mp make_pair
#define pb push_back
#define endl "\\n"
#define deb(x) cout << #x << " " << x << endl

int main() {
  ios_base ::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);

#ifndef ONLINE_JUDGE
  freopen("input.txt", "r", stdin);
  freopen("output.txt", "w", stdout);
  freopen("error.txt", "w", stderr);
#endif

  ll a, b, c;
  cin >> a >> b >> c;
  swap(a, b);
  swap(a, c);
  cout << a << " " << b << " " << c;

  return 0;
}
Problem p02717 (C++) — buggy submission, verdict: Runtime Error

#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vi = vector<int>;
using vvi = vector<vector<int>>;
using vl = vector<ll>;
using vvl = vector<vector<ll>>;
#define all(x) x.begin(), x.end()
#define rep(i, j, n) for (long long i = j; i < (long long)(n); i++)
#define _GLIBCXX_DEBUG
#define MOD 1000000007
template <class T> inline bool chmax(T &a, T b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T> inline bool chmin(T &a, T b) {
  if (a > b) {
    a = b;
    return 1;
  }
  return 0;
}
// name[i][j]-> vvl name(i,vl(j))
// map<int,int>mp
// �]���؂�グ�� =>  (a + b - 1) / b

signed main() {
  int a, b, c;
  cin >> a >> b >> c;
  cout << c << " " << a << " " << b;

  return 0;
}

Error: -6
terminate called after throwing an instance of 'std::out_of_range'
  what():  vector::_M_range_check: __n (which is 1) >= this->size() (which is 1)


Fixed submission:

#include <bits/stdc++.h>
using namespace std;
#define int long long
#define all(x) x.begin(), x.end()
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
signed main() {
  int N, M, A, B;
  A = 0;
  string ans;
  cin >> N >> M;
  vector<int> K(N);
  rep(i, N) {
    cin >> K.at(i);
    A += K.at(i);
  }
  // cout<<A<<endl;
  B = A / (4 * M);
  // cout<<B<<endl;
  sort(all(K));
  reverse(all(K));
  rep(i, M) {
    if ((K.at(i)) >= B) {
      ans = "Yes";

    } else {
      ans = "No";
      break;
    }
  }
  cout << ans << endl;
}
Problem p02717 (C++) — buggy submission, verdict: Runtime Error

#include <bits/stdc++.h>
#define ll long long
#define MP make_pair
#define PB push_back
#define F first
#define S second
#define MOD 100000000000000000
#define UB upper_bound
#define LB lower_bound
#define fast                                                                   \\
  ios_base::sync_with_stdio(0);                                                \\
  cin.tie(NULL);                                                               \\
  cout.tie(NULL);
using namespace std;
/////number of edges in a graph equal (v[i].size() ka summation of all the
///vertices)//
int main() {
  fast;
  // #ifndef ONLINE_JUDGE
  // freopen("input.txt", "r", stdin);
  // freopen("output.txt", "w", stdout);
  // #endif
  ll int x, y, z;
  cin >> x >> y >> z;
  swap(x, y);
  swap(x, z);
  cout << x << " " << y << " " << z << endl;
}

Error: WA

Fixed submission:

#include <bits/stdc++.h>
#define ll long long
#define MP make_pair
#define PB push_back
#define F first
#define S second
#define MOD 100000000000000000
#define UB upper_bound
#define LB lower_bound
#define fast                                                                   \\
  ios_base::sync_with_stdio(0);                                                \\
  cin.tie(NULL);                                                               \\
  cout.tie(NULL);
using namespace std;
/////number of edges in a graph equal (v[i].size() ka summation of all the
///vertices)//
int main() {
  fast;
#ifndef ONLINE_JUDGE
  freopen("input.txt", "r", stdin);
  freopen("output.txt", "w", stdout);
#endif
  ll int x, y, z;
  cin >> x >> y >> z;
  swap(x, y);
  swap(x, z);
  cout << x << " " << y << " " << z << endl;
}
Problem p02717 (C++) — buggy submission, verdict: Runtime Error

#include <bits/stdc++.h>
using namespace std;
#define fast ios_base::sync_with_stdio(false), cin.tie(NULL)
#define loop(var, init, condition) for (int var = init; var < condition; var++)
#define rloop(var, init, condition) for (int var = init; var > condition; var--)
#define mod 1000000007
#define qmod 998244353
#define M 1000001
#define F first
#define S second
#define pb push_back
#define mp make_pair
#define popi pop_back
#define SZ(v) ((int)(v).size())

typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<string> vs;
typedef vector<pii> vii;
typedef vector<vi> vvi;
typedef unordered_map<string, int> usi;
typedef unordered_map<int, int> umii;
typedef map<int, int> omii;
typedef set<int> seti;

ll pow(ll a, ll b, ll m) {
  ll x = 1, y = a;
  while (b > 0) {
    if (b % 2 == 1) {
      x = (x * y);
      if (x > m)
        x %= m;
    }
    y = (y * y);
    if (y > m)
      y %= m;
    b /= 2;
  }
  return x % m;
}
ll gcd(ll a, ll b) {
  if (b == 0)
    return a;
  else
    return gcd(b, a % b);
}

int main() {
  // #ifndef ONLINE_JUDGE
  // freopen("input.txt", "r", stdin);
  // freopen("output.txt", "w", stdout);
  // #endif

  fast;

  int x, y, z;
  cin >> x >> y >> z;
  swap(x, y);
  swap(x, z);
  cout << x << " " << y << " " << z << " " << endl;

  return 0;
}

// MAKING HARD THINGS SIMPLE AND SIMPLE THINGS HARD

//        ,~~.
//       (  6 )-_,
//  (\\___ )=='-'
//   \\ .   ) )
//    \\ `-' /    battak
// ~'`~'`~'`~'`~

Error: WA

Fixed submission:

#include <bits/stdc++.h>
using namespace std;
#define fast ios_base::sync_with_stdio(false), cin.tie(NULL)
#define loop(var, init, condition) for (int var = init; var < condition; var++)
#define rloop(var, init, condition) for (int var = init; var > condition; var--)
#define mod 1000000007
#define qmod 998244353
#define M 1000001
#define F first
#define S second
#define pb push_back
#define mp make_pair
#define popi pop_back
#define SZ(v) ((int)(v).size())

typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<string> vs;
typedef vector<pii> vii;
typedef vector<vi> vvi;
typedef unordered_map<string, int> usi;
typedef unordered_map<int, int> umii;
typedef map<int, int> omii;
typedef set<int> seti;

ll pow(ll a, ll b, ll m) {
  ll x = 1, y = a;
  while (b > 0) {
    if (b % 2 == 1) {
      x = (x * y);
      if (x > m)
        x %= m;
    }
    y = (y * y);
    if (y > m)
      y %= m;
    b /= 2;
  }
  return x % m;
}
ll gcd(ll a, ll b) {
  if (b == 0)
    return a;
  else
    return gcd(b, a % b);
}

int main() {
#ifndef ONLINE_JUDGE
  freopen("input.txt", "r", stdin);
  freopen("output.txt", "w", stdout);
#endif

  fast;

  int x, y, z;
  cin >> x >> y >> z;
  swap(x, y);
  swap(x, z);
  cout << x << " " << y << " " << z << " " << endl;

  return 0;
}

// MAKING HARD THINGS SIMPLE AND SIMPLE THINGS HARD

//        ,~~.
//       (  6 )-_,
//  (\\___ )=='-'
//   \\ .   ) )
//    \\ `-' /    battak
// ~'`~'`~'`~'`~
Problem p02717 (C++) — buggy submission, verdict: Runtime Error

#include <algorithm>
#include <cmath>
#include <iostream>
#include <string>
#include <vector>
#define DEBUG(x) std::cout << '>' << #x << ':' << x << '\\n';
#define PRINTVEC(x)                                                            \\
  for (int i = 0; i < (int)x.size(); i++)                                      \\
    std::cout << x[i] << ' ';                                                  \\
  std::cout << '\\n';
#define PRINTP(x)                                                              \\
  for (int i = 0; i < (int)x.size(); i++)                                      \\
    std::cout << x[i].first << ' ' << x[i].second << '\\n';                     \\
  std::cout << '\\n';
#define io                                                                     \\
  std::ios_base::sync_with_stdio(false);                                       \\
  std::cin.tie(NULL);
const int INF = 1 << 29;
typedef long long ll;
using namespace std;

int main() {
  io;
#ifndef ONLINE_JUDGE
// freopen("input.txt", "r", stdin);
// freopen("output.txt", "w", stdout);
#endif

  int v[3];
  for (int i = 0; i < 3; i++)
    cin >> v[i];
  cout << v[2] << ' ' << v[0] << ' ' << v[1];

#ifndef ONLINE_JUDGE
// std::cout << '\\n' << "Time elapsed : " << 1.0 * clock() / CLOCKS_PER_SEC << "
// sec \\n";
#endif
  return 0;
}


Error: WA

Fixed submission:

#include <algorithm>
#include <cmath>
#include <iostream>
#include <string>
#include <vector>
#define DEBUG(x) std::cout << '>' << #x << ':' << x << '\\n';
#define PRINTVEC(x)                                                            \\
  for (int i = 0; i < (int)x.size(); i++)                                      \\
    std::cout << x[i] << ' ';                                                  \\
  std::cout << '\\n';
#define PRINTP(x)                                                              \\
  for (int i = 0; i < (int)x.size(); i++)                                      \\
    std::cout << x[i].first << ' ' << x[i].second << '\\n';                     \\
  std::cout << '\\n';
#define io                                                                     \\
  std::ios_base::sync_with_stdio(false);                                       \\
  std::cin.tie(NULL);
const int INF = 1 << 29;
typedef long long ll;
using namespace std;

int main() {
  io;
#ifndef ONLINE_JUDGE
  freopen("input.txt", "r", stdin);
  freopen("output.txt", "w", stdout);
#endif

  int v[3];
  for (int i = 0; i < 3; i++)
    cin >> v[i];
  cout << v[2] << ' ' << v[0] << ' ' << v[1];

#ifndef ONLINE_JUDGE
  std::cout << '\\n'
            << "Time elapsed : " << 1.0 * clock() / CLOCKS_PER_SEC << " sec \\n";
#endif
  return 0;
}
Problem p02717 (C++) — buggy submission, verdict: Runtime Error

#include <iostream>
using namespace std;

// int main(int argc, char **argv)
int main() {
  int a, b, c, x, y, z;
  // a = stoi(argv[1]);
  // b = stoi(argv[2]);
  // c = stoi(argv[3]);
  cin >> a >> b >> c;
  x = a;
  y = b;
  z = c;
  a = y;
  b = x;
  x = a;
  y = b;
  z = c;
  a = z;
  c = x;

  cout << a << " " << b << " " << c << endl;
  return 0;
}


Error: -6
terminate called after throwing an instance of 'std::logic_error'
  what():  basic_string: construction from null is not valid


Fixed submission:

#include <iostream>
using namespace std;

int main(int argc, char **argv) {
  int a, b, c, x, y, z;
  a = stoi(argv[1]);
  b = stoi(argv[2]);
  c = stoi(argv[3]);
  cout << a << " " << b << " " << c << endl;
  x = a;
  y = b;
  z = c;
  a = y;
  b = x;
  x = a;
  y = b;
  z = c;
  a = z;
  c = x;

  cout << a << " " << b << " " << c << endl;
  return 0;
}
Problem p02717 (C++) — buggy submission, verdict: Runtime Error

#include <bits/stdc++.h>

#define pb push_back
using namespace std;

int main() {

  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);

  int x, y, z;
  cin >> x >> y >> z;
  cout << z << " " << x << " " << y;

  return 0;
}

Error: WA

Fixed submission:

#include <bits/stdc++.h>

#define pb push_back
using namespace std;

int main() {

#ifndef ONLINE_JUDGE
  freopen("Input.txt", "r", stdin);
  freopen("Output.txt", "w", stdout);
#endif

  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);

  int x, y, z;
  cin >> x >> y >> z;
  cout << z << " " << x << " " << y;

  return 0;
}
Problem p02717 (C++) — buggy submission, verdict: Runtime Error

/*
!لَا أَبْرَحُ حَتَّىٰ أَبْلُغَ
فَصَبْرٌ جَمِيلٌ
*/
#define _CRT_SECURE_NO_WARNINGS
#include <bits/stdc++.h>
using namespace std;
/*#define endl                         '\\n'
#define Ceil(x,y)             ((x+y-1)/y)
#define sz(s)               (int)s.size()
#define RT(x)           return cout<<x,0;
#define mem(x,y)    memset(x,y,sizeof(x))
#define all(v) ((v).begin()), ((v).end())
#define vi                    vector<int>
#define Tesla              file();
#define fr(x,y) for(int x=0; x<(y); ++x)
#define fe(x,z,y) for(int x=z; x<(y); ++x)
const double PI = acos(-1), EPS = 1e-7;

typedef long long ll;
typedef unsigned long long ull;
const int dr[] { -1, -1, 0, 1, 1, 1, 0, -1 };
const int dc[] { 0, 1, 1, 1, 0, -1, -1, -1 };
ll gcd(ll x, ll y) { return (!y) ? x : gcd(y, x%y); }
ll lcm(ll x, ll y) { return ((x / gcd(x, y))*y); }
ll mod = 998244353;
ll power(ll x, ll y)
{
        if (y == 0)return 1;
        if (y == 1)return x;
        ll r = power(x, y / 2) % mod;
        return r%mod*r%mod*power(x, y % 2) % mod;
}
void file() {
#ifndef ONLINE_JUDGE
        freopen("input.txt", "r", stdin);
        freopen("output.txt", "w", stdout);
#endif  !ONLINEJUDGE
        ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);

}*/

int main() {
  // Tesla
  int x, y, z;
  cin >> x >> y >> z;
  cout << z << " " << x << " " << y;
}

Error: WA

Fixed submission:

/*
!لَا أَبْرَحُ حَتَّىٰ أَبْلُغَ
فَصَبْرٌ جَمِيلٌ
*/
#define _CRT_SECURE_NO_WARNINGS
#include <bits/stdc++.h>
#define endl '\\n'
#define Ceil(x, y) ((x + y - 1) / y)
#define sz(s) (int)s.size()
#define RT(x) return cout << x, 0;
#define mem(x, y) memset(x, y, sizeof(x))
#define all(v) ((v).begin()), ((v).end())
#define vi vector<int>
#define Tesla file();
#define fr(x, y) for (int x = 0; x < (y); ++x)
#define fe(x, z, y) for (int x = z; x < (y); ++x)
const double PI = acos(-1), EPS = 1e-7;
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
const int dr[]{-1, -1, 0, 1, 1, 1, 0, -1};
const int dc[]{0, 1, 1, 1, 0, -1, -1, -1};
ll gcd(ll x, ll y) { return (!y) ? x : gcd(y, x % y); }
ll lcm(ll x, ll y) { return ((x / gcd(x, y)) * y); }
ll mod = 998244353;
ll power(ll x, ll y) {
  if (y == 0)
    return 1;
  if (y == 1)
    return x;
  ll r = power(x, y / 2) % mod;
  return r % mod * r % mod * power(x, y % 2) % mod;
}
void file() {
#ifndef ONLINE_JUDGE
  freopen("input.txt", "r", stdin);
  freopen("output.txt", "w", stdout);
#endif !ONLINEJUDGE
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
}

int main() {
  Tesla int x, y, z;
  cin >> x >> y >> z;
  cout << z << " " << x << " " << y;
}
Problem p02717 (C++) — buggy submission, verdict: Runtime Error

#include <bits/stdc++.h>
#define mp(a, b) make_pair(a, b)
#define pb(a) push_back(a)
#define fi first
#define se second
#define siz(v) int(v.size())
#define nl cout << "\\n"
#define print(a, n)                                                            \\
  {                                                                            \\
    for (i = 0; i < n; i++) {                                                  \\
      cout << a[i] << " ";                                                     \\
    }                                                                          \\
    nl;                                                                        \\
  }
#define ll long long int
using namespace std;

int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);

  /*#ifndef ONLINE_JUDGE
  freopen("input.txt", "r", stdin);
      #endif*/
  ll x, y, z;
  cin >> x >> y >> z;
  cout << z << " " << x << " " << y;
}

Error: WA

Fixed submission:

#include <bits/stdc++.h>
#define mp(a, b) make_pair(a, b)
#define pb(a) push_back(a)
#define fi first
#define se second
#define siz(v) int(v.size())
#define nl cout << "\\n"
#define print(a, n)                                                            \\
  {                                                                            \\
    for (i = 0; i < n; i++) {                                                  \\
      cout << a[i] << " ";                                                     \\
    }                                                                          \\
    nl;                                                                        \\
  }
#define ll long long int
using namespace std;

int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);

#ifndef ONLINE_JUDGE
  freopen("input.txt", "r", stdin);
#endif
  ll x, y, z;
  cin >> x >> y >> z;
  cout << z << " " << x << " " << y;
}
Problem p02717 (C++) — buggy submission, verdict: Runtime Error

#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef vector<int> vi;
typedef pair<int, int> pii;

#define MX 35
#define MOD 1'000'000'007
#define set(N, pos) (N = (1LL << (pos)))
#define clear(N, pos) (N = (~(1LL << (pos))))
#define is_set(N, pos) (N & (1LL << (pos)))
#define all(v) (v).begin(), (v).end()

ll bigMod(ll base, ll pw) {
  ll ret = 1, mul = base;
  while (pw) {
    if (pw & 1)
      ret = (ret * mul) % MOD;
    mul = (mul * mul) % MOD;
    pw >>= 1;
  }
  return ret;
}

vi prime;
vector<bool> mark(MX, 0);
void sieve() {
  int limit = sqrt(MX + 1);
  prime.push_back(2);
  for (int i = 3; i < MX; i += 2) {
    if (!mark[i]) {
      prime.push_back(i);
      if (i < limit) {
        for (int j = i * i; j < MX; j += 2 * i)
          mark[j] = 1;
      }
    }
  }
}

int main() {
#ifndef ONLINE_JUDGE
  // freopen("input.txt", "r", stdin);
#endif // ONLINE_JUDGE

  ios_base::sync_with_stdio(false);
  cin.tie(0);

  int a, b, c;
  cin >> a >> b >> c;
  cout << c << ' ' << a << ' ' << b << endl;

  return 0;
}


Error: WA

Fixed submission:

#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef vector<int> vi;
typedef pair<int, int> pii;

#define MX 35
#define MOD 1'000'000'007
#define set(N, pos) (N = (1LL << (pos)))
#define clear(N, pos) (N = (~(1LL << (pos))))
#define is_set(N, pos) (N & (1LL << (pos)))
#define all(v) (v).begin(), (v).end()

ll bigMod(ll base, ll pw) {
  ll ret = 1, mul = base;
  while (pw) {
    if (pw & 1)
      ret = (ret * mul) % MOD;
    mul = (mul * mul) % MOD;
    pw >>= 1;
  }
  return ret;
}

vi prime;
vector<bool> mark(MX, 0);
void sieve() {
  int limit = sqrt(MX + 1);
  prime.push_back(2);
  for (int i = 3; i < MX; i += 2) {
    if (!mark[i]) {
      prime.push_back(i);
      if (i < limit) {
        for (int j = i * i; j < MX; j += 2 * i)
          mark[j] = 1;
      }
    }
  }
}

int main() {
#ifndef ONLINE_JUDGE
  freopen("input.txt", "r", stdin);
#endif // ONLINE_JUDGE

  ios_base::sync_with_stdio(false);
  cin.tie(0);

  int a, b, c;
  cin >> a >> b >> c;
  cout << c << ' ' << a << ' ' << b << endl;

  return 0;
}
Problem p02717 (C++) — buggy submission, verdict: Runtime Error

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

int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);

  int x, y, z;
  cin >> x >> y >> z;
  cout << z << " " << x << " " << y << endl;

  return 0;
}


Error: WA

Fixed submission:

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

int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
#ifndef ONLINE_JUDGE
  freopen("input.txt", "r", stdin);
  freopen("output.txt", "w", stdout);
#endif

  int x, y, z;
  cin >> x >> y >> z;
  cout << z << " " << x << " " << y << endl;

  return 0;
}
Problem p02717 (C++) — buggy submission, verdict: Runtime Error

#include <stdio.h>
#include <stdlib.h>

int main() {
  int a, b, c;
  scanf("%d %d %d", &a, &b, &c);
  printf("%d %d %d\\n", c, a, b);
  return 0;
}

Error: -11

Fixed submission:

#include <stdio.h>
#include <stdlib.h>

int main(int argc, char *argv[]) {
  int a = atoi(argv[1]);
  int b = atoi(argv[2]);
  int c = atoi(argv[3]);
  printf("%d\\n ", c);
  printf("%d\\n ", a);
  printf("%d\\n ", b);
  return 0;
}
Problem p02717 (C++) — buggy submission, verdict: Runtime Error

#include <stdio.h>
int main(void) {
  int X, Y, Z;
  int a, b;

  scanf("%d %d %d", &X, &Y, &Z);

  a = X;
  X = Y;
  Y = a;

  b = X;
  X = Z;
  Z = b;

  printf("%d %d %d", X, Y, Z);

  return 0;
}

Error: -11

Fixed submission:

#include <stdio.h>
int main(void) {

  int X, Y, Z;
  int a, b;

  scanf("%d %d %d", X, Y, Z);

  a = X;
  Y = X;
  X = a;

  b = X;
  Z = X;
  X = b;

  printf("%d %d %d", X, Y, Z);

  return 0;
}
Problem p02717 (C++) — buggy submission, verdict: Runtime Error

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define all(v) ((v).begin()), ((v).end())
#define clr(v, val) memset(v, val, sizeof v)
#define watch(x) cout << (#x) << " is " << (x) << endl
#define endl "\\n"
void Run() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
#ifndef ONLINE_JUDGE
  freopen("in.txt", "r", stdin); // freopen("out.txt", "w", stdout);
#endif
}
const int N = 1e5 + 20;
/***You***Can***Do***It***/
int main() {
  // Run();
  int x, y, z;
  cin >> x >> y >> z;
  cout << z << " " << x << " " << y << endl;
}


Error: WA

Fixed submission:

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define all(v) ((v).begin()), ((v).end())
#define clr(v, val) memset(v, val, sizeof v)
#define watch(x) cout << (#x) << " is " << (x) << endl
#define endl "\\n"
void Run() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
#ifndef ONLINE_JUDGE
  freopen("in.txt", "r", stdin); // freopen("out.txt", "w", stdout);
#endif
}
const int N = 1e5 + 20;
/***You***Can***Do***It***/
int main() {
  Run();
  int x, y, z;
  cin >> x >> y >> z;
  cout << z << " " << x << " " << y << endl;
}