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

#include <cmath>
#include <cstdio>
#include <iomanip>
#include <iostream>
#include <string>
#include <vector>
using namespace std;

int main() {
  long long A, V, B, W, T;
  cin >> A >> V;
  cin >> B >> W;
  cin >> T;
  long long d = abs(A - B);
  long long d2 = (V - W) * T;

  if (d <= d2) {
    cout << "YES" << endl;
  } else {
    cout << "NO" << endl;
  }
  return 0;
}

Error: 0

Fixed submission:

#include <cmath>
#include <cstdio>
#include <iomanip>
#include <iostream>
#include <string>
#include <vector>
using namespace std;

int main() {
  long long A, V, B, W, T;
  cin >> A >> V;
  cin >> B >> W;
  cin >> T;
  bool flg = false;
  long long d = abs(A - B);
  long long d2 = V - W;

  if ((d / d2) <= T) {
    cout << "YES" << endl;
  } else {
    cout << "NO" << endl;
  }
  return 0;
}
Problem p02646 (C++) — buggy submission, verdict: Runtime Error

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

int main() {

  ll a, v;
  cin >> a >> v;
  ll b, w;
  cin >> b >> w;
  ll t;
  cin >> t;

  if (abs(a - b) <= (v - w) * t)
    cout << "YES" << endl;
  else
    cout << "NO" << endl;
}


Error: 0

Fixed submission:

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

int main() {

  ll a, v;
  cin >> a >> v;
  ll b, w;
  cin >> b >> w;
  ll t;
  cin >> t;

  if (abs(a - b) / (v - w) <= t)
    cout << "YES" << endl;
  else
    cout << "NO" << endl;
}
Problem p02646 (C++) — buggy submission, verdict: Runtime Error

#pragma GCC optimize("-Ofast", "-funroll-all-loops")
#include <bits/stdc++.h>
// #define int long long
using namespace std;
int a, b, v, w, t;
signed main() {
  cin >> a >> v >> b >> w >> t;
  if (w >= v)
    puts("NO");
  else if (abs(a - b) <= 1LL * t * (v - w))
    puts("YES");
  else
    puts("NO");
  return 0;
}


Error: 4

Fixed submission:

#pragma GCC optimize("-Ofast", "-funroll-all-loops")
#include <bits/stdc++.h>
// #define int long long
using namespace std;
int a, b, v, w, t;
signed main() {
  cin >> a >> v >> b >> w >> t;
  if (w >= v)
    puts("NO");
  else if (abs(a - b) <= 1LL * t * (v - w))
    return puts("YES");
  else
    puts("NO");
  return 0;
}
Problem p02646 (C++) — buggy submission, verdict: Runtime Error

#include <bits/stdc++.h>
using namespace std;
typedef long long LL;
#define fi first
#define se second
#define pb push_back
#define forn(i, n) for (int i = 0; i < (n); i++)
#define for1(i, n) for (int i = 1; i <= n; i++)
#define forr(i, n) for (int i = n; i >= 0; i--)
#define all(x) x.begin(), x.end()
const int MAXN = 1e5 + 5;

void fio() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
}

int main() {
  fio();
  vector<pair<LL, LL>> v(2);
  forn(i, 2) cin >> v[i].fi >> v[i].se;
  LL t;
  cin >> t;
  LL vi = v[0].se - v[1].se;
  if (vi * t >= (abs(v[0].fi - v[1].fi))) {
    cout << "YES" << endl;
  } else
    cout << "NO" << endl;
  return 0;
}


Error: 0

Fixed submission:

#include <bits/stdc++.h>
using namespace std;
typedef long long LL;
#define fi first
#define se second
#define pb push_back
#define forn(i, n) for (int i = 0; i < (n); i++)
#define for1(i, n) for (int i = 1; i <= n; i++)
#define forr(i, n) for (int i = n; i >= 0; i--)
#define all(x) x.begin(), x.end()
const int MAXN = 1e5 + 5;

void fio() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
}

int main() {
  fio();
  vector<pair<LL, LL>> v(2);
  forn(i, 2) cin >> v[i].fi >> v[i].se;
  LL t;
  cin >> t;
  sort(all(v));
  LL vi = -v[1].se + v[0].se;
  if (v[1].fi == v[0].fi) {
    cout << "YES" << endl;
    return 0;
  }
  if (vi < 0 && v[1].fi != v[0].fi) {
    cout << "NO" << endl;
    return 0;
  }
  if (t >= ((v[1].fi - v[0].fi) / (vi)) && vi >= ((v[1].fi - v[0].fi) / (t))) {
    cout << "YES" << endl;
  } else
    cout << "NO" << endl;
  return 0;
}
Problem p02646 (C++) — buggy submission, verdict: Runtime Error

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int maxn = 1e7 + 5;
const int maxm = 5e5 + 5;
const ll inf = 2147483647;

int main() {
  ll a, v, b, w, t;
  int f = 0;
  cin >> a >> v >> b >> w >> t;

  if (abs(a - b) <= (v - w) * t) {
    cout << "YES";
    return 0;
  }
  cout << "NO";
  return 0;
}


Error: WA

Fixed submission:

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int maxn = 1e7 + 5;
const int maxm = 5e5 + 5;
const ll inf = 2147483647;

int main() {
  ll a, v, b, w, t;
  int f = 0;
  cin >> a >> v >> b >> w >> t;
  ll d = abs(a - b);
  ll k = abs(v - w);
  if (d / k <= t) {
    cout << "YES";
    return 0;
  }
  cout << "NO";
  return 0;
}
Problem p02646 (C++) — buggy submission, verdict: Runtime Error

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

int main() {
  bool ans = false;
  int64_t A, B, V, W, T;
  cin >> A >> V;
  cin >> B >> W;
  cin >> T;
  if (W < V && A > B) {
    if ((A - B) <= T * (V - W)) {
      ans = true;
    }
  }

  if (W < V && A < B) {
    if ((B - A) <= T * (V - W)) {
      ans = true;
    }
  }

  if (ans == true) {
    cout << "YES" << endl;
  } else {
    cout << "NO" << endl;
  }

  return 0;
}

Error: WA

Fixed submission:

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

int main() {
  bool ans = false;
  int A, B, V, W, T;
  double t;
  cin >> A >> V;
  cin >> B >> W;
  cin >> T;
  t = (A - B) / (V - W);
  cout << t;
  if (W < V && -1 * T <= t && t <= T) {
    ans = true;
  }
  if (ans == true) {
    cout << "YES" << endl;
  } else {
    cout << "NO" << endl;
  }

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

/*
    *****
    @Author: Harith Insider
    *****
*/
#include <bits/stdc++.h>
typedef long long int ll;
typedef long double ld;
#define pb push_back
#define ff first
#define ss second
#define fastio                                                                 \\
  ios::sync_with_stdio(0);                                                     \\
  cin.tie(0);                                                                  \\
  cout.tie(0);
using namespace std;
void solve() {
  ll x1, x2, t1, t2, t;
  cin >> x1 >> t1 >> x2 >> t2 >> t;
  ll a = abs(x1 - x2);
  ll b = (t1 - t2) * t;
  if (a <= b)
    cout << "YES" << endl;
  else
    cout << "NO" << endl;
}
int main() {
  fastio;
  solve();
}


Error: 0

Fixed submission:

/*
    *****
    @Author: Harith Insider
    *****
*/
#include <bits/stdc++.h>
typedef long long int ll;
typedef long double ld;
#define pb push_back
#define ff first
#define ss second
#define fastio                                                                 \\
  ios::sync_with_stdio(0);                                                     \\
  cin.tie(0);                                                                  \\
  cout.tie(0);
using namespace std;
void solve() {
  ll x1, x2, t1, t2, t;
  cin >> x1 >> t1 >> x2 >> t2 >> t;
  ll v = abs(x1 - x2) / abs(t2 - t1);
  if (v > 0 and v <= t)
    cout << "YES" << endl;
  else
    cout << "NO" << endl;
}
int main() {
  fastio;
  solve();
}
Problem p02646 (C++) — buggy submission, verdict: Runtime Error

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

int main() {
  ll a, v, b, w, t, ab, vw;
  cin >> a >> v >> b >> w >> t;
  bool flag = true;
  if (a > b) {
    ab = a - b;
  } else {
    ab = b - a;
  }
  if (v - w <= 0) {
    flag = false;
  } else {
    vw = v - w;
    ll n = ab % vw;
    if (n == 0) {
      if (ab / vw > t) {
        flag = false;
      }
    } else {
      if (ab / vw >= t) {
        flag = false;
      }
    }
  }
  if (flag) {
    cout << "YES" << endl;
  } else {
    cout << "NO" << endl;
  }
}

Error: 0

Fixed submission:

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

int main() {
  ll a, v, b, w, t, ab, vw;
  cin >> a >> v >> b >> w >> t;
  bool flag = true;
  if (a > b) {
    ab = a - b;
  } else {
    ab = b - a;
  }
  if (v - w < 0) {
    flag = false;
  } else {
    vw = v - w;
    if (ab % vw == 0) {
      if (ab / vw > t) {
        flag = false;
      }
    } else {
      flag = false;
    }
  }
  if (flag) {
    cout << "YES" << endl;
  } else {
    cout << "NO" << endl;
  }
}
Problem p02646 (C++) — buggy submission, verdict: Runtime Error

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

int main() {
  int a, v;
  cin >> a >> v;
  int b, w;
  cin >> b >> w;
  int t;
  cin >> t;
  int res;

  if (w >= v)
    res = 0;

  else {
    long long int dist = abs(b - a);
    long long int vel = v - w;
    long long d = vel * t;
    if (d >= dist)
      res = 1;
    else
      res = 0;
  }
  if (res)
    cout << "YES" << endl;
  else
    cout << "NO" << endl;
}


Error: WA

Fixed submission:

#include <bits/stdc++.h>
#define Yes cout << "YES" << endl;
#define No cout << "No" << endl;
#define ll long long int
using namespace std;
int main() {
  ll a, b, n, x, y, c, d, t, z, cnt = 0, sum = 0;
  cin >> a >> b >> c >> d >> t;
  if ((c * d / a * b) >= t || ((a * b) / (c * d) >= t))
    cout << "NO" << endl;
  else
    Yes
}
Problem p02646 (C++) — buggy submission, verdict: Runtime Error

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

int main() {
  double A, V, B, W, T;
  cin >> A >> V >> B >> W >> T;

  double sec = 0;

  if (W - V == 0 || W - V > 0) {
    cout << "NO" << endl;
  }

  else {

    sec = (max(A, B) - min(A, B)) / (V - W);

    if (sec <= T)
      cout << "YES" << endl;
    else
      cout << "NO" << endl;
  }
}

Error: 0

Fixed submission:

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

int main() {
  long long int A, V, B, W, T;
  cin >> A >> V >> B >> W >> T;

  long long int sec = 0;

  sec = (max(A, B) - min(A, B)) / (max(W, V) - min(W, V));

  if (sec <= T)
    cout << "YES" << endl;
  else
    cout << "NO" << endl;
}
Problem p02646 (C++) — buggy submission, verdict: Runtime Error

/*
 * author :Sadik Hassan
 *
 */
#include "bits/stdc++.h"
using namespace std;
#define ll long long
#define nl "\\n"
#define pb push_back
#define fi first
#define se second
#define PI (acos(-1.0))
#define _SAD()                                                                 \\
  ios::sync_with_stdio(0), cin.tie(0), cout.tie(0),                            \\
      cout << fixed << setprecision(20);
#define rep(i, n) for (int i = 0; i < n; i++)
#define SZ(s) s.size()
#define SRT(x, y) sort(x, x + y)
#define REV(a, b) reverse(a, a + b)
#define VSRT(x) sort(x.begin(), x.end())
#define VREV(x) reverse(x.begin(), x.end())
#define w(t)                                                                   \\
  int t;                                                                       \\
  cin >> t;                                                                    \\
  while (t--)
#define TSFL(s) transform(s.begin(), s.end(), s.begin(), ::toupper);
#define TSFH(s) transform(s.begin(), s.end(), s.begin(), ::tolower);
typedef vector<int> vi;
typedef vector<ll> vii;
typedef set<int> si;
typedef set<ll> sii;
/*---------------------------------------------------------------------*/

const int N = 2e5 + 10;
const int INF = (int)1e9 + 5;

int main() {
  _SAD()
  int a, b, m, n, t;
  cin >> a >> m >> b >> n >> t;
  a = abs(a - b);
  m -= n;
  if (m <= 0)
    cout << "NO";
  else if ((a + m - 1) / m <= t)
    cout << "YES";
  else
    cout << "NO";
  return 0;
}


Error: WA

Fixed submission:

/*
 * author :Sadik Hassan
 *
 */
#include "bits/stdc++.h"
using namespace std;
#define ll long long
#define nl "\\n"
#define pb push_back
#define fi first
#define se second
#define PI (acos(-1.0))
#define _SAD()                                                                 \\
  ios::sync_with_stdio(0), cin.tie(0), cout.tie(0),                            \\
      cout << fixed << setprecision(20);
#define rep(i, n) for (int i = 0; i < n; i++)
#define SZ(s) s.size()
#define SRT(x, y) sort(x, x + y)
#define REV(a, b) reverse(a, a + b)
#define VSRT(x) sort(x.begin(), x.end())
#define VREV(x) reverse(x.begin(), x.end())
#define w(t)                                                                   \\
  int t;                                                                       \\
  cin >> t;                                                                    \\
  while (t--)
#define TSFL(s) transform(s.begin(), s.end(), s.begin(), ::toupper);
#define TSFH(s) transform(s.begin(), s.end(), s.begin(), ::tolower);
typedef vector<int> vi;
typedef vector<ll> vii;
typedef set<int> si;
typedef set<ll> sii;
/*---------------------------------------------------------------------*/

const int N = 2e5 + 10;
const int INF = (int)1e9 + 5;

int main() {
  _SAD()
  int a, b, m, n, t;
  cin >> a >> m >> b >> n >> t;
  a = abs(a - b);
  m -= n;
  if ((a + m - 1) / m <= t && m > 0)
    cout << "YES";
  else
    cout << "NO";
  return 0;
}
Problem p02646 (C++) — buggy submission, verdict: Runtime Error

#include <algorithm>
#include <bits/stdc++.h>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <iostream>
#define inf 0x3f3f3f3f
const int maxn = 3000050;
using namespace std;
typedef long long ll;
int main() {
  ll A, V;
  cin >> A >> V;
  ll B, W;
  cin >> B >> W;
  ll T;
  cin >> T;
  ll D = abs(A - B);
  ll D2 = (V - W) * T;
  puts(D <= D2 ? "YES" : "NO");
}

Error: WA

Fixed submission:

#include <algorithm>
#include <bits/stdc++.h>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <iostream>
#define inf 0x3f3f3f3f
const int maxn = 3000050;
using namespace std;
typedef long long ll;
int main() {
  ll a, b, v, w, t;
  cin >> a >> v >> b >> w >> t;
  if (a == b) {
    cout << "Yes";
    return 0;
  }
  if ((v <= w && a < b) || abs(a - b) % abs(v - w)) {
    cout << "No";
  } else {
    if (t >= abs(a - b) / abs(v - w)) {
      cout << "Yes";
    } else
      cout << "No";
  }
  return 0;
}
Problem p02646 (C++) — buggy submission, verdict: Runtime Error

#include <bits/stdc++.h>
#define optimize                                                               \\
  ios_base::sync_with_stdio(0);                                                \\
  cin.tie(0);                                                                  \\
  cout.tie(0);
#define ll long long
#define ld long double
#define vi vector<int>
#define vll vector<ll>
#define pb push_back
#define lp(i, a, b) for (int i = a; i <= b; i++)
#define rlp(i, a, b) for (int i = b; i >= a; i--)
#define a_sort(v) sort(v.begin(), v.end())
#define d_sort(v) sort(v.rbegin(), v.rend())
#define pii pair<int, int>
#define pi 3.14159265358979323846264338327950
using namespace std;
// #define debug

const int MOD = 1E9 + 7;
const int N = 1E5;

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

      ll a,
      v;
  cin >> a >> v;
  ll b, w;
  cin >> b >> w;
  ll t;
  cin >> t;
  if (v <= w)
    cout << "NO\\n";
  else {
    puts(abs(a - b) <= t * (v - w) ? "YES" : "NO");
  }
}


Error: 0

Fixed submission:

#include <bits/stdc++.h>
#define optimize                                                               \\
  ios_base::sync_with_stdio(0);                                                \\
  cin.tie(0);                                                                  \\
  cout.tie(0);
#define ll long long
#define ld long double
#define vi vector<int>
#define vll vector<ll>
#define pb push_back
#define lp(i, a, b) for (int i = a; i <= b; i++)
#define rlp(i, a, b) for (int i = b; i >= a; i--)
#define a_sort(v) sort(v.begin(), v.end())
#define d_sort(v) sort(v.rbegin(), v.rend())
#define pii pair<int, int>
#define pi 3.14159265358979323846264338327950
using namespace std;
// #define debug

const int MOD = 1E9 + 7;
const int N = 1E5;

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

      ll a,
      v;
  cin >> a >> v;
  ll b, w;
  cin >> b >> w;
  ll t;
  cin >> t;
  if (v < w)
    cout << "NO\\n";
  else {
    ll speed = v - w, dist = b - a;
    puts(speed * t >= dist && dist % speed == 0 ? "YES" : "NO");
  }
}
Problem p02646 (C++) — buggy submission, verdict: Runtime Error

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

int main() {
  ll A, B;
  ll V, W, T;
  cin >> A >> V;
  cin >> B >> W;
  cin >> T;

  if (V <= W) {
    cout << "NO" << endl;
    return 0;
  }

  if ((V - W) * T >= abs(A - B)) {
    cout << "YES" << endl;
  } else {
    cout << "NO" << endl;
  }
}


Error: 0

Fixed submission:

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

int main() {
  int A, B;
  int V, W, T;
  cin >> A >> V;
  cin >> B >> W;
  cin >> T;

  if (V <= W) {
    cout << "NO" << endl;
  }

  if (A - B > 0) {
    if ((A - B) / (V - W) < T) {
      cout << "YES" << endl;
    } else {
      cout << "NO" << endl;
    }
  } else {
    if (-(A - B) / (V - W) < T) {
      cout << "YES" << endl;
    } else {
      cout << "NO" << endl;
    }
  }
}
Problem p02646 (C++) — buggy submission, verdict: Runtime Error

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

int main() {
  double A, V, B, W, T;
  cin >> A >> V >> B >> W >> T;
  double second;
  second = abs(B - A) / (V - W);
  // 追いつかない場合
  if (V <= W) {
    cout << "NO" << endl;
  }
  // T秒以内に追いつく場合
  else if (second <= T) {
    cout << "YES" << endl;
  } else {
    cout << "NO" << endl;
  }
}


Error: 0

Fixed submission:

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

int main() {
  int A, V, B, W, T;
  cin >> A >> V >> B >> W >> T;
  int second;
  second = abs(B - A) / (V - W);
  if (second <= T) {
    cout << "YES" << endl;
  } else {
    cout << "NO" << endl;
  }
}
Problem p02646 (C++) — buggy submission, verdict: Runtime Error

#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define ll long long

int main() {
  ll a, b, v, w, t;
  cin >> a >> v >> b >> w >> t;

  ll dist = abs(a - b);
  if (v - w <= 0) {
    cout << "NO" << endl;
    return 0;
  }

  ll diff = v - w;
  if (dist <= diff * t)
    cout << "YES" << endl;
  else
    cout << "NO" << endl;

  return 0;
}


Error: 0

Fixed submission:

#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define ll long long

int main() {
  ll a, b, v, w, t;
  cin >> a >> v >> b >> w >> t;

  ll dist = abs(b - a);
  ll diff = v - w;

  if (dist / diff <= t)
    cout << "YES" << endl;
  else
    cout << "NO" << endl;

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

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

bool solve() {
  int a, v, b, w, t;
  cin >> a >> v >> b >> w >> t;
  int dist = abs(b - a);
  int dv = (v - w);
  if (dv <= 0)
    return false;
  int steps = dist / dv;
  if (dist % dv)
    ++steps;
  if (steps <= t)
    return true;
  return false;
}

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.precision(10);
  cout << fixed;

  if (solve()) {
    cout << "YES" << endl;
  } else {
    cout << "NO" << endl;
  }

  return 0;
}

Error: 0

Fixed submission:

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

bool solve() {
  int a, v, b, w, t;
  cin >> a >> v >> b >> w >> t;
  int dist = abs(b - a);
  int dv = (v - w);
  if (dv < 0)
    return false;
  int steps = dist / dv;
  if (dist % dv)
    ++steps;
  if (steps <= t)
    return true;
  return false;
}

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.precision(10);
  cout << fixed;

  if (solve()) {
    cout << "YES" << endl;
  } else {
    cout << "NO" << endl;
  }

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

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

typedef long long int ll;
int main() {
  ll a, b;
  ll v, w;
  cin >> a >> v;
  cin >> b >> w;
  ll t;
  cin >> t;
  ll t1 = abs(a - b);
  ll t2 = (v - w) * t;
  if (t1 <= t2) {
    cout << "YES";
  } else {
    cout << "NO";
  }
  return 0;
}

Error: 0

Fixed submission:

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

typedef long long int ll;
int main() {
  ll a, b;
  ll v, w;
  cin >> a >> v;
  cin >> b >> w;
  ll t;
  cin >> t;
  puts((abs(a - b) / (v - w)) <= t ? "YES" : "NO");
  return 0;
}
Problem p02646 (C++) — buggy submission, verdict: Runtime Error

#include <bits/stdc++.h>
using namespace std;
int main() {
  long long a, v, b, w, t;
  cin >> a >> v >> b >> w >> t;
  if (llabs(a - b) <= t * (v - w))
    cout << "YES";
  else
    cout << "NO";
  return 0;
}

Error: 0

Fixed submission:

//
// Created by admin on 2020/6/13.
//
#include <bits/stdc++.h>
#define int long long
using namespace std;
int a, b, v, w, t;
signed main() {
  cin >> a >> v >> b >> w >> t;
  if (a > b) {
    swap(a, b);
    swap(v, w);
  }
  int deltas = 0, deltac = 0, deltat = 0;
  deltas = v - w;
  deltac = b - a;
  deltat = deltac / deltas;
  if (deltat <= t)
    cout << "YES" << endl;
  else
    cout << "NO" << endl;
  return 0;
}
Problem p02646 (C++) — buggy submission, verdict: Runtime Error

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

int main() {
  long long a, b, v, w, t;
  cin >> a >> v >> b >> w >> t;
  long long c = (v - w) * t, d = abs(a - b);
  if (c >= d)
    cout << "YES\\n";
  else
    cout << "NO\\n";
}


Error: 0

Fixed submission:

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

int main() {
  int flag;
  long long a, b, v, w, t;
  cin >> a >> v >> b >> w >> t;
  if (a < b && v <= w)
    flag = 0;
  else {
    if ((b - a) % (v - w) == 0 && ((b - a) / (v - w)) <= t)
      flag = 1;
    else
      flag = 0;
  }
  if (flag)
    printf("YES\\n");
  else
    printf("NO\\n");
}
Problem p02646 (C++) — buggy submission, verdict: Runtime Error

#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
  ll A, V, B, W, T;
  cin >> A >> V >> B >> W >> T;
  ll D = abs(A - B);
  ll D2 = (V - W) * T;
  puts(D <= D2 ? "YES" : "NO");
}

Error: 0

Fixed submission:

#include <iostream>
using namespace std;
int main() {
  int a, b;
  int v, w;
  int t;
  cin >> a >> v;
  cin >> b >> w;
  cin >> t;
  int ans;
  ans = (a - b) / (v - w);
  if (ans <= t)
    cout << "YES" << endl;
  else
    cout << "NO" << endl;
}
Problem p02647 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <bits/stdc++.h> //C++の機能を「全て」読み込むための命令
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define cout(x) cout << x << endl
#define all(v) v.begin(), v.end()
using namespace std;
// 型エイリアス
using vi = vector<int>;
using ll = long long;
using P = pair<int, int>;
using Graph = vector<vector<int>>;
const ll inf = 1e18;
const int N = 2e5 + 10;

int main() {
  int n, k;
  cin >> n >> k;
  vi a(n);
  rep(i, n) cin >> a[i];

  rep(t, k) {
    vi b(n + 1, 0);
    rep(i, n) {
      int l = max(0, i - a[i]);
      int r = min(n, i + a[i] + 1);
      ++b[l];
      --b[r];
    }
    rep(i, n) b[i + 1] += b[i];
    b.pop_back();
    if (a == b)
      break;
    a = b;
  }
  rep(i, n) cout << a[i] << " ";
  cout << endl;

  return 0;
}

Error: TLE

Fixed submission:

#include <bits/stdc++.h> //C++の機能を「全て」読み込むための命令
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define cout(x) cout << x << endl
#define all(v) v.begin(), v.end()
using namespace std;
// 型エイリアス
using vi = vector<int>;
using ll = long long;
using P = pair<int, int>;
using Graph = vector<vector<int>>;
const ll inf = 1e18;
const int N = 2e5 + 10;

int main() {
  int n, k;
  cin >> n >> k;
  vi a(n);
  rep(i, n) cin >> a[i];

  rep(t, k) {
    vi b(n);
    for (int i = 1; i <= n; ++i) {
      for (int j = 1; j <= n; ++j) {
        if (j - a[j - 1] - 0.5 <= i && i <= j + a[j - 1] + 0.5)
          ++b[i - 1];
      }
      bool can = true;
      rep(i, n) {
        if (b[i] < n)
          can = false;
      }
      if (can) {
        rep(i, n) cout << b[i] << " ";
        cout << endl;
        return 0;
      }
    }
    rep(i, n) a[i] = b[i];
  }
  rep(i, n) cout << a[i] << " ";
  cout << endl;

  return 0;
}