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

#include <algorithm>
#include <bitset>
#include <cmath>
#include <complex>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>

using namespace std;
typedef long long ll;

// i: index, n: size, a: start, b: end
#define REP(i, n) for (ll i = 0; i < (ll)(n); i++)
#define REPD(i, n) for (ll i = n - 1; i >= 0; i--)
#define FOR(i, a, b) for (ll i = a; i <= (ll)(b); i++)
#define FORD(i, a, b) for (ll i = a; i >= (ll)(b); i--)

// x: container(array, vector etc..)
#define ALL(x) (x).begin(), (x).end()
#define SIZE(x) ((ll)(x).size())
#define MAX(x) *max_element(ALL(x))
#define MIN(x) *min_element(ALL(x))

#define INF 1000000000000 // 10^12
#define MOD 10000007      // 10^9+7
#define MAXR 100000       // 10^5

#define PB push_back
#define MP make_pair
#define F first
#define S second

signed main() {
  string s;
  cin >> s;
  string nickName;
  int maxStartIndex = s.length() - 3;
  srand((unsigned int)time(NULL));
  int startIndex = 0;
  if (maxStartIndex != 0) {
    startIndex = rand() % maxStartIndex;
  }
  FOR(i, startIndex, startIndex + 2) { nickName += s[i]; }
  cout << nickName << endl;
  return 0;
}


Error: WA

Fixed submission:

#include <algorithm>
#include <bitset>
#include <cmath>
#include <complex>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>

using namespace std;
typedef long long ll;

// i: index, n: size, a: start, b: end
#define REP(i, n) for (ll i = 0; i < (ll)(n); i++)
#define REPD(i, n) for (ll i = n - 1; i >= 0; i--)
#define FOR(i, a, b) for (ll i = a; i <= (ll)(b); i++)
#define FORD(i, a, b) for (ll i = a; i >= (ll)(b); i--)

// x: container(array, vector etc..)
#define ALL(x) (x).begin(), (x).end()
#define SIZE(x) ((ll)(x).size())
#define MAX(x) *max_element(ALL(x))
#define MIN(x) *min_element(ALL(x))

#define INF 1000000000000 // 10^12
#define MOD 10000007      // 10^9+7
#define MAXR 100000       // 10^5

#define PB push_back
#define MP make_pair
#define F first
#define S second

signed main() {
  string s;
  cin >> s;
  string nickName;
  int maxStartIndex = s.length() - 3;
  srand((unsigned int)time(NULL));
  int startIndex = rand() % maxStartIndex;
  FOR(i, startIndex, startIndex + 2) { nickName += s[i]; }
  cout << nickName << endl;
  return 0;
}
Problem p02645 (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>;

int main() {
  string s;
  cin >> s;
  string s2;
  s2 = s.substr(0, 3);
  cout << s2 << endl;

  return 0;
}

Error: WA

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>;

int main() {
  int n, m;
  cin >> n >> m;
  vector<vector<int>> a(n + 1);
  int b, c;
  rep(i, m) {
    cin >> b >> c;
    a[b].push_back(c);
    a[c].push_back(b);
  }
  vector<int> o(n + 1), ma(n + 1, -1);
  queue<int> q;
  int qq, l, ans = 0, k;

  rep(i, n) {
    k = 0;
    if (ma[i + 1] == -1) {
      ma[i + 1] = 0;
      q.push(i + 1);
      while (q.size() != 0) {
        qq = q.front();
        q.pop();
        l = a[qq].size();
        rep(j, l) {
          if (ma[a[qq][j]] == -1) {
            q.push(a[qq][j]);
            ma[a[qq][j]] = 3;
            o[a[qq][j]] = qq;
          } else {
            if (a[qq][j] != o[qq]) {
              // cout << qq << endl;
              k = 1;
            }
          }
        }
      }
      if (k == 0) {
        ++ans;
      }
    }
  }

  cout << ans << endl;

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

#include <bits/stdc++.h>

using namespace std;

int main() {
  string s;
  cin >> s;
  string ans = "";
  for (int i = 0; i < s.length() - 2; i++) {
    if (s[i] != s[i + 1] and s[i + 1] != s[i + 2] and s[i] != s[i + 2]) {
      ans += s[i];
      ans += s[i + 1];
      ans += s[i + 2];
      break;
    }
  }
  if (ans.length() != 0)
    cout << ans << endl;
  else {
    cout << s[0] << s[1] << s[2] << 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 <bits/stdc++.h>

using namespace std;

int main() {
  string s;
  cin >> s;
  string ans = 0;
  for (int i = 0; i < s.length() - 2; i++) {
    if (s[i] != s[i + 1] and s[i + 1] != s[i + 2] and s[i] != s[i + 2]) {
      ans += s[i];
      ans += s[i + 1];
      ans += s[i + 2];
      break;
    }
  }
  if (ans.length() != 0)
    cout << ans << endl;
  else {
    cout << s[0] << s[1] << s[2] << endl;
  }
  return 0;
}
Problem p02645 (C++) — buggy submission, verdict: Runtime Error

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

int main() {
  string s;
  cin >> s;
  cout << s[0] << s[1] << s[2] << endl;
}

Error: -6
terminate called after throwing an instance of 'std::length_error'
  what():  cannot create std::vector larger than max_size()


Fixed submission:

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

int main() {
  int n, k;
  cin >> n >> k;
  vector<int> d(k);
  int tmp;
  vector<int> a(n);
  rep(i, k) {
    cin >> d.at(i);
    rep(j, d.at(i)) {
      cin >> tmp;
      a.at((int)tmp - 1) = 1;
    }
  }
  int count = 0;
  rep(i, n) {
    if (a.at(i) == 0) {
      count++;
    }
  }
  cout << count << endl;
}
Problem p02645 (C++) — buggy submission, verdict: Runtime Error

#include <iostream>
#include <string>
using namespace std;

int main() {
  string s;
  cin >> s;
  cout << s.substr(0, 3) << endl;
  return 0;
}

Error: WA

Fixed submission:

#include <cstdlib>
#include <ctime>
#include <iostream>
#include <string>
using namespace std;

#define LENGTH 3

int main() {
  string s;
  int n;
  cin >> s;
  srand(time(NULL));
  n = rand() % (s.length() - LENGTH);
  cout << s.substr(n, LENGTH) << endl;
  return 0;
}
Problem p02645 (C++) — buggy submission, verdict: Runtime Error

#include <iostream>
using namespace std;
int main(void) {
  char s[20];
  cin >> s;
  cout << s[0] << s[1] << s[2] << endl;
}

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


Fixed submission:

#include <iostream>
using namespace std;
int main(void) {
  char s[3];
  cin >> s;
  cout << s[0] << s[1] << s[2] << endl;
}
Problem p02645 (C++) — buggy submission, verdict: Runtime Error

#include <iostream>
#include <random>
#include <string>
using namespace std;
std::random_device rnd;
int main() {
  string S;
  cin >> S;

  int number = rnd() % (S.size() - 2);
  for (int i = number; i < number + 3; i++) {
    cout << S.at(i);
  }
  cout << endl;
}


Error: WA

Fixed submission:

#include <iostream>
#include <random>
#include <string>
using namespace std;
std::random_device rnd;
int main() {
  string S;
  int number[3] = {0, 0, 0};
  cin >> S;

  while ((number[0] == number[1]) && (number[1] == number[2]) &&
         (number[2] == number[0])) {
    for (int i = 0; i < 3; i++) {
      number[i] = rnd() % 10;
    }
  }
  for (int i = 0; i < 3; i++) {
    cout << S.at(number[i]);
  }
  cout << endl;
}
Problem p02645 (C++) — buggy submission, verdict: Runtime Error

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

int main() {
  string s;
  cin >> s;

  cout << s[0] << s[1] << s[2] << endl;
  return 0;
}

Error: -11

Fixed submission:

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

int main(void) {

  string S, T, U, I, a, b, c;
  cin >> S;

  int x, y;
  x = (int)(S.length());
  y = rand() % x;
  T.erase(S.end() - y);
  a = T.substr(x - y, 1);
  U.erase(S.end() - 1);
  b = U.substr(x - y, 1);
  I.erase(U.end() - 1);
  c = I.substr(x - y, 1);

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

#include <iostream>
using namespace std;

int main() {
  char name[20];
  for (int j = 0; j < 20; j++) {
    cin >> name[j];
  }
  for (int i = 0; i < 3; i++) {
    cout << name[i];
  }

  return 0;
}

Error: -11

Fixed submission:

#include <iostream>
using namespace std;

int main() {
  char *name;
  cin >> *name;
  for (int i = 0; i < 3; i++) {
    cout << *(name + i);
  }

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

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

int main() {
  string s;
  int n;
  cin >> s >> n;
  cout << s.substr(0, 3) << endl;
  return 0;
}

Error: -6
terminate called after throwing an instance of 'std::out_of_range'
  what():  basic_string::substr: __pos (which is 1711439837) > this->size() (which is 9)


Fixed submission:

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

int main() {
  string s;
  int n;
  cin >> s >> n;
  cout << s.substr(n, 3) << endl;
  return 0;
}
Problem p02645 (C++) — buggy submission, verdict: Runtime Error

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

int main() {
  string s, ans;
  getline(cin, s);
  int a = s.size();
  int i = rand() % (a - 2);
  ans = s.substr(i, 3);
  cout << ans << endl;
}

Error: -6
terminate called after throwing an instance of 'std::out_of_range'
  what():  basic_string::substr: __pos (which is 18446744073709551615) > this->size() (which is 9)


Fixed submission:

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

int main() {
  string s, ans;
  getline(cin, s);
  int a = s.size();
  int i = rand() % a - 2;
  ans = s.substr(i, 3);
  cout << ans << endl;
}
Problem p02645 (C++) — buggy submission, verdict: Runtime Error

#include <bits/stdc++.h>
using namespace std;
int main() {
  string S;
  cin >> S;
  cout << S.at(0) << S.at(1) << S.at(2) << endl;
}


Error: WA

Fixed submission:

#include <bits/stdc++.h>
using namespace std;
int main() {
  string S;
  cin >> S;
  cout << S.at(1) << S.at(2) << S.at(3) << endl;
}
Problem p02645 (C++) — buggy submission, verdict: Runtime Error

#include <iostream>
using namespace std;

int main() {
  char str[4];

  cin.get(str, 4);

  cout << str << endl;
  return 0;
}

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


Fixed submission:

#include <iostream>
using namespace std;

int main() {
  char str[3];

  cin >> str;
  cout << str << endl;

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

#include <iostream>

int main() {
  using namespace std;
  char in[20];
  cin >> in;
  for (int i = 0; i < 3; i++) {
    cout << in[i];
  }
  return 0;
}

Error: WA

Fixed submission:

#include <iostream>
int main() {
  using namespace std;
  char in[10];
  cin >> in;
  for (int i = 0; i < 3; i++) {
    cout << in[i];
  }
  return 0;
}
Problem p02645 (C++) — buggy submission, verdict: Runtime Error

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

int main() {
  string s;
  cin >> s;
  string a, b, c;
  a = s.at(0);
  b = s.at(1);
  c = s.at(2);

  cout << a << b << c << endl;
}


Error: WA

Fixed submission:

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

int main() {
  string s;
  cin >> s;
  string k;
  int N = s.size();
  int p = rand() % N;
  k = s.at(p) + s.at(p + 1) + s.at(p + 2);
  cout << k << endl;
}
Problem p02646 (C++) — buggy submission, verdict: Runtime Error

#include <bits/stdc++.h>
#pragma GCC optimize("O2")
using namespace std;
#define F first
#define S second
#define migmig                                                                 \\
  ios::sync_with_stdio(false);                                                 \\
  cin.tie(0);                                                                  \\
  cout.tie(0);
#define ll long long
#define ld long double
#define pii pair<int, int>
#define bug(x) cout << "passed " << x << endl;
#define ashar(x, y, z)                                                         \\
  cout << setprecision(x) << fixed << y;                                       \\
  if (z == 1)                                                                  \\
    cout << "\\n";
#define ppi pair<pair<int, int>, int>
long long const inf = 3e18, linf = 2e9, mod = 1e9 + 7, inf2 = 1e12;
int const mxn = 5e5 + 10;

ll poww(ll a, ll b, ll md) {
  return (!b ? 1
             : (b & 1 ? a * poww(a * a % md, b / 2, md) % md
                      : poww(a * a % md, b / 2, md) % md));
}

int main() {
  int a, b, v, w, t;
  ;
  cin >> a >> v >> b >> w >> t;
  long long dis = abs(a - b);
  long long s = (v - w);
  if (dis == 0)
    cout << "YES";
  else if (s <= 0)
    cout << "NO";
  else if (dis / s + (dis % s > 0) <= t)
    cout << "YES";
  else
    cout << "NO";
}


Error: WA

Fixed submission:

#include <bits/stdc++.h>
#pragma GCC optimize("O2")
using namespace std;
#define F first
#define S second
#define migmig                                                                 \\
  ios::sync_with_stdio(false);                                                 \\
  cin.tie(0);                                                                  \\
  cout.tie(0);
#define ll long long
#define ld long double
#define pii pair<int, int>
#define bug(x) cout << "passed " << x << endl;
#define ashar(x, y, z)                                                         \\
  cout << setprecision(x) << fixed << y;                                       \\
  if (z == 1)                                                                  \\
    cout << "\\n";
#define ppi pair<pair<int, int>, int>
long long const inf = 3e18, linf = 2e9, mod = 1e9 + 7, inf2 = 1e12;
int const mxn = 5e5 + 10;

ll poww(ll a, ll b, ll md) {
  return (!b ? 1
             : (b & 1 ? a * poww(a * a % md, b / 2, md) % md
                      : poww(a * a % md, b / 2, md) % md));
}

int main() {
  int a, b, v, w, t;
  ;
  cin >> a >> v >> b >> w >> t;
  long long dis = abs(a - b);
  long long s = (v - w);
  if (dis == 0)
    cout << "YES";
  else if (s >= 0 and ((s == 0 and dis == 0) or dis / s + (dis % s > 1) <= t))
    cout << "YES";
  else
    cout << "NO";
}
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;
const ll INF = 10e9;

int main() {
  ll a, b, v, w, t;
  cin >> a >> v >> b >> w >> t;
  if (v <= w) {
    cout << "NO" << endl;
    return 0;
  } else {
    if (abs(a - b) <= t * (v - w)) {
      cout << "YES" << endl;
      return 0;
    } 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;
const ll INF = 10e9;

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

#include <algorithm>
#include <bitset>
#include <cassert>
#include <cctype>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <deque>
#include <fstream>
#include <iomanip>
#include <iostream>
#include <map>
#include <memory.h>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
using namespace std;
typedef long long ll;
#define mp make_pair
ll a, v, b, w, t;
int main() {
  cin >> a >> v >> b >> w >> t;
  if (w >= v) {
    cout << "NO";
    return 0;
  }
  if ((a + v * t >= b + w * t && a < b) || (b - w * t >= a - v * t && a > b)) {
    cout << "YES";
  } else {
    cout << "NO";
  }
  return 0;
}


Error: WA

Fixed submission:

#include <algorithm>
#include <bitset>
#include <cassert>
#include <cctype>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <deque>
#include <fstream>
#include <iomanip>
#include <iostream>
#include <map>
#include <memory.h>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
using namespace std;
typedef long long ll;
#define mp make_pair
int a, v, b, w, t;
int main() {
  cin >> a >> v >> b >> w >> t;
  if ((b - a) <= (v - w) * t && (b - a) % (v - w) == 0) {
    cout << "YES";
  } else {
    cout << "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;
  cin >> b >> w;
  cin >> t;

  long long d = abs(a - b);
  long long dd = (v - w) * t;

  if (d <= dd)
    cout << "YES" << endl;
  else
    cout << "NO" << endl;

  return 0;
}


Error: 0

Fixed submission:

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

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

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

  if (abs(a - b) / (v - w) < 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() {
  int64_t p, v, p1, v1, p2, v2, t;
  cin >> p1 >> v1 >> p2 >> v2 >> t;
  p = abs(p2 - p1);
  if (v1 <= v2) {
    cout << "NO" << endl;
    return 0;
  }
  v = v1 - v2;
  if (p <= v * t) {
    cout << "YES" << endl;
  } else {
    cout << "NO" << endl;
  }

  return 0;
}


Error: 0

Fixed submission:

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

int main() {
  int64_t p, v, p1, v1, p2, v2, t;
  cin >> p1 >> v1 >> p2 >> v2 >> t;
  p = abs(p2 - p1);
  if (v1 < v2) {
    return 0;
  }
  v = v1 - v2;
  if (t >= (p / v)) {
    cout << "YES" << endl;
  } else {
    cout << "OUT" << endl;
  }

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

#include <iostream>
#include <string>

using namespace std;

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

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

  return 0;
}

Error: 0

Fixed submission:

#include <iostream>
#include <string>

#define D(msg) cout << (msg) << endl;

using namespace std;

// more quickly!!!
int main() {
  string a, v, b, w, t;
  cin >> a;
  cin >> v;
  cin >> b;
  cin >> w;
  cin >> t;

  //  long long abPosDiff = std::stoll(a) - std::stoll(b);
  //  long long abVelDiff = std::stoll(v) - std::stoll(w);

  //  if (abPosDiff) {

  //  } else if () {

  //  } else if () {

  //  } else {
  //  }

  long long A = std::stoll(a);
  long long V = std::stoll(v);
  long long B = std::stoll(b);
  long long W = std::stoll(w);
  long long T = std::stoll(t);

  long long abPosDiff = A - B;
  long long abVelDiff = V - W;

  if ((A < B) && (V > W)) {
    // catchable
    long long remain = abPosDiff % abVelDiff;
    if (0 == remain) {
      long long catchTime = abPosDiff / abVelDiff;
      if (catchTime <= T) {
        D("YES");
        return 0;
      }
    }
    D("NO");
    return 0;
  }

  if ((A < B) && (V <= W)) {
    D("NO");
    return 0;
  }

  if ((A > B) && (V > W)) {
    D("NO");
    return 0;
  }
  if ((A > B) && (V <= W)) {
    // catchable
    long long remain = abPosDiff % abVelDiff;
    if (0 == remain) {
      long long catchTime = abPosDiff / abVelDiff;
      if (catchTime <= T) {
        D("YES");
        return 0;
      }
    }
    D("NO");
    return 0;
  }

  // never pass
  D("NO");
  return 0;
}
Problem p02646 (C++) — buggy submission, verdict: Runtime Error

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

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

  int dif = abs(A - B);
  int difV = V - W;

  if ((difV * T) >= dif) {
    cout << "YES" << endl;
  } else {
    cout << "NO" << endl;
  }
}

Error: 0

Fixed submission:

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

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

#include <iostream>
// #include <cstdlib>

using namespace std;

int main() {
  long long a, b, v, w, t;
  cin >> a >> v >> b >> w >> t;
  if (w - v == 0) {
    cout << "NO";
    return 0;
  }
  if (a < b) {
    if ((double)(a - b) / (w - v) <= t && (double)(a - b) / (w - v) >= 0)
      cout << "YES";
    else
      cout << "NO";
  } else {
    if ((double)(a - b) / (v - w) <= t && (double)(a - b) / (v - w) >= 0)
      cout << "YES";
    else
      cout << "NO";
  }
  // system("PAUSE");
  return 0;
}

Error: WA

Fixed submission:

#include <iostream>

using namespace std;

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

  if (w >= v && a < b) {
    if (a == b)
      cout << "YES";
    else
      cout << "NO";
    return 0;
  }
  long double tw = (a - b) / (w - v);
  if (tw <= t)
    cout << "YES";
  else
    cout << "NO";
  return 0;
}