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

#include <algorithm>
#include <bitset>
#include <cassert>
#include <cmath>
#include <complex>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <time.h>
#include <tuple>
#include <utility>
#include <vector>
#define ll long long
#define double long double
#define itn int
#define endl '\\n'
#define co(ans) cout << ans << endl;
#define COYE cout << "YES" << endl;
#define COYe cout << "Yes" << endl;
#define COye cout << "yes" << endl;
#define CONO cout << "NO" << endl;
#define CONo cout << "No" << endl;
#define COno cout << "no" << endl;
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define FFOR(i, a, b) for (int i = (a); i <= (b); ++i)
#define REP(i, n) FOR(i, 0, n)
#define RREP(i, n) FFOR(i, 1, n)
#define ALL(V) ((V).begin(), (V).end())
#define SORT(V) sort((V).begin(), (V).end())
#define REVERSE(V) reverse((V).begin(), (V).end())
#define INF ((1LaL << 62) - (1LL << 31))
#define EPS 1e-10
#define PI 3.141592653589793238
#define MOD 1000000007
#define MAX 5100000
template <class T> bool chmax(T &a, const T &b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T> bool chmin(T &a, const T &b) {
  if (b < a) {
    a = b;
    return 1;
  }
  return 0;
}
using namespace std;

int main() {
  unsigned long long X, L = 100, cnt = 0;
  cin >> X;

  while (X > L) {
    L *= 1.01;
    cnt++;
  }

  cout << cnt << endl;
}

Error: TLE

Fixed submission:

#include <algorithm>
#include <bitset>
#include <cassert>
#include <cmath>
#include <complex>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <time.h>
#include <tuple>
#include <utility>
#include <vector>
#define ll long long
#define double long double
#define itn int
#define endl '\\n'
#define co(ans) cout << ans << endl;
#define COYE cout << "YES" << endl;
#define COYe cout << "Yes" << endl;
#define COye cout << "yes" << endl;
#define CONO cout << "NO" << endl;
#define CONo cout << "No" << endl;
#define COno cout << "no" << endl;
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define FFOR(i, a, b) for (int i = (a); i <= (b); ++i)
#define REP(i, n) FOR(i, 0, n)
#define RREP(i, n) FFOR(i, 1, n)
#define ALL(V) ((V).begin(), (V).end())
#define SORT(V) sort((V).begin(), (V).end())
#define REVERSE(V) reverse((V).begin(), (V).end())
#define INF ((1LaL << 62) - (1LL << 31))
#define EPS 1e-10
#define PI 3.141592653589793238
#define MOD 1000000007
#define MAX 5100000
template <class T> bool chmax(T &a, const T &b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T> bool chmin(T &a, const T &b) {
  if (b < a) {
    a = b;
    return 1;
  }
  return 0;
}
using namespace std;

int main() {
  ll X, L = 100ll, cnt = 0;
  cin >> X;

  while (X > L) {
    L *= 101;
    L /= 100;
    cnt++;
  }

  cout << cnt << endl;
}
Problem p02694 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <bits/stdc++.h>

using namespace std;
#define ll long long int

int main() {
  ll x;
  cin >> x;
  int cnt = 0;
  ll amt = 100;
  while (1) {
    amt = amt + amt / 100;
    cnt++;
    if (amt >= x)
      break;
  }
  cout << cnt << endl;
}


Error: TLE

Fixed submission:

#include <bits/stdc++.h>

using namespace std;
#define ll long long int

int main() {
  ll x;
  cin >> x;
  int cnt = 0;
  int amt = 100;
  while (1) {
    amt = amt + amt / 100;
    cnt++;
    if (amt >= x)
      break;
  }
  cout << cnt << endl;
}
Problem p02694 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, c = 0;
  cin >> n;
  long long p = 100;
  while (p < n) {
    p = floor(1.01 * p);
    c++;
  }
  cout << c;
}


Error: TLE

Fixed submission:

#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int x;
  cin >> x;
  int s = 0, p = 100;
  while (x > p) {
    p += p / 100;
    s++;
  }
  cout << s;
}
Problem p02694 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <bits/stdc++.h>
using namespace std;
int main() {
  long long a, cnt = 100;
  cin >> a;
  for (int i = 0;; i++) {
    cnt = cnt + cnt / 100;
    if (cnt >= a) {
      cout << i + 1;
      return 0;
    }
  }
  return 0;
}


Error: TLE

Fixed submission:

#include <bits/stdc++.h>
using namespace std;
int main() {
  long long a, cnt = 100;
  cin >> a;
  for (int i = 0;; i++) {
    cnt = cnt + cnt / 100;
    if (cnt == a) {
      cout << i + 1;
      return 0;
    }
  }
  return 0;
}
Problem p02694 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <iostream>

int main() {
  long long int X;
  int year = 0;
  long long int money = 100;
  std::cin >> X;
  for (; money < X; year++) {
    money += money / 100;
  }
  std::cout << year << std::endl;
}

Error: TLE

Fixed submission:

#include <iostream>

int main() {
  long long int X;
  int year = 0, money = 100;
  std::cin >> X;
  for (; money < X; year++) {
    money *= 1.01;
  }
  std::cout << year << std::endl;
}
Problem p02694 (C++) — buggy submission, verdict: Time Limit Exceeded

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

int main() {
  long X;
  cin >> X;
  long now = 100, cnt = 0;
  while (now < X)
    now += now / 100, cnt++;
  cout << cnt << "\\n";
}

Error: TLE

Fixed submission:

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

int main() {
  int X;
  cin >> X;
  int now = 100, cnt = 0;
  while (now < X)
    now += now / 100, cnt++;
  cout << cnt << "\\n";
}
Problem p02694 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < n; i++)
#define rep2(i, a, n) for (int i = a; i < n; i++)
using namespace std;
long long X;
int main() {
  cin >> X;
  long long res = 0;
  long long money = 100;
  while (money < X) {
    money = money * 1.01;
    res++;
  }
  cout << res << endl;
  return 0;
}


Error: TLE

Fixed submission:

#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < n; i++)
#define rep2(i, a, n) for (int i = a; i < n; i++)
using namespace std;
long long X;
int main() {
  cin >> X;
  long long res = 0;
  long long money = 100;
  while (money < X) {
    money = money * 101 / 100;
    res++;
  }
  cout << res << endl;
  return 0;
}
Problem p02694 (C++) — buggy submission, verdict: Time Limit Exceeded

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

int main() {
  long long X, count = 0;
  cin >> X;
  long long price = 100;
  while (price < X) {
    count++;
    long long z = price / 100;
    price += z;
  }
  cout << count << endl;
}


Error: TLE

Fixed submission:

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

int main() {
  int X, count = 0;
  cin >> X;
  int price = 100;
  while (price < X) {
    count++;
    int z = price / 100;
    price += z;
  }
  cout << count << endl;
}
Problem p02694 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <iostream>
using namespace std;

int main(void) {
  long long X;
  cin >> X;

  long long N = 100;
  int count = 0;

  while (1) {
    N += N / 100;
    count++;

    if (N >= X) {
      break;
    }
  }

  cout << count << endl;

  return 0;
}

Error: TLE

Fixed submission:

#include <iostream>
using namespace std;

int main(void) {
  int X;
  cin >> X;

  int N = 100;
  int count = 0;

  while (1) {
    N = N * 1.01;
    count++;

    if (N >= X) {
      break;
    }
  }

  cout << count << endl;

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

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

int main() {
  long long k;
  cin >> k;
  int ans = 0;
  long long d = 100.0;
  while (d < k) {
    d = floor(1.01 * d);
    ans++;
  }
  cout << ans << endl;
  return 0;
}

Error: TLE

Fixed submission:

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

int main() {
  long long k;
  cin >> k;
  int ans = 0;
  int d = 100;
  while (d < k) {
    d = floor(1.01 * d);
    ans++;
  }
  cout << ans << endl;
  return 0;
}
Problem p02694 (C++) — buggy submission, verdict: Runtime Error

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

int main() {
  long long x;
  cin >> x;
  long long s = 100;
  int res = 0;
  while (s < x) {
    s = s + s * 0.01;
    res++;
  }
  cout << res;
  return 0;
}

Error: 3

Fixed submission:

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

int main() {
  long long x;
  cin >> x;
  long long s = 100;
  int res = 0;
  while (s < x) {
    s = s + s * 0.01;
    res++;
  }
  cout << res;
  return res;
}
Problem p02694 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <algorithm>
#include <array>
#include <bitset>
#include <cstdlib>
#include <ctime>
#include <functional>
#include <iomanip>
#include <iostream>
#include <limits>
#include <map>
#include <numeric>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <type_traits>
#include <utility>
#include <vector>

using namespace std;

int main() {
  long long X;

  cin >> X;

  long long m = 100, count = 0;

  while (m < X) {
    m += m / 100;
    count++;
  }

  cout << count << endl;
}

Error: TLE

Fixed submission:

#include <algorithm>
#include <array>
#include <bitset>
#include <cstdlib>
#include <ctime>
#include <functional>
#include <iomanip>
#include <iostream>
#include <limits>
#include <map>
#include <numeric>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <type_traits>
#include <utility>
#include <vector>

#ifdef _MSC_FULL_VER
#endif

using namespace std;

int main() {
  int m = 100;
  int X, count = 0;

  cin >> X;

  while (m < X) {
    m *= 1.01;
    count++;
  }
  cout << count << endl;
}
Problem p02694 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <iostream>
using namespace std;
int main() {
  long long X;
  cin >> X;
  long long P = 100;
  int i = 0;
  while (P < X) {
    P += P / 100;
    i++;
  }
  cout << i << endl;
}

Error: TLE

Fixed submission:

#include <iostream>
using namespace std;
int main() {
  long long X;
  cin >> X;
  long long k = 100;
  int i = 0;
  while (true) {
    if (k >= X) {
      cout << i << endl;
      return 0;
    }
    k *= 101;
    k /= 100;
    i++;
  }
}
Problem p02694 (C++) — buggy submission, verdict: Time Limit Exceeded

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

int main() {
  long long x, y = 100, cnt = 0;
  cin >> x;

  while (true) {
    if (x <= y) {
      cout << cnt << endl;
      return 0;
    }
    cnt++;
    y = y + y / 100;
  }
}


Error: TLE

Fixed submission:

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

int main() {
  long long x, y = 100, cnt = 0;
  cin >> x;

  while (true) {
    if (x <= y) {
      cout << cnt << endl;
      return 0;
    }
    cnt++;
    y = y * 20.1 / 20;
  }
}
Problem p02694 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <algorithm>
#include <cmath>
#include <iostream>
#include <map>
#include <queue>
#include <string>
#include <vector>
using namespace std;

int main() {

  long long X;
  long long ans = 100;
  int i = 0;
  cin >> X;

  while (ans < X) {
    ans += ans / 100;
    i++;
  }

  cout << i;
}

Error: TLE

Fixed submission:

#include <algorithm>
#include <cmath>
#include <iostream>
#include <map>
#include <queue>
#include <string>
#include <vector>
using namespace std;

int main() {

  long long X;
  long long ans = 100;
  int i = 0;
  cin >> X;

  while (ans < X) {
    ans *= 101;
    ans /= 100;
    i++;
  }

  cout << i;
}
Problem p02694 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep2(i, a, b) for (int i = (int)(a); i < (int)(b); i++)
#define FOR(i) for (cin >> i; i > 0; i--)
#define elif else if
#define pb push_back
#define ll long long
#define mp make_pair
#define all(x) x.begin(), x.end()
#define re(x)                                                                  \\
  {                                                                            \\
    cout << x << endl;                                                         \\
    return 0;                                                                  \\
  }
// #define x first
// #define y second

using namespace std;
ll a, k = 0, m = 100;
int main() {
  cin >> a;
  while (m < a) {
    k++;
    m = m / 100 + m;
  }
  re(k) return 0;
}

Error: TLE

Fixed submission:

#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep2(i, a, b) for (int i = (int)(a); i < (int)(b); i++)
#define FOR(i) for (cin >> i; i > 0; i--)
#define elif else if
#define pb push_back
#define ll long long
#define mp make_pair
#define all(x) x.begin(), x.end()
#define re(x)                                                                  \\
  {                                                                            \\
    cout << x << endl;                                                         \\
    return 0;                                                                  \\
  }
// #define x first
// #define y second

using namespace std;
int a, k = 0, m = 100;
int main() {
  cin >> a;
  while (m < a) {
    k++;
    m *= 1.01;
  }
  re(k) return 0;
}
Problem p02694 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <iostream>
#include <math.h>

using namespace std;
/*
double logn(double base, double antilog) {
    return log(antilog) / log((double)base);
}
*/
int main() {
  long long st = 100;
  long long n = 0, cnt = 0;
  // double tmp1,tmp2;

  cin >> n;
  while (1) {
    st = st + st / 100;
    cnt++;
    if (st >= n) {
      cout << cnt << "\\n";
      break;
    }
  }
  /*
  tmp2=logn(1.01,tmp1);
  tmp2=(int)tmp2+1;
  */
  // cout<<cnt<<"\\n";

  return 0;
}

Error: TLE

Fixed submission:

#include <iostream>
using namespace std;

int main() {
  int st = 100, n = 0, cnt = 0;

  cin >> n;

  while (1) {
    cnt++;
    st = st * 1.01;

    if (st >= n) {
      cout << cnt << "\\n";
      break;
    }
  }
  return 0;
}
Problem p02694 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define all(v) v.begin(), v.end()
using ll = long long;
using namespace std;
int main() {
  ll x;
  cin >> x;
  ll y = 100;
  ll n = 0;
  while (1) {
    y *= 1.01;
    n++;
    if (y >= x) {
      cout << n;
      return 0;
    }
  }
}

Error: TLE

Fixed submission:

#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define all(v) v.begin(), v.end()
using ll = long long;
using namespace std;
int main() {
  int x;
  cin >> x;
  int y = 100;
  ll n = 0;
  while (1) {
    y *= 1.01;
    n++;
    if (y >= x) {
      cout << n;
      return 0;
    }
  }
}
Problem p02694 (C++) — buggy submission, verdict: Time Limit Exceeded

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

int main() {
  long long x, f = 100, count = 0;
  cin >> x;
  while (f < x) {
    f *= 1.01;
    count += 1;
  }
  cout << count << endl;
}


Error: TLE

Fixed submission:

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

int main() {
  int X;
  int A = 100;
  cin >> X;
  for (int i = 0;; i++) {
    A *= 1.01;
    if (A >= X) {
      cout << i + 1 << endl;
      return 0;
    }
  }
}
Problem p02694 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <iostream>

using namespace std;

int main() {
  long x, d = 100, y = 0;
  cin >> x;
  while (d < x) {
    d = d * 1.01;
    y++;
  }
  cout << y << endl;

  return 0;
}


Error: TLE

Fixed submission:

#include <iostream>

using namespace std;

int main() {
  int x, d = 100, y = 0;
  cin >> x;
  while (d < x) {
    d = d * 1.01;
    y++;
  }
  cout << y << endl;

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

#include <bits/stdc++.h>
#define ll long long
using namespace std;
int main() {
  ll x, n = 100;
  int i = 1;
  scanf("%lld", &x);
  for (i = 1; i <= 4000; ++i) {
    n *= 1.01;
    if (n >= x)
      break;
  }

  printf("%d", i);
}

Error: TLE

Fixed submission:

#include <bits/stdc++.h>
#define ll long long
using namespace std;
int main() {
  ll x, n = 100, sum = 0;
  scanf("%lld", &x);
  while (n != x) {
    n *= 1.01;
    sum++;
  }

  printf("%lld", sum);
}
Problem p02694 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <bits/stdc++.h>
using namespace std;
int main() {
  long long a, b, i;
  b = 100;
  i = 0;
  cin >> a;
  while (b < a) {
    long long c = b / 100;
    b = b + c;
    i++;
  }
  cout << i;
}

Error: TLE

Fixed submission:

#include <bits/stdc++.h>
using namespace std;
int main() {
  long long a, b, i;
  b = 100;
  i = 0;
  cin >> a;
  while (b < a) {
    b = (b * 101) / 100;
    i++;
  }
  cout << i;
}
Problem p02694 (C++) — buggy submission, verdict: Time Limit Exceeded

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

int main() {
  long long int N, M, K = 100;
  string S;

  cin >> N;
  long long int cnt = 0;
  while (K < N) {
    cnt++;
    K *= 1.01;
  }

  cout << cnt << endl;
}


Error: TLE

Fixed submission:

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

int main() {
  int N, M, K = 100;
  string S;

  cin >> N;
  int cnt = 0;
  while (K < N) {
    cnt++;
    K *= 1.01;
  }

  cout << cnt << endl;
}
Problem p02694 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <iostream>
using namespace std;

int main() {
  long x, yokin = 100, cnt = 0;
  cin >> x;
  while (x > yokin) {
    cnt++;
    yokin = (double)yokin * 1.01;
  }
  cout << cnt;
  return 0;
}


Error: TLE

Fixed submission:

#include <iostream>
using namespace std;

int main() {
  int x, yokin = 100, cnt = 0;
  cin >> x;
  while (x > yokin) {
    cnt++;
    yokin = (double)yokin * 1.01;
  }
  cout << cnt;
  return 0;
}
Problem p02694 (C++) — buggy submission, verdict: Time Limit Exceeded

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

int main() {
  long long x;
  long long a = 100;
  cin >> x;
  long long i;
  for (i = 0; a < x; i++) {
    a += (a / 100);
  }
  cout << i << endl;
}


Error: TLE

Fixed submission:

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

int main() {
  long long x;
  int a = 100;
  cin >> x;
  int i;
  for (i = 0; a < x; i++) {
    a += (a / 100);
  }
  cout << i << endl;
}
Problem p02694 (C++) — buggy submission, verdict: Time Limit Exceeded

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

int main() {
  ll x;
  cin >> x;
  ll n = 100;
  ll i = 0;
  while (x > n) {
    n *= 1.01;
    i++;
  }
  cout << i;
  return 0;
}

Error: TLE

Fixed submission:

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

int main() {
  int x;
  cin >> x;
  int n = 100;
  int i = 0;
  while (x > n) {
    n *= 1.01;
    i++;
  }
  cout << i;
  return 0;
}
Problem p02694 (C++) — buggy submission, verdict: Time Limit Exceeded

// codeforces
//
#include "bits/stdc++.h"
using namespace std;
#define pb push_back
#define F first
#define S second
// #define inf 1e9+7
#define int64 long long
#define VI vector<int>
#define all(v) v.begin(), v.end()
#define inpv(v)                                                                \\
  for (auto &x : v)                                                            \\
  cin >> x
#define pii pair<int, int>
#define CASES                                                                  \\
  int tt;                                                                      \\
  cin >> tt;                                                                   \\
  while (tt--)
#define for0(i, n) for (int i = 0; i < n; i++)
const int64 inf = 1e9 + 7;
const char nwl = '\\n';

int main() {
  // ur code
  int64 n;
  cin >> n;
  int64 s = 100;
  int t = 0;
  while (s < n) {
    s = s + s / 100;
    t++;
  }
  cout << t;

  return 0;
}


Error: TLE

Fixed submission:

// codeforces
//
#include "bits/stdc++.h"
using namespace std;
#define pb push_back
#define F first
#define S second
// #define inf 1e9+7
#define int64 long long
#define VI vector<int>
#define all(v) v.begin(), v.end()
#define inpv(v)                                                                \\
  for (auto &x : v)                                                            \\
  cin >> x
#define pii pair<int, int>
#define CASES                                                                  \\
  int tt;                                                                      \\
  cin >> tt;                                                                   \\
  while (tt--)
#define for0(i, n) for (int i = 0; i < n; i++)
const int64 inf = 1e9 + 7;
const char nwl = '\\n';

int main() {
  // ur code
  int64 n;
  cin >> n;
  int64 s;
  int t = 0;
  while (s < n) {
    s = s + s / 100;
    t++;
  }
  cout << t;

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

#include <cstdio>
#include <iostream>
using namespace std;
typedef long long ll;
int main() {
  ll yen = 100, x, res = 0;
  scanf("%lld", &x);
  while (yen < x) {
    yen = yen + yen / 100;
    res++;
  }
  printf("%lld\\n", res);
  return 0;
}


Error: TLE

Fixed submission:

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

#define LL long long

int main() {
  LL num;
  int i, sum, temp;
  cin >> num;
  i = 0;
  sum = 100;
  while (num > sum) {
    i++;
    temp = sum / 100;
    sum += temp;
  }
  cout << i << endl;
  return 0;
}
Problem p02694 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <bits/stdc++.h>
using namespace std;
long long dp[4000];
int main() {
  long long n, i;
  cin >> n;
  // cout<<n<<endl;
  dp[0] = 100;
  for (i = 1; dp[i - 1] < n; i++) {
    dp[i] = floor(dp[i - 1] * 1.01);
    // cout<<1<<endl;
  }
  cout << i - 1 << endl;
  return 0;
}


Error: TLE

Fixed submission:

#include <iostream>
using namespace std;
int main() {
  long long int yen;
  int year = 0;
  int i = 100;
  cin >> yen;
  do {
    i += (0.01 * i);
    year++;
  } while (i < yen);
  cout << year << endl;
  return 0;
}
Problem p02694 (C++) — buggy submission, verdict: Time Limit Exceeded

#define ll long long
#define pb push_back
#define mp make_pair
#define GCD(a, b) __gcd(a, b);
#define FRU freopen("out.txt", "w", stdout)
#define FRO freopen("in.txt", "r", stdin)

#include <bits/stdc++.h>
using namespace std;
int main() {
  ll pay, s = 0, c = 100;
  cin >> pay;
  while (pay > c) {

    c = c + c / 100;
    s++;
  }
  cout << s;
}


Error: TLE

Fixed submission:

#include <bits/stdc++.h>
using namespace std;
#define endl '\\n'
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int p = 100, x, cnt = 0;
  cin >> x;
  while (p < x) {
    p = p + p / 100;
    cnt++;
  }
  cout << cnt;
}
Problem p02694 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <cmath>
#include <iostream>

using namespace std;

int main() {
  long long x;

  cin >> x;

  long long b = 100;
  int cnt = 1;
  while (1) {
    b *= 1.01;
    // cout << b << endl;
    if (b >= x) {
      cout << cnt << endl;
      break;
    }
    cnt++;
  }
}

Error: TLE

Fixed submission:

#include <iostream>

using namespace std;

int main() {
  int x;

  cin >> x;

  int cnt = 0;
  int c = 100;
  while (1) {
    if (c >= x) {
      cout << cnt << endl;
      return 0;
    }
    c *= 1.01;

    cnt++;
  }
}
Problem p02694 (C++) — buggy submission, verdict: Time Limit Exceeded

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

int main() {
  long long x;
  cin >> x;
  long long p = 100;
  int step = 0;
  while (p < x) {
    p += p / 100;
    step++;
  }
  cout << step << endl;
}


Error: TLE

Fixed submission:

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

int main() {
  int x;
  cin >> x;
  int p = 100;
  int step = 0;
  while (p < x) {
    p += p / 100;
    step++;
  }
  cout << step << endl;
}