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

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

int main() {
  long long X, sum = 100, count = 0;
  cin >> X;

  while (X > sum) {
    long long intr = sum * 1 / 100;
    sum += intr;
    count++;
  }
  cout << count << endl;
}

Error: TLE

Fixed submission:

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

int main() {
  int X, sum = 100, count = 0;
  cin >> X;

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

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

int main() {
  long x;
  cin >> x;
  long sum = 100;
  for (int i = 1;; i++) {
    sum *= 1.01;
    if (sum >= x) {
      cout << i << endl;
      break;
    }
  }
}


Error: TLE

Fixed submission:

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

int main() {
  long x;
  cin >> x;
  int sum = 100;
  for (int i = 1; i < 1000000000; i++) {
    sum *= 1.01;
    if (sum >= x) {
      cout << i << endl;
      break;
    }
  }
}
Problem p02694 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <bits/stdc++.h>
using namespace std;
#define repr(i, a, b) for (int i = a; i < b; i++)
#define rep(i, n) for (int i = 0; i < n; i++)
typedef long long ll;
#define mod 1000000007

ll gcd(ll x, ll y) { return y ? gcd(y, x % y) : x; }
ll lcm(ll x, ll y) { return x / gcd(x, y) * y; }

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


Error: TLE

Fixed submission:

#include <bits/stdc++.h>
using namespace std;
#define repr(i, a, b) for (int i = a; i < b; i++)
#define rep(i, n) for (int i = 0; i < n; i++)
typedef long long ll;
#define mod 1000000007

ll gcd(ll x, ll y) { return y ? gcd(y, x % y) : x; }
ll lcm(ll x, ll y) { return x / gcd(x, y) * y; }

int main() {
  ll x;
  cin >> x;
  ll ans = 0;
  ll now = 100;
  while (now < x) {
    now = now * 101 / 100;
    ans++;
  }
  cout << ans << endl;
  return 0;
}
Problem p02694 (C++) — buggy submission, verdict: Time Limit Exceeded

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

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


Error: TLE

Fixed submission:

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

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

/*
Author: Sanskar Agarwal
Nick: sanskarag
Birla Institute Of Technology, Mesra
*/
#include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define endl "\\n"
#define fast                                                                   \\
  ios::sync_with_stdio(0);                                                     \\
  cin.tie(0);                                                                  \\
  cout.tie(0);
#define F(i, a, b) for (ll i = (ll)(a); i <= (ll)(b); i++)
#define RF(i, a, b) for (ll i = (ll)(a); i >= (ll)(b); i--)
#define INF 100009
#define mod 1000000007
#define pb(x) push_back(x)
#define mp(x, y) make_pair(x, y)
#define ff first
#define ss second

int main() {
  fast ll x;
  cin >> x;
  ll p = 100;
  int count = 0;
  while (p < x) {
    count++;
    p = p + floor(p * 0.01);
  }
  cout << count << endl;
  return 0;
}


Error: TLE

Fixed submission:

/*
Author: Sanskar Agarwal
Nick: sanskarag
Birla Institute Of Technology, Mesra
*/
#include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define endl "\\n"
#define fast                                                                   \\
  ios::sync_with_stdio(0);                                                     \\
  cin.tie(0);                                                                  \\
  cout.tie(0);
#define F(i, a, b) for (ll i = (ll)(a); i <= (ll)(b); i++)
#define RF(i, a, b) for (ll i = (ll)(a); i >= (ll)(b); i--)
#define INF 100009
#define mod 1000000007
#define pb(x) push_back(x)
#define mp(x, y) make_pair(x, y)
#define ff first
#define ss second

int main() {
  fast ll x;
  cin >> x;
  int p = 100;
  int count = 0;
  while (p < x) {
    count++;
    p = p * (1.01);
  }
  cout << count << endl;
  return 0;
}
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 FOR(i, a, b) for (int i = (a); i < (b); i++)
using namespace std;
const long long MOD = 1e9 + 7;
const long long INF = 1e12;
const int inf = 1e9;
const int mod = 1e9 + 7;
typedef long long ll;
typedef pair<ll, int> P;
typedef set<int> S;
int main() {
  cout << fixed << setprecision(10);
  ll x;
  cin >> x;
  ll now = 100;
  int cnt = 0;
  while (now < x) {
    cnt++;
    ll sa = now / 100;
    now += sa;
  }
  cout << cnt << endl;
  return 0;
}

Error: TLE

Fixed submission:

#include <bits/stdc++.h>
#define rep(i, N) for (int i = 0; i < (N); i++)
#define FOR(i, a, b) for (int i = (a); i < (b); i++)
using namespace std;
const long long MOD = 1e9 + 7;
const long long INF = 1e12;
const int inf = 1e9;
const int mod = 1e9 + 7;
typedef long long ll;
typedef pair<ll, int> P;
typedef set<int> S;
int main() {
  cout << fixed << setprecision(10);
  ll x;
  cin >> x;
  ll now = 100;
  int cnt = 0;
  while (now < x) {
    cnt++;
    now *= 101;
    now /= 100;
  }
  cout << cnt << endl;
  return 0;
}
Problem p02694 (C++) — buggy submission, verdict: Time Limit Exceeded

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

int main() {
  long long x;
  cin >> x;
  long long cho = 100;
  for (long long i = 1; i < 3000000000; i++) {
    cho = cho + (cho / 100);
    // cout << cho << endl;
    if (cho >= x) {
      cout << i;
      return 0;
    }
  }
  cout << cho;
}

Error: TLE

Fixed submission:

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

int main() {
  long long x;
  cin >> x;
  long long cho = 100;
  for (long long i = 1; i < 1000000000; i++) {
    cho = cho * 101 / 100;
    if (cho >= x) {
      cout << i;
      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++)
#include <iostream>
typedef long long ll;
using namespace std;

int main() {
  ll n, x = 100, flag = 0;
  cin >> n;

  while (x < n) {
    x += x / 100;
    flag++;
  }

  cout << flag << endl;
}

Error: TLE

Fixed submission:

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

int main() {
  ll n, x = 100, flag = 0;
  cin >> n;
  while (x < n) {
    x *= 101;
    x /= 100;
    flag++;
  }

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

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

int main() {

  long long x, yokin = 100, year = 0;
  cin >> x;

  while (x > yokin) {
    yokin = yokin * 1.01;
    year++;
  }

  cout << year << endl;
}


Error: TLE

Fixed submission:

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

int main() {

  int x, yokin = 100, year = 0;
  cin >> x;

  while (x > yokin) {
    yokin = yokin * 1.01;
    year++;
  }

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

#include <bits/stdc++.h>

using namespace std;

int main() {
  int64_t x;
  cin >> x;
  int N = 500000;
  vector<int64_t> cal(N, 100);
  int ans = 0;

  for (int j = 1; j < N; j++) {
    cal.at(j) = floor(cal.at(j - 1) * 1.01);
    if (cal.at(j) >= x) {
      ans = j;
      // cout << "break" << endl;
      break;
    }
  }
  cout << ans << endl;
}


Error: TLE

Fixed submission:

#include <bits/stdc++.h>

using namespace std;

int main() {
  int x;
  cin >> x;
  int m = 100;
  int i = 1;

  while (1 >= 0) {
    m = 1.01 * m;
    if (m >= x) {
      break;
    }
    i++;
  }

  cout << i << endl;
}
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 a;
  int k;
  a = 100;
  k = 0;
  double b;
  // b = log((double)X/100.0)/log(1.01);

  while (a < X) {
    k++;
    a = a * 1.01;
    // cout<<k<<" "<<a<<endl;
  }
  cout << k << endl;
}


Error: TLE

Fixed submission:

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

int main() {
  long long X;
  cin >> X;
  int a, k;
  a = 100;
  k = 0;
  double b;
  // b = log((double)X/100.0)/log(1.01);

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

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

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

  int year = 0;
  long long s = 100;

  while (s < X) {
    s = s + s / 100;

    year++;
  }
  cout << year << endl;
}


Error: TLE

Fixed submission:

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

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

  int year = 0;
  long long s = 100;

  while (s < X) {
    s = s * 101 / 100;

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

#include <algorithm>
#include <bitset>
#include <cstdio>
#include <functional>
#include <iomanip>
#include <iostream>
#include <iso646.h>
#include <map>
#include <math.h>
#include <numeric>
#include <queue>
#include <set>
#include <string>
#include <unordered_map>
#include <vector>

#ifndef M_PI
#define M_PI 3.14159265358979
#endif
#define deg_to_rad(deg) (((deg) / 360) * 2 * M_PI)
#define rad_to_deg(rad) (((rad) / 2 / M_PI) * 360)

using namespace std;

typedef vector<int> vi;
typedef pair<int, int> pii;
typedef long long ll;
typedef vector<long long> vll;
typedef pair<long long, long long> pll;

const ll INF = 1e15;
const ll MOD = 1e9 + 7;

int main() {
  ll i, j, k;
  ll X;
  cin >> X;
  ll ans = 1;
  ll now = 100;
  while (1) {
    now += now / 100;
    if (now >= X) {
      cout << ans << endl;
      return 0;
    }
    ans++;
  }

  return 0;
}

Error: TLE

Fixed submission:

#include <algorithm>
#include <bitset>
#include <cstdio>
#include <functional>
#include <iomanip>
#include <iostream>
#include <iso646.h>
#include <map>
#include <math.h>
#include <numeric>
#include <queue>
#include <set>
#include <string>
#include <unordered_map>
#include <vector>

#ifndef M_PI
#define M_PI 3.14159265358979
#endif
#define deg_to_rad(deg) (((deg) / 360) * 2 * M_PI)
#define rad_to_deg(rad) (((rad) / 2 / M_PI) * 360)

using namespace std;

typedef vector<int> vi;
typedef pair<int, int> pii;
typedef long long ll;
typedef vector<long long> vll;
typedef pair<long long, long long> pll;

const ll INF = 1e15;
const ll MOD = 1e9 + 7;

int main() {
  ll i, j, k;
  ll X;
  cin >> X;
  ll ans = 1;
  ll now = 100;
  while (1) {
    now = now * 101 / 100;
    if (now >= X) {
      cout << ans << endl;
      return 0;
    }
    ans++;
  }

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

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

int main() {
  long long a, x;
  a = 100;
  int year = 0;

  cin >> x;

  while (a < x) {
    a = a * 1.01;
    year = year + 1;
  }

  cout << year << endl;
}


Error: TLE

Fixed submission:

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

int main() {
  int a = 100, x;
  int year = 0;

  cin >> x;

  while (a < x) {
    a = a * 1.01;
    year = year + 1;
  }

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

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

int main() {
  ll N, M = 100;
  cin >> N;
  for (int i = 1;; i++) {
    M *= 1.01;
    if (M >= N) {
      cout << i;
      return 0;
    }
  }

  return 0;
}

Error: TLE

Fixed submission:

#include <iostream>
#include <stdio.h>
#include <string.h>
#include <vector>
using namespace std;

int main() {
  int N, M = 100;
  cin >> N;
  for (int i = 1;; i++) {
    M *= 1.01;
    if (M >= N) {
      cout << i;
      return 0;
    }
  }

  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 a = 100;
  while (a < x) {
    a += a / 100;
    count++;
  }
  cout << count << endl;
  return 0;
}

Error: TLE

Fixed submission:

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

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

#include <bits/stdc++.h>
#include <cstdio>
#include <iostream>
using namespace std;
const int MAX_N = 100;
typedef long long ll;

void solve(ll x) {
  ll money = 100;
  int n = 0;
  double money_tmp;
  money_tmp = money;
  while (x > money) {
    money_tmp = money;
    money_tmp = money_tmp * 1.01;
    money = money_tmp;
    n = n + 1;
  }
  cout << n << endl;
}

int main() {
  ll x;
  cin >> x;
  solve(x);
  return 0;
}


Error: TLE

Fixed submission:

#include <bits/stdc++.h>
#include <cstdio>
#include <iostream>
using namespace std;
const int MAX_N = 100;
typedef long long ll;

void solve(int x) {
  int money = 100;
  int n = 0;
  double money_tmp;
  money_tmp = money;
  while (x > money_tmp) {
    money_tmp = money_tmp * 1.01;
    money_tmp = (int)(money_tmp);
    n = n + 1;
  }
  cout << n << endl;
}

int main() {
  int x;
  cin >> x;
  solve(x);
  return 0;
}
Problem p02694 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <bits/stdc++.h>
using namespace std;
int main() {

  long long X;
  cin >> X;
  long long P = 100, step = 0;
  while (P < X) {
    P += P / 100;
    step++;
  }
  cout << step << endl;
  return 0;
}


Error: TLE

Fixed submission:

#include <bits/stdc++.h>
using namespace std;
int main() {
  int X;
  cin >> X;
  int answer = 0;
  int mon = 100;
  while (mon < X) {
    mon *= 101;
    mon /= 100;
    answer++;
  }

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

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

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


Error: TLE

Fixed submission:

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

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

#include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define pb push_back
#define fast                                                                   \\
  ios_base::sync_with_stdio(false);                                            \\
  cin.tie(NULL);
#define pp pop_back
#define in insert
#define ff first
#define ss second
#define e endl
#define MAXN 2005
#define MOD 998244353
int main() {
  ll x;
  cin >> x;
  ll a = 100;
  ll t = 0;
  while (a < x && t <= 4000) {
    a *= 1.01;
    t++;
  }
  cout << t;
}


Error: TLE

Fixed submission:

#include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define pb push_back
#define fast                                                                   \\
  ios_base::sync_with_stdio(false);                                            \\
  cin.tie(NULL);
#define pp pop_back
#define in insert
#define ff first
#define ss second
#define e endl
#define MAXN 2005
#define MOD 998244353
int main() {
  ll x;
  cin >> x;
  ll a = 100;
  ll t = 0;
  while (a < x) {

    a = a * 101;
    a = a / 100;
    t++;
  }
  cout << t;
}
Problem p02694 (C++) — buggy submission, verdict: Time Limit Exceeded

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

int main() {
  long long money = 100;
  long long X;
  cin >> X;
  int year = 0;

  while (money < X) {
    money = money + money / 100;
    year++;
  }

  cout << year << endl;
}


Error: TLE

Fixed submission:

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

int main() {
  int money = 100;
  int X;
  cin >> X;
  int year = 0;

  while (money < X) {
    money = money + money / 100;
    year++;
  }

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

#include <cmath>
#include <iostream>
#include <math.h>
using namespace std;

int main() {
  long long X, deposit = 100;
  cin >> X;

  int i = 0;
  while (X > deposit) {
    deposit += deposit * 0.01;
    i++;
  }
  cout << i << endl;
  return 0;
}


Error: TLE

Fixed submission:

#include <iostream>
using namespace std;

int main() {
  int X;
  int deposit = 100;
  cin >> X;

  int i = 0;
  while (X > deposit) {
    deposit = deposit * 1.01;
    i = i + 1;
  }

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

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

int main() {
  long long a = 100, X;
  cin >> X;
  int i;
  for (i = 0; true; i++) {
    a = a * 1.01;
    if (X <= a) {
      break;
    }
  }
  cout << i + 1 << endl;
  return 0;
}


Error: TLE

Fixed submission:

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

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

#include <iostream>
#include <math.h>
using namespace std;

int main() {
  long long InVal = 100;
  long long x;
  long long years = 0;
  cin >> x;
  while (InVal < x) {
    InVal = floor(InVal * 1.01);
    ++years;
  }
  cout << years << endl;
  return 0;
}

Error: TLE

Fixed submission:

#include <iostream>
#include <math.h>
using namespace std;

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

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

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

  long int balance = 100;
  int i = 1;
  while (true) {
    balance = static_cast<long int>(balance * 1.01);
    if (balance >= X) {
      cout << i << endl;
      break;
    }
    i++;
  }
}


Error: TLE

Fixed submission:

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

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

  int balance = 100;
  int i = 1;
  while (true) {
    balance = static_cast<int>(balance * 1.01);
    if (balance >= X) {
      cout << i << endl;
      break;
    }
    i++;
  }
}
Problem p02694 (C++) — buggy submission, verdict: Time Limit Exceeded

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

int main() {
  long long a;
  cin >> a;
  int t = 0;
  long long k = 100;
  while (k < a) {
    k = k * 1.01;
    t++;
  }
  cout << t;
}

Error: TLE

Fixed submission:

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

int main() {
  long long a;
  cin >> a;
  int t = 0;
  long long k = 100;
  while (k != a) {
    k = k * 1.01;
    t++;
  }
  cout << t;
}
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 ok() puts(ok ? "Yes" : "No");
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef pair<int, int> ii;
typedef vector<vi> vvi;
typedef vector<ii> vii;
typedef vector<bool> vb;
typedef vector<vb> vvb;
typedef set<int> si;
typedef map<string, int> msi;
typedef greater<int> gt;
typedef priority_queue<int, vector<int>, gt> minq;
typedef long long ll;
typedef pair<ll, ll> pll;
const ll LINF = 1e18L + 1;
const int INF = 1e9 + 1;
// clang++ -std=c++11 -stdlib=libc++

int main() {
  ll x;
  cin >> x;
  ll now = 100;
  int day = 0;
  while (now < x) {
    day++;
    now += now / 100;
  }
  cout << day << endl;
  return 0;
}

Error: TLE

Fixed submission:

#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define ok() puts(ok ? "Yes" : "No");
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef pair<int, int> ii;
typedef vector<vi> vvi;
typedef vector<ii> vii;
typedef vector<bool> vb;
typedef vector<vb> vvb;
typedef set<int> si;
typedef map<string, int> msi;
typedef greater<int> gt;
typedef priority_queue<int, vector<int>, gt> minq;
typedef long long ll;
typedef pair<ll, ll> pll;
const ll LINF = 1e18L + 1;
const int INF = 1e9 + 1;
// clang++ -std=c++11 -stdlib=libc++

int main() {
  ll x;
  cin >> x;
  double up = log(x) - log(100);
  double down = log(101) - log(100);
  double ans = ((double)(log(x) - log(100)) / (double)(log(101) - log(100)));
  ll y = 0;
  ll money = 100;
  while (money < x) {
    y++;
    money *= (101);
    money /= 100;
  }
  printf("%lld\\n", y);
  return 0;
}
Problem p02694 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <cmath>
#include <iostream>

int main(int argc, char **argv) {
  double x;
  std::cin >> x;
  int year = 0;
  long double money = 100;
  while (true) {
    money = money * 1.01;
    money = std::floor(money);
    if (money >= x) {
      year++;
      break;
    }
    year++;
  }
  std::cout << year << std::endl;
  return 0;
}

Error: TLE

Fixed submission:

#include <iostream>

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

  int x;
  std::cin >> x;
  int year = 1;
  double money = 100;
  int i_money = 100;
  while (true) {
    money = static_cast<double>(i_money);
    money = money * 1.01;
    i_money = static_cast<int>(money);
    if (i_money >= x) {
      break;
    }
    year++;
  }
  std::cout << year << std::endl;
  return 0;
}
Problem p02694 (C++) — buggy submission, verdict: Time Limit Exceeded

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

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


Error: TLE

Fixed submission:

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

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

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

int main() {
#define int long long
  int x;
  cin >> x;
  int a = 100;
  int count = 0;
  for (int i = 0; i < 10000; i++) {
    a = a + a / 100;
    count++;
    if (a >= x) {
      break;
    }
  }

  cout << count << endl;
}

Error: TLE

Fixed submission:

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

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

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

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

Error: TLE

Fixed submission:

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

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

#include <cmath>
#include <iostream>
using namespace std;
int main() {
  long long int x, i = 0, m = 100;
  cin >> x;
  // x=1000000000000000000;
  while (m < x) {
    m *= 1.01;
    i++;
  }
  cout << i << endl;
}

Error: TLE

Fixed submission:

#include <iostream>
using namespace std;
int main() {
  int x, i = 0, m = 100;
  cin >> x;
  while (m < x) {
    m = int(float(m) * 1.01);
    i++;
  }
  cout << i << endl;
}
Problem p02694 (C++) — buggy submission, verdict: Time Limit Exceeded

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

int main() {
  int Z;
  long X, Y;

  cin >> X;

  Y = 100;
  Z = 0;

  if (X > 1001009377) {
    Y = 1001009377;
    Z = 1677;
  }
  while (Y < X) {
    Y = Y * 1.01;
    Z++;
  }

  cout << Z << endl;
}


Error: TLE

Fixed submission:

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

int main() {
  int Y, Z;
  long X;

  cin >> X;

  Y = 100;
  Z = 0;

  long c = X / 20000;
  if (c > 0) {
    for (int i = 0; i < c; i++) {
      Y = Y * 200;
    }
    Z = Z + 100 * c;
  }

  while (Y < X) {
    Y = Y * 1.01;
    Z++;
  }

  cout << Z << endl;
}