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;
  cin >> x;

  auto y = 100LL;
  auto year = 0;
  while (y < x) {
    y += (y / 100);
    ++year;
  }

  cout << year << endl;
  return 0;
}


Error: TLE

Fixed submission:

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

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

  auto y = 100LL;
  auto year = 0;
  while (y < x) {
    y = (y * 101) / 100;
    ++year;
  }

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

#include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <deque>
#include <fstream>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
#define IOS                                                                    \\
  ios_base::sync_with_stdio(0);                                                \\
  cin.tie(0);
#define mod 1000000007
#define eps 1e-6
#define ll long long
#define INF 0x3f3f3f3f
#define MEM(x, y) memset(x, y, sizeof(x))
#define pb push_back
#define mk make_pair
#define pi pair<int, int>
#define rep(i, a, b) for (int i = (a); i <= (b); ++i)
#define per(i, a, b) for (int i = a; i >= (b); --i)
using namespace std;
int dt[][2] = {{1, 0}, {-1, 0}, {0, 1}, {0, -1}, {0, 0}};
// typedef pair<int, int> P;
// priority_queue<int, vector<int>, greater<int> > q;
int main() {
  IOS;
  ll x;
  cin >> x;
  ll now = 100;
  ll ans = 0;
  while (now < x) {
    now += now * 0.01;
    ++ans;
  }
  cout << ans;
}


Error: TLE

Fixed submission:

#include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <deque>
#include <fstream>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
#define IOS                                                                    \\
  ios_base::sync_with_stdio(0);                                                \\
  cin.tie(0);
#define mod 1000000007
#define eps 1e-6
#define ll long long
#define INF 0x3f3f3f3f
#define MEM(x, y) memset(x, y, sizeof(x))
#define pb push_back
#define mk make_pair
#define pi pair<int, int>
#define rep(i, a, b) for (int i = (a); i <= (b); ++i)
#define per(i, a, b) for (int i = a; i >= (b); --i)
using namespace std;
int dt[][2] = {{1, 0}, {-1, 0}, {0, 1}, {0, -1}, {0, 0}};
// typedef pair<int, int> P;
// priority_queue<int, vector<int>, greater<int> > q;
int main() {
  IOS;
  ll x;
  cin >> x;
  ll now = 100;
  ll ans = 0;
  while (now < x) {
    now += (int)(now * 0.01);
    ++ans;
  }
  cout << ans;
}
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 T = 100LL;
  int year = 0;

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

  cout << year << endl;
}

Error: TLE

Fixed submission:

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

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

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

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

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

int main() {
  long a, count;
  cin >> a;
  count = 0;

  for (long i = 100; i < a; count++) {
    i = i * 1.01;
  }
  cout << count << endl;
  return 0;
}


Error: TLE

Fixed submission:

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

int main() {
  int a, count;
  cin >> a;
  count = 0;

  for (int i = 100; i < a; count++) {
    i = i * 1.01;
  }
  cout << count << endl;
  return 0;
}
Problem p02694 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <bits/stdc++.h>
#include <cstdio>
#include <fstream>
using namespace std;
// vector<pair<int,int> > v;
// cin.ignore();//twice getline(cin,s);
// g++ iterator.cpp -std=c++17
// cout<<(A + B == C ? "YES" : "NO")<<endl;
// __gcd(a,b)
// string s=to_string(i);
// sort(arr, arr+n, greater<int>());
// const long double pi = acos(-1.0);
#define ff first
#define ss second
#define pb push_back
#define mk make_pair
#define vll vector<ll>
#define mll map<ll, ll>
#define mlli map<ll, ll>::iterator
#define size size()
#define endl "\\n"
#define ll long long int
#define ld long double
void fast() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
}

int main(void) {
  fast();
  ll x;
  cin >> x;
  ll c = 0;
  ll an = 100;
  while (1) {
    if (an < x) {
      // an=an+(an*0.01);
      an = an + (an * double(double(1) / double(100)));
      c++;
    } else {
      break;
    }
  }
  cout << c << endl;
  return 0;
}

Error: TLE

Fixed submission:

#include <bits/stdc++.h>
#include <cstdio>
#include <fstream>
using namespace std;
// vector<pair<int,int> > v;
// cin.ignore();//twice getline(cin,s);
// g++ iterator.cpp -std=c++17
// cout<<(A + B == C ? "YES" : "NO")<<endl;
// __gcd(a,b)
// string s=to_string(i);
// sort(arr, arr+n, greater<int>());
// const long double pi = acos(-1.0);
#define ff first
#define ss second
#define pb push_back
#define mk make_pair
#define vll vector<ll>
#define mll map<ll, ll>
#define mlli map<ll, ll>::iterator
#define size size()
#define endl "\\n"
#define ll long long int
#define ld long double
void fast() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
}

int main(void) {
  fast();
  ll x;
  cin >> x;
  ll c = 0;
  ll an = 100;
  while (1) {
    if (an < x) {
      an = an + (an * double(1 / 100));
      c++;
    } else {
      break;
    }
  }
  cout << c << 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 sum = 100;
  long long count = 0;
  while (sum < x) {
    sum += sum / 100;
    count++;
  }
  cout << count << endl;
}

Error: TLE

Fixed submission:

#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
int main() {
  int x;
  cin >> x;
  int sum = 100;
  int count = 0;
  while (sum < x) {
    sum = sum + sum * 0.01;
    count++;
  }

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

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define REP(i, n) for (ll i = 0, i##_len = (n); i < i##_len; ++i)
#define REPR(i, n) for (ll i = n; i >= 0; --i)
#define FOR(i, m, n) for (ll i = m, i##_len = (n); i < i##_len; ++i)
#define all(x) (x).begin(), (x).end()
template <class T> inline bool chmax(T &a, T b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T> inline bool chmin(T &a, T b) {
  if (a > b) {
    a = b;
    return 1;
  }
  return 0;
}
ll gcd(ll a, ll b) { return b ? gcd(b, a % b) : a; }
const int INF = 1e9;
const ll LLINF = 1e16;

int main() {
  double X;
  cin >> X;
  double a = 100;

  for (int i = 1;; i++) {

    a += floor(a / 100);
    if (a >= X) {
      cout << i << endl;
      break;
    }
  }

  return 0;
}


Error: TLE

Fixed submission:

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define REP(i, n) for (ll i = 0, i##_len = (n); i < i##_len; ++i)
#define REPR(i, n) for (ll i = n; i >= 0; --i)
#define FOR(i, m, n) for (ll i = m, i##_len = (n); i < i##_len; ++i)
#define all(x) (x).begin(), (x).end()
template <class T> inline bool chmax(T &a, T b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T> inline bool chmin(T &a, T b) {
  if (a > b) {
    a = b;
    return 1;
  }
  return 0;
}
ll gcd(ll a, ll b) { return b ? gcd(b, a % b) : a; }
const int INF = 1e9;
const ll LLINF = 1e16;

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

  for (int i = 1;; i++) {

    a += a / 100;
    if (a >= X) {
      cout << i << endl;
      break;
    }
  }

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

#include <iostream>
using namespace std;
int main() {
  long int n;
  cin >> n;
  long int m = 100, i = 0;
  do {
    i++;
    m *= 1.01;
  } while (m < n);
  cout << i;
  return 0;
}

Error: TLE

Fixed submission:

#include <iostream>
using namespace std;
int main() {
  int n;
  cin >> n;
  int m = 100, i = 0;
  do {
    i++;
    m *= 1.01;
  } while (m < n);
  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;
  int64_t a = 100; // 預金額
  int t = 0;       // 年数

  while (a < X) {
    a += a / 100;
    t++;
  }

  cout << t << endl;
}


Error: TLE

Fixed submission:

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

int main() {
  int X;
  cin >> X;
  int a = 100; // 預金額
  int t = 0;   // 年数

  while (a < X) {
    a *= 1.01;
    t++;
  }

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

#include <bits/stdc++.h>

using namespace std;

int main() {
  long long int x;
  long long int m = 100;
  int year = 0;
  cin >> x;
  while (x > m) {
    m *= 1.01;
    year++;
  }
  cout << year;
  return 0;
}


Error: TLE

Fixed submission:

#include <bits/stdc++.h>

using namespace std;

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

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


Error: TLE

Fixed submission:

#include <iostream>
using namespace std;
int main(void) {
  int x;
  cin >> x;
  int n = 100;
  int year = 0;
  while (n < x) {
    n *= 1.01;
    ++year;
  }
  cout << year << endl;
}
Problem p02694 (C++) — buggy submission, verdict: Runtime Error

#include <bits/stdc++.h>
#define MOD 1e9 + 7
#define PI 3.141592653589793238
#define pb push_back
#define ALL(V) (V).begin(), (V).end()
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef long long int lint;
typedef vector<ll> VL;
typedef vector<VL> VVL;
typedef vector<int> VI;
typedef pair<ll, ll> P;
ll gcd(ll a, ll b) { return (a % b == 0 ? b : gcd(b, a % b)); }
ll lcm(ll a, ll b) { return a * b / gcd(a, b); }
ll char_to_ll(char c) { return (int)(c - '0'); }
ll string_to_ll(string s) { return char_to_ll(atoi(s.c_str())); }
bool is_prime(ll x) {
  if (x <= 1)
    return false;
  for (ll i = 2; sqrt(i) <= x; i++)
    if (x % i == 0)
      return false;
  return true;
}

int main() {

  long long x;
  cin >> x;

  long long p = 100, co = 0;
  while (p < x) {
    p += p / 100;
    co++;
  }
  cout << co << endl;

  return 0;
}


Error: TLE

Fixed submission:

#include <bits/stdc++.h>
#define MOD 1e9 + 7
#define PI 3.141592653589793238
#define pb push_back
#define ALL(V) (V).begin(), (V).end()
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef long long int lint;
typedef vector<ll> VL;
typedef vector<VL> VVL;
typedef vector<int> VI;
typedef pair<ll, ll> P;
ll gcd(ll a, ll b) { return (a % b == 0 ? b : gcd(b, a % b)); }
ll lcm(ll a, ll b) { return a * b / gcd(a, b); }
ll char_to_ll(char c) { return (int)(c - '0'); }
ll string_to_ll(string s) { return char_to_ll(atoi(s.c_str())); }
bool is_prime(ll x) {
  if (x <= 1)
    return false;
  for (ll i = 2; sqrt(i) <= x; i++)
    if (x % i == 0)
      return false;
  return true;
}

int main() {
  ll x, ans = 0, co = 0;
  cin >> x;
  while (x > 0) {
    ll a = (x % 100) - 1;
    co += 100 / a;
    x -= x % 100;
  }

  cout << co << endl;

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

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

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

Error: TLE

Fixed submission:

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

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

#include <iostream>
using namespace std;

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


Error: TLE

Fixed submission:

#include <iostream>
using namespace std;

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

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

int main() {
  ll x, money = 100;
  cin >> x;
  if (x <= 100) {
    cout << 0 << endl;
    return 0;
  }
  rep(i, 3761) {
    ll plus = money / 100;
    money += plus;
    if (money >= x) {
      cout << i + 1 << endl;
      return 0;
    }
  }
}

Error: TLE

Fixed submission:

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

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

#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
using BigInt = long long;
#define ALL(a) (a).begin(), (a).end()
const long long INF = 1LL << 60;
const int MOD = 1000000007;

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


Error: TLE

Fixed submission:

#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
int main() {
  int X;
  cin >> X;
  int sum = 100;
  for (int i = 1; i < X; i++) {
    sum *= 1.01;
    if (sum >= X) {
      cout << i << endl;
      return 0;
    }
  }
}
Problem p02694 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <iostream>

using namespace std;

int main() {

  long long x, res = 0, curr = 100;
  cin >> x;

  while (curr < x) {
    res++;
    curr += curr * 0.01;
  }
  cout << res << endl;
  return 0;
}


Error: TLE

Fixed submission:

#include <iostream>

using namespace std;

int main() {

  int x, res = 0, curr = 100;
  cin >> x;

  while (curr < x) {
    res++;
    curr += curr * 0.01;
  }
  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 int x;
  cin >> x;
  long long int d = 100;
  long long int cnt = 0;

  while (d < x) {
    d = d + d * 0.01;
    cnt++;
  }
  cout << cnt << endl;
}


Error: TLE

Fixed submission:

#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int x;
  cin >> x;
  int d = 100;
  int cnt = 0;

  while (d < x) {
    d = d + d * 0.01;
    cnt++;
  }
  cout << cnt << endl;
}
Problem p02694 (C++) — buggy submission, verdict: Time Limit Exceeded

#define _USE_MATH_DEFINES
#include <iostream>
#include <math.h>
#include <string>
#include <vector>

using namespace std;

int main() {

  unsigned long K;
  unsigned long N = 100;
  int i;

  cin >> K;

  for (i = 0; N < K; i++) {
    N = N + N / 100;
  }

  cout << i;

  return 0;
}

Error: TLE

Fixed submission:

#define _USE_MATH_DEFINES
#include <iostream>
#include <math.h>
#include <string>
#include <vector>

using namespace std;

int main() {

  unsigned long K;
  unsigned long N = 0;
  int i;

  cin >> K;

  for (i = 0; N <= K; i++) {
    N = 100 + N / 100;
  }

  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 year = 0;
  int64_t sta = 100;
  long double kak = 1.01;
  while (true) {
    year += 1;
    sta *= kak;
    if (sta >= x)
      break;
  }

  cout << year << endl;
}

Error: TLE

Fixed submission:

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

int main() {

  int64_t x;
  cin >> x;

  int year = 0;
  int sta = 100;
  while (true) {
    year += 1;
    sta *= 1.01;
    if (sta >= x)
      break;
  }

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

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

#define ll long long
#define ar array

ll solve() {
  ll t = 0, a = 100, x;
  cin >> x;
  while (a < x) {
    a += a / 100;
    t++;
  }
  cout << t << endl;
  return 0;
}

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

  solve();
}


Error: TLE

Fixed submission:

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

#define ll long long
#define ar array

ll solve() {
  ll t = 0, a = 0, x;
  cin >> x;
  while (a < x) {
    a += a / 100;
    t++;
  }
  cout << t << endl;
  return 0;
}

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

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

#include <algorithm>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
typedef long long ll;
#define rep(i, n) for (int i = 0; i < (n); i++)
#define pb push_back
#define sz(a) (int)a.size()
using namespace std;

int main() {
  long double x;
  cin >> x;
  int cnt = 0;
  long double a = 100.0;
  while (a < x) {
    a *= 1.01;
    a = (ll)a;
    cnt++;
  }
  cout << cnt << endl;
}

Error: TLE

Fixed submission:

#include <algorithm>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
typedef long long ll;
#define rep(i, n) for (int i = 0; i < (n); i++)
#define pb push_back
#define sz(a) (int)a.size()
using namespace std;

int main() {
  ll x;
  cin >> x;
  int cnt = 0;
  double a = 100.0;
  while (a < x) {
    a *= 1.01;
    a = (int)a;
    cnt++;
  }
  cout << cnt << endl;
}
Problem p02694 (C++) — buggy submission, verdict: Runtime Error

#include <iostream>
#include <stdexcept>
#include <stdio.h>

using namespace std;
typedef unsigned long long llong;

#define MAX
const llong mod = 1000000000 + 7;

int main() {
  llong base = 100, X;
  int ans = 0;
  scanf("%llu", &X);

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

  printf("%d\\n", ans);

  return 0;
}

Error: TLE

Fixed submission:

#include <stdio.h>

using namespace std;
typedef long long llong;

#define MAX
const llong mod = 1000000000 + 7;

int rate = 101;
int compoundInterest(int n) { return n * rate / 100; }

int main() {
  int base = 100, X;
  int ans;
  scanf("%lld", &X);

  while (base < X) {
    base = compoundInterest(base);
    ans++;
  }

  printf("%d\\n", ans);

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

#include <iostream>
using namespace std;
int main(void) {
  long long x, a = 100;
  cin >> x;
  for (int i = 1;; i++) {
    a += a / 100;
    if (a >= x) {
      cout << i << endl;
      return 0;
    }
  }
}

Error: TLE

Fixed submission:

#include <iostream>
using namespace std;

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

  int count = 0;
  int money = 100;

  while (x > money) {
    /*money *= 1.01;
    money /= 1;*/
    money += money / 100;
    count++;
  }

  /*

      for (int i = 0; i < 3760; i++)
      {
          money *= 1.01;
          money /= 1;
          count ++ ;
          if(x <= money){
              break;
          }
      }
  */

  cout << count << endl;

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

#include <algorithm>
#include <iostream>
#include <vector>

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

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

  long long total = 100;
  int Counter = 0;
  for (int i = 0; total < X; i++) {
    total *= 1.01;
    Counter += 1;
  }
  cout << Counter << endl;
}


Error: TLE

Fixed submission:

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

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

#include <bits/stdc++.h>
#include <iostream>
#include <math.h>
using namespace std;
int64_t fukuri(int64_t price, int64_t target, int64_t count) {
  if (price >= target) {
    return count;
  }

  price = int(price * 1.01);
  count += 1;
  return fukuri(price, target, count);
}
int main() {
  long long X;
  cin >> X;
  long long count = 0;
  long long price = 100;
  while (price < X) {
    price = price * 1.01;
    count += 1;
  }
  cout << count << endl;
  return 0;
}

Error: TLE

Fixed submission:

#include <bits/stdc++.h>
#include <iostream>
#include <math.h>
using namespace std;
int64_t fukuri(int64_t price, int64_t target, int64_t count) {
  if (price >= target) {
    return count;
  }

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

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

int main() {
  long long int x = 100, z, count = 0;
  cin >> z;
  // co=x;
  int i = 1;
  while (i) {

    // t=int(x/100);

    x += x / 100;
    count++;
    // cout<<x;
    if (x >= z)
      i = 0;
  }
  cout << count;
}


Error: TLE

Fixed submission:

#include <algorithm>
#include <cctype>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <functional>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
using namespace std;
#define DEBUG(x) cout << '>' << #x << ':' << x << endl;
#define REP(i, n) for (int i = 0; i < (n); i++)
#define FOR(i, a, b) for (int i = (a); i <= (b); i++)
#define FORD(i, a, b) for (int i = (a); i >= (b); i--)

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

#include <bits/stdc++.h>
#define ll long long int
using namespace std;
int main() {
  ll x;
  cin >> x;
  ll val = 100;
  int i;
  for (i = 0; val < x; i++)
    val = (ll)(val * 1.01);
  cout << i << endl;
  return 0;
}

Error: TLE

Fixed submission:

#include <bits/stdc++.h>
#define ll long long int
using namespace std;
int main() {
  ll x;
  cin >> x;
  ll val = 100;
  int i;
  for (i = 0; val < x; i++)
    val = (int)(val * 1.01);
  cout << i << endl;
  return 0;
}