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

Buggy submission (status: Runtime Error):
#include <algorithm>
#include <climits>
#include <cmath>
#include <deque>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <tuple>
#include <unordered_map>
#include <unordered_set>
#include <vector>

using namespace std;

#define sz(x) (int)x.size()
#define all(x) begin(x), end(x)
#define rall(x) rbegin(x), rend(x)
#define cina(s, n, a)                                                          \
  for (int i = s; i < n; i++)                                                  \
  cin >> a[i]
#define couta(n, a)                                                            \
  for (int i = 0; i < n; i++)                                                  \
  cout << a[i] << ' '
#define copy(s, n, a, b)                                                       \
  for (int i = s; i < n; i++)                                                  \
  b[i] = a[i]
#define yesno(ok) cout << (ok ? "YES" : "NO")
#define mod(a, b) (b + (a % b)) % b
#define MOD (ll)1e9 + 7

typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef vector<pii> vpii;

void solve() {
  int a, b;
  cin >> a >> b;
  cout << (a + b - 1) / b;
}

int main() {
  ios::sync_with_stdio(false);
  // freopen("input.txt", "r", stdin);
  // freopen("output.txt", "w", stdout);
  int q = 1;
  cin >> q;
  for (int i = 1; i <= q; i++) {
    solve();
  }
}


Fixed submission:
#include <algorithm>
#include <climits>
#include <cmath>
#include <deque>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <tuple>
#include <unordered_map>
#include <unordered_set>
#include <vector>

using namespace std;

#define sz(x) (int)x.size()
#define all(x) begin(x), end(x)
#define rall(x) rbegin(x), rend(x)
#define cina(s, n, a)                                                          \
  for (int i = s; i < n; i++)                                                  \
  cin >> a[i]
#define couta(n, a)                                                            \
  for (int i = 0; i < n; i++)                                                  \
  cout << a[i] << ' '
#define copy(s, n, a, b)                                                       \
  for (int i = s; i < n; i++)                                                  \
  b[i] = a[i]
#define yesno(ok) cout << (ok ? "YES" : "NO")
#define mod(a, b) (b + (a % b)) % b
#define MOD (ll)1e9 + 7

typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef vector<pii> vpii;

void solve() {
  int a, b;
  cin >> a >> b;
  cout << (a + b - 1) / b;
}

int main() {
  ios::sync_with_stdio(false);
  // freopen("input.txt", "r", stdin);
  // freopen("output.txt", "w", stdout);
  int q = 1;
  // cin >> q;
  for (int i = 1; i <= q; i++) {
    solve();
  }
}
Problem p02783 (C++)

Buggy submission (status: Runtime Error):
#include <algorithm>
#include <bits/stdc++.h>
#include <iostream>
#define max(a, b) a > b ? a : b
#define min(a, b) a < b ? a : b
#define pb push_back
#define IM_N00B                                                                \
  ios_base::sync_with_stdio(false);                                            \
  cin.tie(0);                                                                  \
  cout.tie(0)
using namespace std;
typedef long long ll;

int main() {

  IM_N00B;
#ifndef ONLINE_JUDGE
  freopen("input.txt", "r", stdin);
  freopen("output.txt", "w", stdout);
#endif

  int h, a;
  cin >> h >> a;
  int ans = h / a;
  if (h % a != 0)
    cout << ans + 1;
  else
    cout << ans;
  return 0;
}


Fixed submission:
#include <algorithm>
#include <bits/stdc++.h>
#include <iostream>
#define max(a, b) a > b ? a : b
#define min(a, b) a < b ? a : b
#define pb push_back
#define IM_N00B                                                                \
  ios_base::sync_with_stdio(false);                                            \
  cin.tie(0);                                                                  \
  cout.tie(0)
using namespace std;
typedef long long ll;

int main() {

  int h, a;
  cin >> h >> a;
  int ans = h / a;
  if (h % a != 0)
    cout << ans + 1;
  else
    cout << ans;
  return 0;
}
Problem p02783 (C++)

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

int main() {
  int i, n;
  cin >> i >> n;
  int result = 0;
  while (1) {
    i -= n;
    if (n <= 0) {
      break;
    }
  }
  cout << result << endl;
}

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

int main() {
  int i, n;
  cin >> i >> n;
  int result = 0;
  while (1) {
    i -= n;
    result++;
    if (i <= 0) {
      break;
    }
  }
  cout << result << endl;
}
Problem p02783 (C++)

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

int n, m, k;

int main() {
  freopen("in.txt", "r", stdin);
  cin >> n >> m;
  cout << (n - 1) / m + 1 << endl;
  return 0;
}

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

int n, m, k;

int main() {
  // freopen("in.txt","r",stdin);
  cin >> n >> m;
  cout << (n - 1) / m + 1 << endl;
  return 0;
}
Problem p02783 (C++)

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

int main(void) {
  int h, a;
  cout << (h + (a - 1)) / a << endl;
  return 0;
}

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

int main(void) {
  int h, a;
  cin >> h >> a;
  cout << (h + (a - 1)) / a << endl;
  return 0;
}
Problem p02783 (C++)

Buggy submission (status: Time Limit Exceeded):
#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, a;
  cin >> n >> a;
  int c = 0;
  for (int i = n; i > 0;) {
    c++;
    n = n - a;
  }
  cout << c;
  return 0;
}

Fixed submission:
#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, a;
  cin >> n >> a;
  int c = 0;
  while (n > 0) {
    c++;
    n = n - a;
  }
  cout << c;
  return 0;
}
Problem p02783 (C++)

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

int main() {
  int h, a;
  cout << (h + a - 1) / a;
  return 0;
}

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

int main() {
  int h, a;
  cin >> h >> a;
  cout << (h + a - 1) / a;
  return 0;
}
Problem p02783 (Python)

Buggy submission (status: Runtime Error):
h = int(input())  # Monster health
a = int(input())  # Servant attack
x = a
attack = 1

while h > x:
    h -= x
    attack += 1

print(attack)


Fixed submission:
h, a = input().split()
h = int(h)
a = int(a)
x = a
attack = 1

while h > x:
    h -= x
    attack += 1

print(attack)
Problem p02783 (C++)

Buggy submission (status: Time Limit Exceeded):
// 2020.1.26.#153:A
#include <cmath>
#include <iostream>
using namespace std;

int main(int argc, char const *argv[]) {
  int i = 0;
  unsigned A, H;
  do {
    cin >> A, H;
    if (A <= 10000 && H <= 10000 && A >= 1 && H >= 1) {
      break;
    }
  } while (1);
  while (A * (++i) < H) {
  }
  cout << i << endl;

  return 0;
}


Fixed submission:
// 2020.1.26.#153:A
#include <cmath>
#include <iostream>
using namespace std;

int main(int argc, char const *argv[]) {
  int i = 0;
  unsigned A, H;
  do {
    cin >> H;
    cin >> A;
    if (A <= 10000 && H <= 10000 && A >= 1 && H >= 1) {
      break;
    }
  } while (1);
  while (A * (++i) < H) {
  }
  cout << i << endl;

  return 0;
}
Problem p02783 (C++)

Buggy submission (status: Time Limit Exceeded):
#include <iostream>
using namespace std;

int main() {
  int H, A, b = 0;
  cin >> H >> A;
  while (H > 0)
    ;
  {
    H -= A;
    b++;
  }
  cout << b << endl;
  return 0;
}

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

int main() {
  int H, A, b = 0;
  cin >> H >> A;
  while (H > 0) {
    H -= A;
    b++;
  }
  cout << b << endl;
  return 0;
}
Problem p02783 (C++)

Buggy submission (status: Runtime Error):
#include <algorithm>
#include <bitset>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <utility>
#include <vector>
using namespace std;
const int inf = 2147483647, dx[] = {-1, 0, 1, 0},
          dy[] = {0, -1, 0, 1}; // 上 左 下 右
const int N = 100005, M = 1000005, K = 200005, mod = 1000000007;
const long long llinf = 9223372036854775807ll;
// int & long long
int h, a;
int main() {
  cin >> h >> a;
  cout << h / a + (h % a) / (h % a);
  return 0;
}

Fixed submission:
#include <algorithm>
#include <bitset>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <utility>
#include <vector>
using namespace std;
const int inf = 2147483647, dx[] = {-1, 0, 1, 0},
          dy[] = {0, -1, 0, 1}; // 上 左 下 右
const int N = 100005, M = 1000005, K = 200005, mod = 1000000007;
const long long llinf = 9223372036854775807ll;
// int & long long
int h, a;
int main() {
  cin >> h >> a;
  if (h % a == 0)
    cout << h / a;
  else
    cout << h / a + 1;
  return 0;
}
Problem p02783 (C++)

Buggy submission (status: Runtime Error):
/*
     author : masaow
     g++ : 17.3.20
*/
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define forn(i, a, b) for (i = a; i < b; i++)
#define debug(x) cout << #x << " " << x << " -- \n  "
#define I__O ios::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL)
#define ll long long
#define p(x) cout << x << "\n";
#define MOD 100000007
#define pi pair<int, int>
#define vi vector<int>
#define pb push_back
#define vp vector<pair<ll, ll>>
#define endl cout << "\n"
#define mi map<int, int>
#define f1 first
#define s1 second
#define in insert
#define all(x) x.begin(), x.end()
using namespace std;
using namespace __gnu_pbds;
typedef tree<int, null_type, less<int>, rb_tree_tag,
             tree_order_statistics_node_update>
    indexed_set;
const int N = 2e5 + 7;
/*
    time : 10 : 14
    date : 24.01.2020
*/

// int L,R,mid,target,idx ;
int tests() {
  int a, b;
  cin >> a >> b;
  cout << (a + b - 1) / b << '\n';
  return 0;
}
int main() {
  I__O;
  int cases = 1;
  cin >> cases;
  while (cases--)
    tests();
  return 0;
}

Fixed submission:
/*
     author : masaow
     g++ : 17.3.20
*/
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define forn(i, a, b) for (i = a; i < b; i++)
#define debug(x) cout << #x << " " << x << " -- \n  "
#define I__O ios::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL)
#define ll long long
#define p(x) cout << x << "\n";
#define MOD 100000007
#define pi pair<int, int>
#define vi vector<int>
#define pb push_back
#define vp vector<pair<ll, ll>>
#define endl cout << "\n"
#define mi map<int, int>
#define f1 first
#define s1 second
#define in insert
#define all(x) x.begin(), x.end()
using namespace std;
using namespace __gnu_pbds;
typedef tree<int, null_type, less<int>, rb_tree_tag,
             tree_order_statistics_node_update>
    indexed_set;
const int N = 2e5 + 7;
/*
    time : 10 : 14
    date : 24.01.2020
*/

// int L,R,mid,target,idx ;
int tests() {
  int a, b;
  cin >> a >> b;
  cout << (a + b - 1) / b << '\n';
  return 0;
}
int main() {
  I__O;
  int cases = 1;
  // cin >> cases;
  while (cases--)
    tests();
  return 0;
}
Problem p02783 (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, a;
  cin >> h >> a;

  int ans = ceil((float)(h) / (float)a);
  cout << ans << 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, a;
  cin >> h >> a;

  int ans = ceil((float)(h) / (float)a);
  cout << ans << endl;
  // cout<<"Execution time : "<<tick()<<"\n";

  return 0;
}
Problem p02783 (C++)

Buggy submission (status: Runtime Error):
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < n; i++)
int main() {
  int a, b, c;
  cin >> a, b;
  c = a / b;
  if (a % b != 0) {
    c++;
  }
  cout << c << endl;
}


Fixed submission:
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < n; i++)
int main() {
  int a, b, c;
  cin >> a >> b;
  c = a / b;
  if (a % b != 0) {
    c++;
  }
  cout << c << endl;
}
Problem p02783 (Python)

Buggy submission (status: Runtime Error):
H, A = map(int, input().split())

print(H // A + min(H % A))


Fixed submission:
H, A = map(int, input().split())

print(H // A + min(H % A, 1))
Problem p02783 (C++)

Buggy submission (status: Runtime Error):
#define _CRT_SECURE_NO_WARNINGS
#include <bits/stdc++.h>
#include <unordered_map>
#define endl "\n"
#define all(v) v.begin(), v.end()
#define allr(s) s.rbegin(), s.rend()
#define RT(s) return cout << s, 0
#define watch(x) cout << (#x) << " = " << x << endl
#define sz(s) (int)(s.size())
// #define PI acos(-1)
#define EPS 1e-8
using namespace std;
typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;
typedef pair<int, int> ii;
typedef vector<int> vi;
typedef vector<ii> vii;
int dy[] = {1, -1, 0, 0, -1, 1, 1, -1};
int dx[] = {0, 0, 1, -1, 1, -1, 1, -1};
void file() {
#ifndef ONLINE_JUDGE
  freopen("in.txt", "r", stdin);
  // freopen("out.txt", "w", stdout);
#else
  // freopen("street.in", "r", stdin);
  // freopen("out.txt", "w", stdout);
#endif
}
void fast() {
  std::ios_base::sync_with_stdio(0);
  cin.tie(NULL);
}

int main() {
  file();
  fast();
  int h, a;
  cin >> h >> a;
  cout << (h + a - 1) / a << endl;
  return 0;
}

Fixed submission:
#define _CRT_SECURE_NO_WARNINGS
#include <bits/stdc++.h>
#include <unordered_map>
#define endl "\n"
#define all(v) v.begin(), v.end()
#define allr(s) s.rbegin(), s.rend()
#define RT(s) return cout << s, 0
#define watch(x) cout << (#x) << " = " << x << endl
#define sz(s) (int)(s.size())
// #define PI acos(-1)
#define EPS 1e-8
using namespace std;
typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;
typedef pair<int, int> ii;
typedef vector<int> vi;
typedef vector<ii> vii;
int dy[] = {1, -1, 0, 0, -1, 1, 1, -1};
int dx[] = {0, 0, 1, -1, 1, -1, 1, -1};
void file() {
#ifndef ONLINE_JUDGE
  freopen("in.txt", "r", stdin);
  // freopen("out.txt", "w", stdout);
#else
  // freopen("street.in", "r", stdin);
  // freopen("out.txt", "w", stdout);
#endif
}
void fast() {
  std::ios_base::sync_with_stdio(0);
  cin.tie(NULL);
}

int main() {
  // file();
  fast();
  int h, a;
  cin >> h >> a;
  cout << (h + a - 1) / a << endl;
  return 0;
}
Problem p02783 (C++)

Buggy submission (status: Runtime Error):
#include <bits/stdc++.h>
using namespace std;
int main() {
  int h, a;
  cin >> h, a;
  cout << (h + (a - 1)) / a << endl;
}


Fixed submission:
#include <bits/stdc++.h>
using namespace std;
int main() {
  int h, a;
  cin >> h >> a;
  int ans = (h + (a - 1)) / a;
  cout << ans << endl;
  return 0;
}
Problem p02783 (C++)

Buggy submission (status: Runtime Error):
#include <algorithm>
#include <iomanip>
#include <iostream>
#include <vector>
using namespace std;
int main() {
  long long int a = 0, b = 0, c = 0, d = 0, n = 0, ans = 0, count = 0, h, w, up,
                down, end = 0, idx, m, kuso;
  string s;
  vector<long long int> x;
  vector<long long int>::iterator position;
  bool q = false;
  cin >> h, a;
  ans = h / a;
  if (h % a != 0)
    ans++;

  cout << ans << endl;
}

Fixed submission:
#include <algorithm>
#include <iomanip>
#include <iostream>
#include <vector>
using namespace std;
int main() {
  long long int a = 0, b = 0, c = 0, d = 0, n = 0, ans = 0, count = 0, h, w, up,
                down, end = 0, idx, m, kuso;
  string s;
  vector<long long int> x;
  vector<long long int>::iterator position;
  bool q = false;
  cin >> h >> a;
  ans = h / a;
  if (h % a != 0)
    ans++;

  cout << ans << endl;
}
Problem p02783 (C++)

Buggy submission (status: Runtime Error):
#include <cmath>
#include <cstdio>
int main() {
  int h, a;
  scanf("%d", &h, &a);
  printf("%d", (int)ceil(h / a));
  return 0;
}

Fixed submission:
#include <cmath>
#include <cstdio>
int main() {
  int h, a;
  scanf("%d%d", &h, &a);
  printf("%d", (int)ceil((double)h / a));
  return 0;
}
Problem p02783 (C++)

Buggy submission (status: Runtime Error):
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>

using namespace std;

const int N = 3e5 + 50;

int n, m, a[N];

int main() {
#ifdef ONLINE_JUDGE
#else
  freopen("r.txt", "r", stdin);
#endif
  ios::sync_with_stdio(false);
  cin >> n >> m;
  cout << (n + m - 1) / m;
}

Fixed submission:
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>

using namespace std;

const int N = 3e5 + 50;

int n, m, a[N];

int main() {
  ios::sync_with_stdio(false);
  cin >> n >> m;
  cout << (n + m - 1) / m;
}
Problem p02783 (C++)

Buggy submission (status: Runtime Error):
#include <bits/stdc++.h>
using namespace std;
int main() {
  int h, a;
  cin >> h >> a;
  return h % a ? h / a : ((h / a) + 1);
}

Fixed submission:
#include <bits/stdc++.h>
using namespace std;
int main() {
  int h, a;
  cin >> h >> a;
  int ans = h % a ? ((h / a) + 1) : h / a;
  cout << ans << endl;
  return 0;
}
Problem p02783 (C++)

Buggy submission (status: Runtime Error):
#define _CRT_SECURE_NO_WARNINGS
#include <bits/stdc++.h>
#include <unordered_map>
#include <unordered_set>
using namespace std;
typedef long long ll;
#define bay_bay return 0;
#define fori(n) for (int i = 0; i < n; ++i)
#define for1(n) for (int i = 1; i <= n; i += 3)
#define all(v) ((v).begin()), ((v).end())
#define sz(v) v.size()
#define endl "\n"
constexpr auto EPS = 1e-9;
#define ff fflush(stdout);
const int mod = 1000000007;
clock_t T;
#define ctime cerr << "Time : " << double(clock() - T) / CLOCKS_PER_SEC << endl
void GOAT() {
  std::ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  cout.tie(NULL);
#ifndef ONLINE_JUDGE
  freopen("input.txt", "r", stdin);
  // freopen("output.txt", "w", stdout);
#else
#endif
}
int main() {

  GOAT();
  int h, a;
  cin >> h >> a;
  (h % a == 0) ? cout << h / a : cout << (h / a) + 1;
}

Fixed submission:
#define _CRT_SECURE_NO_WARNINGS
#include <bits/stdc++.h>
#include <unordered_map>
#include <unordered_set>
using namespace std;
typedef long long ll;
#define bay_bay return 0;
#define fori(n) for (int i = 0; i < n; ++i)
#define for1(n) for (int i = 1; i <= n; i += 3)
#define all(v) ((v).begin()), ((v).end())
#define sz(v) v.size()
#define endl "\n"
constexpr auto EPS = 1e-9;
#define ff fflush(stdout);
const int mod = 1000000007;
clock_t T;
#define ctime cerr << "Time : " << double(clock() - T) / CLOCKS_PER_SEC << endl
void GOAT() {
  std::ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  cout.tie(NULL);
#ifndef ONLINE_JUDGE
  freopen("input.txt", "r", stdin);
  // freopen("output.txt", "w", stdout);
#else
#endif
}
int main() {

  // GOAT();
  int h, a;
  cin >> h >> a;
  (h % a == 0) ? cout << h / a : cout << (h / a) + 1;
}
Problem p02783 (C++)

Buggy submission (status: Time Limit Exceeded):
#include <bits/stdc++.h>
using namespace std;
int main() {
  int H, A;
  cin >> H >> A;
  for (int i = 0;; i++) {
    H = H - i * A;
    if (H <= 0) {
      cout << i << endl;
    }
  }
}


Fixed submission:
#include <bits/stdc++.h>
using namespace std;
int main() {
  int H, A;
  cin >> H >> A;
  if (H % A == 0)
    cout << H / A << endl;
  else
    cout << H / A + 1 << endl;
}
Problem p02783 (C++)

Buggy submission (status: Runtime Error):
#define _USE_MATH_DEFINES
#include <bits/stdc++.h>
#define ll long long
#define pb push_back
#define mp make_pair
#define ff first
#define ss second
#define vi vector<int>
#define br cout << "\n";
#define all(x) (x).begin(), (x).end()
#define tr(c, i) for (auto i : c)
#define pii pair<int, int>
#define fast_io()                                                              \
  ios_base::sync_with_stdio(false);                                            \
  cin.tie(nullptr)
#define pq                                                                     \
  priority_queue<pair<ll, pii>, vector<pair<ll, pii>>, greater<pair<ll, pii>>> \
      p; // container adapter makes ascending q
#define er(x) cout << x << " "
#define err(x, y) cout << x << " " << y
using namespace std;

const ll MAX = 1000 * 1000;
const int dx[] = {1, -1, 0, 0};
const int dy[] = {0, 0, 1, -1};
const int MOD = 1000 * 1000 * 1000 + 7;
const int N = 301;
const int INF = INT_MAX;
const int M = 200005;
int main() {
#ifndef ONLINE_JUDGE
  freopen("C:/Users/Abhudya/Desktop/input.txt", "r", stdin);
  freopen("C:/Users/Abhudya/Desktop/output.txt", "w", stdout);
#endif

  ll h, a;
  cin >> h >> a;
  cout << ((h + a - 1) / a);

  return 0;
}


Fixed submission:
#define _USE_MATH_DEFINES
#include <bits/stdc++.h>
#define ll long long
#define pb push_back
#define mp make_pair
#define ff first
#define ss second
#define vi vector<int>
#define br cout << "\n";
#define all(x) (x).begin(), (x).end()
#define tr(c, i) for (auto i : c)
#define pii pair<int, int>
#define fast_io()                                                              \
  ios_base::sync_with_stdio(false);                                            \
  cin.tie(nullptr)
#define pq                                                                     \
  priority_queue<pair<ll, pii>, vector<pair<ll, pii>>, greater<pair<ll, pii>>> \
      p; // container adapter makes ascending q
#define er(x) cout << x << " "
#define err(x, y) cout << x << " " << y
using namespace std;

const ll MAX = 1000 * 1000;
const int dx[] = {1, -1, 0, 0};
const int dy[] = {0, 0, 1, -1};
const int MOD = 1000 * 1000 * 1000 + 7;
const int N = 301;
const int INF = INT_MAX;
const int M = 200005;
int main() {

  ll h, a;
  cin >> h >> a;
  cout << ((h + a - 1) / a);

  return 0;
}
Problem p02784 (Python)

Buggy submission (status: Runtime Error):
H, N = map(int, input().split())
attacks = [*map(int, input().split())]
if sum(attacks) >= H:
    print("Yes")
else:
    print("No")


Fixed submission:
H, N = map(int, input().split())
attacks = list(map(int, input().split()))
if sum(attacks) >= H:
    print("Yes")
else:
    print("No")
Problem p02784 (C++)

Buggy submission (status: Runtime Error):
#include <stdio.h>
int main(void) {
  int H;
  int N;
  int T = 0;
  int array[10000];
  scanf("%d", &H);
  scanf("%d", &N);
  for (int i = 0; i < N; i++) {
    scanf("%d", &array[i]);
    T = T + array[i];
  }
  if (T >= H) {
    printf("Yes");
  }
  if (T < H) {
    printf("No");
  }
}

Fixed submission:
#include <stdio.h>
int main(void) {
  int H;
  int N;
  int T = 0;
  int array[100000];
  scanf("%d", &H);
  scanf("%d", &N);
  for (int i = 0; i < N; i++) {
    scanf("%d", &array[i]);
    T = T + array[i];
  }
  if (T >= H) {
    printf("Yes");
  }
  if (T < H) {
    printf("No");
  }
}
Problem p02784 (C++)

Buggy submission (status: Runtime Error):
#include <stdio.h>
#include <string.h>
int main(void) {
  int H, N, i;
  int A[N];
  int s = 0;
  scanf("%d %d", &H, &N);
  for (i = 0; i < N; i++) {
    scanf("%d", &A[i]);
  }
  for (i = 0; i < N; i++) {
    s = s + A[i];
  }
  if (s >= H) {
    printf("Yes\n");
  } else {
    printf("No\n");
  }
  return 0;
}

Fixed submission:
#include <stdio.h>
#include <string.h>
int main(void) {
  int H, N, i;
  int A[1000001];
  int s = 0;
  scanf("%d %d", &H, &N);
  for (i = 0; i < N; i++) {
    scanf("%d", &A[i]);
  }
  for (i = 0; i < N; i++) {
    s = s + A[i];
  }
  if (s >= H) {
    printf("Yes\n");
  } else {
    printf("No\n");
  }
  return 0;
}
Problem p02784 (C++)

Buggy submission (status: Runtime Error):
#include <stdio.h>
int main(void) {
  int h, n, a[1000], i, m;
  m = 0;
  scanf("%d %d", &h, &n);
  for (i = 0; i < n; i++) {
    scanf("%d", &a[i]);
  }
  for (i = 0; i < n; i++) {
    m += a[i];
  }
  if (m >= h) {
    printf("Yes\n");
  } else {
    printf("No\n");
  }
  return 0;
}

Fixed submission:
#include <stdio.h>
int main(void) {
  int h, n, a[100000], i, m;
  m = 0;
  scanf("%d %d", &h, &n);
  for (i = 0; i < n; i++) {
    scanf("%d", &a[i]);
  }
  for (i = 0; i < n; i++) {
    m += a[i];
  }
  if (m >= h) {
    printf("Yes\n");
  } else {
    printf("No\n");
  }
  return 0;
}
Problem p02784 (C++)

Buggy submission (status: Runtime Error):
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <map>
#include <queue>
#include <vector>

using namespace std;

typedef pair<int, int> P;
typedef long long ll;

ll mod = 1e9 + 7;

int main() {
  ll h;
  int n;
  ll a[10000];

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

  return 0;
}


Fixed submission:
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <map>
#include <queue>
#include <vector>

using namespace std;

typedef pair<int, int> P;
typedef long long ll;

ll mod = 1e9 + 7;

int main() {
  ll h;
  int n;
  ll a[100000];

  cin >> h >> n;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  ll sum = 0;
  for (int i = 0; i < n; 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 <bits/stdc++.h>
using namespace std;

int main() {
  int h, N;
  int a[10000];
  cin >> h >> N;
  for (int i = 0; i < N; ++i)
    cin >> a[i];

  int sum;
  for (int i = 0; i < N; ++i)
    sum += a[i];

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


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

int main() {
  int h, N;
  int a[100000];
  cin >> h >> N;
  for (int i = 0; i < N; ++i)
    cin >> a[i];

  int sum;
  for (int i = 0; i < N; ++i)
    sum += a[i];

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

Buggy submission (status: Runtime Error):
#include <bits/stdc++.h>
#define ll long long
#define int long long
#define MOD 1000000007
#define MAX 500005
#include <iomanip>
#define Need_for_speed(activated)                                              \
  ios_base ::sync_with_stdio(0);                                               \
  cin.tie(NULL);                                                               \
  cout.tie(NULL)
#define satisfy                                                                \
  ll t;                                                                        \
  cin >> t;                                                                    \
  while (t--)
#define inp(n)                                                                 \
  int n;                                                                       \
  cin >> n
#define mp make_pair
#define pb push_back
#define fore(i, a, b) for (ll i = a; i < b; i++)
#define x first
#define y second
using namespace std;

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

int32_t main() {
  Need_for_speed(activated);
  //    satisfy
  //    {}
  ll h, n;
  cin >> h >> n;
  ll s = 0;
  ll a[10005];
  for (ll i = 0; i < n; i++)
    cin >> a[i];
  for (ll i = 0; i < n; i++) {
    s += a[i];
  }
  if (s >= h)
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
  return 0;
}


Fixed submission:
#include <bits/stdc++.h>
#define ll long long
#define int long long
#define MOD 1000000007
#define MAX 500005
#include <iomanip>
#define Need_for_speed(activated)                                              \
  ios_base ::sync_with_stdio(0);                                               \
  cin.tie(NULL);                                                               \
  cout.tie(NULL)
#define satisfy                                                                \
  ll t;                                                                        \
  cin >> t;                                                                    \
  while (t--)
#define inp(n)                                                                 \
  int n;                                                                       \
  cin >> n
#define mp make_pair
#define pb push_back
#define fore(i, a, b) for (ll i = a; i < b; i++)
#define x first
#define y second
using namespace std;

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

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

Buggy submission (status: Runtime Error):
#include <algorithm>
#include <iostream>
#include <list>
#include <map>
#include <math.h>
#include <stdio.h>
#include <string>
#include <vector>

using namespace std;

int main() {
  long long int h, sum = 0;
  int n, a[10000];
  cin >> h >> n;
  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 <iostream>
#include <list>
#include <map>
#include <math.h>
#include <stdio.h>
#include <string>
#include <vector>

using namespace std;

int main() {
  long long int h, sum = 0;
  int n, a[100000];
  cin >> h >> n;
  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 <iostream>
#include <vector>
using namespace std;
int main() {
  long long h;
  long long n;
  cin >> h;
  cin >> n;
  long long A[10000 + 1];
  long long sum = 0;
  for (long long i = 0; i < n; i++) {
    cin >> A[i];
    sum += A[i];
  }
  if (h - sum <= 0) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
  return 0;
}


Fixed submission:
#include <iostream>
#include <vector>
using namespace std;
int main() {
  long long h;
  long long n;
  cin >> h;
  cin >> n;
  long long A[100000 + 1];
  long long sum = 0;
  for (long long i = 0; i < n; i++) {
    cin >> A[i];
    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 <algorithm>
#include <iostream>
#include <string>
#include <vector>
using namespace std;

int main() {
  int h, n;
  cin >> h >> n;
  int a[n];
  for (int i = 0; i < n; i++)
    cin >> n;
  string ans = "No";
  sort(a, a + n, std::greater<int>());
  for (int i = 0; i < n; i++) {
    h -= a[i];
    if (h <= 0) {
      ans = "Yes";
      break;
    }
  }
  cout << ans << endl;
}

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

int main() {
  int h, n;
  cin >> h >> n;
  int a[n];
  for (int i = 0; i < n; i++)
    cin >> a[i];
  string ans = "No";
  sort(a, a + n, std::greater<int>());
  for (int i = 0; i < n; i++) {
    h -= a[i];
    if (h <= 0) {
      ans = "Yes";
      break;
    }
  }
  cout << ans << endl;
}
Problem p02784 (C++)

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

int main() {
  int n, KO, ACE = 0;
  cin >> n >> KO;
  int a[KO + 1];

  for (int i = 1; i <= n; i++) {
    cin >> a[i];
    ACE += a[i];
  }

  if (ACE >= n)
    cout << "Yes" << endl;
  else
    cout << "No" << endl;

  return 0;
}

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

int main() {
  int n, KO, ACE = 0;
  cin >> n >> KO;
  int a[KO + 1];

  for (int i = 1; i <= KO; i++) {
    cin >> a[i];
    ACE += a[i];
  }

  if (ACE >= n)
    cout << "Yes" << endl;
  else
    cout << "No" << endl;

  return 0;
}
Problem p02784 (C++)

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

int main(void) {
  long int H, N;
  cin >> H >> N;
  long int A[11000];
  long int count = 0;
  for (int i = 0; i < N; i++) {
    cin >> A[i];
    count += A[i];
  }
  if (count >= H) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
  return 0;
}

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

int main(void) {
  long int H, N;
  cin >> H >> N;
  long int A[110000];
  long int count = 0;
  for (int i = 0; i < N; i++) {
    cin >> A[i];
    count += A[i];
  }
  if (count >= 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;

int main() {
  int H, N;
  cin >> H >> N;
  int i, A, sum = 0;
  for (i = 0; i < N; i++) {
    cin >> A;
    sum += A;
    if (sum >= H) {
      cout << "Yes" << endl;
      exit(1);
    }
  }
  if (i == N) {
    cout << "No" << endl;
  }
  return 0;
}


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

int main() {
  int H, N;
  cin >> H >> N;
  int i, A, sum = 0;
  for (i = 0; i < N; i++) {
    cin >> A;
    sum += A;
    if (sum >= H) {
      cout << "Yes" << endl;
      exit(0);
    }
  }
  if (i == N) {
    cout << "No" << endl;
  }
  return 0;
}
Problem p02784 (C++)

Buggy submission (status: Runtime Error):
#include <iostream>
using namespace std;
int main() {
  int H, N;
  cin >> H >> N;
  int A[10010];
  int total = 0;
  for (int i = 0; i < N; ++i) {
    cin >> A[i];
    total += A[i];
  }

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

Fixed submission:
#include <iostream>
using namespace std;
int main() {
  int H, N;
  cin >> H >> N;
  int A[100010];
  int total = 0;
  for (int i = 0; i < N; ++i) {
    cin >> A[i];
    total += A[i];
  }

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

Buggy submission (status: Runtime Error):
#include <bits/stdc++.h>
#define F first
#define S second
#define mp make_pair
#define pb push_back
#define ll long long
#define mod 1000000007
#define M 1000000
using namespace std;

int isprime(ll n) {
  if (n == 1)
    return 0;
  if (n == 2 || n == 3)
    return 1;
  for (int i = 2; i * i <= n; i++) {
    if (n % i == 0)
      return 0;
  }
  return 1;
}

void answer() {
  ll n, ans = 0, m, p = 0, x;
  cin >> n >> m;
  ll a[n];
  for (int i = 0; i < m; i++)
    cin >> a[i];
  sort(a, a + m);
  for (int i = 0; i < m; i++) {
    ans += a[i];
  }
  if (ans >= n)
    cout << "Yes";
  else
    cout << "No";
}

int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int q;
  // cin>>q; while(q--)
  answer();
  return 0;
}

Fixed submission:
#include <bits/stdc++.h>
#define F first
#define S second
#define mp make_pair
#define pb push_back
#define ll long long
#define mod 1000000007
#define M 1000000
using namespace std;

int isprime(ll n) {
  if (n == 1)
    return 0;
  if (n == 2 || n == 3)
    return 1;
  for (int i = 2; i * i <= n; i++) {
    if (n % i == 0)
      return 0;
  }
  return 1;
}

void answer() {
  ll n, ans = 0, m, p = 0, x;
  cin >> n >> m;
  ll a[m];
  for (int i = 0; i < m; i++)
    cin >> a[i];
  sort(a, a + m);
  for (int i = 0; i < m; i++) {
    ans += a[i];
  }
  if (ans >= n)
    cout << "Yes";
  else
    cout << "No";
}

int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int q;
  // cin>>q; while(q--)
  answer();
  return 0;
}
Problem p02784 (C++)

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

using namespace std;

const int MAX_N = 10000;

int main() {
  int H, N, A[MAX_N];
  cin >> H >> N;

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

  for (int i = 0; i < N; i++) {
    H -= A[i];
    if (H <= 0) {
      cout << "Yes" << endl;
      exit(0);
    }
  }

  cout << "No" << endl;
}


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

using namespace std;

const int MAX_N = 100000;

int main() {
  int H, N, A[MAX_N];
  cin >> H >> N;

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

  for (int i = 0; i < N; i++) {
    H -= A[i];
    if (H <= 0) {
      cout << "Yes" << endl;
      exit(0);
    }
  }

  cout << "No" << endl;
}
Problem p02784 (Python)

Buggy submission (status: Runtime Error):
H, N = map(int, input().split())
total_A = sum(list(map(int, input.split())))

if H <= total_A:
    print("Yes")
else:
    print("No")


Fixed submission:
H, N = map(int, input().split())
total_A = sum(list(map(int, input().split())))

if H <= total_A:
    print("Yes")
else:
    print("No")
Problem p02784 (C++)

Buggy submission (status: Runtime Error):
#include <algorithm>
#include <iostream>
#include <queue>
#include <string>
#include <vector>
#define print(n) std::cout << n << std::endl
#define print_no_indention(n) std::cout << n
using namespace std;

int main() {
  int h, n;
  // h = 10;
  // n = 3;
  cin >> h >> n;
  int sum = 0;
  vector<int> a;
  for (int i = 0; i < n; ++i) {
    cin >> a.at(i);
    sum += a.at(i);
  }
  if (sum >= h)
    print("Yes");
  else
    print("No");
}

Fixed submission:
#include <algorithm>
#include <iostream>
#include <queue>
#include <string>
#include <vector>
#define print(n) std::cout << n << std::endl
#define print_no_indention(n) std::cout << n
using namespace std;

int main() {
  int h, n;
  // h = 10;
  // n = 3;
  cin >> h >> n;
  int sum = 0;
  vector<int> a(n);
  for (int i = 0; i < n; ++i) {
    cin >> a.at(i);
    sum += a.at(i);
  }
  if (sum >= h)
    print("Yes");
  else
    print("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 rep2(s, i, n) for (int i = (int)s; i < (int)(n); i++)
#define pb push_back

int main() {
  int h, n, sum = 0;
  cin >> h >> n;
  vector<int> a;
  rep(i, n) {
    cin >> a[i];
    sum += a[i];
  }
  string ans = "Yes";
  if (sum < h)
    ans = "No";
  cout << ans << endl;

  return 0;
}


Fixed submission:
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep2(s, i, n) for (int i = (int)s; i < (int)(n); i++)
#define pb push_back

int main() {
  int h, n, sum = 0;
  cin >> h >> n;
  vector<int> a(100001);
  rep(i, n) {
    cin >> a[i];
    sum += a[i];
  }
  string ans = "Yes";
  if (sum < h)
    ans = "No";
  cout << ans << endl;

  return 0;
}
Problem p02784 (C++)

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

int main() {
  int a, b, c, i; // aは相手、ｂは種類
  int t[100];     // 必殺のダメージ
  c = 0;
  cin >> a >> b;

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

  for (i = 0; i < b; i++) {
    c = c + t[i];
  }
  i = a % b;
  if (c >= a) {
    cout << "Yes";
  } else {

    cout << "No";
  }
}

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

int main() {
  int a, b, c, i; // aは相手、ｂは種類
  int t[1000000]; // 必殺のダメージ
  c = 0;
  cin >> a >> b;

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

  for (i = 0; i < b; i++) {
    c = c + t[i];
  }
  i = a % b;
  if (c >= a) {
    cout << "Yes";
  } else {

    cout << "No";
  }
}
Problem p02784 (C++)

Buggy submission (status: Time Limit Exceeded):
#include <algorithm>
#include <assert.h>
#include <bitset>
#include <cfloat>
#include <complex>
#include <deque>
#include <fstream>
#include <functional>
#include <iomanip>
#include <iostream>
#include <limits.h>
#include <list>
#include <map>
#include <math.h>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <string.h>
#include <string>
#include <time.h>
#include <unordered_map>
#include <unordered_set>
#include <vector>
#define rep(i, n) for (int i = 0; i < n; i++)
#define REP(i, n) for (int i = 1; i <= n; i++)
#define ll long long
using namespace std;

int main() {

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

  for (int i = 0; 0 < n; i++) {
    int a;
    cin >> a;
    h -= a;
  }

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

Fixed submission:
#include <algorithm>
#include <assert.h>
#include <bitset>
#include <cfloat>
#include <complex>
#include <deque>
#include <fstream>
#include <functional>
#include <iomanip>
#include <iostream>
#include <limits.h>
#include <list>
#include <map>
#include <math.h>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <string.h>
#include <string>
#include <time.h>
#include <unordered_map>
#include <unordered_set>
#include <vector>
#define rep(i, n) for (int i = 0; i < n; i++)
#define REP(i, n) for (int i = 1; i <= n; i++)
#define ll long long
using namespace std;

int main() {

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

  for (int i = 0; i < n; i++) {
    int a;
    cin >> a;
    h -= a;
  }

  if (h <= 0) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
  return 0;
}
Problem p02784 (C++)

Buggy submission (status: Runtime Error):
#include <algorithm>
#include <cassert>
#include <cmath>
#include <iostream>
#include <map>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string>
#include <time.h>
#include <vector>
using namespace std;

int main() {
  int i, j;
  int H;
  int N;
  int sum = 0;
  int A[20000];
  cin >> H >> N;
  for (i = 0; i < N; ++i) {
    cin >> A[i];
  }
  for (i = 0; i < N; ++i) {
    sum += A[i];
  }
  if (sum >= H) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
}

Fixed submission:
#include <algorithm>
#include <cassert>
#include <cmath>
#include <iostream>
#include <map>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string>
#include <time.h>
#include <vector>
using namespace std;

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

Buggy submission (status: Runtime Error):
#include <bits/stdc++.h>
#define Would
#define you
#define please
#define mp make_pair
#define pb push_back
#define INF 1000000000000
#define modulo 1000000007
#define ii pair<int, int>
#define int long long int
using namespace std;
map<int, int> performans;
int32_t main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  freopen("q.gir", "r", stdin);
  freopen("q.cik", "w", stdout);
  int a, b, c;
  cin >> a >> b;
  for (int i = 0; i < b; i++) {
    cin >> c;
    a -= c;
  }
  if (a <= 0)
    cout << "Yes";
  else
    cout << "No";
  Would you please return 0;
}

Fixed submission:
#include <bits/stdc++.h>
#define Would
#define you
#define please
#define mp make_pair
#define pb push_back
#define INF 1000000000000
#define modulo 1000000007
#define ii pair<int, int>
#define int long long int
using namespace std;
map<int, int> performans;
int32_t main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int a, b, c;
  cin >> a >> b;
  for (int i = 0; i < b; i++) {
    cin >> c;
    a -= c;
  }
  if (a <= 0)
    cout << "Yes";
  else
    cout << "No";
  Would you please return 0;
}
Problem p02784 (C++)

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

using namespace std;

typedef pair<int, bool> Pair;

int main() {

  int H, N;
  int A[10000];

  cin >> H >> N;

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

  for (int i = 0; i < N; ++i)
    H = H - A[i];

  if (H > 0)
    cout << "No" << endl;
  else
    cout << "Yes" << endl;

  cout << endl;

  return 0;
}

Fixed submission:
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <iostream>
#include <map>
#include <string>
#include <utility>
#include <vector>

using namespace std;

typedef pair<int, bool> Pair;

int main() {

  int H, N;
  int A[100000];

  cin >> H >> N;

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

  for (int i = 0; i < N; ++i)
    H = H - A[i];

  if (H > 0)
    cout << "No" << endl;
  else
    cout << "Yes" << endl;

  cout << endl;

  return 0;
}
Problem p02784 (C++)

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

int main() {
  int a, b, sum = 0;
  cin >> a >> b;
  int ara[a];
  for (int i = 0; i < b; i++)
    cin >> ara[i];
  for (int i = 0; i < b; i++) {
    sum += ara[i];
  }
  if (sum >= a)
    cout << "Yes" << endl;
  else
    cout << "No" << endl;

  return 0;
}


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

int main() {
  int a, b, sum = 0;
  cin >> a >> b;
  int ara[b];
  for (int i = 0; i < b; i++)
    cin >> ara[i];
  for (int i = 0; i < b; i++) {
    sum += ara[i];
  }
  if (sum >= a)
    cout << "Yes" << endl;
  else
    cout << "No" << endl;

  return 0;
}