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

#include <bits/stdc++.h>
#define int long long
#define pb push_back
#define MAX 10000005
#define mod 1000000007
#define sp fixed << setprecision(12)
using namespace std;
/*
vector<int> primes;
ll sumprime[MAX];
bool is_prime[MAX];
void sieve(){
        is_prime[0]=is_prime[1]=true;
        for(int i=4;i<MAX;i+=2){
                is_prime[i]=true;
        }
        for(int i=3;i*i<MAX;i+=2){
                if(!is_prime[i]){
                        for(int j=i*i;j<MAX;j+=i){
                                is_prime[j]=true;
                        }
                }
        }
        for(int i=0;i<MAX;i++){
                if(!is_prime[i]){
                        sumprime[i]=sumprime[i-1]+i;
                }else{
                        sumprime[i]=sumprime[i-1];
                }
        }
}
*/

int32_t main() {

  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
#ifndef ONLINE_JUDGE
  freopen("input.txt", "r", stdin);
  freopen("output.txt", "w", stdout);
#endif
  // double	pi=3.14159265358979323846;
  // sieve();

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

  return 0;
}

Error: WA

Fixed submission:

#include <bits/stdc++.h>
#define int long long
#define pb push_back
#define MAX 10000005
#define mod 1000000007
#define sp fixed << setprecision(12)
using namespace std;
/*
vector<int> primes;
ll sumprime[MAX];
bool is_prime[MAX];
void sieve(){
        is_prime[0]=is_prime[1]=true;
        for(int i=4;i<MAX;i+=2){
                is_prime[i]=true;
        }
        for(int i=3;i*i<MAX;i+=2){
                if(!is_prime[i]){
                        for(int j=i*i;j<MAX;j+=i){
                                is_prime[j]=true;
                        }
                }
        }
        for(int i=0;i<MAX;i++){
                if(!is_prime[i]){
                        sumprime[i]=sumprime[i-1]+i;
                }else{
                        sumprime[i]=sumprime[i-1];
                }
        }
}
*/

int32_t main() {

  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
#ifndef ONLINE_JUDGE
  freopen("input.txt", "r", stdin);
  freopen("output.txt", "w", stdout);
#endif
  // double	pi=3.14159265358979323846;
  // sieve();

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

#include <iostream>
using namespace std;
typedef long long int 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 <cstdlib> // abs() for integer
#include <iostream>
typedef long long int ll;

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

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

#include <bits/stdc++.h>
using namespace std;
#define int int64_t
signed main() {
  int a, v, b, w, t;
  cin >> a >> v >> b >> w >> t;
  if (v - w <= 0)
    cout << "NO\\n";
  else {
    if (a < 0 || b < 0) {
      int l = min(a, b);
      l = 0 - l;
      a += l;
      b += l;
    }
    if (v * t - w * t >= abs(a - b))
      cout << "YES\\n";
    else
      cout << "NO\\n";
  }
}

Error: 0

Fixed submission:

#include <bits/stdc++.h>
using namespace std;
#define int int64_t
signed main() {
  int a, v, b, w, t, l;
  cin >> a >> v >> b >> w >> t;
  if (a < 0 || b < 0) {
    l = min(a, b);
    a -= l, b -= l;
  }
  a = abs(a - b);
  if (a == 0)
    cout << "NO\\n";
  else {
    for (int i = 1; i <= t; i++) {
      if (a % (abs(w - v) * i)) {
        cout << "YES\\n";
        return 0;
      }
    }
    cout << "NO\\n";
  }
}
Problem p02646 (C++) — buggy submission, verdict: Runtime Error

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

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

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

  ll dist = max(a - b, b - a);
  ll sekkin = v - w;

  bool kotae = false;

  for (int i = 0; i < t; i++) {
    dist -= sekkin;
    if (dist <= 0) {
      kotae = true;
    }
  }

  if (kotae) {
    cout << "YES" << endl;
  }

  else {
    cout << "NO" << endl;
  }
}


Error: 0

Fixed submission:

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

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

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

  ll dist = max(a - b, b - a);
  ll sekkin = v - w;

  bool kotae = false;

  if (dist % sekkin == 0) {

    for (int i = 0; i < t; i++) {
      dist -= sekkin;

      if (dist == 0) {
        kotae = true;
      }
    }
  }

  if (kotae) {
    cout << "YES" << endl;
  }

  else {
    cout << "NO" << endl;
  }
}
Problem p02646 (C++) — buggy submission, verdict: Runtime Error

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

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

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


Error: 0

Fixed submission:

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

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

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

#include <bits/stdc++.h>

using namespace std;

void input();
string s;
long long a;
long long b;
long long v, w, t;
void solve() {
  if (v <= w) {
    cout << "NO\\n";
  } else {
    long long d = (v - w) * t;

    if (abs(a - b) <= d) {
      cout << "YES\\n";
    } else {
      cout << "NO\\n";
    }
  }
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);

  input();
  solve();
}

void input() {
  cin >> a >> v >> b >> w;
  cin >> t;
}


Error: 0

Fixed submission:

#include <bits/stdc++.h>

using namespace std;

void input();
string s;
long long a;
long long b;
long long v, w, t;
void solve() {
  if (a < b && v <= w) {
    cout << "NO\\n";
  } else if (a == b) {
    cout << "YES\\n";
  } else {
    if ((a - b) / (w - v) <= t) {
      cout << "YES\\n";
    } else {
      cout << "NO\\n";
    }
  }
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);

  input();
  solve();
}

void input() {
  cin >> a >> v >> b >> w;
  cin >> t;
}
Problem p02646 (C++) — buggy submission, verdict: Runtime Error

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

int main() {
  long long a, v, b, w, p;
  cin >> a >> v >> b >> w >> p;
  long long wdnmd = abs(b - a);
  long long xswl = (v - w) * p;
  if (wdnmd <= xswl) {
    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 = 0;
  cin >> A >> V >> B >> W >> T;
  int X = B - A;
  if (B > A && V >= W && (B - A) / (V - W) <= T) {
    cout << "YES" << endl;
  } else if (X == 0) {
    cout << "YES" << endl;
  } else if (B > A && W >= V && (B - A) / (V - W) <= T) {
    cout << "YES" << endl;
  } else {
    cout << "NO" << endl;
  }
}
Problem p02646 (C++) — buggy submission, verdict: Runtime Error

#include <algorithm>
#include <iostream>
#include <vector>

using namespace std;

template <class T> inline bool chmin(T &a, T b) {
  if (a > b) {
    a = b;
    return true;
  }

  return false;
}

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

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

  int dist = abs(B - A);

  for (int i = 0; i < T; i++) {
    dist -= speed;
    if (dist <= 0) {
      cout << "YES" << endl;
      return 0;
    }
  }

  cout << "NO" << endl;
}


Error: 0

Fixed submission:

#include <iostream>
#include <vector>

using namespace std;

template <class T> inline bool chmin(T &a, T b) {
  if (a > b) {
    a = b;
    return true;
  }

  return false;
}

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

  vector<int> dp(T, 0);

  int pa = A;
  int pb = B;
  for (int i = 0; i < T; i++) {
    if (pa < pb) {
      pa += V;
      pb += W;
    } else {
      pa -= V;
      pb -= W;
    }

    if (pa == pb) {
      cout << "YES" << endl;
      return 0;
    }
  }

  cout << "NO" << endl;
}
Problem p02646 (C++) — buggy submission, verdict: Runtime Error

#include <bits/stdc++.h>
using namespace std;
#define ll long long int
int main() {
  ll A, B, V, W, T;
  cin >> A >> V;
  cin >> B >> W;
  cin >> T;

  ll D = abs(A - B);
  ll D2 = (V - W) * T;
  puts(D <= D2 ? "YES" : "NO");
}

Error: WA

Fixed submission:

#include <bits/stdc++.h>
using namespace std;
int A, B, V, W, T;
bool cheack(int lo, int hi) {
  int mid = lo + (hi - lo) / 2;
  int p1 = 0, p2 = 0;
  p1 = A + (V * mid);
  p2 = B + (W * mid);
  if (lo < hi)
    return false;
  if (p1 == p2)
    return true;
  else if (p1 > p2)
    cheack(lo, mid - 1);
  else
    cheack(mid + 1, hi);
}
int main() {
  cin >> A >> V;
  cin >> B >> W;
  cin >> T;
  if ((A > B && V > W) || (A < B && V < W) || (A != B && V == W)) {
    cout << "NO";
    return 0;
  }
  if (cheack(1, T)) {
    cout << "YES";
    return 0;
  } else {
    cout << "NO";
    return 0;
  }
}
Problem p02646 (C++) — buggy submission, verdict: Runtime Error

#include <bits/stdc++.h>
#include <iostream>
#include <string.h>
#include <string>
#include <vector>

using namespace std;
#define ll long long int

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

  ll a, as, b, bs, t;
  cin >> a >> as >> b >> bs >> t;
  if (bs >= as) {
    cout << "NO" << endl;
  } else {
    if (abs(b - a) <= t * (as - bs)) {
      cout << "YES" << endl;
    } else {
      cout << "NO" << endl;
    }
  }

  return 0;
}


Error: WA

Fixed submission:

#include <bits/stdc++.h>
#include <iostream>
#include <string.h>
#include <string>
#include <vector>

using namespace std;
#define ll long long int

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

  ll a, as, b, bs, t;
  cin >> a >> as >> b >> bs >> t;
  if (b >= a) {
    cout << "NO" << endl;
  } else {
    if ((b - a) / (as - bs) <= 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 int a, v, b, w, t, t1, t2;
  long double ans;
  cin >> a >> v;
  cin >> b >> w;
  cin >> t;
  if (v - w > 0) {
    t1 = abs(b - a);
    t2 = v - w;
    ans = (double)t1 / t2;
  } else {
    cout << "NO";
    return 0;
  }

  if (ans <= t)
    cout << "YES";
  else
    cout << "NO";
  return 0;
}

Error: WA

Fixed submission:

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

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

#include <bits/stdc++.h>

using namespace std;
typedef long long ll;
typedef pair<int, int> pa;
int mod = 1e9 + 7;
const int N = 1e5 + 100;

struct node {
  ll a, v;
} p[5];
int main() {
  long double t;
  cin >> p[1].a >> p[1].v >> p[2].a >> p[2].v >> t;
  // sort(p+1,p+3);
  long double tt = fabs(1.0 * (p[1].a - p[2].a)) / (1.0 * (p[1].v - p[2].v));
  if (tt > 0 && tt <= t)
    puts("YES");
  else
    puts("NO");
  return 0;
}


Error: 0

Fixed submission:

#include <bits/stdc++.h>

using namespace std;
typedef long long ll;
typedef pair<int, int> pa;
int mod = 1e9 + 7;
const int N = 1e5 + 100;

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

#include <cstdlib>
#include <iostream>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
using namespace std;

int main() {

  long A, V; // oni
  long B, W; // nigeteru
  long T;

  cin >> A >> V >> B >> W >> T;

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

  if (A == B) {
    printf("YES");
    return 0;
  }

  long double catch_time = double(abs(A - B)) / double(V - W);

  if (catch_time > T) {
    printf("NO");
    return 0;
  }

  printf("YES");

  return 0;
}


Error: WA

Fixed submission:

#include <cstdlib>
#include <iostream>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
using namespace std;

int main() {

  long A, V; // oni
  long B, W; // nigeteru
  long T;

  cin >> A >> V >> B >> W >> T;

  if (V < W) {
    printf("NO");
    return 0;
  }

  long catch_time = abs(A - B) / (V - W);

  if (catch_time > T) {
    printf("NO");
    return 0;
  }

  printf("YES");

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

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

int main() {
  long double A, B, V, W, T;
  double X;
  cin >> A >> V >> B >> W >> T;
  if (W < V) {
    X = abs(A - B) / (V - W);
    if (X <= T) {
      cout << "YES" << endl;
    } else {
      cout << "NO" << endl;
    }
  } else {
    cout << "NO" << endl;
  }
}


Error: WA

Fixed submission:

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

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


/**
 *    Coded by : lucky_21
 *               --------Lokesh Singh
 **/

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

#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
template <class T>
using oset =
    tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;

#define F first
#define S second
#define pb push_back
#define lb lower_bound
#define ub upper_bound
#define pii pair<int, int>
#define all(x) x.begin(), x.end()
#define fix fixed << setprecision(10)
#define rep(i, a, b) for (int i = int(a); i <= int(b); i++)
#define repb(i, b, a) for (int i = int(b); i >= int(a); i--)
#define FastIO ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0)

typedef double db;
typedef long long ll;

const int N = 2e5 + 5;
const int mod = 1e9 + 7;

signed main() {
  FastIO;
  ll a, b, c, d, t;
  cin >> a >> b >> c >> d >> t;
  if (a < c) {
    return cout << ((c - a) <= (b - d) * t ? "YES" : "NO"), 0;
  }
  cout << ((a - c) <= (b - d) * t ? "YES" : "NO");
  return 0;
}


Error: WA

Fixed submission:


/**
 *    Coded by : lucky_21
 *               --------Lokesh Singh
 **/

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

#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
template <class T>
using oset =
    tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;

#define F first
#define S second
#define pb push_back
#define lb lower_bound
#define ub upper_bound
#define pii pair<int, int>
#define all(x) x.begin(), x.end()
#define fix fixed << setprecision(10)
#define rep(i, a, b) for (int i = int(a); i <= int(b); i++)
#define repb(i, b, a) for (int i = int(b); i >= int(a); i--)
#define FastIO ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0)

typedef double db;
typedef long long ll;

const int N = 2e5 + 5;
const int mod = 1e9 + 7;

signed main() {
  FastIO;
  ll a, b, c, d, t;
  cin >> a >> b >> c >> d >> t;
  if ((c - a) <= (b - d) * t and (c - a) % (b - d) == 0)
    return cout << "YES", 0;
  cout << "NO";
  return 0;
}
Problem p02646 (C++) — buggy submission, verdict: Runtime Error

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

int main() {
  ll a, v, b, w, t;
  cin >> a >> v >> b >> w >> t;
  ll dis;
  if (a < b)
    dis = b - a + (w - v) * t;
  else
    dis = a - b + (w - v) * t;
  if (dis <= 0)
    cout << "YES" << endl;
  else
    cout << "NO" << endl;
  return 0;
}


Error: 0

Fixed submission:

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

int main() {
  ll a, v, b, w, t;
  cin >> a >> v >> b >> w >> t;
  ll T = (b - a + v - w - 1) / (v - w);
  if (T > 0 && T <= 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, v, b, w, t;
  cin >> a >> v >> b >> w >> t;
  long long x = a - b;
  if (x < 0) {
    x *= -1;
  }
  if ((x <= t * (v - w)) && (v - w) > 0)
    cout << "YES";
  else {
    cout << "NO";
  }
}


Error: WA

Fixed submission:

#include <bits/stdc++.h>
using namespace std;
int main() {
  long long a, v, b, w, t;
  cin >> a >> v >> b >> w >> t;
  long long x = a - b;
  if (x < 0) {
    x *= -1;
  }
  if (((x / (v - w)) <= t) && (x / (v - w)) > 0)
    cout << "YES";
  else {
    cout << "NO";
  }
}
Problem p02646 (C++) — buggy submission, verdict: Runtime Error

#include <algorithm>
#include <cstdio>
using namespace std;
int main() {
  long long A, V, B, W, T;
  scanf("%lld%lld%lld%lld%lld", &A, &V, &B, &W, &T);
  if (abs(A - B) > (V - W) * T) {
    printf("NO\\n");
  } else
    printf("YES\\n");
}

Error: -6
*** stack smashing detected ***: terminated


Fixed submission:

#include <algorithm>
#include <cstdio>
using namespace std;
int main() {
  int A, V, B, W, T;
  scanf("%lld%lld%lld%lld%lld", &A, &V, &B, &W, &T);
  if (abs(A - B) > (V - W) * T) {
    printf("NO\\n");
  } else
    printf("YES\\n");
}
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;

  long long dis = abs(b - a);
  long long ver = w - v;

  // if(ver == 0) {
  //   if(dis == 0) cout << "YES" << endl;
  //   else cout << "NO" << endl;
  //   return 0;
  // }

  // if(ver < 0 && dis / abs(ver) <= t){
  if (ver < 0 && dis <= t * abs(ver)) {
    cout << "YES" << endl;
  } else
    cout << "NO" << endl;

  return 0;
}

Error: 0

Fixed submission:

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

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

  long long dis = b - a;
  long long ver = -(w - v);

  if (dis / ver >= 0 && dis % ver == 0 && dis / ver <= t) {
    cout << "YES" << endl;
  } else {
    cout << "NO" << endl;
  }

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

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

const ll MX = 1e18;
const long double PI = acos(-1);

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


Error: 0

Fixed submission:

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

const ll MX = 1e18;
const long double PI = acos(-1);

int main() {
  ll a, b, v, w, t;
  cin >> a >> v >> b >> w >> t;
  ll ans = (a - b) / (w - v);
  if (w - v != 0 && ans <= t && ans > 0 && (a - b) % (w - v) == 0)
    pri("YES");
  else
    pri("NO");
  return 0;
}
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++)

int main() {
  long double A, V, B, W, T;
  cin >> A >> V >> B >> W >> T;
  string ans = "NO";

  if (V <= W) {
    cout << ans << endl;
    return 0;
  }
  if (abs(A - B) / abs(V - W) <= T)
    ans = "YES";

  cout << ans << endl;
}

Error: 0

Fixed submission:

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

int main() {
  int64_t A, V, B, W, T;
  cin >> A >> V >> B >> W >> T;
  string ans = "NO";
  if (V < W) {
    cout << ans << endl;
    return 0;
  }
  if (abs(A - B) / abs(V - W) <= T)
    ans = "YES";

  cout << ans << endl;
}
Problem p02646 (C++) — buggy submission, verdict: Runtime Error

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll N = 1e6 + 5;
const ll MOD = 1e9 + 7;
#define all(x) x.begin(), x.end()
#define pii pair<int, int>
#define pis pair<ll, string>
#define F first
#define S second
#define LCM(a, b) ((a * b) / __gcd(a, b))
#define inf 1e15
#define test                                                                   \\
  ll cse;                                                                      \\
  cin >> cse;                                                                  \\
  for (ll _i = 1; _i <= cse; _i++)
#define PI 3.14159265
#define fast                                                                   \\
  ios_base::sync_with_stdio(false);                                            \\
  cin.tie(NULL);                                                               \\
  cout.tie(NULL);
const double EPS = 1E-9;
typedef vector<vector<double>> matrix;
typedef vector<int> vi;

int main() {
  fast;

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

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

  if (v <= w)
    cout << "NO\\n";
  else {
    if ((abs(a - b) + (v - w) - 1) / (v - w) <= t)
      cout << "YES\\n";
    else
      cout << "NO\\n";
  }
  return 0;
}

Error: 0

Fixed submission:

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll N = 1e6 + 5;
const ll MOD = 1e9 + 7;
#define all(x) x.begin(), x.end()
#define pii pair<int, int>
#define pis pair<ll, string>
#define F first
#define S second
#define LCM(a, b) ((a * b) / __gcd(a, b))
#define inf 1e15
#define test                                                                   \\
  ll cse;                                                                      \\
  cin >> cse;                                                                  \\
  for (ll _i = 1; _i <= cse; _i++)
#define PI 3.14159265
#define fast                                                                   \\
  ios_base::sync_with_stdio(false);                                            \\
  cin.tie(NULL);                                                               \\
  cout.tie(NULL);
const double EPS = 1E-9;
typedef vector<vector<double>> matrix;
typedef vector<int> vi;

int main() {
  fast;

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

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

  ll aAfterT = a + t * v;
  ll bAfterT = b + t * w;

  // if(a > b) {
  //     if(w < v) cout << "NO\\n";
  //     else{
  //         if((w - v) != 0 && (a - b) % (w - v) == 0 && ((a - b)/(w - v)) <=
  //         t) cout << "YES\\n"; else
  //             cout << "NO\\n";
  //     }
  // }
  // else {
  //     // a < b
  //     if(v < w) cout << "NO\\n";
  //     else{
  //         // v > w
  //         if((v - w) != 0 && (b - a) % (v - w) == 0 && ((b - a)/(v - w)) <=
  //         t) cout << "YES\\n"; else
  //             cout << "NO\\n";
  //     }
  // }
  // t = (X - a) / v;
  // t = (X - b) / w;

  if (aAfterT >= bAfterT && ((b - a) % (v - w)) == 0 &&
      ((b - a) / (v - w)) <= t)
    cout << "YES\\n";
  else
    cout << "NO\\n";
  return 0;
}