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;

  int v = 0;
  long long goukei = 100;
  long ans = 0;
  while (true) {
    goukei += goukei / 100;
    ans++;
    if (goukei >= x) {
      break;
    }
  }
  cout << ans << endl;
}

Error: TLE

Fixed submission:

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

int result = 0;
int sum(int &y) {
  y = y + y * 0.01;
  return y;
}

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

  int goukei = 100;
  int ans = 0;
  while (true) {
    goukei = goukei + goukei * 0.01;
    ans++;
    if (goukei >= x) {
      break;
    }
  }
  cout << ans << 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 c = 100;
  for (int i = 1; i < 4000; i++) {
    c *= 1.01;
    if (c >= X) {
      cout << i << endl;
      break;
    }
  }
}


Error: TLE

Fixed submission:

#include <bits/stdc++.h>
using namespace std;
int main() {
  int X;
  cin >> X;
  int c = 100;
  for (int64_t i = 0; i < 1000000000000000000; i++) {
    c *= 1.01;
    if (c >= X) {
      cout << i + 1 << endl;
      break;
    }
  }
}
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 y = 100;
  int count = 0;
  while (x > y) {
    y += y / 100;
    count++;
  }
  cout << count << endl;
}


Error: TLE

Fixed submission:

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

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

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

int main() {
  double x;
  cin >> x;
  int i = 0;
  double a = 100;
  while (a < x) {
    a = floor(a * 1.01);
    i += 1;
  }
  cout << i << endl;
  return 0;
}

Error: TLE

Fixed submission:

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

int main() {
  float x;
  cin >> x;
  int i = 0;
  float a = 100;
  while (a < x) {
    x = floor(a * 1.01);
    i += 1;
  }
  cout << i << endl;
  return 0;
}
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;
  long year = 0;

  while (money <= x - 1) {
    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 - 1) {
    money += money / 100;
    year++;
  }
  cout << year << endl;
}
Problem p02694 (C++) — buggy submission, verdict: Time Limit Exceeded

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

Error: TLE

Fixed submission:

#include <iostream>
using namespace std;
int main() {
  long long x;
  cin >> x;
  long long money = 100;
  int i;
  for (i = 0; money < x; i++) {
    money = money * 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 N;
  int64_t count = 0;
  cin >> N;
  int64_t sum = 100;
  while (sum < N) {
    int64_t r = sum / 100;
    sum += r;
    count++;
  }
  cout << count << endl;
}


Error: TLE

Fixed submission:

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

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

#include <algorithm>
#include <array>
#include <bitset>
#include <cassert>    // assert
#include <cmath>      // abs など
#include <functional> // greater など
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric> // accumulate, gcd など
#include <queue>
#include <set>
#include <stdexcept>
#include <string>
#include <tuple>
#include <vector>
using namespace std;

// #include <boost/multiprecision/cpp_int.hpp>
// using namespace boost::multiprecision;

#define rep(i, n) for (int i = 0; i < (int)(n); i++)
typedef long long ll;
// typedef int128_t ll;
// typedef cpp_int ll;

// GCC, 配列のアクセスなど
#define _GLIBCXX_DEBUG
// Clang, 配列のアクセスなど
#define _LIBCPP_DEBUG 0

// #define NDEBUG 1
// debug用出力 https://trap.jp/post/998/
void debug_out() { cerr << endl; }
template <typename Head, typename... Tail> void debug_out(Head H, Tail... T) {
  cerr << H << " ";
  debug_out(T...);
}
#ifdef NDEBUG
#define debug(...)
#else
#define debug(...) debug_out(__VA_ARGS__)
#endif

//////////////// //////////////// //////////////// ////////////////
///////////////////
//////////////// //////////////// //////////////// ////////////////
///////////////////

// constexpr inline ll mod = 1'000'000'007;
// constexpr int max_n = 200'000 + 5;

int main() {
  // 高速な入出力
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  cout << setprecision(15); // 浮動小数の表示の精度

  ll x;
  cin >> x;
  int y = 0;
  ll a = 100;
  while (a < x) {
    y++;
    a += a / 100;
  }
  cout << y << endl;

  return 0;
}


Error: TLE

Fixed submission:

#include <algorithm>
#include <array>
#include <bitset>
#include <cassert>    // assert
#include <cmath>      // abs など
#include <functional> // greater など
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric> // accumulate, gcd など
#include <queue>
#include <set>
#include <stdexcept>
#include <string>
#include <tuple>
#include <vector>
using namespace std;

// #include <boost/multiprecision/cpp_int.hpp>
// using namespace boost::multiprecision;

#define rep(i, n) for (int i = 0; i < (int)(n); i++)
typedef long long ll;
// typedef int128_t ll;
// typedef cpp_int ll;

// GCC, 配列のアクセスなど
#define _GLIBCXX_DEBUG
// Clang, 配列のアクセスなど
#define _LIBCPP_DEBUG 0

// #define NDEBUG 1
// debug用出力 https://trap.jp/post/998/
void debug_out() { cerr << endl; }
template <typename Head, typename... Tail> void debug_out(Head H, Tail... T) {
  cerr << H << " ";
  debug_out(T...);
}
#ifdef NDEBUG
#define debug(...)
#else
#define debug(...) debug_out(__VA_ARGS__)
#endif

//////////////// //////////////// //////////////// ////////////////
///////////////////
//////////////// //////////////// //////////////// ////////////////
///////////////////

// constexpr inline ll mod = 1'000'000'007;
// constexpr int max_n = 200'000 + 5;

int main() {
  // 高速な入出力
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  cout << setprecision(15); // 浮動小数の表示の精度

  ll x;
  cin >> x;
  int y = 0;
  ll a = 100;
  while (a < x) {
    y++;
    a = a * 101 / 100;
  }
  cout << y << endl;

  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 p = 100;
  int64_t count = 0;
  while (1) {
    p *= 1.01;
    count++;
    if (x <= p)
      break;
  }
  cout << count << endl;
}


Error: TLE

Fixed submission:

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

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

  while (1) {
    p += p / 100;
    count++;
    if (x <= p)
      break;
  }
  cout << count << endl;
}
Problem p02694 (C++) — buggy submission, verdict: Time Limit Exceeded

#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 * 1.01;
  }
  printf("%lld", i);
  return 0;
}

Error: TLE

Fixed submission:

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

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

int main() {
  cin >> X;

  int i = 0;
  long long Y = 100;
  while (X > Y) {
    Y += 0.01 * Y;
    i++;
  }

  cout << i << endl;
}

Error: TLE

Fixed submission:

#include <cmath>
#include <iostream>
using namespace std;
unsigned long long X;

int main() {
  cin >> X;

  for (int i = 0;; i++) {
    unsigned long long Y = 100;

    Y = 1.01 * Y;
    if (X <= Y) {
      cout << i << endl;
      break;
    }
  }
}
Problem p02694 (C++) — buggy submission, verdict: Time Limit Exceeded

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

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

  int count = 0;
  ll sum = 100;
  ;

  while (x > sum) {
    sum = sum + (sum / 100);
    count++;
  }

  cout << count << endl;
}

Error: TLE

Fixed submission:

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

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

  int count = 0;
  int sum = 100;
  ;

  while (x > sum) {
    sum = sum + (sum / 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 P = 100, step = 0;
  while (P < X) {
    P += P / 100;
    step++;
  }
  cout << step << endl;
}

Error: TLE

Fixed submission:

#include <iostream>
using namespace std;

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

#include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define rep(i, n) for (ll i = 0; i < n; i++)
#define rep1(i, n) for (ll i = 1; i <= n; i++)
#define mp make_pair
#define F first
#define S second
#define pf pop_front
#define IOS                                                                    \\
  ios_base::sync_with_stdio(0);                                                \\
  cin.tie(0)
typedef long long ll;
const ll mod = 1e9 + 7;
const ll maxn = 1000005;
const ll inf = 1e9 + 7;
typedef pair<ll, ll> pii;
ll k, a, b;
int main() {
  while (cin >> k) {
    ll x = 100;
    ll sum = 0;
    while (x < k) {
      x = x + x * 1 / 100;
      sum++;
      // cout<<x<<"\\n";
    }
    cout << sum << "\\n";
  }
}


Error: TLE

Fixed submission:

#include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define rep(i, n) for (ll i = 0; i < n; i++)
#define rep1(i, n) for (ll i = 1; i <= n; i++)
#define mp make_pair
#define F first
#define S second
#define pf pop_front
#define IOS                                                                    \\
  ios_base::sync_with_stdio(0);                                                \\
  cin.tie(0)
typedef long long ll;
const ll mod = 1e9 + 7;
const ll maxn = 1000005;
const ll inf = 1e9 + 7;
typedef pair<ll, ll> pii;
ll k, a, b;
int main() {
  while (cin >> k) {
    ll x = 100;
    ll sum = 0;
    while (x < k) {
      x = x * 101 / 100;
      sum++;
    }
    cout << sum << "\\n";
  }
}
Problem p02694 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define rep(i, sta, end) for (ll i = sta; i < end; i++)
#define all(x) x.begin(), x.end()
#define MOD 1000000007
#define vvl vector<vector<ll>>
#define vl vector<ll>
#define acc_io                                                                 \\
  cin.tie(0);                                                                  \\
  ios::sync_with_stdio(false)
// name[i]   -> vl  name(i)
// name[i][j]-> vvl name(i,vl(j))
// or-> ||
#include <math.h>

signed main() {
  acc_io;
  ll x;
  cin >> x;
  ll y = 1, tmp = 100;
  while (1) {
    //		tmp/=100;
    tmp *= 1.01;
    if (x <= tmp)
      break;
    y++;
  }
  cout << y << endl;
  return 0;
}


Error: TLE

Fixed submission:

#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define rep(i, sta, end) for (ll i = sta; i < end; i++)
#define all(x) x.begin(), x.end()
#define MOD 1000000007
#define vvl vector<vector<ll>>
#define vl vector<ll>
#define acc_io                                                                 \\
  cin.tie(0);                                                                  \\
  ios::sync_with_stdio(false)
// name[i]   -> vl  name(i)
// name[i][j]-> vvl name(i,vl(j))
// or-> ||
#include <math.h>

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

#include <algorithm>
#include <iostream>
#include <string>
#include <vector>
using namespace std;
using ll = long long;
using P = pair<int, int>;

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

  long long year = 0;
  long long sum = 100;
  while (sum < x) {
    sum += sum / 100;
    ++year;
  }
  cout << year << endl;
}

Error: TLE

Fixed submission:

#include <algorithm>
#include <iostream>
#include <string>
#include <vector>
using namespace std;
using ll = long long;
using P = pair<int, int>;

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

  int tot = 100;
  int year = 0;

  while (tot < x) {
    tot *= 1.01;
    ++year;
  }
  cout << year << endl;
}
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 < n; i++)
typedef long long ll;
#define ALL(a) (a).begin(), (a).end()

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

Error: TLE

Fixed submission:

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

int main() {
  ll x;
  cin >> x;
  ll start = 100;
  for (ll i = 1;; i++) {
    start *= 101;
    start /= 100;
    if (start >= x) {
      cout << i << endl;
      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 < n; i++)
typedef long long ll;
#define ALL(a) (a).begin(), (a).end()

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

Error: TLE

Fixed submission:

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

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

#include <algorithm>
#include <cmath>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <string>
#include <vector>
using namespace std;
typedef long long ll;

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


Error: TLE

Fixed submission:

#include <algorithm>
#include <cmath>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <string>
#include <vector>
using namespace std;
typedef long long ll;

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

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

int main() {
  long long N, M = 100, cnt = 0;
  cin >> N;

  while (true) {
    long long i = M / 100;
    M += i;
    cnt++;
    if (M >= N)
      break;
  }
  cout << cnt << endl;
}


Error: TLE

Fixed submission:

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

int main() {
  double N, M = 100, cnt = 0;
  cin >> N;

  while (true) {
    M * 1.01;
    cnt++;
    if (M >= N)
      break;
  }
  cout << cnt << 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 sum = 100;
  long long i = 0;

  while (sum < x) {
    sum += sum * 0.01;
    i++;
  }
  cout << i << endl;
}

Error: TLE

Fixed submission:

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

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

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

#include <algorithm>
#include <cmath>
#include <functional>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <utility>
#include <vector>

using namespace std;

int main() {
  long long int n;
  cin >> n;
  long long int i = 100;
  int j = 0;
  while (true) {
    if (n <= i) {
      cout << j;
      return 0;
    }
    i = i * 1.01;
    j++;
  }
}


Error: TLE

Fixed submission:

#include <algorithm>
#include <cmath>
#include <functional>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <utility>
#include <vector>

using namespace std;

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

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

int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.tie(nullptr);
  cout.precision(10);
  cout << fixed;

#ifdef _DEBUG
  freopen("input.txt", "r", stdin);
#endif // _DEBUG

  long long x;
  cin >> x;
  long long p = 100, i = 0;
  while (p < x) {
    p += p / 100;
    i++;
  }
  cout << i;
  return 0;
}


Error: TLE

Fixed submission:

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

int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.tie(nullptr);
  cout.precision(10);
  cout << fixed;

#ifdef _DEBUG
  freopen("input.txt", "r", stdin);
#endif // _DEBUG

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

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

int main() {
  int64_t x;
  int ans = 0;
  int64_t save = 100;
  cin >> x;

  while (save < x) {
    save += save / 100;
    ans++;
  }
  cout << ans << endl;
}


Error: TLE

Fixed submission:

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

int main() {
  int64_t x;
  int64_t cnt = 0;
  int64_t save = 100;
  cin >> x;

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

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

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

Error: TLE

Fixed submission:

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

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

#include <iostream>
using namespace std;
int main() {
  // 整数の入力
  long a;
  cin >> a;

  long long i = 100;
  int k = 0;
  while (i < a) {
    i += i / 100;
    k++;
  }

  cout << k << endl;

  return 0;
}


Error: TLE

Fixed submission:

#include <iostream>
using namespace std;
int main() {
  // 整数の入力
  int a;
  cin >> a;

  int i = 100; // カウンタ変数
  int k = 0;
  while (i < a) {
    i = (int)(i * 1.01);
    k++;
  }

  cout << k << endl;

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

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

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


Error: TLE

Fixed submission:

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

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

#include <iostream>
using namespace std;

/* */

int main() {
  // 入力スタンダード
  long long x;
  cin >> x;

  int year = 1;
  long long val = 100;

  while (true) {
    val += val / 100;
    if (val >= x) {
      break;
    } else {
      year++;
    }
  }

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

Error: TLE

Fixed submission:

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

/* */

int main() {
  // 入力スタンダード
  int x;
  cin >> x;

  int year = 1;
  int val = 100;
  while ((val *= 1.01) < x) {
    year++;
  }

  cout << year;
  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 = 0;
  cin >> x;
  int count = 0;
  long long num = 100;
  while (num < x) {
    num += num / 100;
    count++;
  }
  cout << count << endl;
}


Error: TLE

Fixed submission:

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

int main() {
  long long x = 0;
  cin >> x;
  int count = 0;
  int num = 100;
  while (num < x) {
    num += num / 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 int X;
  int i = 0;
  long long int sum = 100;
  cin >> X;
  while (X > sum) {
    sum *= 1.01;
    // cout << sum << endl;
    i++;
  }
  cout << i << endl;
}

Error: TLE

Fixed submission:

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

int main() {

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

#include <bits/stdc++.h>
using namespace std;
void print() { cout << endl; }
template <class Head, class... Tail> void print(Head &&head, Tail &&...tail) {
  cout << head;
  if (sizeof...(tail) != 0)
    cout << " ";
  print(forward<Tail>(tail)...);
}
template <class T> void print(vector<T> &vec) {
  for (auto &a : vec) {
    cout << a;
    if (&a != &vec.back())
      cout << " ";
  }
  cout << endl;
}
template <class T> void print(vector<vector<T>> &df) {
  for (auto &vec : df) {
    print(vec);
  }
}
#define rep(i, n) for (int i = 0, i##_len = (n); i < i##_len; ++i)
#define xrep(i, a, b) for (int i = int(a); i < int(b); ++i)
using ll = long long;
const int INF = 1001001001;

int main() {
  ll X;
  cin >> X;
  ll base = 100;
  int n = 0;
  while (base < X) {
    base += base / 100;
    n++;
  }
  print(n);

  return 0;
}

Error: TLE

Fixed submission:

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

int main() {
  ll X;
  cin >> X;
  double base = 100;
  ll c = 0;
  while (base < X) {
    base = (int)(1.01 * base);
    ++c;
  }

  cout << c << endl;

  return 0;
}