alexjercan/bugnet huggingface dataset:
Problem p02591 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define fi first
#define se second
const int M = 262144;
const ll mod = 1e9 + 7;
int n;
vector<pair<int, ll>> v[M];
ll s[M], s2[M];
ll a[M];
bool done[M];
ll ans = 0;
ll coo(ll p, ll t) {
  return p * t % mod *
         ((1 + (p / 2) * (t / 2) % mod * p % mod * t % mod - p * (p / 2) -
           t * (t / 2)) %
          mod) %
         mod;
}
void solve(ll p, ll t) {
  ll cur = s[t] * s[t] - s2[t];
  cur = (cur % mod + mod) % mod;
  ll co = coo(p, t);
  co = (co + mod) % mod;
  ans = (ans + co * cur) % mod;
  done[t] = true;
}
int main() {
  ios::sync_with_stdio(false);
  cin >> n;
  for (int i = (1 << (n - 1)); i < (1 << n); i++) {
    cin >> a[i];
    a[i] += (1 << (n - 1)) - 1;
    ll p = i;
    ll r = 1;
    for (int j = 0; j < n; j++) {
      ll q = a[i];
      ll s = 1;
      for (int k = 0; k < n; k++) {
        v[p].push_back({q, r * s % mod});
        s = s * q % mod;
        q /= 2;
      }
      r = r * p % mod;
      p /= 2;
    }
  }
  for (int i = 1; i < (1 << n); i++) {
    for (auto c : v[i]) {
      s[c.fi] = (s[c.fi] + c.se) % mod;
      s2[c.fi] = (s2[c.fi] + c.se * c.se) % mod;
    }
    for (auto c : v[i]) {
      if (done[c.fi])
        continue;
      solve(i, c.fi);
    }
    for (auto c : v[i]) {
      done[c.fi] = false;
      s[c.fi] = s2[c.fi] = 0;
      // g[c.fi].clear();
    }
  }
  ll half = (mod + 1) / 2;
  ans = ans * half % mod;
  cout << ans << '\\n';
}

Error: TLE

Fixed submission:

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define fi first
#define se second
const int M = 262144;
const ll mod = 1e9 + 7;
int n;
vector<pair<int, ll>> v[M];
vector<ll> g[M];
ll a[M];
bool done[M];
ll ans = 0;
ll coo(ll p, ll t) {
  return p * t % mod *
         ((1 + (p / 2) * (t / 2) % mod * p % mod * t % mod - p * (p / 2) -
           t * (t / 2)) %
          mod) %
         mod;
}
void solve(ll p, ll t) {
  ll s = 0, s2 = 0;
  for (auto c : g[t]) {
    s = (s + c) % mod;
    s2 = (s2 + c * c) % mod;
  }
  ll cur = s * s - s2;
  cur = (cur % mod + mod) % mod;
  ll co = coo(p, t);
  co = (co + mod) % mod;
  ans = (ans + co * cur) % mod;
  done[t] = true;
}
int main() {
  ios::sync_with_stdio(false);
  cin >> n;
  for (int i = (1 << (n - 1)); i < (1 << n); i++) {
    cin >> a[i];
    a[i] += (1 << (n - 1)) - 1;
    ll p = i;
    ll r = 1;
    for (int j = 0; j < n; j++) {
      ll q = a[i];
      ll s = 1;
      for (int k = 0; k < n; k++) {
        v[p].push_back({q, r * s % mod});
        s = s * q % mod;
        q /= 2;
      }
      r = r * p % mod;
      p /= 2;
    }
  }
  for (int i = 1; i < (1 << n); i++) {
    for (auto c : v[i]) {
      g[c.fi].push_back(c.se);
    }
    for (auto c : v[i]) {
      if (done[c.fi])
        continue;
      solve(i, c.fi);
    }
    for (auto c : v[i]) {
      done[c.fi] = false;
      g[c.fi].clear();
    }
  }
  ll half = (mod + 1) / 2;
  ans = ans * half % mod;
  cout << ans << '\\n';
}
Problem p02591 (C++) — buggy submission, verdict: Runtime Error

#include <bits/stdc++.h>
#define F first
#define S second
#define pb push_back
using namespace std;
const int maxn = 434567;
const int M = 1000000007;
typedef long long ll;
typedef pair<int, ll> pi;
void add(ll &x, ll y) {
  x += y;
  if (x >= M)
    x -= M;
}
int n, h, p[maxn];
vector<pi> v[2];
ll ans, cnt[2][maxn];
void ins(int x, ll val, int o) {
  while (x) {
    val = val * x % M;
    add(cnt[o][x], val);
    x >>= 1;
  }
}
ll dfs2(int x) {
  if (!cnt[0][x] || !cnt[1][x])
    return 0;
  ll ret =
      (cnt[0][x * 2] * cnt[1][x * 2 + 1] + cnt[1][x * 2] * cnt[0][x * 2 + 1]) %
      M * x % M;
  add(ret, dfs2(x * 2));
  add(ret, dfs2(x * 2 + 1));
  return ret;
}
void dfs(int x, ll val, int o) {
  val = val * x % M;
  if (x >= n) {
    v[o].pb((pi){p[x - n] + n, val});
    return;
  }
  dfs(x * 2, val, o);
  dfs(x * 2 + 1, val, o);
}
ll solve(int x) {
  v[0].clear();
  v[1].clear();
  dfs(x * 2, 1, 0);
  dfs(x * 2 + 1, 1, 1);
  for (auto x : v[0])
    ins(x.F, x.S, 0);
  for (auto x : v[1])
    ins(x.F, x.S, 1);
  ll ret = dfs2(1);
  for (auto x : v[0])
    ins(x.F, M - x.S, 0);
  for (auto x : v[1])
    ins(x.F, M - x.S, 1);
  return ret;
}
int main() {
  cin >> h;
  n = 1 << (h - 1);
  for (int i = 0; i < n; i++) {
    cin >> p[i];
    p[i]--;
  }
  for (int i = 1; i < n; i++)
    ans = (ans + solve(i) * i) % M;
  cout << ans << endl;
  return 0;
}


Error: 0

Fixed submission:

#include <bits/stdc++.h>
#define F first
#define S second
#define pb push_back
using namespace std;
const int maxn = 234567;
const int M = 1000000007;
typedef long long ll;
typedef pair<int, ll> pi;
void add(ll &x, ll y) {
  x += y;
  if (x >= M)
    x -= M;
}
int n, h, p[maxn];
vector<pi> v[2];
ll ans, cnt[2][maxn];
void ins(int x, ll val, int o) {
  while (x) {
    val = val * x % M;
    add(cnt[o][x], val);
    x >>= 1;
  }
}
ll dfs2(int x) {
  if (!cnt[0][x] || !cnt[1][x])
    return 0;
  ll ret =
      (cnt[0][x * 2] * cnt[1][x * 2 + 1] + cnt[1][x * 2] * cnt[0][x * 2 + 1]) %
      M * x % M;
  add(ret, dfs2(x * 2));
  add(ret, dfs2(x * 2 + 1));
  return ret;
}
void dfs(int x, ll val, int o) {
  val = val * x % M;
  if (x >= n) {
    v[o].pb((pi){p[x - n] + n, val});
    return;
  }
  dfs(x * 2, val, o);
  dfs(x * 2 + 1, val, o);
}
ll solve(int x) {
  v[0].clear();
  v[1].clear();
  dfs(x * 2, 1, 0);
  dfs(x * 2 + 1, 1, 1);
  for (auto x : v[0])
    ins(x.F, x.S, 0);
  for (auto x : v[1])
    ins(x.F, x.S, 1);
  ll ret = dfs2(1);
  for (auto x : v[0])
    ins(x.F, M - x.S, 0);
  for (auto x : v[1])
    ins(x.F, M - x.S, 1);
  return ret;
}
int main() {
  cin >> h;
  n = 1 << (h - 1);
  for (int i = 0; i < n; i++) {
    cin >> p[i];
    p[i]--;
  }
  for (int i = 1; i < n; i++)
    ans = (ans + solve(i) * i) % M;
  cout << ans << endl;
  return 0;
}
Problem p02591 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <bits/stdc++.h>
using namespace std;
int const p = 1e9 + 7;
int c[1000005], w[1000005], lg2[1000005];
int mod(int x) { return x >= p ? x - p : x; }
int main() {
  int h, ans = 0;
  scanf("%d", &h);
  for (int i = (1 << (h - 1)); i < (1 << h); i++)
    scanf("%d", &c[i]), c[i] += (1 << (h - 1)) - 1;
  for (int i = 2; i < (1 << (h - 1)); i++)
    lg2[i] = lg2[i >> 1] + 1;
  for (int i = 1; i < (1 << (h - 1)); i++) {
    int t = lg2[i] + 1;
    for (int j = 0; j < (1 << (h - t - 1)); j++) {
      int x = (i << (h - t)) + j, now = x, prod = i;
      while (now != i)
        prod = 1ll * prod * now % p, now >>= 1;
      now = c[x];
      while (now)
        prod = 1ll * prod * now % p, w[now] = mod(w[now] + prod), now >>= 1;
    }
    for (int j = (1 << (h - t - 1)); j < (1 << (h - t)); j++) {
      int x = (i << (h - t)) + j, now = x, prod = 1, pre = 0;
      while (now != i)
        prod = 1ll * prod * now % p, now >>= 1;
      now = c[x];
      while (now) {
        ans = mod(ans + 1ll * (w[now] - 1ll * w[pre] * now % p + p) * prod % p);
        prod = 1ll * prod * now % p, pre = now, now >>= 1;
      }
    }
    for (int j = 0; j < (1 << (h - t - 1)); j++) {
      int now = c[(i << (h - t)) + j];
      while (now)
        w[now] = 0, now >>= 1;
    }
  }
  printf("%d", ans);
  return 0;
}

Error: TLE

Fixed submission:

#include <bits/stdc++.h>
using namespace std;
int const p = 1e9 + 7;
int c[1000005], w[1000005], lg2[100005];
int mod(int x) { return x >= p ? x - p : x; }
int main() {
  int h, ans = 0;
  scanf("%d", &h);
  for (int i = (1 << (h - 1)); i < (1 << h); i++)
    scanf("%d", &c[i]), c[i] += (1 << (h - 1)) - 1;
  for (int i = 2; i < (1 << (h - 1)); i++)
    lg2[i] = lg2[i >> 1] + 1;
  for (int i = 1; i < (1 << (h - 1)); i++) {
    int t = lg2[i] + 1;
    for (int j = 0; j < (1 << (h - t - 1)); j++) {
      int x = (i << (h - t)) + j, now = x, prod = i;
      while (now != i)
        prod = 1ll * prod * now % p, now >>= 1;
      now = c[x];
      while (now)
        prod = 1ll * prod * now % p, w[now] = mod(w[now] + prod), now >>= 1;
    }
    for (int j = (1 << (h - t - 1)); j < (1 << (h - t)); j++) {
      int x = (i << (h - t)) + j, now = x, prod = 1, pre = 0;
      while (now != i)
        prod = 1ll * prod * now % p, now >>= 1;
      now = c[x];
      while (now) {
        ans = mod(ans + 1ll * (w[now] - 1ll * w[pre] * now % p + p) * prod % p);
        prod = 1ll * prod * now % p, pre = now, now >>= 1;
      }
    }
    for (int j = 0; j < (1 << (h - t - 1)); j++) {
      int now = c[(i << (h - t)) + j];
      while (now)
        w[now] = 0, now >>= 1;
    }
  }
  printf("%d", ans);
  return 0;
}
Problem p02594 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <cstdio>
#include <cstring>
#include <iostream>

using namespace std;

inline int read() {
  int x = 0, f = 1;
  char c = getchar();
  while (c < '0' || c > '9') {
    if (c == '-')
      f = -1;
    c = getchar();
  }
  while ('0' <= c && c <= '9') {
    x = x * 10 + c - '0';
    c = getchar();
  }
  return x * f;
}

int main() {
  int t = read();
  if (t >= 30)
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
  return 0;
}

Error: TLE

Fixed submission:

#include <cmath>
#include <cstdio>
#include <cstring>
#include <iostream>

#define Maxn 200010
#define LL long long

using namespace std;

const double eps = 0.00001;

inline LL read() {
  LL x = 0, f = 1;
  char c = getchar();
  while (c < '0' || c > '9') {
    if (c == '-')
      f = -1;
    c = getchar();
  }
  while ('0' <= c && c <= '9') {
    x = x * 10 + c - '0';
    c = getchar();
  }
  return x * f;
}

LL n, k, a[Maxn], maxone;

LL calc(int len) {
  LL tim = 0;
  for (int i = 1; i <= n; ++i) {
    tim += (a[i] - 1) / len;
  }
  return tim;
}

int main() {
  n = read();
  k = read();
  for (int i = 1; i <= n; ++i)
    a[i] = read(), maxone = max(maxone, a[i]);
  int l = 0, r = maxone;
  while (l < r) {
    int mid = (l + r) >> 1;
    if (calc(mid) > k)
      l = mid + 1;
    else
      r = mid;
  }
  cout << l << endl;
  return 0;
}
Problem p02594 (C++) — buggy submission, verdict: Runtime Error

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

int main() {
  long long N;
  cin >> N;

  if (N >= 30) {
    cout << "Yes" << endl;
  } else if (N < 30) {
    cout << "No" << endl;
  }

  return 0;
}

Error: 0

Fixed submission:

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

int main() {
  int N;
  cin >> N;
  vector<int> A[N];

  if (N >= 30) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }

  return 0;
}
Problem p02594 (C++) — buggy submission, verdict: Memory Limit Exceeded

// #define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i, s, n) for (ll i = (s); i < (ll)(n); i++)
#define all(x) (x).begin(), (x).end()
#define in(x, l, r) (ll)(l) <= (x) && (x) < (ll)(r)

int main() {
  vector<int> v(250000000, 0);
  int X;
  cin >> X;
  if (X >= 30) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
}


Error: MLE

Fixed submission:

// #define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i, s, n) for (ll i = (s); i < (ll)(n); i++)
#define all(x) (x).begin(), (x).end()
#define in(x, l, r) (ll)(l) <= (x) && (x) < (ll)(r)

int main() {
  vector<int> v(300000000, 0);
  int X;
  cin >> X;
  if (X >= 30) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
}
Problem p02594 (C++) — buggy submission, verdict: Runtime Error

#include <iostream>
using namespace std;
int main() {
  int n;
  cin >> n;
  if (n >= 30)
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
}

Error: WA

Fixed submission:

#include <algorithm>
#include <bitset>
#include <cfloat>
#include <cmath>
#include <ctime>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <math.h>
#include <numeric>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <stdlib.h>
#include <string>
#include <tuple>
#include <vector>
#define rip(i, n) for (int i = 0; i < n; i++)
#define Rip(i, n) for (int i = 1; i <= n; i++)
#define RIP(i, a, b) for (int i = a; i < b; i++)
#define all(V) V.begin(), V.end()
#define sec setprecision;
#define _CRT_SECURE_NO_WARNINGS
#pragma target("avx")
#pragma optimize("O3")
#pragma optimize("unroll-loops");
constexpr double eps = 1e-9;
constexpr double pi = 3.141592653589793238462643383279;
using namespace std;
using ll = long long;
using ld = long double;
using Pa = pair<ll, ll>;
ll MOD = 998244353;
ll gcd(ll a, ll b) {
  if (a % b == 0)
    return (b);
  else
    return (gcd(b, a % b));
}
ll lcm(ll a, ll b) { return a * b / gcd(a, b); }
ll pow(ll x, ll n, ll mod) {
  x %= mod;
  if (n == 0)
    return 1;
  if (n % 2 == 0)
    return (pow((x * x) % mod, n / 2, mod) % mod);
  else
    return (x * pow(x, n - 1, mod) % mod);
}
signed main() {
  int n, q;
  cin >> n >> q;
  vector<int> c(n);
  rip(i, n) cin >> c[i];
  vector<int> nam(n);
  set<int> p;
  rip(i, n) {
    p.insert(c[i]);
    nam[i] = p.size();
  }
  while (q--) {
    int l, r;
    cin >> l >> r;
    set<int> q;
    for (int i = l; l <= r; i++)
      q.insert(c[i]);
    int ans = q.size();
    cout << ans << endl;
  }
}
Problem p02594 (C++) — buggy submission, verdict: Runtime Error

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

int main() {
  int x;
  cin >> x;

  string ret;
  if (x >= 30) {
    ret = "Yes";
  } else {
    ret = "No";
  }

  cout << ret << endl;
}

Error: 1

Fixed submission:

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

int main() {
  int x;
  cin >> x;

  string ret;
  if (x >= 30) {
    ret = "Yes";
  } else {
    ret = "No";
  }

  cout << ret << endl;
  return true;
}
Problem p02594 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  if (n >= 30)
    cout << "Yes" << endl;

  else
    cout << "No" << endl;
  return 0;
}


Error: TLE

Fixed submission:

#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  while (1) {
    cin >> n;
    if (n >= 30) {
      cout << "Yes" << endl;
      break;
    } else
      cout << "No" << endl;
  }
  return 0;
}
Problem p02594 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <iostream>
using namespace std;
int main() {
  int n;
  cin >> n;
  if (n >= 30)
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
}


Error: TLE

Fixed submission:

#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  while (1) {
    cin >> n;
    if (n >= 40 && n <= 40) {
      if (n >= 30) {
        cout << "Yes" << endl;

      } else
        cout << "NO" << endl;
    }
  }
  return 0;
}
Problem p02594 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <bits/stdc++.h>
using namespace std;
#define vi vector<int>
#define sl set<ll>
#define vs vector<string>
#define vl vector<ll>
#define vi vector<int>
#define vpl vector<pair<ll, ll>>
#define pb push_back
#define PI 3.14159265358979323846
#define ll long long
#define ld long double
#define endl "\\n"
#define rep(i, a, b) for (ll i = (a); i < (b); i++)
#define repp(i, a, b) for (ll i = (a); i >= (b); i--)
#define rop(i, a, b) for (ll i = (a); i > (b); i--)
#define min3(a, b, c) min(c, min(a, b))
#define min4(a, b, c, d) min(d, min(c, min(a, b)))
#define tt                                                                     \\
  long long t;                                                                 \\
  cin >> t;                                                                    \\
  while (t--)
#define IOS                                                                    \\
  ios::sync_with_stdio(0);                                                     \\
  cin.tie(0);
const int maxn = 1e5 + 100;

int main() {
  ll n;
  cin >> n;
  if (n >= 30)
    cout << "Yes";
  else
    cout << "No";
}

Error: TLE

Fixed submission:

#include <bits/stdc++.h>
using namespace std;
#define vi vector<int>
#define sl set<ll>
#define vs vector<string>
#define vl vector<ll>
#define vi vector<int>
#define vpl vector<pair<ll, ll>>
#define pb push_back
#define PI 3.14159265358979323846
#define ll long long
#define ld long double
#define endl "\\n"
#define rep(i, a, b) for (ll i = (a); i < (b); i++)
#define repp(i, a, b) for (ll i = (a); i >= (b); i--)
#define rop(i, a, b) for (ll i = (a); i > (b); i--)
#define min3(a, b, c) min(c, min(a, b))
#define min4(a, b, c, d) min(d, min(c, min(a, b)))
#define tt                                                                     \\
  long long t;                                                                 \\
  cin >> t;                                                                    \\
  while (t--)
#define IOS                                                                    \\
  ios::sync_with_stdio(0);                                                     \\
  cin.tie(0);
const int maxn = 1e5 + 100;

int main() {
  tt {
    ll w;
    cin >> w;
    map<int, int> mp;
    for (int i = 0; i < w; i++) {
      string s;
      cin >> s;
      ll p = s.length();

      rep(i, 0, p) { mp[s[i] - 'a']++; }
    }
    ll flag = 0;

    rep(i, 0, 26) {
      if (mp[i] % w) {
        cout << "NO";
        flag = 1;
        break;
      }
    }
    if (flag == 0) {
      cout << "YES";
    }
    cout << endl;
  }
}
Problem p02594 (C++) — buggy submission, verdict: Runtime Error

#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
using namespace std;
typedef long long ll;
typedef unsigned long long int ull;
// PB-DS
#define o_set                                                                  \\
  tree<int, null_type, less<int>, rb_tree_tag,                                 \\
       tree_order_statistics_node_update>

#define ff first
#define ss second
#define pb push_back
#define Inf 1000000000000000000
#define inf -1000000000000000000
#define mod 1000000007

ll mulmod(ll x, ll y) { return (x % mod * y % mod) % mod; }

ll addmod(ll x, ll y) { return (x % mod + y % mod) % mod; }

long long power(long long x, long long y) {
  long long res = 1;
  x = x % mod;
  while (y > 0) {
    if (y & 1)
      res = (res * x) % mod;
    y = y >> 1;
    x = (x * x) % mod;
  }
  return res;
}

void testcases(int cases) {
  int c;
  cin >> c;
  if (c >= 30)
    cout << "Yes"
         << "\\n";
  else
    cout << "No"
         << "\\n";
}

int main() {

  // sieve();
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  ll t;
  t = 1;
  // cin >> t;
  ll Case = 1;
  while (t--) {
    testcases(Case++);
  }
}


Error: WA

Fixed submission:

#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
using namespace std;
typedef long long ll;
typedef unsigned long long int ull;
// PB-DS
#define o_set                                                                  \\
  tree<int, null_type, less<int>, rb_tree_tag,                                 \\
       tree_order_statistics_node_update>

#define ff first
#define ss second
#define pb push_back
#define Inf 1000000000000000000
#define inf -1000000000000000000
#define mod 1000000007

ll mulmod(ll x, ll y) { return (x % mod * y % mod) % mod; }

ll addmod(ll x, ll y) { return (x % mod + y % mod) % mod; }

long long power(long long x, long long y) {
  long long res = 1;
  x = x % mod;
  while (y > 0) {
    if (y & 1)
      res = (res * x) % mod;
    y = y >> 1;
    x = (x * x) % mod;
  }
  return res;
}

void testcases(int cases) {
  int n;
  cin >> n;
  ll arr[n + 2];
  for (int i = 1; i <= n; i++) {
    cin >> arr[i];
  }
  ll maxx;
  if (n == 1)
    maxx = 1;
  else
    maxx = 2;
  int i = 1;
  ll len = 2;
  int j = 2;
  int k = 3;
  while (k <= n) {
    if (arr[k] == (arr[i] + arr[j])) {
      k++;
      i++;
      j++;
      len++;
      maxx = max(maxx, len);
    } else {
      i++;
      j++;
      k++;
      len = 2;
      maxx = max(maxx, len);
    }
  }
  cout << maxx << "\\n";
}

int main() {

  // sieve();
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  ll t;
  t = 1;
  // cin >> t;
  ll Case = 1;
  while (t--) {
    testcases(Case++);
  }
}
Problem p02594 (C++) — buggy submission, verdict: Runtime Error

#include <stdio.h>
#include <string.h>

int main() {

  int temp;
  scanf("%d", &temp);

  (temp >= 30) ? printf("Yes") : printf("No");

  return 0;
}

//  \\N JANGAN LUPA!!!!!

Error: 1

Fixed submission:

#include <stdio.h>

int main() {
  int degree;
  scanf("%d", &degree);

  if (degree < 30) {
    printf("No");

    return 1;
  }
  printf("Yes");

  return 0;
}
Problem p02594 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <iostream>
using namespace std;
int main() {
  int X;
  cin >> X;
  if (X < 30)
    cout << "No" << endl;
  else if (X >= 30)
    cout << "Yes" << endl;
  return 0;
}

Error: TLE

Fixed submission:

#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  while (1) {
    cin >> n;
    if (n >= 40 && n <= 40) {
      if (n >= 30) {
        cout << "Yes" << endl;
        break;
      } else
        cout << "NO" << endl;
    }
  }
  return 0;
}
Problem p02594 (C++) — buggy submission, verdict: Runtime Error

#include <bits/stdc++.h>
#define int long long int
#define pb push_back
#define fast                                                                   \\
  ios_base::sync_with_stdio(false);                                            \\
  cin.tie(NULL);
#define pii pair<int, int>
#define vvi vector<vector<int>>
#define vi vector<int>
#define f first
#define s second
using namespace std;
const int N = 5e6 + 10;
const int mod = 1e9 + 7;
int arr[N], iarr[N];
int logi(int n) {
  int p = 0;
  while (n / 2) {
    n = n / 2;
    p++;
  }
  return p;
}
int poww(int x, int y) {
  int pro = 1;
  while (y) {
    if (y & 1)
      pro = ((pro % mod) * (x % mod) % mod);
    y = y >> 1;
    x = ((x % mod) * (x % mod) % mod);
  }
  return pro;
}
int poww2(int x, int y) {
  int pro = 1;
  while (y) {
    if (y & 1)
      pro = pro * x;
    y = y >> 1;
    x = x * x;
  }
  return pro;
}
double poww1(double x, int y) {
  double pro = 1.000000000;
  while (y) {
    if (y & 1)
      pro = ((pro) * (x));
    y = y >> 1;
    x = ((x) * (x));
  }
  return pro;
}
map<int, int> mp1, mp2;
set<int> st;
int arr1[1000001], arr2[1000001];
/*

*/
void solve() {
  int x;
  cin >> x;
  if (x >= 30)
    cout << "Yes";
  else
    cout << "No";
}

int32_t main() {
  fast;
  int t = 1;
  // cin>>t;
  while (t--) {
    solve();
  }
  return 0;
}


Error: WA

Fixed submission:

#include <bits/stdc++.h>
#define int long long int
#define pb push_back
#define fast                                                                   \\
  ios_base::sync_with_stdio(false);                                            \\
  cin.tie(NULL);
#define pii pair<int, int>
#define vvi vector<vector<int>>
#define vi vector<int>
#define f first
#define s second
using namespace std;
const int N = 5e6 + 10;
const int mod = 1e9 + 7;
int arr[N], iarr[N];
int logi(int n) {
  int p = 0;
  while (n / 2) {
    n = n / 2;
    p++;
  }
  return p;
}
int poww(int x, int y) {
  int pro = 1;
  while (y) {
    if (y & 1)
      pro = ((pro % mod) * (x % mod) % mod);
    y = y >> 1;
    x = ((x % mod) * (x % mod) % mod);
  }
  return pro;
}
int poww2(int x, int y) {
  int pro = 1;
  while (y) {
    if (y & 1)
      pro = pro * x;
    y = y >> 1;
    x = x * x;
  }
  return pro;
}
double poww1(double x, int y) {
  double pro = 1.000000000;
  while (y) {
    if (y & 1)
      pro = ((pro) * (x));
    y = y >> 1;
    x = ((x) * (x));
  }
  return pro;
}
map<int, int> mp1, mp2;
set<int> st;
int arr1[1000001], arr2[1000001];
/*

*/
int solve() {
  int x;
  cin >> x;
  if (x >= 30)
    cout << "Yes";
  else
    cout << "No";
}

int32_t main() {
  fast;
  int t = 1;
  // cin>>t;
  while (t--) {
    solve();
  }
}