prithivMLmods/Coder-Stat huggingface dataset:
Problem p02784 (C++)

Buggy submission (status: Runtime Error):
#include <algorithm>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

using namespace std;
typedef long long ll;

int main() {
  ll H, N;
  ll A[10000];
  scanf("%lld %lld", &H, &N);

  for (int i = 0; i < N; i++) {
    scanf("%lld", &A[i]);
  }

  ll sum = 0;
  for (int i = 0; i < N; i++) {
    sum += A[i];
  }

  if (sum >= H) {
    printf("Yes\n");
  } else {
    printf("No\n");
  }

  return 0;
}

Fixed submission:
#include <algorithm>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

using namespace std;
typedef long long ll;

int main() {
  ll H, N;
  ll A[100000];
  scanf("%lld %lld", &H, &N);

  for (int i = 0; i < N; i++) {
    scanf("%lld", &A[i]);
  }

  ll sum = 0;
  for (int i = 0; i < N; i++) {
    sum += A[i];
  }

  if (sum >= H) {
    printf("Yes\n");
  } else {
    printf("No\n");
  }

  return 0;
}
Problem p02784 (C++)

Buggy submission (status: Runtime Error):
#include <bits/stdc++.h>
using namespace std;

typedef long long int lli;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<lli> vli;
typedef priority_queue<int, vector<int>, greater<int>> min_pq;

const int MOD = 1e9 + 7;

#define fastio                                                                 \
  ios_base::sync_with_stdio(0);                                                \
  cin.tie(0);                                                                  \
  cout.tie(0)
#define init(a) memset(a, 0, sizeof(a))
#define pb push_back
#define all(a) a.begin(), a.end()
#define loop(i, n) for (int i = 0; i < n; i++)
#define loops(i, s, n) for (int i = s; i < n; i++)
#define rloop(i, n) for (int i = n - 1; i >= 0; i--)
#define rloops(i, s, n) for (int i = n - 1; i >= s; i--)

template <typename T> T gcd(T a, T b) { return (b ? __gcd(a, b) : a); }
template <typename T> T lcm(T a, T b) { return (a * b) / gcd(a, b); }

double tick() {
  static clock_t oldt, newt = clock();
  double diff = 1.0 * (newt - oldt) / CLOCKS_PER_SEC;
  oldt = newt;
  return diff;
}
//---------------------------------------------------------------------------------------------

int main() {
  fastio;

#ifndef ONLINE_JUDGE
  freopen("in.txt", "r", stdin);
#endif

  int h, n;
  cin >> h >> n;

  int a[n];
  loop(i, n) { cin >> a[i]; }

  lli s = 0;
  loop(i, n) { s += a[i]; }

  if (h <= s) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }

  // cout<<"Execution time : "<<tick()<<"\n";

  return 0;
}

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

typedef long long int lli;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<lli> vli;
typedef priority_queue<int, vector<int>, greater<int>> min_pq;

const int MOD = 1e9 + 7;

#define fastio                                                                 \
  ios_base::sync_with_stdio(0);                                                \
  cin.tie(0);                                                                  \
  cout.tie(0)
#define init(a) memset(a, 0, sizeof(a))
#define pb push_back
#define all(a) a.begin(), a.end()
#define loop(i, n) for (int i = 0; i < n; i++)
#define loops(i, s, n) for (int i = s; i < n; i++)
#define rloop(i, n) for (int i = n - 1; i >= 0; i--)
#define rloops(i, s, n) for (int i = n - 1; i >= s; i--)

template <typename T> T gcd(T a, T b) { return (b ? __gcd(a, b) : a); }
template <typename T> T lcm(T a, T b) { return (a * b) / gcd(a, b); }

double tick() {
  static clock_t oldt, newt = clock();
  double diff = 1.0 * (newt - oldt) / CLOCKS_PER_SEC;
  oldt = newt;
  return diff;
}
//---------------------------------------------------------------------------------------------

int main() {
  fastio;

  int h, n;
  cin >> h >> n;

  int a[n];
  loop(i, n) { cin >> a[i]; }

  lli s = 0;
  loop(i, n) { s += a[i]; }

  if (h <= s) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }

  // cout<<"Execution time : "<<tick()<<"\n";

  return 0;
}
Problem p02784 (C++)

Buggy submission (status: Runtime Error):
#include <algorithm>
#include <cstdio>
using namespace std;
int main() {
  int h, n, a[10001];
  scanf("%d%d", &h, &n);
  for (int i = 0; i < n; i++)
    scanf("%d", &a[i]);
  sort(a, a + n);
  for (int i = n - 1; i >= 0; i--) {
    h -= a[i];
    if (h <= 0) {
      printf("Yes");
      return 0;
    }
  }
  printf("No");
  return 0;
}

Fixed submission:
#include <algorithm>
#include <cstdio>
using namespace std;
int main() {
  int h, n, a[100001];
  scanf("%d%d", &h, &n);
  for (int i = 0; i < n; i++)
    scanf("%d", &a[i]);
  sort(a, a + n);
  for (int i = n - 1; i >= 0; i--) {
    h -= a[i];
    if (h <= 0) {
      printf("Yes");
      return 0;
    }
  }
  printf("No");
  return 0;
}
Problem p02784 (C++)

Buggy submission (status: Runtime Error):
#include <bits/stdc++.h>
using namespace std;

int main() {
  int H, N;
  cin >> H >> N;
  int act[10010];
  for (int i = 0; i < N; i++) {
    cin >> act[i];
  }
  int dmg = 0;
  for (int i = 0; i < N; i++) {
    dmg += act[i];
  }
  if (dmg >= H)
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
}


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

int main() {
  int H, N;
  cin >> H >> N;
  int act[100100];
  for (int i = 0; i < N; i++) {
    cin >> act[i];
  }
  int dmg = 0;
  for (int i = 0; i < N; i++) {
    dmg += act[i];
  }
  if (dmg >= H)
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
}
Problem p02784 (C++)

Buggy submission (status: 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() {

  int N, M;
  int ans = 0;
  cin >> N >> M;
  vector<int> A(N);
  rep(i, M) {
    cin >> A.at(i);
    ans += A.at(i);
  }
  if (ans >= N)
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
}

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() {

  int N, M;
  int ans = 0;
  cin >> N >> M;
  vector<int> A(M);
  rep(i, M) {
    cin >> A.at(i);
    ans += A.at(i);
  }
  if (ans >= N)
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
}
Problem p02784 (C++)

Buggy submission (status: Runtime Error):
#include <stdio.h>
int main() {
  int H, N, A[9999], i;
  scanf("%d%d", &H, &N);

  for (i = 0; i < N; i++) {
    scanf("%d", &A[i]);
    H = H - A[i];
  }
  if (H <= 0)
    printf("Yes");
  else
    printf("No");
  return 0;
}


Fixed submission:
#include <stdio.h>
int main() {
  int H, N, A[100005], i;
  scanf("%d%d", &H, &N);

  for (i = 0; i < N; i++) {
    scanf("%d", &A[i]);
    H = H - A[i];
  }
  if (H <= 0)
    printf("Yes");
  else
    printf("No");
  return 0;
}
Problem p02784 (C++)

Buggy submission (status: Runtime Error):
#include <algorithm>
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <iomanip>
#include <iostream>
#include <queue>
#include <set>
#include <string>
#include <utility>
#include <vector>
#define rep(i, n) for (int i = 0; i < int(n); i++)
using namespace std;
long long MOD = 1000000007;
long long INF = 1000000000000000; // 10^15
typedef long long ll;
typedef unsigned long long ull;

int ds(int n) {
  int r = 0;
  while (n > 0) {
    r += n % 10;
    n /= 10;
  }
  return r;
}

int main(void) {

  ll h, n, a[10001];
  cin >> h >> n;
  rep(i, n) cin >> a[i];

  ll sum = 0;
  rep(i, n) sum += a[i];

  if (h > sum)
    cout << "No\n";
  else
    cout << "Yes\n";

  return 0;
}


Fixed submission:
#include <algorithm>
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <iomanip>
#include <iostream>
#include <queue>
#include <set>
#include <string>
#include <utility>
#include <vector>
#define rep(i, n) for (int i = 0; i < int(n); i++)
using namespace std;
long long MOD = 1000000007;
long long INF = 1000000000000000; // 10^15
typedef long long ll;
typedef unsigned long long ull;

int ds(int n) {
  int r = 0;
  while (n > 0) {
    r += n % 10;
    n /= 10;
  }
  return r;
}

int main(void) {

  ll h, n, a[100001];
  cin >> h >> n;
  rep(i, n) cin >> a[i];

  ll sum = 0;
  rep(i, n) sum += a[i];

  if (h > sum)
    cout << "No\n";
  else
    cout << "Yes\n";

  return 0;
}
Problem p02784 (C++)

Buggy submission (status: Runtime Error):
#include <bits/stdc++.h>

using namespace std;

int main() {

  int H, N;
  scanf("%d %d", &H, &N);

  vector<int> A(H);
  for (int &x : A)
    scanf("%d", &x);

  long long total = 0;
  for (int x : A) {
    total += x;
    if (total >= H) {
      printf("Yes\n");
      return 0;
    }
  }

  if (total >= H) {
    printf("Yes\n");
    return 0;
  }

  printf("No\n");

  return 0;
}


Fixed submission:
#include <bits/stdc++.h>

using namespace std;

int main() {

  int H, N;
  scanf("%d %d", &H, &N);

  vector<int> A(N);
  for (int &x : A)
    scanf("%d", &x);

  long long total = 0;
  for (int x : A) {
    total += x;
    if (total >= H) {
      printf("Yes\n");
      return 0;
    }
  }

  if (total >= H) {
    printf("Yes\n");
    return 0;
  }

  printf("No\n");

  return 0;
}
Problem p02784 (C++)

Buggy submission (status: Runtime Error):
#include <iostream>
#define rep(i, beg, end) for (int i = (beg); i < (end); i++)
using namespace std;

int main() {
  long long h, nums[10004], n;
  cin >> h >> n;
  long long tot = 0;
  rep(i, 0, n) {
    cin >> nums[i];
    tot += nums[i];
  }
  if (tot >= h)
    cout << "Yes\n";
  else
    cout << "No\n";
  return 0;
}


Fixed submission:
#include <iostream>
#define rep(i, beg, end) for (int i = (beg); i < (end); i++)
using namespace std;

int main() {
  long long h, nums[100004], n;
  cin >> h >> n;
  long long tot = 0;
  rep(i, 0, n) {
    cin >> nums[i];
    tot += nums[i];
  }
  if (tot >= h)
    cout << "Yes\n";
  else
    cout << "No\n";
  return 0;
}
Problem p02784 (C++)

Buggy submission (status: Runtime Error):
#include <cmath>
#include <iomanip>
#include <iostream>
#include <stdio.h>
using namespace std;
int main() {
  int H, n, A[10000], sum, i;
  cin >> H >> n;
  sum = 0;
  for (i = 0; i < n; i++) {
    cin >> A[i];
    sum = sum + A[i];

    if (sum >= H) {
      cout << "Yes";
      return 0;
    }
  }
  cout << "No";
}

Fixed submission:
#include <cmath>
#include <iomanip>
#include <iostream>
#include <stdio.h>
using namespace std;
int main() {
  int H, n, A[100000], sum, i;
  cin >> H >> n;
  sum = 0;
  for (i = 0; i < n; i++) {
    cin >> A[i];
    sum = sum + A[i];

    if (sum >= H) {
      cout << "Yes";
      return 0;
    }
  }
  cout << "No";
}
Problem p02784 (C++)

Buggy submission (status: Runtime Error):
#include <bits/stdc++.h>

#define rep(i, n) for (ll i = 0; i < (ll)(n); i++)
#define ll long long
using namespace std;

int main() {
  int h, n;
  vector<int> a(10000);
  int count = 0;
  cin >> h >> n;
  rep(i, n) {
    cin >> a.at(i);
    count += a.at(i);
  }
  if (h - count <= 0) {
    cout << "Yes" << endl;
  }
  if (h - count > 0) {
    cout << "No" << endl;
  }

  return 0;
}

Fixed submission:
#include <bits/stdc++.h>

#define rep(i, n) for (ll i = 0; i < (ll)(n); i++)
#define ll long long
using namespace std;

int main() {
  int h, n;
  vector<int> a(100000);
  int count = 0;
  cin >> h >> n;
  rep(i, n) {
    cin >> a.at(i);
    count += a.at(i);
  }
  if (h - count <= 0) {
    cout << "Yes" << endl;
  }
  if (h - count > 0) {
    cout << "No" << endl;
  }

  return 0;
}
Problem p02784 (C++)

Buggy submission (status: Runtime Error):
#include <stdio.h>

int main() {
  int m, n, i, sum = 0;
  scanf("%d %d", &m, &n);
  int a;
  for (i = 0; i < n; i++) {
    scanf("%d", a);
    sum = sum + a;
  }
  if (sum >= m)
    printf("Yes");
  else
    printf("No");
}

Fixed submission:
#include <stdio.h>

int main() {
  int m, n, i, sum = 0;
  scanf("%d %d", &m, &n);
  int a;
  for (i = 0; i < n; i++) {
    scanf("%d", &a);
    sum = sum + a;
  }
  if (sum >= m)
    printf("Yes");
  else
    printf("No");
}
Problem p02784 (C++)

Buggy submission (status: Runtime Error):
#include <iostream>
#include <stdio.h>
#pragma warning(disable : 4996)
unsigned long long int h, n, a[10000];
unsigned long long int b = 0;

int main() {

  scanf("%llu %llu", &h, &n);
  for (int i = 0; i != n; i++) {
    scanf("%llu", &a[i]);
  }
  for (int i = 0; i != n; i++) {
    b = b + a[i];
  }
  if (b >= h) {
    printf("Yes");
  } else {
    printf("No");
  }
  return 0;
}

Fixed submission:
#include <iostream>
#include <stdio.h>
#pragma warning(disable : 4996)
unsigned long long int h, n, a[100000];
unsigned long long int b = 0;

int main() {

  scanf("%llu %llu", &h, &n);
  for (int i = 0; i != n; i++) {
    scanf("%llu", &a[i]);
  }
  for (int i = 0; i != n; i++) {
    b = b + a[i];
  }
  if (b >= h) {
    printf("Yes");
  } else {
    printf("No");
  }
  return 0;
}
Problem p02784 (C++)

Buggy submission (status: Runtime Error):
/*
 author : arush gupta
 date :26.01.2020
 */
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  ll h, n;
  ll arr[10000];
  cin >> h >> n;
  ll sum = 0;
  for (ll i = 0; i < n; i++) {
    cin >> arr[i];
    sum += arr[i];
  }
  if (sum >= h) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }

  return 0;
}


Fixed submission:
/*
 author : arush gupta
 date :26.01.2020
 */
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  ll h, n;
  ll arr[100000];
  cin >> h >> n;
  ll sum = 0;
  for (ll i = 0; i < n; i++) {
    cin >> arr[i];
    sum += arr[i];
  }
  if (sum >= h) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }

  return 0;
}
Problem p02784 (C++)

Buggy submission (status: Runtime Error):
#include <bits/stdc++.h>
using namespace std;
long long int power(long long int x, long long int y) {
  long long int res = 1; // Initialize result
                         // x=x;
  while (y > 0) {
    // If y is odd, multiply x with result
    if (y & 1)
      res = (res * x);

    // y must be even now
    y = y >> 1;  // y = y/2
    x = (x * x); // Change x to x^2
  }
  return res;
}
long long int power(long long int x, long long int y, long long int m) {
  long long int res = 1; // Initialize result
  x = x % m;
  while (y > 0) {
    // If y is odd, multiply x with result
    if (y & 1)
      res = (res * x) % m;

    // y must be even now
    y = y >> 1;      // y = y/2
    x = (x * x) % m; // Change x to x^2
  }
  return res;
}

long long int gcd(long long int a, long long int b) {
  if (a == 0)
    return b;
  return gcd(b % a, a);
}
long long int lcm(long long int a, long long int b) {
  long long int temp;

  return (a * b) / gcd(a, b);
}

int main() {
  long long int t = 0;
  string c;
  string s;
  long long int n, m, o = 0, l, d = 0, i, j, p = 0, k, f;
  double pie = 3.141592653589793238;
  long long int MOD = 1000000007;
  cin >> n >> k;
  long long int a[k];
  for (i = 0; i < n; i++) {
    cin >> a[i];
    p = p + a[i];
    // b[a[i]-1]=i;
  }
  if (p >= n)
    cout << "Yes";
  else
    cout << "No";
  return 0;
}

Fixed submission:
#include <bits/stdc++.h>
using namespace std;
long long int power(long long int x, long long int y) {
  long long int res = 1; // Initialize result
                         // x=x;
  while (y > 0) {
    // If y is odd, multiply x with result
    if (y & 1)
      res = (res * x);

    // y must be even now
    y = y >> 1;  // y = y/2
    x = (x * x); // Change x to x^2
  }
  return res;
}
long long int power(long long int x, long long int y, long long int m) {
  long long int res = 1; // Initialize result
  x = x % m;
  while (y > 0) {
    // If y is odd, multiply x with result
    if (y & 1)
      res = (res * x) % m;

    // y must be even now
    y = y >> 1;      // y = y/2
    x = (x * x) % m; // Change x to x^2
  }
  return res;
}

long long int gcd(long long int a, long long int b) {
  if (a == 0)
    return b;
  return gcd(b % a, a);
}
long long int lcm(long long int a, long long int b) {
  long long int temp;

  return (a * b) / gcd(a, b);
}

int main() {
  long long int t = 0;
  string c;
  string s;
  long long int n, m, o = 0, l, d = 0, i, j, p = 0, k, f;
  double pie = 3.141592653589793238;
  long long int MOD = 1000000007;
  cin >> n >> k;
  long long int a[k];
  for (i = 0; i < k; i++) {
    cin >> a[i];
    p = p + a[i];
    // b[a[i]-1]=i;
  }
  if (p >= n)
    cout << "Yes";
  else
    cout << "No";
  return 0;
}
Problem p02784 (C++)

Buggy submission (status: Runtime Error):
#include <iostream>
#include <math.h>
#include <queue>
#include <stdio.h>
#include <string>
using namespace std;

int main(int argc, char *argv[]) {

  int H, N;
  scanf("%d %d", &H, &N);

  int A[10005];

  int sum = 0;
  for (int i = 0; i < N; i++) {
    scanf("%d", &A[i]);
    sum += A[i];
  }

  if (sum >= H) {
    printf("Yes\n");
  } else {
    printf("No\n");
  }

  return 0;
}


Fixed submission:
#include <iostream>
#include <math.h>
#include <queue>
#include <stdio.h>
#include <string>
using namespace std;

int main(int argc, char *argv[]) {

  int H, N;
  scanf("%d %d", &H, &N);

  int A[100005];

  int sum = 0;
  for (int i = 0; i < N; i++) {
    scanf("%d", &A[i]);
    sum += A[i];
  }

  if (sum >= H) {
    printf("Yes\n");
  } else {
    printf("No\n");
  }

  return 0;
}
Problem p02784 (C++)

Buggy submission (status: Runtime Error):
#include <iostream>
#include <numeric>
#include <stdio.h>
#include <string>
#include <vector>
using namespace std;
int main() {
  int H, N;
  vector<int> vec(N);
  cin >> H >> N;

  for (int i = 0; i < N; i++) {
    cin >> vec.at(i);
  }
  int sum = accumulate(vec.begin(), vec.end(), 0);
  if (H <= sum) {
    string s = "Yes";
    cout << "Yes";
    // printf("%s\n", s);
  } else {
    string s = "No";
    cout << "No";
    // printf("%s\n", s);
  }
  return 0;
}


Fixed submission:
#include <iostream>
#include <numeric>
#include <stdio.h>
#include <string>
#include <vector>
using namespace std;
int main() {
  int H, N;
  cin >> H;
  cin >> N;
  vector<int> vec(N + 1);
  for (int i = 0; i < N; i++) {
    cin >> vec.at(i);
  }
  int sum = accumulate(vec.begin(), vec.end(), 0);
  if (H <= sum) {
    string s = "Yes";
    cout << "Yes";
    // printf("%s\n", s);
  } else {
    string s = "No";
    cout << "No";
    // printf("%s\n", s);
  }
  return 0;
}
Problem p02784 (C++)

Buggy submission (status: Runtime Error):
#include <bits/stdc++.h>
using namespace std;

int main() {
  int H, N;
  int a[10010];
  cin >> H >> N;
  for (int i = 0; i < N; ++i)
    cin >> a[i];
  // cout<<"Hの値:"<<H<<"  Nの値:"<<N<<endl;
  int sum = 0;
  for (int i = 0; i < N; ++i) {
    //  cout <<"sumに"<<a[i]<<"を代入"<<endl;
    sum += a[i];
  }

  if (sum >= H) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
}

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

int main() {
  int H, N;
  int a[100010];
  cin >> H >> N;
  for (int i = 0; i < N; ++i)
    cin >> a[i];
  // cout<<"Hの値:"<<H<<"  Nの値:"<<N<<endl;
  int sum = 0;
  for (int i = 0; i < N; ++i) {
    //  cout <<"sumに"<<a[i]<<"を代入"<<endl;
    sum += a[i];
  }

  if (sum >= H) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
}
Problem p02784 (C++)

Buggy submission (status: Runtime Error):
#include <iostream>

using namespace std;

int nigarel[10001];

int main() {
  int a, b, i, sum = 0;

  cin >> a >> b;

  for (i = 0; i < b; i++) {
    cin >> nigarel[i];
    sum += nigarel[i];
  }

  if (sum >= a)
    cout << "Yes";
  else
    cout << "No";

  return 0;
}


Fixed submission:
#include <iostream>

using namespace std;

int nigarel[100001];

int main() {
  int a, b, i, sum = 0;

  cin >> a >> b;

  for (i = 0; i < b; i++) {
    cin >> nigarel[i];
    sum += nigarel[i];
  }

  if (sum >= a)
    cout << "Yes";
  else
    cout << "No";

  return 0;
}
Problem p02784 (C++)

Buggy submission (status: Runtime Error):
#include <iostream>
#include <string>

using namespace std;

#define rep(i, n) for (int i = 0; i < n; i++)

int main() {
  int h, n, a[10000];
  cin >> h >> n;
  rep(i, n) cin >> a[i];
  string com = "No";
  rep(i, n) {
    h -= a[i];
    if (h <= 0) {
      com = "Yes";
      break;
    }
  }
  cout << com;
  return 0;
}


Fixed submission:
#include <iostream>
#include <string>

using namespace std;

#define rep(i, n) for (int i = 0; i < n; i++)

int main() {
  int h, n, a[100000];
  cin >> h >> n;
  rep(i, n) cin >> a[i];
  string com = "No";
  rep(i, n) {
    h -= a[i];
    if (h <= 0) {
      com = "Yes";
      break;
    }
  }
  cout << com;
  return 0;
}
Problem p02784 (C++)

Buggy submission (status: Runtime Error):
#include <algorithm>
#include <iostream>
#include <string>
using namespace std;

int main() {
  int H, N;
  int A[10000];
  int sum = 0;

  cin >> H >> N;
  for (int i = 0; i < N; i++) {
    cin >> A[i];
  }

  for (int i = 0; i < N; i++) {
    sum += A[i];
  }

  cout << (sum >= H ? "Yes" : "No") << endl;

  return 0;
}

Fixed submission:
#include <algorithm>
#include <iostream>
#include <string>
using namespace std;

int main() {
  long long H, N;
  long long A[100000];
  long long sum = 0;

  cin >> H >> N;
  for (int i = 0; i < N; i++) {
    cin >> A[i];
  }

  for (int i = 0; i < N; i++) {
    sum += A[i];
  }

  cout << (sum >= H ? "Yes" : "No") << endl;

  return 0;
}
Problem p02784 (C++)

Buggy submission (status: Runtime Error):
#include <algorithm>
#include <cmath>
#include <iostream>
#include <map>
#include <queue>
using namespace std;
typedef long long ll;
ll inf = 100000000;
ll w[205];
ll v[205];
ll c[200005];
ll h[200005];
ll dp[105][100005];
typedef pair<int, int> P;

int main() {
  ll h, n;
  cin >> h >> n;
  ll a[10005];
  ll sum = 0;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    sum += a[i];
  }
  if (sum >= h) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
  return 0;
}


Fixed submission:
#include <algorithm>
#include <cmath>
#include <iostream>
#include <map>
#include <queue>
using namespace std;
typedef long long ll;
ll inf = 100000000;
ll w[205];
ll v[205];
ll c[200005];
ll h[200005];
ll dp[105][100005];
typedef pair<int, int> P;

int main() {
  ll h, n;
  cin >> h >> n;
  ll a[100005];
  ll sum = 0;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    sum += a[i];
  }
  if (sum >= h) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
  return 0;
}
Problem p02784 (C++)

Buggy submission (status: Runtime Error):
#include <algorithm>
#include <cmath>
#include <iostream>
#include <string>
using namespace std;
int main(void) {
  // Your code here!
  long long int N, M, H, W, x, i, j, k, ans, count, cost, tmp, a, b, c, d, c1,
      c2, HP;
  long long int S[11000];
  // long long int T[11000];
  // long long int U[300000];
  // long long int Ssum[300000];
  string T[110], TA, V, G, ans2;
  bool flag;
  count = 0;
  ans = std::pow(10, 18);
  ans = 0;
  flag = false;
  cin >> HP >> N;
  for (i = 0; i < N; i++) {
    cin >> S[i];
    count += S[i];
  }

  // cin >> c >>d;
  // count=0;

  // cout << count<<endl;

  if (HP <= count) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }

  return 0;
}


Fixed submission:
#include <algorithm>
#include <cmath>
#include <iostream>
#include <string>
using namespace std;
int main(void) {
  // Your code here!
  long long int N, M, H, W, x, i, j, k, ans, count, cost, tmp, a, b, c, d, c1,
      c2, HP;
  long long int S[110000];
  // long long int T[11000];
  // long long int U[300000];
  // long long int Ssum[300000];
  string T[110], TA, V, G, ans2;
  bool flag;
  count = 0;
  ans = std::pow(10, 18);
  ans = 0;
  flag = false;
  cin >> HP >> N;
  for (i = 0; i < N; i++) {
    cin >> S[i];
    count += S[i];
  }

  // cin >> c >>d;
  // count=0;

  // cout << count<<endl;

  if (HP <= count) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }

  return 0;
}
Problem p02784 (C++)

Buggy submission (status: Runtime Error):
#include <bits/stdc++.h>

using namespace std;
int main() {
  int h, n;
  cin >> h >> n;

  vector<int> v(h);
  int sum = 0;
  for (int i = 0; i < n; i++) {
    cin >> v[i];
    sum += v[i];
  }
  if (sum >= h)
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
}


Fixed submission:
#include <bits/stdc++.h>

using namespace std;
int main() {
  int h, n;
  cin >> h >> n;

  vector<int> v(n);
  int sum = 0;
  for (int i = 0; i < n; i++) {
    cin >> v[i];
    sum += v[i];
  }
  if (sum >= h)
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
}
Problem p02784 (C++)

Buggy submission (status: Runtime Error):
#include <algorithm>
#include <cmath>
#include <iostream>
#include <stdio.h>
#include <string>
using namespace std;

int main() {
  int h, n, a[10000] = {}, m = 0;
  cin >> h >> n;
  for (int i = 0; i < n; ++i) {
    cin >> a[i];
    m += a[i];
  }
  if (m >= h)
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
}

Fixed submission:
#include <algorithm>
#include <cmath>
#include <iostream>
#include <stdio.h>
#include <string>
using namespace std;

int main() {
  int h, n, a[100000] = {}, m = 0;
  cin >> h >> n;
  for (int i = 0; i < n; ++i) {
    cin >> a[i];
    m += a[i];
  }
  if (m >= h)
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
}
Problem p02784 (C++)

Buggy submission (status: Runtime Error):
#include <bits/stdc++.h>
using namespace std;
int main() {
  long long h, n, s = 0, a[10005];
  cin >> h >> n;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    s += a[i];
  }
  if (s >= h)
    cout << "Yes\n";
  else
    cout << "No\n";
  return 0;
}


Fixed submission:
#include <bits/stdc++.h>
using namespace std;
int main() {
  long long h, n, s = 0, a[100005];
  cin >> h >> n;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    s += a[i];
  }
  if (s >= h)
    cout << "Yes\n";
  else
    cout << "No\n";
  return 0;
}
Problem p02784 (C++)

Buggy submission (status: Runtime Error):
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
using namespace std;
int main(void) {
  long long h, n, a[10001];
  cin >> h >> n;
  rep(i, n) {
    cin >> a[i];
    h -= a[i];
  }
  if (h > 0) {
    cout << "No" << endl;
  } else {
    cout << "Yes" << endl;
  }
}


Fixed submission:
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
using namespace std;
int main(void) {
  long long h, n, a[100001];
  cin >> h >> n;
  rep(i, n) {
    cin >> a[i];
    h -= a[i];
  }
  if (h > 0) {
    cout << "No" << endl;
  } else {
    cout << "Yes" << endl;
  }
}
Problem p02784 (C++)

Buggy submission (status: Runtime Error):
#include <algorithm>
#include <bits/stdc++.h>
using namespace std;

#define rep(i, a, b) for (int i = a; i <= b; i++)
#define revp(i, a, b) for (int i = b; i >= a; i--)

int h, n, temp, sum = 0;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
#ifndef ONLINE_JUDGE
  freopen("input.txt", "r", stdin);
  freopen("output.txt", "w", stdout);
#endif

  cin >> h >> n;
  while (n--)
    cin >> temp, sum += temp;
  if (sum >= h)
    cout << "Yes";
  else
    cout << "No";
}


Fixed submission:
#include <algorithm>
#include <bits/stdc++.h>
using namespace std;

#define rep(i, a, b) for (int i = a; i <= b; i++)
#define revp(i, a, b) for (int i = b; i >= a; i--)

int h, n, temp, sum = 0;
int main() {

  cin >> h >> n;
  while (n--)
    cin >> temp, sum += temp;
  if (sum >= h)
    cout << "Yes";
  else
    cout << "No";
}
Problem p02784 (C++)

Buggy submission (status: Runtime Error):
#include <bits/stdc++.h>
int main() {
  long long int i, a, b, arr[10000], sum;
  scanf("%lld %lld", &a, &b);
  sum = 0;
  for (i = 0; i < b; i++) {
    scanf("%lld", &arr[i]);
    sum += arr[i];
  }
  if (sum >= a) {
    printf("Yes");
  } else {
    printf("No");
  }
  printf("\n");
  return 0;
}


Fixed submission:
#include <bits/stdc++.h>
int main() {
  long long int i, a, b, arr[100000], sum;
  scanf("%lld %lld", &a, &b);
  sum = 0;
  for (i = 0; i < b; i++) {
    scanf("%lld", &arr[i]);
    sum += arr[i];
  }
  if (sum >= a) {
    printf("Yes");
  } else {
    printf("No");
  }
  printf("\n");
  return 0;
}
Problem p02784 (C++)

Buggy submission (status: Runtime Error):
#include <iostream>
#include <string>

using namespace std;

int main() {
  int a, b, d;
  int c[10000];
  cin >> a >> b;
  d = 0;
  for (int i = 0; i < b; i++) {
    cin >> c[i];
  }
  for (int i = 0; i < b; i++) {
    d = d + c[i];
  }
  if (d >= a)
    cout << "Yes";
  if (d < a)
    cout << "No";
}

Fixed submission:
#include <iostream>
#include <string>

using namespace std;

int main() {
  int a, b, d;
  int c[100000];
  cin >> a >> b;
  d = 0;
  for (int i = 0; i < b; i++) {
    cin >> c[i];
  }
  for (int i = 0; i < b; i++) {
    d = d + c[i];
  }
  if (d >= a)
    cout << "Yes";
  if (d < a)
    cout << "No";
}
Problem p02784 (C++)

Buggy submission (status: Runtime Error):
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define INF 1e9
#define PI 3.14159265359
#define MOD 1000000007
#define ALL(v) v.begin(), v.end()
typedef long long ll;
int main() {
  int h, n;
  cin >> h >> n;
  vector<int> a(n);
  rep(i, n) { cin >> a.at(i); }
  sort(ALL(a));
  int sum = a.at(n - 1) + a.at(n - 2);
  if (sum >= h) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
}

Fixed submission:
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define INF 1e9
#define PI 3.14159265359
#define MOD 1000000007
#define ALL(v) v.begin(), v.end()
typedef long long ll;
int main() {
  int h, n;
  cin >> h >> n;
  vector<int> a(n);
  ll sum = 0;
  rep(i, n) {
    cin >> a.at(i);
    sum += a.at(i);
  }
  if (sum >= h) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
}
Problem p02784 (C++)

Buggy submission (status: Runtime Error):
#include "algorithm"
#include "bitset"
#include "cassert"
#include "climits"
#include "cmath"
#include "cstdio"
#include "ctime"
#include "functional"
#include "iomanip"
#include "iostream"
#include "list"
#include "map"
#include "numeric"
#include "queue"
#include "random"
#include "set"
#include "stack"
#include "string"
#include "unordered_map"
#include "unordered_set"

using namespace std;

constexpr long long int MOD = 1000000007;
// constexpr int MOD = 1000000007;
// constexpr int MOD = 998244353;
// constexpr long long int MOD = 998244353;
constexpr long double EPS = 1e-12;

// int N, M, K, H, W, L, R;
long long int N, M, K, H, W, L, R;

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

  cin >> N >> M;
  vector<long long int> v(N);
  for (auto &i : v)
    cin >> i;
  if (accumulate(v.begin(), v.end(), 0LL) < N)
    cout << "No\n";
  else
    cout << "Yes\n";
  return 0;
}

Fixed submission:
#include "algorithm"
#include "bitset"
#include "cassert"
#include "climits"
#include "cmath"
#include "cstdio"
#include "ctime"
#include "functional"
#include "iomanip"
#include "iostream"
#include "list"
#include "map"
#include "numeric"
#include "queue"
#include "random"
#include "set"
#include "stack"
#include "string"
#include "unordered_map"
#include "unordered_set"

using namespace std;

constexpr long long int MOD = 1000000007;
// constexpr int MOD = 1000000007;
// constexpr int MOD = 998244353;
// constexpr long long int MOD = 998244353;
constexpr long double EPS = 1e-12;

// int N, M, K, H, W, L, R;
long long int N, M, K, H, W, L, R;

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

  cin >> N >> M;
  vector<long long int> v(M);
  for (auto &i : v)
    cin >> i;
  if (accumulate(v.begin(), v.end(), 0LL) < N)
    cout << "No\n";
  else
    cout << "Yes\n";
  return 0;
}
Problem p02784 (C++)

Buggy submission (status: Runtime Error):
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
template <class T> inline bool chmin(T &a, T b) {
  if (a > b) {
    a = b;
    return true;
  }
  return false;
}
template <class T> inline bool chmax(T &a, T b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}

#define rep(i, n) for (ll i = 0; i < (ll)n; i++)
#define rep2(i, begin_i, end_i) for (ll i = (ll)begin_i; i < (ll)end_i; i++)

long long INF = 1LL << 60;
int n;
int main() {
  int h;
  cin >> n >> h;
  vector<int> a(n);
  rep(i, n) cin >> a[i];
  ll adre = 0;
  rep(i, n) adre += a[i];
  if (h > adre)
    cout << "No" << endl;
  else
    cout << "Yes" << endl;
  return 0;
}


Fixed submission:
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
template <class T> inline bool chmin(T &a, T b) {
  if (a > b) {
    a = b;
    return true;
  }
  return false;
}
template <class T> inline bool chmax(T &a, T b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}

#define rep(i, n) for (ll i = 0; i < (ll)n; i++)
#define rep2(i, begin_i, end_i) for (ll i = (ll)begin_i; i < (ll)end_i; i++)

long long INF = 1LL << 60;
int n;
int main() {
  int h;
  cin >> h >> n;
  vector<int> a(n);
  rep(i, n) cin >> a[i];
  ll adre = 0;
  rep(i, n) adre += a[i];
  if (h > adre)
    cout << "No" << endl;
  else
    cout << "Yes" << endl;
  return 0;
}
Problem p02784 (C++)

Buggy submission (status: Runtime Error):
#include <iostream>
#include <vector>
using namespace std;
int main() {
  int h = 0, x = 0, o = 0;
  cin >> h;
  cin >> x;
  vector<int> n(h);
  for (int i = 0; i < x; i++) {
    cin >> n[i];
    o = o + n[i];
  }
  h = h - o;
  if (h <= 0) {
    cout << "Yes";
  } else if (h > 0) {
    cout << "No";
  }
  cout << endl;
}


Fixed submission:
#include <iostream>
#include <vector>
using namespace std;
int main() {
  int h = 0, x = 0, o = 0;
  cin >> h;
  cin >> x;
  vector<int> n(x);
  for (int i = 0; i < x; i++) {
    cin >> n[i];
    o = o + n[i];
  }
  h = h - o;
  if (h <= 0) {
    cout << "Yes";
  } else if (h > 0) {
    cout << "No";
  }
  cout << endl;
}
Problem p02784 (C++)

Buggy submission (status: Runtime Error):
#include <bits/stdc++.h>
using namespace std;

int main() {

  int H = 0, N = 0, A[210];

  cin >> H >> N;

  for (int i = 0; i < N; i++) {

    cin >> A[i];
  }

  int sum = 0;

  for (int i = 0; i < N; i++) {

    sum = sum + A[i];
  }

  if (H - sum <= 0) {

    cout << "Yes" << endl;

  } else {

    cout << "No" << endl;
  }

  return 0;
}

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

int main() {

  int H = 0, N = 0, A[1000000];

  cin >> H >> N;

  for (int i = 0; i < N; i++) {

    cin >> A[i];
  }

  int sum = 0;

  for (int i = 0; i < N; i++) {

    sum = sum + A[i];
  }

  if (H - sum <= 0) {

    cout << "Yes" << endl;

  } else {

    cout << "No" << endl;
  }

  return 0;
}
Problem p02784 (C++)

Buggy submission (status: Runtime Error):
#include <bits/stdc++.h>
using namespace std;

#define ll long long int
#define FIO                                                                    \
  ios_base::sync_with_stdio(false);                                            \
  cin.tie(0);                                                                  \
  cout.tie(0)

int main() {
  FIO;
  ll N, i, H, s = 0, A[10005];
  cin >> H >> N;
  for (i = 0; i < N; i++)
    cin >> A[i];
  for (i = 0; i < N; i++)
    s += A[i];
  if (s >= H)
    cout << "Yes";
  else
    cout << "No";
  return 0;
}


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

#define ll long long int
#define FIO                                                                    \
  ios_base::sync_with_stdio(false);                                            \
  cin.tie(0);                                                                  \
  cout.tie(0)

int main() {
  FIO;
  ll N, i, H, s = 0, A[100000];
  cin >> H >> N;
  for (i = 0; i < N; i++)
    cin >> A[i];
  for (i = 0; i < N; i++)
    s += A[i];
  if (s >= H)
    cout << "Yes";
  else
    cout << "No";
  return 0;
}
Problem p02784 (C++)

Buggy submission (status: Runtime Error):
#include <bits/stdc++.h>
using namespace std;
typedef long long unsigned int ll;
#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))
#define rep(i, start, end) for (int i = start; i < (int)(end); ++i)
int a[10010];
int main() {
  int h, n;
  cin >> h >> n;
  rep(i, 0, n) cin >> a[i];
  rep(i, 0, n) h -= a[i];
  if (0 < h)
    cout << "No" << endl;
  else
    cout << "Yes" << endl;
  return 0;
}

Fixed submission:
#include <bits/stdc++.h>
using namespace std;
typedef long long unsigned int ll;
#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))
#define rep(i, start, end) for (int i = start; i < (int)(end); ++i)
int a[100010];
int main() {
  int h, n;
  cin >> h >> n;
  rep(i, 0, n) cin >> a[i];
  rep(i, 0, n) h -= a[i];
  if (0 < h)
    cout << "No" << endl;
  else
    cout << "Yes" << endl;
  return 0;
}
Problem p02784 (C++)

Buggy submission (status: Runtime Error):
#include <bits/stdc++.h>
// #include <ext/pb_ds/tree_policy.hpp>
// #include <ext/pb_ds/assoc_container.hpp>

using namespace std;
// using namespace __gnu_pbds;

#define ll long long
#define DS pair<ll, ll>
#define READ(f) freopen(f, "r", stdin)
#define WRITE(f) freopen(f, "w", stdout)

const int N = 1005;
const int MOD = 1e9 + 7;
const double PI = 2 * acos(0.0);
// template<typename T> using ordered_set = tree<T, null_type, less<T>,
// rb_tree_tag, tree_order_statistics_node_update>;

ll a[N];

int main() {
  // ios::sync_with_stdio(false);
  // cin.tie(0);
  ll h, n, sum = 0;
  cin >> h >> n;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    sum += a[i];
  }
  puts(h <= sum ? "Yes" : "No");
  return 0;
}


Fixed submission:
#include <bits/stdc++.h>
// #include <ext/pb_ds/tree_policy.hpp>
// #include <ext/pb_ds/assoc_container.hpp>

using namespace std;
// using namespace __gnu_pbds;

#define ll long long
#define DS pair<ll, ll>
#define READ(f) freopen(f, "r", stdin)
#define WRITE(f) freopen(f, "w", stdout)

const int N = 3e5 + 5;
const int MOD = 1e9 + 7;
const double PI = 2 * acos(0.0);
// template<typename T> using ordered_set = tree<T, null_type, less<T>,
// rb_tree_tag, tree_order_statistics_node_update>;

ll a[N];

int main() {
  // ios::sync_with_stdio(false);
  // cin.tie(0);
  ll h, n, sum = 0;
  cin >> h >> n;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    sum += a[i];
  }
  puts(h <= sum ? "Yes" : "No");
  return 0;
}
Problem p02784 (C++)

Buggy submission (status: Runtime Error):
#include <bits/stdc++.h>
using namespace std;
#define inf 100000000000000000
#define ll long long int
#define pb push_back
#define f first
#define s second
#define mod 1000000007
#define fast ios_base::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL)
void mahakal() {
#ifndef ONLINE_JUDGE
  freopen("input.txt", "r", stdin);
  freopen("output.txt", "w", stdout);
  freopen("error.txt", "w", stderr);
#endif
}

int main() {
  mahakal();
  fast;

  ll h, n;
  cin >> h >> n;
  ll sum = 0;
  for (ll i = 0, a; i < n; i++) {
    cin >> a;
    sum += a;
  }
  if (sum >= h)
    cout << "Yes" << endl;
  else
    cout << "No" << endl;

  return 0;
}

Fixed submission:
#include <bits/stdc++.h>
using namespace std;
#define inf 100000000000000000
#define ll long long int
#define pb push_back
#define f first
#define s second
#define mod 1000000007
#define fast ios_base::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL)
void mahakal() {
#ifndef ONLINE_JUDGE
  freopen("input.txt", "r", stdin);
  freopen("output.txt", "w", stdout);
  freopen("error.txt", "w", stderr);
#endif
}

int main() {
  // mahakal();fast;

  ll h, n;
  cin >> h >> n;
  ll sum = 0;
  for (ll i = 0, a; i < n; i++) {
    cin >> a;
    sum += a;
  }
  if (sum >= h)
    cout << "Yes" << endl;
  else
    cout << "No" << endl;

  return 0;
}
Problem p02784 (C++)

Buggy submission (status: Runtime Error):
#include <bits/stdc++.h>
using namespace std;
#define BeatMeScanf                                                            \
  ios_base::sync_with_stdio(false);                                            \
  cin.tie(NULL);                                                               \
  cout.tie(NULL)

int arr[10005];

int main() {
  BeatMeScanf;
  // freopen("G:/C++/in.txt", "r", stdin);
  // freopen("G:/C++/out.txt", "w", stdout);

  int h, n, sum = 0;
  cin >> h >> n;

  for (int i = 0; i < n; i++) {
    cin >> arr[i];
    sum += arr[i];
  }
  if (sum >= h)
    cout << "Yes" << endl;
  else
    cout << "No" << endl;

  return 0;
}


Fixed submission:
#include <bits/stdc++.h>
using namespace std;
#define BeatMeScanf                                                            \
  ios_base::sync_with_stdio(false);                                            \
  cin.tie(NULL);                                                               \
  cout.tie(NULL)

int arr[100005];

int main() {
  BeatMeScanf;
  // freopen("G:/C++/in.txt", "r", stdin);
  // freopen("G:/C++/out.txt", "w", stdout);

  int h, n, sum = 0;
  cin >> h >> n;

  for (int i = 0; i < n; i++) {
    cin >> arr[i];
    sum += arr[i];
  }
  if (sum >= h)
    cout << "Yes" << endl;
  else
    cout << "No" << endl;

  return 0;
}
Problem p02784 (C++)

Buggy submission (status: Runtime Error):
#include <array>
#include <iostream>

using namespace std;

int main() {
  int H, N;
  cin >> H;
  cin >> N;

  array<int, 10000> A;
  for (int i = 0; i < N; i++) {
    cin >> A[i];
  }

  bool result = false;
  for (int i = 0; i < N; i++) {
    H = H - A[i];
    if (H <= 0) {
      result = true;
      break;
    }
  }

  if (result)
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
}


Fixed submission:
#include <array>
#include <iostream>

using namespace std;

int main() {
  int H, N;
  cin >> H;
  cin >> N;

  array<int, 100000> A;
  for (int i = 0; i < N; i++) {
    cin >> A[i];
  }

  bool result = false;
  for (int i = 0; i < N; i++) {
    H = H - A[i];
    if (H <= 0) {
      result = true;
      break;
    }
  }

  if (result)
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
}
Problem p02784 (C++)

Buggy submission (status: Runtime Error):
#include <bits/stdc++.h>
using namespace std;

#define ll long long int

int main() {
  ll N, i, H, s = 0, A[10005];
  cin >> H >> N;
  for (i = 0; i < N; i++)
    cin >> A[i];
  for (i = 0; i < N; i++)
    s += A[i];
  if (s >= H)
    cout << "Yes";
  else
    cout << "No";
  return 0;
}

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

#define ll long long int

int main() {
  ll N, i, H, s = 0, A[100000];
  cin >> H >> N;
  for (i = 0; i < N; i++)
    cin >> A[i];
  for (i = 0; i < N; i++)
    s += A[i];
  if (s >= H)
    cout << "Yes";
  else
    cout << "No";
  return 0;
}
Problem p02784 (Python)

Buggy submission (status: Runtime Error):
# ABC153
# B Common Raccoon VS Monster
h, n = map(int, input().split())
a = list(map(int, input().split()))
s = sum(a)
if a <= s:
    print("Yes")
else:
    print("No")


Fixed submission:
# ABC153
# B Common Raccoon VS Monster
h, n = map(int, input().split())
a = list(map(int, input().split()))
s = sum(a)
if h <= s:
    print("Yes")
else:
    print("No")
Problem p02784 (C++)

Buggy submission (status: Runtime Error):
/*#pragma GCC optimize("Ofast,no-stack-protector")
#pragma GCC
target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,avx2,tune=native") #pragma
GCC optimize("unroll-loops") #pragma GCC optimize("fast-math")*/
#include <bits/stdc++.h>

using namespace std;

using ll = long long;
using ld = long double;
using ull = unsigned long long;

#define int long long
// #define double ld
#define F first
#define S second
#define all(v) v.begin(), v.end()
#define rall(v) v.rbegin(), v.rend()

void accell() {
  cin.tie(0);
  cout.tie(0);
  ios_base::sync_with_stdio(0);
}

signed main() {
  srand(time(0));
  accell();
  int n, a;
  cin >> n >> a;
  int s = 0;
  vector<int> b(n);
  for (int i = 0; i < n; ++i) {
    cin >> b[i];
    s += b[i];
  }
  if (s >= a) {
    cout << "Yes" << '\n';
  } else {
    cout << "No" << '\n';
  }
  return 0;
}


Fixed submission:
/*#pragma GCC optimize("Ofast,no-stack-protector")
#pragma GCC
target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,avx2,tune=native") #pragma
GCC optimize("unroll-loops") #pragma GCC optimize("fast-math")*/
#include <bits/stdc++.h>

using namespace std;

using ll = long long;
using ld = long double;
using ull = unsigned long long;

#define int long long
// #define double ld
#define F first
#define S second
#define all(v) v.begin(), v.end()
#define rall(v) v.rbegin(), v.rend()

void accell() {
  cin.tie(0);
  cout.tie(0);
  ios_base::sync_with_stdio(0);
}

signed main() {
  srand(time(0));
  accell();
  int n, a;
  cin >> a >> n;
  int s = 0;
  vector<int> b(n);
  for (int i = 0; i < n; ++i) {
    cin >> b[i];
    s += b[i];
  }
  if (s >= a) {
    cout << "Yes" << '\n';
  } else {
    cout << "No" << '\n';
  }
  return 0;
}
Problem p02785 (C++)

Buggy submission (status: Runtime Error):
#include <algorithm>
#include <cmath>
#include <cstring>
#include <iostream>
#include <map>
#include <set>
#include <string>
#include <tuple>
#include <utility>
#include <vector>

#define rep(i, n) for (int i = 0; i < (int)(n); i++)

using namespace std;
typedef long long ll;

int N, K;
int H[100001];

int main() {
  cin >> N >> K;
  rep(i, N) cin >> H[i];
  sort(H, H + N, std::greater<int>());
  ll sum = 0;
  for (int i = K; i < N; i++) {
    sum += H[i];
  }
  cout << sum << endl;
  return 0;
}

Fixed submission:
#include <algorithm>
#include <cmath>
#include <cstring>
#include <iostream>
#include <map>
#include <set>
#include <string>
#include <tuple>
#include <utility>
#include <vector>

#define rep(i, n) for (int i = 0; i < (int)(n); i++)

using namespace std;
typedef long long ll;

int N, K;
int H[200001];

int main() {
  cin >> N >> K;
  rep(i, N) cin >> H[i];
  sort(H, H + N, std::greater<int>());
  ll sum = 0;
  for (int i = K; i < N; i++) {
    sum += H[i];
  }
  cout << sum << endl;
  return 0;
}
Problem p02785 (C++)

Buggy submission (status: Runtime Error):
#include <bits/stdc++.h>
using namespace std;
#define REP(i, n) for (long long i = 0; i < (long long)(n); i++)
#define FOR(i, m, n) for (long long i = m; i < n; i++)
#define SORT(x) sort(x.begin(), x.end())
#define RS(x) rsort(x.begin(),x,end()))
#define REVE(x) reverse(x.begin(), x.end())
#define ALL(x) (x).begin(), (x).end()
#define pb push_back
#define pob pop_back
int INF = 1e9 + 1;
int MOD = 1e9 + 7;
int main() {
  long long n, k, c = 0;
  cin >> n >> k;
  vector<long long> h(n);
  REP(i, n) { cin >> h[i]; }
  SORT(h);
  REP(i, k) { h[n - i - 1] = 0; }
  REP(i, n) { c += h[i]; }
  cout << c;
}

Fixed submission:
#include <bits/stdc++.h>
using namespace std;
#define REP(i, n) for (long long i = 0; i < (long long)(n); i++)
#define FOR(i, m, n) for (long long i = m; i < n; i++)
#define SORT(x) sort(x.begin(), x.end())
#define RS(x) rsort(x.begin(),x,end()))
#define REVE(x) reverse(x.begin(), x.end())
#define ALL(x) (x).begin(), (x).end()
#define pb push_back
#define pob pop_back
int INF = 1e9 + 1;
int MOD = 1e9 + 7;
int main() {
  long long n, k, c = 0;
  cin >> n >> k;
  if (k >= n)
    k = n;
  vector<long long> h(n);
  REP(i, n) { cin >> h[i]; }
  SORT(h);
  REP(i, k) { h[n - i - 1] = 0; }
  REP(i, n) { c += h[i]; }
  cout << c;
}
Problem p02785 (C++)

Buggy submission (status: Runtime Error):
#include <bits/stdc++.h>

using namespace std;

typedef long long ll;

ll ans[20005];

int main() {
  int n, k;
  cin >> n >> k;
  for (int i = 0; i < n; i++) {
    cin >> ans[i];
  }
  sort(ans, ans + n);
  if (n <= k) {
    cout << 0 << endl;
    return 0;
  } else {
    ll sum = 0;
    for (int i = 0; i < n - k; i++)
      sum += ans[i];
    cout << sum << endl;
  }
  return 0;
}

Fixed submission:
#include <bits/stdc++.h>

using namespace std;

typedef long long ll;

ll ans[200005];

int main() {
  int n, k;
  cin >> n >> k;
  for (int i = 0; i < n; i++) {
    cin >> ans[i];
  }
  sort(ans, ans + n);
  if (n <= k) {
    cout << 0 << endl;
    return 0;
  } else {
    ll sum = 0;
    for (int i = 0; i < n - k; i++)
      sum += ans[i];
    cout << sum << endl;
  }
  return 0;
}