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

#include <bits/stdc++.h>
using namespace std;
using vi = vector<int>;
using vii = vector<vi>;
using vs = vector<string>;
using in6 = int64_t;
using ind = double;
using pii = pair<int, int>;
using psi = pair<string, int>;
using vpi = vector<pii>;
using vps = vector<psi>;
#define rep(i, n) for (in6 i = 0; i < (in6)(n); i++)
#define repa(i, a, n) for (in6 i = a; i < (in6)(n); i++)
#define repdown(i, n) for (in6 i = n; i > 0; i--)
#define kyun ios::sync_with_stdio(false)
#define hinata cout << "\\n"
#define all(c) (c).begin(), (c).end()
#define pb push_back
#define inf 2147483647
#define dset(n) cout << fixed << setprecision(n)

void yes() { cout << "Yes"; }

void no() { cout << "No"; }

int main() {
  in6 x;
  cin >> x;
  in6 price = 100;
  in6 ans = 0;
  while (price < x) {
    price *= 1.01;
    ans++;
  }
  cout << ans;
  hinata;
}

Error: TLE

Fixed submission:

#include <bits/stdc++.h>
using namespace std;
using vi = vector<int>;
using vii = vector<vi>;
using vs = vector<string>;
using in6 = int64_t;
using ind = double;
using pii = pair<int, int>;
using psi = pair<string, int>;
using vpi = vector<pii>;
using vps = vector<psi>;
#define rep(i, n) for (in6 i = 0; i < (in6)(n); i++)
#define repa(i, a, n) for (in6 i = a; i < (in6)(n); i++)
#define repdown(i, n) for (in6 i = n; i > 0; i--)
#define kyun ios::sync_with_stdio(false)
#define hinata cout << "\\n"
#define all(c) (c).begin(), (c).end()
#define pb push_back
#define inf 2147483647
#define dset(n) cout << fixed << setprecision(n)

void yes() { cout << "Yes"; }

void no() { cout << "No"; }

int main() {
  int x;
  cin >> x;
  int price = 100;
  int ans = 0;
  while (1) {
    price *= 1.01;
    ans++;
    if (price >= x) {
      cout << ans;
      break;
    }
  }
  hinata;
}
Problem p02694 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <iostream>
using namespace std;

int main() {
  long long X;
  cin >> X;
  long long sum = 100;
  int year = 0;
  while (sum < X) {
    sum += sum / 100;
    year++;
  }
  cout << year;
  return 0;
}

Error: TLE

Fixed submission:

#include <iostream>
using namespace std;

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

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

int main() {
  long long X, n = 0;
  long long yen = 100;
  cin >> X;

  while (++n) {
    yen = yen + yen * 0.01;
    if (yen >= X)
      break;
  }
  cout << n << endl;
  // cout << round(log((double) X/100) / log(1.01)) << endl;
}


Error: TLE

Fixed submission:

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

int main() {
  long long X, n = 0;
  int yen = 100;
  cin >> X;

  while (++n) {
    yen = yen + yen * 0.01;
    if (yen >= X)
      break;
  }
  cout << n << endl;
  // cout << round(log((double) X/100) / log(1.01)) << endl;
}
Problem p02694 (C++) — buggy submission, verdict: Time Limit Exceeded

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

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

  long money = 100;
  int year = 0;

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

  cout << year << endl;
}


Error: TLE

Fixed submission:

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

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

  int money = 100;
  int year = 0;

  while (money < X) {
    money *= 1.01;
    year++;
  }

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

#include <bits/stdc++.h>
#define ll long long int
#define mod 1000000007
#define se second
#define fi first
#define endl "\\n"
#define pi 3.1415926535897932384626433832795028841971
#define MAX 9223372036854775807
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  //	cout<<fixed<<setprecision(10);
  ll n;
  cin >> n;
  ll x, y, z;
  x = 100;
  y = 0;
  double xx = 101.0 / 100.0;
  while (x < n) {
    x = x * xx;
    y++;
  }
  cout << y;
  return 0;
}

Error: TLE

Fixed submission:

#include <bits/stdc++.h>
#define ll long long int
#define mod 1000000007
#define se second
#define fi first
#define endl "\\n"
#define pi 3.1415926535897932384626433832795028841971
#define MAX 9223372036854775807
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  //	cout<<fixed<<setprecision(10);
  ll n;
  cin >> n;
  ll x, y, z;
  x = 100;
  y = 0;
  while (x < n) {
    x = (101 * x) / 100;
    y++;
  }
  cout << y;
  return 0;
}
Problem p02694 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <bits/stdc++.h>
using namespace std;
int main(int argc, char const *argv[]) {

  long long int x, a = 100;
  cin >> x;
  int ans = 0;
  while (a < x) {
    a = a * 1.01;
    ans++;
  }
  cout << ans << "\\n";
  return 0;
}

Error: TLE

Fixed submission:

#include <bits/stdc++.h>
using namespace std;
int main(int argc, char const *argv[]) {

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

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

int main() {
  long long a = 100;
  long long x;
  cin >> x;
  int i = 0;

  while (a < x) {
    a += a / 100;

    i++;
  }
  cout << i << endl;
}

Error: TLE

Fixed submission:

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

int main() {
  int a = 100;
  long long x;
  cin >> x;
  int i = 0;

  while (a < x) {
    a += a / 100;

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

// #define _GLIBCXX_DEBUG
#include <bits/stdc++.h>

using namespace std;

//------------------------------- Type Names -------------------------------//

using i64 = int_fast64_t;

using seika = string;
//{akari : 1D, yukari : 2D, maki : 3D} vector
template <class kizuna> using akari = vector<kizuna>;
template <class yuzuki> using yukari = akari<akari<yuzuki>>;
template <class tsurumaki> using maki = akari<yukari<tsurumaki>>;
//{akane : ascending order, aoi : decending order} priority queue
template <class kotonoha>
using akane = priority_queue<kotonoha, akari<kotonoha>, greater<kotonoha>>;
template <class kotonoha> using aoi = priority_queue<kotonoha>;

//------------------------------- Libraries ---------------------------------//

//------------------------------- Dubug Functions ---------------------------//

inline void print() { cout << endl; }
template <typename First, typename... Rest>
void print(const First &first, const Rest &...rest) {
  cout << first << ' ';
  print(rest...);
}

//------------------------------- Solver ------------------------------------//

void solve() {
  i64 x;
  cin >> x;
  i64 c = 100;
  for (int i = 1;; i++) {
    c = c * 1.01;
    if (c >= x) {
      cout << i << endl;
      return;
    }
  }
}

int main() {
  solve();
  return 0;
}


Error: TLE

Fixed submission:

// #define _GLIBCXX_DEBUG
#include <bits/stdc++.h>

using namespace std;

//------------------------------- Type Names -------------------------------//

using i64 = int_fast64_t;

using seika = string;
//{akari : 1D, yukari : 2D, maki : 3D} vector
template <class kizuna> using akari = vector<kizuna>;
template <class yuzuki> using yukari = akari<akari<yuzuki>>;
template <class tsurumaki> using maki = akari<yukari<tsurumaki>>;
//{akane : ascending order, aoi : decending order} priority queue
template <class kotonoha>
using akane = priority_queue<kotonoha, akari<kotonoha>, greater<kotonoha>>;
template <class kotonoha> using aoi = priority_queue<kotonoha>;

//------------------------------- Libraries ---------------------------------//

//------------------------------- Dubug Functions ---------------------------//

inline void print() { cout << endl; }
template <typename First, typename... Rest>
void print(const First &first, const Rest &...rest) {
  cout << first << ' ';
  print(rest...);
}

//------------------------------- Solver ------------------------------------//

void solve() {
  i64 x;
  cin >> x;
  i64 c = 100;
  for (int i = 1;; i++) {
    c = c * 101 / 100;
    if (c >= x) {
      cout << i << endl;
      return;
    }
  }
}

int main() {
  solve();
  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;
  int c = 0;
  long long i = 100;
  while (i < x) {
    i *= 1.01;
    c++;
  }
  cout << c << endl;
}

Error: TLE

Fixed submission:

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

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

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

  ll y = 100;
  ll ans = 0;
  while (y < x) {
    y += y / 100;
    ans++;
  }
  cout << ans << endl;
}


Error: TLE

Fixed submission:

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

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

  int y = 100;
  int ans = 0;
  while (y < x) {
    y += y / 100;
    ans++;
  }
  cout << ans << endl;
}
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++)

using namespace std;
using ll = long long;
using P = pair<int, int>;

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

Error: TLE

Fixed submission:

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

using namespace std;
using ll = long long;
using P = pair<int, int>;

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

#include <bits/stdc++.h>
using namespace std;
int main() {
  int64_t n, as = 100;
  cin >> n;
  for (int64_t i = 1;; i++) {
    as += (int64_t)as * 1 / 100;
    if (as >= n) {
      cout << i << endl;
      break;
    }
  }
}


Error: TLE

Fixed submission:

#include <bits/stdc++.h>
using namespace std;
int main() {
  int64_t n, as = 100;
  cin >> n;
  for (int64_t i = 1;; i++) {
    as += (int)as * 0.01;
    if (as >= n) {
      cout << i << endl;
      break;
    }
  }
}
Problem p02694 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <algorithm>
#include <cstdio>
#include <cstring>
#include <iostream>
using namespace std;
typedef long long ll;

int main() {
  ll X;
  cin >> X;
  ll sum = 100;
  int cnt = 0;
  while (sum < X) {
    sum += sum * 0.01;
    cnt++;
  }
  printf("%d", cnt);
  return 0;
}

Error: TLE

Fixed submission:

#include <iostream>
using namespace std;
long long i, x, ans;
int main() {
  scanf("%lld", &x);
  ans = 100;
  for (i = 0; ans < x; i++) {
    ans = ans * 101 / 100;
  }
  printf("%lld", i);
  return 0;
}
Problem p02694 (C++) — buggy submission, verdict: Time Limit Exceeded

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

int main() {
  int n = 0;
  int i;
  long long y = 100;
  long long x;
  cin >> x;
  // n = ceil((log10(x) - 2) / log10(1.01));
  // if (x < 1000000000) {
  for (i = 0; y < x; i++) {
    y *= 1.01;
  }
  // } else {
  // y = 1000000000;
  // for (i = 1677; y <  x; i++) {
  // y *= 1.01;
  // }
  // }
  cout << i << endl;
}

Error: TLE

Fixed submission:

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

int main() {
  int n = 0;
  int i;
  int y = 100;
  int x;
  cin >> x;
  // n = ceil((log10(x) - 2) / log10(1.01));
  for (i = 0; y < x; i++) {
    y *= 1.01;
  }
  cout << i << endl;
}
Problem p02694 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <iostream>
// #include<string>
// #include <math.h>
using namespace std;
int main() {
  long long x, compInt = 100, years = 0;
  cin >> x;
  while (compInt < x) {
    years++;
    compInt += (compInt * 0.01);
  }
  cout << years;
}

Error: TLE

Fixed submission:

#include <iostream>
// #include<string>
// #include <math.h>
using namespace std;
int main() {
  int x, compInt = 100, years = 0;
  cin >> x;
  while (1) {
    if (compInt >= x) {
      cout << years;
      return 0;
    }
    years++;
    compInt += (compInt * 0.01);
  }
}
Problem p02694 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <iostream>
using namespace std;
int main(void) {
  long long x;
  cin >> x;
  long ans = 0;
  long long temp = 100;
  while (temp < x) {
    temp += temp / 100;
    ans++;
  }
  cout << ans << endl;
}


Error: TLE

Fixed submission:

#include <iostream>
using namespace std;
int main(void) {
  long long x;
  long long n = 100;
  cin >> x;

  long long ans = 0;
  while (n < x) {
    n = n * 101 / 100;
    ans++;
  }
  cout << ans << 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 sum = 0;
  long long A = 100;
  while (A < X) {
    A = A + A / 100;
    sum++;
  }
  cout << sum << endl;
}

Error: TLE

Fixed submission:

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

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

#include <bits/stdc++.h>

using namespace std;

int main() {
  long long x = 0;
  cin >> x;

  int counter = 0;
  long long sum = 100;

  while (sum < x) {
    sum *= 1.01;
    counter++;
  }

  cout << counter << endl;
  return 0;
}

Error: TLE

Fixed submission:

#include <bits/stdc++.h>

using namespace std;

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

  int checker = 0;
  int counter = 0;
  int sum = 100;

  while (sum < x) {
    sum *= 1.01;
    counter++;
  }

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

#include <bits/stdc++.h>

using namespace std;

typedef long long ll;

int main() {
  ll X;
  cin >> X;
  ll sum = 100;
  ll n = 0;
  while (sum < X) {
    sum = sum + sum / 100;
    n++;
  }
  cout << n << endl;
}

Error: TLE

Fixed submission:

#include <bits/stdc++.h>

using namespace std;

typedef long long ll;

int main() {
  ll X;
  cin >> X;
  ll sum = 100;
  ll n = 0;
  while (sum < X) {
    sum = sum * 101 / 100;
    n++;
  }
  cout << n << endl;
}
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++)

using namespace std;

typedef long long ll;
typedef unsigned long long u_ll;
typedef pair<int, int> pair_;

const int INF = 1001001001;
const int dx[] = {-1, 0, 1, 0};
const int dy[] = {0, -1, 0, 1};
int k;

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

  return gcd(b, a % b);
}

int main() {

  ll x;
  cin >> x;
  ll ans = 100;
  ll i = 0;
  while (ans < x) {
    i++;
    ans = ans * 1.01;
  }

  cout << i;

  return 0;
}

Error: TLE

Fixed submission:

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

using namespace std;

typedef long long ll;
typedef unsigned long long u_ll;
typedef pair<int, int> pair_;

const int INF = 1001001001;
const int dx[] = {-1, 0, 1, 0};
const int dy[] = {0, -1, 0, 1};
int k;

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

  return gcd(b, a % b);
}

int main() {

  int x;
  cin >> x;
  int ans = 100;
  int i = 0;
  while (1) {
    if (x <= ans) {
      break;
    } else
      i++;
    ans = ans * 1.01;
  }
  cout << i;

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

#include <bits/stdc++.h>
using namespace std;
int main() {
  int64_t x;
  cin >> x;
  int ans = 0;
  int64_t a = 100;
  while (a < x) {
    a += a / 100;
    ans++;
  }
  cout << ans << endl;
}

Error: TLE

Fixed submission:

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

#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int x;
  cin >> x;
  long long int o = 100, t = 0;
  while (o < x) {
    t++;
    o = o + o / 100;
  }
  cout << t;
  return 0;
}


Error: TLE

Fixed submission:

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

#include <bits/stdc++.h>

using namespace std;
#define ll long long
int main() {
  ll r = 0;
  ll x;
  cin >> x;
  ll i = 100;
  while (i < x) {
    i = i + i / 100;
    r++;
  }
  cout << r;
  return 0;
}


Error: TLE

Fixed submission:

#include <bits/stdc++.h>

using namespace std;
#define ll long long
int main() {
  ll r = 0;
  ll x;
  cin >> x;
  ll i = 100;
  while (i < x) {
    i = i * 101 / 100;
    r++;
  }
  cout << r;
  return 0;
}
Problem p02694 (C++) — buggy submission, verdict: Time Limit Exceeded

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

int main() {
  ll x;
  cin >> x;
  ll ans = 0;
  ll yokin = 100;
  for (ll i = 1;; i++) {
    yokin = yokin * 1.01;
    if (yokin >= x) {
      ans = i;
      break;
    }
  }

  cout << ans << endl;
}

Error: TLE

Fixed submission:

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

int main() {
  ll x;
  cin >> x;
  ll ans = 0;
  ll yokin = 100;
  for (ll i = 1;; i++) {
    yokin = yokin * 101 / 100;
    if (yokin >= x) {
      ans = i;
      break;
    }
  }

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

#include <bits/stdc++.h>
#define int long long
#define f first
#define s second
using namespace std;
const int inf = 1e18;
int32_t main() {
  ios::sync_with_stdio(0), cin.tie(0);
  int x, p = 100, c = 0;
  cin >> x;
  while (p < x) {
    p += p / 100;
    c++;
  }
  cout << c;
}

Error: TLE

Fixed submission:

#include <bits/stdc++.h>
#define int long long
#define f first
#define s second
using namespace std;
const int inf = 1e18;
int32_t main() {
  ios::sync_with_stdio(0), cin.tie(0);
  int x, p = 100, c = 0;
  cin >> x;
  while (p < x) {
    p = (p * 101) / 100;
    c++;
  }
  cout << c;
}
Problem p02694 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <bits/stdc++.h>
#include <cmath>
#include <cstdlib>
#include <math.h>
#include <stdio.h>
#include <string>

using namespace std;

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

Error: TLE

Fixed submission:

#include <bits/stdc++.h>
#include <cmath>
#include <cstdlib>
#include <math.h>
#include <stdio.h>
#include <string>

using namespace std;

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

#include <bits/stdc++.h>
using namespace std;
int main() {
  unsigned long long a = 100, x, y = 0, ans = 0;
  cin >> x;
  while (a < x) {
    a *= 1.01;
    ans += 1;
  }
  cout << ans;
  return 0;
}

Error: TLE

Fixed submission:

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

#include <iostream>

using namespace std;

int main() {
  long long X;
  cin >> X;
  long long a = 0;
  long long i = 100;
  while (i < X) {
    i *= 1.01;
    a += 1;
  }
  cout << a << endl;
}


Error: TLE

Fixed submission:

#include <iostream>

using namespace std;

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

#include <bits/stdc++.h>

using namespace std;

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

Error: TLE

Fixed submission:

#include <bits/stdc++.h>

using namespace std;

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

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

Error: TLE

Fixed submission:

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

#include <bits/stdc++.h>
using namespace std;
int main() {
  int64_t X;
  cin >> X;
  int64_t 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 n;
  int a = 100;
  cin >> n;
  int count = 0;
  for (int i = 0; i < n; i++) {
    a += a / 100;
    count++;
    if (a >= n)
      break;
  }
  cout << count << endl;
}
Problem p02694 (C++) — buggy submission, verdict: Time Limit Exceeded

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

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


Error: TLE

Fixed submission:

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

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

#include <iostream>
using namespace std;

int main() {
  long long int x;
  cin >> x;
  long long int yokin = 100;
  int tol = 0;

  while (yokin < x) {
    yokin += yokin / 100;
    tol++;
  }

  cout << tol << endl;

  return 0;
}

Error: TLE

Fixed submission:

#include <iostream>
using namespace std;

int main() {
  long long int x;
  cin >> x;
  int yokin = 100;
  int tol = 0;

  while (yokin < x) {
    yokin = yokin * 1.01;
    tol++;
  }

  cout << tol << endl;

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

#include <iostream>
using namespace std;

int main() {
  long bank = 100;
  long X;
  cin >> X;
  long year = 0;
  while (bank < X) {
    bank += bank * 0.01;
    year++;
  }
  cout << year;
  return 0;
}


Error: TLE

Fixed submission:

#include <iostream>
using namespace std;

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

#include <bits/stdc++.h>
#include <boost/multiprecision/cpp_int.hpp>
using namespace std;
namespace mp = boost::multiprecision;
using ll = long long;
constexpr long long MOD = 1000000007;
int main() {
  mp::cpp_int x;
  cin >> x;
  mp::cpp_int motode = 100;
  ll ans = 0;
  while (true) {
    motode *= 101;
    motode /= 100;
    ans++;
    if (motode >= x)
      break;
    if (ans == 3760)
      break;
  }
  cout << ans << endl;
}


Error: TLE

Fixed submission:

#include <bits/stdc++.h>
using namespace std;
using ll = long long;
constexpr long long MOD = 1000000007;
int main() {
  ll x;
  cin >> x;
  ll motode = 100;
  ll ans = 0;
  while (true) {
    motode *= 101 / 100;
    ans++;
    if (motode >= x)
      break;
  }
  cout << ans << endl;
}