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

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

long long n, m;

int main() {
  long long a = 100;
  cin >> n;
  if (n >= 1335850880) {
    a = 1335850880;
    int i = 0;
    while (a < n) {
      a = a + a * 0.01;
      i++;
    }
    cout << i + 1706;
    return 0;
  }
  int i = 0;
  while (a < n) {
    a = a + a * 0.01;
    i++;
  }
  cout << i;
  return 0;
}


Error: TLE

Fixed submission:

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

long long n, m;

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

#include <iostream>
using namespace std;

int main() {
  unsigned long long int nowmoney = 100, x;
  int year = 0;
  cin >> x;

  while (x > nowmoney) {
    nowmoney = nowmoney * 1.01;
    year++;
  }
  cout << year << endl;

  return 0;
}

Error: TLE

Fixed submission:

#include <iostream>
using namespace std;

int main() {
  int nowmoney = 100, x, year = 0;
  cin >> x;

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


Error: TLE

Fixed submission:

#include <iostream>
using namespace std;
int main() {
  long long x;
  cin >> x;
  long long sum = 100, cnt = 0;
  while (sum != x) {

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


Error: TLE

Fixed submission:

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

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

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


Error: TLE

Fixed submission:

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

int main() {
  int x, now = 100, ans = 0;
  cin >> x;
  while (now < x) {
    now += now / 100;
    ans++;
  }
  cout << ans << endl;
}
Problem p02694 (C++) — buggy submission, verdict: Runtime Error

#include <algorithm>
#include <cmath>
#include <fstream>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>

using namespace std;

typedef long long ll;
#define pb push_back
#define ld long double
const ll N = 100005;
const int inf = 1e9;

int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  ll n, k, c, ans = 0;
  cin >> n;
  k = 100;
  while (k < n) {
    k += k / 100;
    ans++;
  }
  cout << ans << '\\n';
  return 0;
}


Error: WA

Fixed submission:

#include <algorithm>
#include <cmath>
#include <fstream>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>

using namespace std;

typedef long long ll;
#define pb push_back
#define ld long double
const ll N = 100005;
const int inf = 1e9;

struct edge {
  int a, b, cost;
};

int n, m, v;
vector<edge> e;

int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> m;
  vector<int> d(n, inf);
  e.resize(m);
  for (int i = 0; i < m; i++) {
    cin >> e[i].a >> e[i].b >> e[i].cost;
    --e[i].a, --e[i].b;
  }
  d[0] = 0;
  for (int i = 0; i < n - 1; ++i)
    for (int j = 0; j < m; ++j)
      if (d[e[j].a] < inf)
        d[e[j].b] = min(d[e[j].b], d[e[j].a] + e[j].cost);
  for (int i = 0; i < n; i++) {
    if (d[i] != 1e9)
      cout << d[i] << ' ';
    else
      cout << 30000 << ' ';
  }
  return 0;
}
Problem p02694 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <iostream>
#define line cout << endl
#pragma GCC optimize(2)
#pragma GCC optimize(3)
#pragma GCC optimize("Ofast")
#pragma GCC optimize("inline")
#pragma GCC optimize("-fgcse")
#pragma GCC optimize("-fgcse-lm")
#pragma GCC optimize("-fipa-sra")
#pragma GCC optimize("-ftree-pre")
#pragma GCC optimize("-ftree-vrp")
#pragma GCC optimize("-fpeephole2")
#pragma GCC optimize("-ffast-math")
#pragma GCC optimize("-fsched-spec")
#pragma GCC optimize("unroll-loops")
#pragma GCC optimize("-falign-jumps")
#pragma GCC optimize("-falign-loops")
#pragma GCC optimize("-falign-labels")
#pragma GCC optimize("-fdevirtualize")
#pragma GCC optimize("-fcaller-saves")
#pragma GCC optimize("-fcrossjumping")
#pragma GCC optimize("-fthread-jumps")
#pragma GCC optimize("-funroll-loops")
#pragma GCC optimize("-fwhole-program")
#pragma GCC optimize("-freorder-blocks")
#pragma GCC optimize("-fschedule-insns")
#pragma GCC optimize("inline-functions")
#pragma GCC optimize("-ftree-tail-merge")
#pragma GCC optimize("-fschedule-insns2")
#pragma GCC optimize("-fstrict-aliasing")
#pragma GCC optimize("-fstrict-overflow")
#pragma GCC optimize("-falign-functions")
#pragma GCC optimize("-fcse-skip-blocks")
#pragma GCC optimize("-fcse-follow-jumps")
#pragma GCC optimize("-fsched-interblock")
#pragma GCC optimize("-fpartial-inlining")
#pragma GCC optimize("no-stack-protector")
#pragma GCC optimize("-freorder-functions")
#pragma GCC optimize("-findirect-inlining")
#pragma GCC optimize("-fhoist-adjacent-loads")
#pragma GCC optimize("-frerun-cse-after-loop")
#pragma GCC optimize("inline-small-functions")
#pragma GCC optimize("-finline-small-functions")
#pragma GCC optimize("-ftree-switch-conversion")
#pragma GCC optimize("-foptimize-sibling-calls")
#pragma GCC optimize("-fexpensive-optimizations")
#pragma GCC optimize("-funsafe-loop-optimizations")
#pragma GCC optimize("inline-functions-called-once")
#pragma GCC optimize("-fdelete-null-pointer-checks")
using namespace std;
long long x;
long long num = 100, ans;
int main() {
  cin >> x;
  while (num < x) {
    num += num * 0.01;
    ans++;
  }
  cout << ans;
  line;
  return 0;
}


Error: TLE

Fixed submission:

#include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <iostream>
#define line cout << endl
using namespace std;
int x;
int num = 100, ans;
int main() {
  cin >> x;
  while (num < x) {
    num += num * 0.01;
    ans++;
  }
  cout << ans;
  line;
  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 money = 100;
  long long year = 0;

  while (money < X) {
    money = money + (money / 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;

  int money = 100;
  int year = 0;

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

  cout << year << endl;

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

#include <bits/stdc++.h>
#include <iostream>
#include <sstream>
#include <string>
#include <vector>
using namespace std;

int main() {
  long long i = 0;
  long long X;
  long long N = 100;
  cin >> X;

  while (N < X) {
    N = N * 1.01;
    i++;
  }

  cout << i << endl;
}


Error: TLE

Fixed submission:

#include <bits/stdc++.h>
#include <iostream>
#include <sstream>
#include <string>
#include <vector>
using namespace std;

int main() {
  int i = 0;
  int X;
  int N = 100;
  cin >> X;

  while (N < X) {
    N = N * 1.01;
    i++;
  }

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

#include <bits/stdc++.h>
#define ll long long
using namespace std;
#define rep(i, n) for (int i = 0; i < n; i++)
#define rrep(i, n) for (int i = 1; i <= n; i++)
ll gcd(ll a, ll b) { return b ? gcd(b, a % b) : a; }
ll lcm(ll a, ll b) { return (a * b) / gcd(a, b); }
using P = pair<int, int>;

ll MOD = 1000000007;
ll INF = 1 << 29;
ll dp[100100];

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


Error: TLE

Fixed submission:

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

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

#include <cmath>
#include <iostream>

using namespace std;
int main() {
  // prepare variables
  int init_value = 100;
  long int target_value;
  cin >> target_value;

  // calculate answer
  int ans = 0;
  long int stock = init_value;
  while (ans <= 1e18) {
    stock = (long int)(stock * 1.01);
    ans++;
    if (stock >= target_value) {
      break;
    }
  }
  cout << ans << endl;
  return 0;
}


Error: TLE

Fixed submission:

#include <cmath>
#include <iostream>

using namespace std;
int main() {
  // prepare variables
  int init_value = 100;
  long int target_value;
  cin >> target_value;

  // calculate answer
  int ans = 0;
  long int stock = init_value;
  while (ans <= 1e18) {
    stock = (int)(stock * 1.01);
    ans++;
    if (stock >= target_value) {
      break;
    }
  }
  cout << ans << endl;
  return 0;
}
Problem p02694 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <iostream>
using namespace std;
int main() {
  long X;
  cin >> X;
  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() {
  int X;
  cin >> X;
  int P = 100, step = 0;
  while (P < X) {
    P += P / 100;
    step++;
  }
  cout << step << 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 money = 100;
  int ans = 0;
  while (money < x) {
    money *= 1.01;
    ans++;
  }

  cout << ans << endl;
}

Error: TLE

Fixed submission:

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

int main() {

  long long x;
  cin >> x;
  int money = 100;
  int ans = 0;
  while (money < x) {
    money *= 1.01;
    ans++;
  }

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

#include <bits/stdc++.h>
using namespace std;
int main(void) {
  long long n, m = 100;
  cin >> n;
  int a = 0;
  for (int i = 0; i < 100000; i++) {
    if (m >= n)
      break;
    m += m / 100;
    a++;
  }
  cout << a << endl;
  return 0;
}


Error: TLE

Fixed submission:

#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int n, m = 100, i = 0;
  cin >> n;
  while (n > m) {
    m += m / 100;
    i++;
  }
  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;
  cin >> x;
  long long ans = 0;
  long long count = 100;
  while (count < x) {
    ans++;
    count = count * 1.01;
  }
  cout << ans << endl;
}

Error: TLE

Fixed submission:

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

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

int main() {
  unsigned long x, n;
  n = 0;
  cin >> x;
  for (unsigned long i = 100; i < x; n++)
    i = i + (i / 100);
  cout << n;

  return 0;
}

Error: TLE

Fixed submission:

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

int main() {
  int x, n;
  n = 0;
  cin >> x;
  for (int i = 100; i < x; n++)
    i = i + (i / 100);
  cout << n;

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

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

int main() {
  int64_t X, M, Y;
  cin >> X;
  M = 100;
  Y = 0;
  while (M < X) {
    M *= 1.01;
    Y++;
  }

  cout << Y << endl;

  // ここにプログラムを追記
  // (ここで"試合結果の表"の2次元配列を宣言)
}


Error: TLE

Fixed submission:

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

int main() {
  int X, M, Y;
  cin >> X;
  M = 100;
  Y = 0;
  while (M < X) {
    M *= 1.01;
    Y++;
  }

  cout << Y << endl;

  // ここにプログラムを追記
  // (ここで"試合結果の表"の2次元配列を宣言)
}
Problem p02694 (C++) — buggy submission, verdict: Time Limit Exceeded

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

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


Error: TLE

Fixed submission:

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

int main() {
  int a, x = 100;
  int count = 0;
  cin >> a;
  while (x < a) {
    x *= 1.01;
    count++;
  }
  cout << count << 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 A = 100;
  int ans = 0;
  while (true) {
    A += A / 100;
    ans++;

    if (A >= X) {
      break;
    }
  }

  cout << ans << endl;
}


Error: TLE

Fixed submission:

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

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

  int64_t A = 100;
  int ans = 0;
  while (true) {
    A = (A * 101) / 100;
    ans++;

    if (A >= X) {
      break;
    }
  }

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

#include <iomanip>
#include <iostream>
using namespace std;
int main() {
  int count = 0;
  unsigned long money = 100, X = 0;
  cin >> X;
  while (1) {
    count++;
    money *= 1.01;
    if (money >= X)
      break;
  }
  cout << count << endl;
  return 0;
}

Error: TLE

Fixed submission:

#include <iostream>
using namespace std;
int main() {
  int count = 0, money = 100, X = 0;
  cin >> X;
  do {
    count++;
    money *= 1.01;
  } while (X > money);
  cout << count << 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 N = 100;
  for (int i = 1; i < 100000; i++) {
    N += N / 100;
    if (N >= X) {
      cout << i << endl;
      return 0;
    }
  }
}

Error: TLE

Fixed submission:

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

#include <bits/stdc++.h>
using namespace std;
#define int long long
#define M 1000000007
// #define M 998244353
const int inf = 4e18;
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int x;
  cin >> x;
  int c = 100, o = 0;
  while (c < x) {
    c = ((double)101 / 100) * c;
    o++;
  }
  cout << o << endl;
}

Error: TLE

Fixed submission:

#include <bits/stdc++.h>
using namespace std;
#define int long long
#define M 1000000007
// #define M 998244353
const int inf = 4e18;
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int x;
  cin >> x;
  int c = 100, o = 0;
  while (c < x) {
    c = (101 * c) / 100;
    o++;
  }
  cout << o << endl;
}
Problem p02694 (C++) — buggy submission, verdict: Time Limit Exceeded

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

int main() {
  ll sum = 100;
  ll year = 0;
  ll x;
  cin >> x;
  for (ll i = 0; sum < x; i++) {
    sum = sum * 1.01 / 1;
    year++;
  }
  cout << year << endl;
}


Error: TLE

Fixed submission:

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

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

  for (int i = 0; sum <= X; i++) {
    sum *= 1.01;
    if (sum >= 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 P = 100, step = 0;
  while (P < X) {
    P += P / 100;
    step++;
  }
  cout << step << endl;
  return 0;
}


Error: TLE

Fixed submission:

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

int main() {
  int X;
  cin >> X;
  int n;
  int s = 0;

  while (n < X) {
    n += n / 100;
    s++;
  }
  cout << s << endl;
  return 0;
}
Problem p02694 (C++) — buggy submission, verdict: Time Limit Exceeded

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


Error: TLE

Fixed submission:

#include <bits/stdc++.h>
using namespace std;
int main() {
  int x, c = 0, val = 100;
  cin >> x;
  while (x > val) {
    val += val / 100;
    c++;
  }
  cout << c;
  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 p = 100, n, s = 0;
  cin >> n;
  while (p < n) {
    p += p / 100;
    s++;
  }
  cout << s << endl;
  return 0;
}

Error: TLE

Fixed submission:

#include <bits/stdc++.h>
using namespace std;
int main() {
  int p = 100, n, s = 0;
  cin >> n;
  while (p < n) {
    p += p / 100;
    s++;
  }
  cout << s << 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;
  int count = 0;
  long long A = 100;
  while (A < X) {
    A += A / 100;
    count++;
  }
  cout << count << endl;
}


Error: TLE

Fixed submission:

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

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

int main() {
  unsigned long X;
  unsigned long sum, count;

  cin >> X;
  sum = 100;
  count = 0;

  while (count < X) {
    sum += sum * 0.01;
    if (sum >= X) {
      count++;
      cout << count;
      break;
    }
    count++;
  }
}

Error: TLE

Fixed submission:

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

int main() {
  unsigned long X;
  unsigned long sum, count;

  cin >> X;

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

#include <iostream>

int main() {
  double X;
  std::cin >> X;

  double okane = 100;
  int nen = 0;

  while (true) {
    okane += okane * 0.01;
    okane = floor(okane);
    nen++;
    if (okane >= X) {
      break;
    }
  }
  std::cout << nen << std::endl;
}

Error: TLE

Fixed submission:

#include <iostream>

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

  int okane = 100;
  int nen = 0;

  while (true) {
    okane += okane * 0.01;
    nen++;
    if (okane >= X) {
      break;
    }
  }
  std::cout << nen << std::endl;
}
Problem p02694 (C++) — buggy submission, verdict: Time Limit Exceeded

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

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

  for (int i = 0; i < 3760; i++) {
    count++;
    b = b * 1.01;
    if (b >= a)
      break;
  }
  cout << count << endl;
}


Error: TLE

Fixed submission:


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

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

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

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

int main() {
  // #ifndef ONLINE_JUDGE
  // 	freopen("input.txt","r",stdin);
  // 	freopen("output1.txt","w",stdout);
  // #endif

  long long int x;
  cin >> x;
  long long int ans = 100;
  long long int count = 0;
  while (ans < x) {
    ans += (ans / 100);
    count++;
  }
  cout << count << endl;
}


Error: TLE

Fixed submission:

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

int main() {
  // #ifndef ONLINE_JUDGE
  // 	freopen("input.txt","r",stdin);
  // 	freopen("output1.txt","w",stdout);
  // #endif

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

#include <iostream>
using namespace std;

int main() {
  // your code goes here
  long long t;
  cin >> t;
  long long x = 100;
  long long flag = 0;
  long long interest = 0;
  while (x < t) {
    interest = x / 100;
    x += interest;
    flag++;
  }
  cout << flag;
  return 0;
}

Error: TLE

Fixed submission:

#include "bits/stdc++.h"
using namespace std;
typedef unsigned long long ll;
#define fast                                                                   \\
  ios_base::sync_with_stdio(false);                                            \\
  cin.tie(NULL);                                                               \\
  cout.tie(NULL);

int main() {

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

#include <bits/stdc++.h>
using namespace std;
#include <boost/multiprecision/cpp_int.hpp>
using namespace boost::multiprecision;
#define int int128_t
#define fr(a, b) for (int i = a; i < b; i++)
#define frn(a, b) for (int i = a; i >= b; i--)

int32_t main() {
#ifndef ONLINE_JUDGE
  freopen("input.txt", "r", stdin);
  freopen("output.txt", "w", stdout);
#endif
  int x;
  cin >> x;
  int a = 100;
  int t = 0;
  while (a < x) {
    a = a * 101;
    a = a / 100;
    t++;
  }
  cout << t;
}

Error: TLE

Fixed submission:

#include <bits/stdc++.h>
using namespace std;
int main() {
  long long x;
  cin >> x;
  long long n;
  n = 100;
  for (int i = 1; i <= 1000000000; i++) {
    n = (n / 100) + n;
    if (n == x) {
      cout << i;
      break;
    }
  }
  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 money = 100, cnt = 0;
  while (money < x) {
    money *= 1.01;
    cnt++;
  }
  cout << cnt << endl;
}

Error: TLE

Fixed submission:

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

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

#include <iostream>

using namespace std;

int main() {
  long long a;
  cin >> a;
  long long p = 100;
  int c = 0;
  while (p < a) {
    p = p + p / 100;
    c += 1;
  }
  cout << c;
  return 0;
}


Error: TLE

Fixed submission:

#include <iostream>

using namespace std;

int main() {
  long long a;
  cin >> a;
  long long p = 100;
  int c = 0;
  while (p != a) {
    p = p + int(p / 100);
    c += 1;
  }
  cout << c;
  return 0;
}