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;
  unsigned long long now = 100, ctr = 0;
  while (now < X) {
    now += now / 100;
    ctr++;
  }
  cout << ctr << endl;
  return 0;
}


Error: TLE

Fixed submission:

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

int main() {

  long long X;
  cin >> X;
  unsigned long long now = 100, ctr = 0;
  while (now < X) {
    now = now * 101 / 100;
    ctr++;
  }
  cout << ctr << 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 RREP(i, s, n) for (int i = s; i < (n); i++)
#define ALL(a) a.begin(), a.end()
#define RALL(a) a.rbegin(), a.rend()
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;
}
using namespace std;
using ll = long long;
typedef pair<int, int> pint;
typedef pair<ll, ll> pll;
const ll MOD = 1000000007;
const ll INF = MOD * MOD;
const int inf = (1 << 29);

int main() {

  ll x;
  cin >> x;

  ll a = 100;

  ll i = 0;
  while (a < x) {
    i++;
    a += a / 100;
  }

  cout << i << endl;

  return 0;
}

Error: TLE

Fixed submission:

#include <bits/stdc++.h>
#define REP(i, n) for (int i = 0; i < (n); i++)
#define RREP(i, s, n) for (int i = s; i < (n); i++)
#define ALL(a) a.begin(), a.end()
#define RALL(a) a.rbegin(), a.rend()
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;
}
using namespace std;
using ll = long long;
typedef pair<int, int> pint;
typedef pair<ll, ll> pll;
const ll MOD = 1000000007;
const ll INF = MOD * MOD;
const int inf = (1 << 29);

int main() {

  ll x;
  cin >> x;

  ll a = 100;

  ll i = 0;
  while (a < x) {
    i++;
    a = a * 101 / 100;
  }

  cout << i << endl;

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

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

int main() {

  long long X;
  long long sum = 100;
  cin >> X;
  for (long long i = 1; i < X; i++) {
    sum *= 1.01;

    if (sum >= X) {
      cout << i << endl;
      break;
    }
  }
}


Error: TLE

Fixed submission:

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

int main() {

  int X;
  int sum = 100;
  cin >> X;
  for (int i = 1; i < X; i++) {
    sum *= 1.01;

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

#include <iostream>
using namespace std;

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


Error: TLE

Fixed submission:

#include <iostream>
using namespace std;

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

#include <algorithm>
#include <iostream>
#include <string>
#include <vector>
using ll = long long;
using namespace std;
#define rep(i, n) for (int i = 0; i < n; i++)

int main() {
  ll x;
  cin >> x;
  int count = 0;
  ll p = 100;
  bool a = true;
  while (a) {
    p += p / 100;
    count++;
    if (p >= x) {
      cout << count << endl;
      a = false;
    }
  }
  return 0;
}


Error: TLE

Fixed submission:

#include <algorithm>
#include <iostream>
#include <string>
#include <vector>
using ll = long long;
using namespace std;
#define rep(i, n) for (int i = 0; i < n; i++)

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

#include <algorithm>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <vector>
#define rep(i, n) for (int i = 0; i < n; ++i)
using namespace std;
using ll = long long;
using P = pair<int, int>;

int main() {
  ll X, yen;
  cin >> X;
  ll year = 0;
  yen = 100;
  while (yen / X < 1) {
    yen += yen / 100;
    year++;
  }
  cout << year << endl;
  return 0;
}

Error: TLE

Fixed submission:

#include <algorithm>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <vector>
#define rep(i, n) for (int i = 0; i < n; ++i)
using namespace std;
using ll = long long;
using P = pair<int, int>;

int main() {
  ll X, yen;
  cin >> X;
  ll year = 0;
  yen = 100;
  while (yen < X) {
    yen = ll(101 * yen);
    yen /= 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 X;
  cin >> X;
  long long sum = 100;
  long long ans = 0;

  while (sum < X) {
    sum += sum * 0.01;
    ans++;
  }

  cout << ans << endl;
}

Error: TLE

Fixed submission:

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

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

  while (sum < X) {
    sum += sum * 0.01;
    ans++;
  }

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

#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const ll d1 = 101;
const ll d2 = 100;

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

Error: TLE

Fixed submission:

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

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

#include <bits/stdc++.h>

using namespace std;

typedef long long int ll;

#define FOR(i, l, r) for (i = l; i < r; i++)

#define REP(i, n) FOR(i, 0, n)

#define ALL(x) x.begin(), x.end()

#define P pair<ll, ll>

#define F first

#define S second

signed main() {

  ll X, i = 100, ans = 0;
  cin >> X;

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

  return 0;
}

Error: TLE

Fixed submission:

#include <bits/stdc++.h>

using namespace std;

typedef long long int ll;

#define FOR(i, l, r) for (i = l; i < r; i++)

#define REP(i, n) FOR(i, 0, n)

#define ALL(x) x.begin(), x.end()

#define P pair<ll, ll>

#define F first

#define S second

signed main() {

  ll X, i = 100, ans = 0;
  cin >> X;

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

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

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

int main() {
  unsigned long long int x;
  unsigned long long int n = 100;
  int count = 0;
  cin >> x;

  while (n < x) {
    n = n * 1.01;
    count++;
  }

  cout << count;
}


Error: TLE

Fixed submission:

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

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

  while (n < x) {
    n = n * 101;
    n = n / 100;
    count++;
  }

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

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


Error: TLE

Fixed submission:

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

#include <iostream>
using namespace std;

int main() {
  long long int x, tmp = 100, cnt = 0;
  cin >> x;
  while (tmp < x) {
    tmp = tmp * 1.01;
    cnt++;
    if (tmp >= x)
      break;
  }
  cout << cnt << endl;
  return 0;
}

Error: TLE

Fixed submission:

#include <iostream>
using namespace std;

int main() {
  long long int x, tmp = 100, cnt = 0;
  cin >> x;
  while (tmp < x) {
    tmp = tmp * 101 / 100;
    cnt++;
    if (tmp >= x)
      break;
  }
  cout << cnt << 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 y = 100;
  int count = 0;
  while (y < x) {
    y *= 1.01;
    count++;
  }
  cout << count << endl;
}

Error: TLE

Fixed submission:

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

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

#include <algorithm>
#include <cmath>
#include <iostream>
#include <sstream>
#include <string>
using namespace std;

int arr[101] = {0};

int main() {
  long long int a, num = 100, t = 0;
  cin >> a;
  while (num < a) {
    num += num / 100;
    t++;
  }
  cout << t;
}


Error: TLE

Fixed submission:

#include <algorithm>
#include <cmath>
#include <iostream>
#include <sstream>
#include <string>
using namespace std;

int arr[101] = {0};

int main() {
  int a, num = 100, t = 0;
  cin >> a;
  while (num < a) {
    num *= 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)
using namespace std;
using ll = long long;
using P = pair<int, int>;

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

Error: TLE

Fixed submission:

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

int main() {
  ll x;
  cin >> x;
  ll ans = 0;
  ll y = 100;
  while (y < x) {
    y = y * 101 / 100;
    // cout << y << endl;
    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 P = 100, step = 0;
  while (P < X) {
    P += P / 100;
    step++;
  }
  cout << step << endl;
  return 0;
}


Error: TLE

Fixed submission:

#include <iostream>
using namespace std;
int main(void) {
  // Your code here!
  long long X = 100;
  long long A;
  cin >> A;
  int ans = 0;
  while (X < A) {
    X = X * 101 / 100;
    ans++;
  }
  cout << ans << endl;
}
Problem p02694 (C++) — buggy submission, verdict: Time Limit Exceeded

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

using namespace std;

long long x;
int n = 0;
long long chokin = 100;

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


Error: TLE

Fixed submission:

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

using namespace std;

int x;
int n = 0;
int chokin = 100;

int main() {
  cin >> x;
  do {
    n++;
    chokin = chokin * 1.01;

  } while (chokin < x);
  cout << n << 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 K = 100;
  int a = 0;
  while (K < X) {
    K *= 1.01;
    a++;
  }
  cout << a << endl;
}


Error: TLE

Fixed submission:

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

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


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

int main()

{
  unsigned long long int n = 100;
  unsigned long long int check;
  cin >> check;
  // int ans;

  for (int i = 1; i < i + 2; i++) {
    unsigned long long temp = (n / 100);
    n = n + temp;
    if (n >= check) {
      // ans=i;
      cout << i << endl;
      return 0;
      // cout<<"there are sum of the first
    }
  }
}


Error: TLE

Fixed submission:


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

int main()

{
  int n = 100;
  int check;
  cin >> check;
  int ans;

  for (int i = 1; i < i + 2; i++) {
    int temp = (n / 100);
    n = n + temp;
    if (n >= check) {
      ans = i;
      cout << i << endl;
      return 0;
      // cout<<"there are sum of the first
    }
  }
}
Problem p02694 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <iostream>
using namespace std;

int main() {
  long long x, m = 100;
  cin >> x;
  for (int i = 1;; i++) {
    m += m / 100;
    if (m >= x) {
      cout << i << endl;
      break;
    }
  }

  return 0;
}

Error: TLE

Fixed submission:

#include <iostream>
using namespace std;

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

  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 n = 0;
  long long X;
  cin >> X;

  while (a < X) {
    a = a * 1.01;
    n++;
  }
  cout << n << endl;
}


Error: TLE

Fixed submission:

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

int main() {
  int a = 100;
  int n = 0;
  int X;
  cin >> X;
  while (a < X) {
    a = a * 1.01;
    n++;
  }
  cout << n << 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 < (int)(n); i++)
#define all(v) v.begin(), v.end()
int main() {
  int64_t x;
  cin >> x;
  int64_t t = 100;
  int ans = 0;
  while (t < x) {
    t = t + t / 100;
    ans++;
  }
  cout << ans << endl;
}

Error: TLE

Fixed submission:

#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define all(v) v.begin(), v.end()
int main() {
  int64_t x;
  cin >> x;
  int64_t t = 100;
  int ans = 0;
  while (t < x) {
    t = (t * 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, i = 1, m = 100;
  cin >> x;

  while (true) {
    m += (m / 100);
    if (m >= x) {
      cout << i << endl;
      break;
    }
    i++;
  }
}


Error: TLE

Fixed submission:

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

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

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

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

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

Error: TLE

Fixed submission:

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

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

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

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

Error: TLE

Fixed submission:

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

int main(void) {
  int x;
  int n = 100;
  cin >> x;
  int i = 0;
  while (true) {
    if (n >= x) {
      cout << i;
      return 0;
    }
    n *= 1.01;
    i++;
  }
}
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;
  long cnt = 0;
  while (sum < X) {
    sum = sum * 1.01;
    cnt++;
  }
  cout << cnt << endl;
}

Error: TLE

Fixed submission:

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

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

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

#include <algorithm>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <map>
#include <string>
#include <vector>
#define rip(i, n) for (int i = 0; i < n; i++)
#define ll long long
#define ld long double
#define set setprecision　 //小数点以下何位まで知りたいか
#define mod 1000000007
#define pi 3.14159265
#include <numeric>
using namespace std;
int gcd(int a, int b) // 最大公約数
{
  if (a % b == 0)
    return (b);
  else
    return (gcd(b, a % b));
}
int lcm(int a, int b) // 最小公倍数
{
  return a * b / gcd(a, b);
}
ll pow(ll a, ll b) {
  ll k = b % 30000, h = b / 30000, s = 1;
  rip(i, 30000) s = (s * a) % mod;
  ll j = 1;
  if (h != 0)
    rip(i, h) j = j * s % mod;
  if (k != 0)
    rip(i, k) j = j * a % mod;
  return (j);
}
int main() {
  ll x;
  cin >> x;
  ll s = 100;
  ll p = 0;
  while (s < x) {
    s += s / 100;
    p++;
  }
  cout << p << endl;
}


Error: TLE

Fixed submission:

#include <algorithm>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <map>
#include <string>
#include <vector>
#define rip(i, n) for (int i = 0; i < n; i++)
#define ll long long
#define ld long double
#define set setprecision　 //小数点以下何位まで知りたいか
#define mod 1000000007
#define pi 3.14159265
#include <numeric>
using namespace std;
int main() {
  ll x;
  cin >> x;
  int k = 100;
  int i = 0;
  while (k < x) {
    k += k / 100;
    i++;
  }
  cout << i << endl;
}
Problem p02694 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
using namespace std;

#define ff first
#define ss second
#define int long long
#define pb push_back
#define mp make_pair
#define pii pair<int, int>
#define vi vector<int>
#define mii map<int, int>
#define pqb priority_queue<int>
#define pqs priority_queue<int, vi, greater<int>>
#define setbits(x) __builtin_popcountll(x)
#define zrobits(x) __builtin_ctzll(x)
#define mod 1000000007
#define inf 1e18
#define ps(x, y) fixed << setprecision(y) << x
#define mk(arr, n, type) type *arr = new type[n];
#define w(x)                                                                   \\
  int x;                                                                       \\
  cin >> x;                                                                    \\
  while (x--)
#define FIO                                                                    \\
  ios_base::sync_with_stdio(0);                                                \\
  cin.tie(0);                                                                  \\
  cout.tie(0)
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

typedef tree<int, null_type, less<int>, rb_tree_tag,
             tree_order_statistics_node_update>
    pbds;

int32_t main() {
  FIO;
  int cur = 100;
  int x;
  cin >> x;
  int yr = 0;
  while (cur < x) {
    cur = cur + cur / 100;
    yr++;
  }

  cout << yr << '\\n';
  return 0;
}

Error: TLE

Fixed submission:

#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
using namespace std;

#define ff first
#define ss second
#define int long long
#define pb push_back
#define mp make_pair
#define pii pair<int, int>
#define vi vector<int>
#define mii map<int, int>
#define pqb priority_queue<int>
#define pqs priority_queue<int, vi, greater<int>>
#define setbits(x) __builtin_popcountll(x)
#define zrobits(x) __builtin_ctzll(x)
#define mod 1000000007
#define inf 1e18
#define ps(x, y) fixed << setprecision(y) << x
#define mk(arr, n, type) type *arr = new type[n];
#define w(x)                                                                   \\
  int x;                                                                       \\
  cin >> x;                                                                    \\
  while (x--)
#define FIO                                                                    \\
  ios_base::sync_with_stdio(0);                                                \\
  cin.tie(0);                                                                  \\
  cout.tie(0)
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

typedef tree<int, null_type, less<int>, rb_tree_tag,
             tree_order_statistics_node_update>
    pbds;

int32_t main() {
  FIO;
  int cur = 100;
  int x;
  cin >> x;
  int yr = 0;
  while (cur < x)
    cur = (101 * cur) / 100, yr++;

  cout << yr << '\\n';
  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)
using namespace std;
typedef long long ll;

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

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

#include <bits/stdc++.h>
#include <iostream>
using namespace std;
typedef long long ll;
int main(void) {
  ll c = 0;
  ll x, m = 100;
  cin >> x;
  while (x > m) {
    m += m / 100;
    c++;
  }
  cout << c << endl;
}


Error: TLE

Fixed submission:

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

#include <iostream>
using namespace std;

int main() {
  long long int n = 100;
  long long int x;
  int count = 0;
  cin >> x;
  while (n < x) {
    count += 1;
    n += n / 100;
  }
  cout << count << '\\n';
  return 0;
}


Error: TLE

Fixed submission:

#include <iostream>
using namespace std;

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

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

signed main() {

  ios::sync_with_stdio(false);
  cin.tie(nullptr);

  int x;
  cin >> x;
  int n = 100;
  int cnt = 0;
  while (true) {
    cnt++;
    n += n / 100;
    if (n >= x)
      break;
  }
  cout << cnt << endl;
  return 0;
}

Error: TLE

Fixed submission:

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

int gaku(int n) {
  if (n == 0)
    return 100;
  int ans = 101 * gaku(n - 1) / 100;
  return ans;
}

signed main() {

  ios::sync_with_stdio(false);
  cin.tie(nullptr);

  int x;
  cin >> x;
  int n = 0;
  int ans;
  while (true) {
    if (gaku(n) >= x) {
      int ans = n;
      break;
    }
    n++;
  }
  cout << n << 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 y = 100;

  int count = 0;

  while (y < x) {
    y += y / 100;
    count++;
  }

  cout << count << endl;
}


Error: TLE

Fixed submission:

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

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

  long long count = 0;

  while (y < x) {
    y += y / 100;
    count++;
  }

  cout << count << endl;
}