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

#include <iostream>

int main() {
  int64_t x;
  std::cin >> x;

  int64_t count = 0, money = 100;
  while (money < x) {
    money *= 1.01;
    count++;
  }
  std::cout << count << std::endl;
}

Error: TLE

Fixed submission:

#include <iostream>

int main() {
  int64_t x;
  std::cin >> x;

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

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

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

  ll a = 100;
  int count = 1;

  while (true) {
    a += a / 100;
    if (a >= n)
      break;
    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;
using ll = long long;
using P = pair<int, int>;

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

  int a = 100;
  int count = 1;

  while (true) {
    a += a / 100;
    if (a >= n)
      break;
    count++;
  }

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

#include <cmath>
#include <iostream>
#include <string>

#define START 100

using namespace std;

int main() {
  int year;
  long x, money, value;

  cin >> x;

  money = START;
  year = 0;

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

  cout << year;
}


Error: TLE

Fixed submission:

#include <cmath>
#include <iostream>
#include <string>

#define START 100

using namespace std;

int main() {
  int year, money, value;
  long x;

  cin >> x;

  money = START;
  year = 0;

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

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

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

int main() {
  long long a;
  cin >> a;
  int ans = 0;
  long long p = 100;
  for (int i = 0;; i++) {
    p += p / 100;
    if (p >= a) {
      ans = i + 1;
      break;
    }
  }
  cout << ans << endl;
}

Error: TLE

Fixed submission:

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

int main() {
  int a;
  cin >> a;
  int ans = 0;
  int p = 100;
  for (int i = 0;; i++) {
    p += p / 100;
    if (p >= a) {
      ans = i + 1;
      break;
    }
  }
  cout << ans << endl;
}
Problem p02694 (C++) — buggy submission, verdict: Time Limit Exceeded

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

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

Error: TLE

Fixed submission:

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

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

#include <bits/stdc++.h>

using namespace std;

void solve() {
  double x = 100;
  long long n;
  cin >> n;
  int ans = 0;
  while (x < n) {
    x += 0.01 * x;
    x = (long long)x;
    // cout << x << " " << ans << endl;
    ans++;
  }
  cout << ans;
}

int main() {
  ios::sync_with_stdio(NULL), cin.tie(0), cout.tie(0);
  cout.setf(ios::fixed), cout.precision(20);
  solve();
}


Error: TLE

Fixed submission:

#include <bits/stdc++.h>

using namespace std;

void solve() {
  long long x = 100;
  long long n;
  cin >> n;
  int ans = 0;
  while (x < n) {
    x += int(0.01 * x);
    ans++;
  }
  cout << ans;
}

int main() {
  ios::sync_with_stdio(NULL), cin.tie(0), cout.tie(0);
  cout.setf(ios::fixed), cout.precision(20);
  solve();
}
Problem p02694 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <bits/stdc++.h>
using namespace std;
int main() {
  int A = 0;
  int long long X, B = 100;
  cin >> X;
  double C = 101 * 0.01;
  while (true) {
    B = B * C;
    A = A + 1;
    if (B >= X) {
      goto ABC;
    }
  }
ABC:
  cout << A << endl;
}


Error: TLE

Fixed submission:

#include <bits/stdc++.h>
using namespace std;
int main() {
  int long long A = 0;
  int long long X, B = 100;
  cin >> X;
  while (true) {
    B = (B * 101) * 0.01;
    B = B;
    A = A + 1;
    if (B >= X) {
      goto ABC;
    }
  }
ABC:
  cout << A << endl;
}
Problem p02694 (C++) — buggy submission, verdict: Runtime Error

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
#define pb push_back
#define fi first
#define se second
const int N = 3e5 + 6;
const int mod = 1e9 + 7;
const int inf = 1e8;
void solve() {
  ll k;
  cin >> k;
  ll st = 100;
  for (int i = 0; i <= 40000; i++) {
    if (st >= k) {
      cout << i << endl;
      return;
    }
    ll interst = st * 0.01;
    st += interst;
  }
  exit(-1);
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int t = 1;
  //    cin>>t;
  while (t--)
    solve();
  return 0;
}


Error: 255

Fixed submission:

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
#define pb push_back
#define fi first
#define se second
const int N = 3e5 + 6;
const int mod = 1e9 + 7;
const int inf = 1e8;
void solve() {
  ll k;
  cin >> k;
  ll st = 100;
  for (int i = 0; i <= 40000; i++) {
    if (st >= k) {
      cout << i << endl;
      break;
    }
    ll interst = st * 0.01;
    st += interst;
  }
  exit(-1);
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int t = 1;
  //    cin>>t;
  while (t--)
    solve();
  return 0;
}
Problem p02694 (C++) — buggy submission, verdict: Time Limit Exceeded

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

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

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

  cout << b << endl;
}


Error: TLE

Fixed submission:

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

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

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

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

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

int main() {
  int64_t x, price = 100, count = 0;
  cin >> x;
  while (price < x) {
    price *= 1.01;
    count += 1;
  }
  cout << count << endl;
}


Error: TLE

Fixed submission:

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

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

#include <iostream>

using namespace std;

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

  long long b = 100, step = 0;

  while (b < a) {
    b += b / 100;
    step++;
  }

  cout << step;
  return 0;
}

Error: TLE

Fixed submission:

#include <iostream>

using namespace std;

int main(int argc, char **argv) {
  int a;
  cin >> a;
  int b = 100, step = 0;
  while (b < a) {
    b += b / 100;
    step++;
  }

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

#include <bits/stdc++.h>
using namespace std;
int main() {
  long long a;
  cin >> a;
  long long s = 100;
  int i = 0;
  while (s < a) {
    s += s * 0.01;
    i++;
  }
  cout << i << endl;
  return 0;
}

Error: TLE

Fixed submission:

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

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

ll n, m, ans;

inline ll read() {
  ll s = 0, w = 1;
  char ch = getchar();
  for (; ch < '0' || ch > '9'; ch = getchar())
    w *= ch == '-' ? -1 : 1;
  for (; ch >= '0' && ch <= '9'; ch = getchar())
    s = s * 10 + ch - '0';
  return s * w;
}

inline void work() {
  n = read(), m = 101;
  for (ans = 1; m < n; ++ans, m += m * 0.01 * 1ll)
    ;
  printf("%lld\\n", ans);
}

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

Error: TLE

Fixed submission:

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

ll n, m, ans;

inline ll read() {
  ll s = 0, w = 1;
  char ch = getchar();
  for (; ch < '0' || ch > '9'; ch = getchar())
    w *= ch == '-' ? -1 : 1;
  for (; ch >= '0' && ch <= '9'; ch = getchar())
    s = s * 10 + ch - '0';
  return s * w;
}

inline void work() {
  n = read();
  m = 101;
  for (ans = 1; m < n; ++ans, m += int(m * 0.01))
    ;
  printf("%lld\\n", ans);
}

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

#include <algorithm>
#include <cstdio>
#include <iostream>
#include <map>
#include <math.h>
#include <queue>
#include <set>
#include <stack>
#include <vector>
using namespace std;
typedef long long int ll;
typedef long double ld;
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define Sort(Array) sort(Array.begin(), Array.end())
#define Reverse(a) reverse(a.begin(), a.end())
#define out(ans) cout << ans << endl;
const int MOD = 1000000007;
const int INF = 2147483647;
const ld PI = 3.14159265358979323846;

//------------↓------------- M -------------- E ---------------- M
//--------------- O ---------------↓--------------//
// コンパイル
// g++ -std=c++1z
//
// -------型変換--------
// int を string に変換
// string s = to_string(n);
// string を int に変換
// int n = stoi(s);
//
// -------二分探索---------
// k以上の値が最初に現れる時のイテレータ
// lower_bound(data.begin(), data.end(), k)
// kより大きい値が最初の現れる時のイテレータ O(logN)
// upper_bound(data.begin(), data.end(), k)
// kがdataに存在するかをtrue or falseで返す O(logN)
// binary_search(data.begin(), data.end(), k)
//
//
//
//
//
//
//
//------------↑------------- M -------------- E ---------------- M
//--------------- O ---------------↑--------------//

int main(void) {

  ll g = 100;
  int ans = 0;
  ll X;
  cin >> X;
  while (X > g) {
    g = g + g / 100;
    ++ans;
  }
  out(ans);

  return 0;
}


Error: TLE

Fixed submission:

#include <algorithm>
#include <cstdio>
#include <iostream>
#include <map>
#include <math.h>
#include <queue>
#include <set>
#include <stack>
#include <vector>
using namespace std;
typedef long long int ll;
typedef long double ld;
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define Sort(Array) sort(Array.begin(), Array.end())
#define Reverse(a) reverse(a.begin(), a.end())
#define out(ans) cout << ans << endl;
const int MOD = 1000000007;
const int INF = 2147483647;
const ld PI = 3.14159265358979323846;

//------------↓------------- M -------------- E ---------------- M
//--------------- O ---------------↓--------------//
// コンパイル
// g++ -std=c++1z
//
// -------型変換--------
// int を string に変換
// string s = to_string(n);
// string を int に変換
// int n = stoi(s);
//
// -------二分探索---------
// k以上の値が最初に現れる時のイテレータ
// lower_bound(data.begin(), data.end(), k)
// kより大きい値が最初の現れる時のイテレータ O(logN)
// upper_bound(data.begin(), data.end(), k)
// kがdataに存在するかをtrue or falseで返す O(logN)
// binary_search(data.begin(), data.end(), k)
//
//
//
//
//
//
//
//------------↑------------- M -------------- E ---------------- M
//--------------- O ---------------↑--------------//

int main(void) {

  ll g = 100;
  int ans = 0;
  ll X;
  cin >> X;
  while (X > g) {
    g = g * 101 / 100;
    ++ans;
  }
  out(ans);

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

#include <iostream>
using namespace std;
int main() {
  unsigned long int X, num = 100;
  int cou = 0;
  cin >> X;
  while (true) {
    num += num * 0.01;
    cou++;
    if (num >= X)
      break;
  }
  cout << cou << endl;
}

Error: TLE

Fixed submission:

#include <iostream>
using namespace std;
int main() {
  int X, num = 100, cou = 0;
  cin >> X;
  while (true) {
    num += num * 0.01;
    cou++;
    if (num >= X)
      break;
  }
  cout << cou << endl;
}
Problem p02694 (C++) — buggy submission, verdict: Time Limit Exceeded

/*  TAHMID RAHMAN
    DAMIAN FOREVER
     MATH LOVER
    NEVER GIVE UP
*/
#include <bits/stdc++.h>
using namespace std;
#define pi acos(-1.0)
#define fastio                                                                 \\
  ios_base::sync_with_stdio(false);                                            \\
  cin.tie(NULL);                                                               \\
  cout.tie(NULL)
#define ll long long
#define pb push_back
#define fi first
#define se second
#define in insert
#define mp make_pair
#define GCD(a, b) __gcd(a, b);
#define endl "\\n"
#define FRU freopen("out.txt", "w", stdout)
#define FRO freopen("in.txt", "r", stdin)
#define INFLL 9223372036854775807
#define debug 0
// Don't hesitate to ask me if you don't understand my code.......Happy
// coding,Tahmid...;
int main() {
  fastio;
  ll t = 1;
  while (t--) {
    ll x, n, c = 0;
    cin >> x;
    n = 100;
    while (n < x) {
      n += n / 100;
      c++;
    }
    cout << c << endl;
  }
}


Error: TLE

Fixed submission:

#include <iostream>

using namespace std;

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

#include <bits/stdc++.h>

#define forn(i, n) for (int i = 0; i < int(n); ++i)
#define for1(i, n) for (int i = 1; i <= int(n); ++i)
#define ms(a, x) memset(a, x, sizeof(a))
#define F first
#define S second
#define all(x) (x).begin(), (x).end()

using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
const int INF = 0x3f3f3f3f;
mt19937 gen(chrono::steady_clock::now().time_since_epoch().count());
template <typename... Args> void rd(Args &...args) { ((cin >> args), ...); }
template <typename... Args> void write(Args... args) {
  ((cout << args << " "), ...);
  cout << endl;
}

int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  int ans = 0;
  ll x;
  cin >> x;
  ll n = 100;
  while (n < x) {
    n = n * 1.01;
    ans++;
  }
  cout << ans;
  return 0;
}


Error: TLE

Fixed submission:

#include <algorithm>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <map>
#include <string.h>
#include <vector>
using namespace std;
typedef long long ll;
char s[4005];
int main() {
  ll x;
  cin >> x;
  int mmid = 100;
  for (int i = 1;; i++) {
    mmid *= 1.01;
    if (mmid >= x) {
      cout << i;
      break;
    }
  }
}
Problem p02694 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <iostream>
using namespace std;
#define ll long long

int main() {
  ll X;
  cin >> X;
  ll count = 0;
  ll mon = 100;
  while (mon < X) {
    mon *= 1.01;
    ++count;
  }

  cout << count << endl;
}

Error: TLE

Fixed submission:

#include <iostream>
using namespace std;

int main() {
  int X;
  cin >> X;
  int count = 0;
  int mon = 100;
  while (mon < X) {
    mon *= 1.01;
    count++;
  }

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

#include <algorithm>
#include <iostream>
#define flush fflush(stdout)
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
typedef pair<ll, ll> Pl;
const int mod = (int)1e9 + 7, INF = (int)1e9;
const int di[4] = {1, 0, -1, 0}, dj[4] = {0, 1, 0, -1};

int main(void) {
  ll x, ans, p;

  scanf("%lld", &x);

  p = 100;

  ans = 0ll;
  while (p < x) {
    p += p / 100;
    ans++;
  }

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

  return 0;
}

Error: TLE

Fixed submission:

#include <algorithm>
#include <iostream>
#define flush fflush(stdout)
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
typedef pair<ll, ll> Pl;
const int mod = (int)1e9 + 7, INF = (int)1e9;
const int di[4] = {1, 0, -1, 0}, dj[4] = {0, 1, 0, -1};

int main(void) {
  ll p, x, ans;

  scanf("%lld", &x);

  p = 100;

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

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

  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 A;
  A = 100;
  long long i = 0;
  while (i < 4000) {
    A = A + (A / 100);
    if (A >= X) {
      long long N;
      N = i + 1;
      cout << N << endl;
      break;
    }
    i++;
  }
}

Error: TLE

Fixed submission:

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

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

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

#include <bits/stdc++.h>
#define console
using namespace std;
#ifndef console
ifstream fin("data.in");
ofstream fout("data.out");
#else
#define fin cin
#define fout cout
#endif
#define usain_bolt()                                                           \\
  (ios_base::sync_with_stdio(false), fin.tie(NULL), fout.tie(NULL))
typedef long long ll;
int main() {
  usain_bolt();
  ll x;
  fin >> x;
  ll p = 100, rez = 0;
  while (p < x) {
    p += p / 100;
    ++rez;
  }
  fout << rez;
#ifndef console
  fin.close(), fout.close();
#endif
  return 0;
}


Error: TLE

Fixed submission:

#include <bits/stdc++.h>
#define console
using namespace std;
#ifndef console
ifstream fin("data.in");
ofstream fout("data.out");
#else
#define fin cin
#define fout cout
#endif
#define usain_bolt()                                                           \\
  (ios_base::sync_with_stdio(false), fin.tie(NULL), fout.tie(NULL))
typedef long long ll;
int main() {
  usain_bolt();
  ll x;
  fin >> x;
  int p = 100, rez = 0;
  while (p < x) {
    p += p / 100;
    ++rez;
  }
  fout << rez;
#ifndef console
  fin.close(), fout.close();
#endif
  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 s = 100;
  int ans = 0;
  while (s < x) {
    s = (long long)(s * 1.01);
    ans++;
  }
  cout << ans << endl;
  return 0;
}


Error: TLE

Fixed submission:

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

  for (i = 0; a < x; i++) {
    a *= 1.01;
  }
  cout << i << endl;
}


Error: TLE

Fixed submission:

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

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

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

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


Error: TLE

Fixed submission:

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

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


Error: TLE

Fixed submission:

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

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

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


Error: TLE

Fixed submission:

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

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

#include <iostream>
using namespace std;
#define int long long

signed main() {
  // Your code here!
  int i, p;
  int ans = 0;
  cin >> i;
  p = 100;

  for (int o = 1;; o++) {
    p += (p / 100);
    if (p >= i) {
      cout << o;
      return 0;
    }
  }
  /*
  while(p < i)
  {
      ans ++;
      p *= 1.01;
  }
  cout << ans;
  */
}


Error: TLE

Fixed submission:

#include <iostream>
using namespace std;
int main(void) {
  // Your code here!
  int i, p;
  int ans = 0;
  cin >> i;
  p = 100;
  /*
  for(int o=1;;o++){
      p=p*1.01;
      if(p>=i){
          cout << o;
          return 0;
      }
  }*/

  while (p < i) {
    ans++;
    p *= 1.01;
  }
  cout << ans;
}
Problem p02694 (C++) — buggy submission, verdict: Time Limit Exceeded


// </> : towhid1zaman

#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vll;
#define fill(a, b) memset(a, b, sizeof(a))
#define all(v) (v).begin(), (v).end()
#define sp(k) cout << setprecision(k) << fixed;
#define rep(i, a) for (int i = 0; i < a; i++)
#define rep1(i, a, b) for (int i = (a); i <= (b); ++i)
#define irep(i, b, a) for (int i = (b); i >= (a); --i)
#define minv(v) *min_element(all(v))
#define maxv(v) *max_element(all(v))
#define unq(v) sort(all(v)), (v).erase(unique(all(v)), (v).end())
#define _ios                                                                   \\
  ios::sync_with_stdio(0);                                                     \\
  cin.tie(0);                                                                  \\
  cout.tie(0);
#define endl "\\n"
#define sqr(a) ((a) * (a))
#define sz(a) int(a.size())
#define ff first
#define ss second
#define pb push_back

const double pi = acos(-1.0);
const int mod = 1000000007; // (int)1e9+7
const int maxn = 2000100;

int main() {
  _ios;

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

  return 0;
}


Error: TLE

Fixed submission:


// </> : towhid1zaman

#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vll;
#define fill(a, b) memset(a, b, sizeof(a))
#define all(v) (v).begin(), (v).end()
#define sp(k) cout << setprecision(k) << fixed;
#define rep(i, a) for (int i = 0; i < a; i++)
#define rep1(i, a, b) for (int i = (a); i <= (b); ++i)
#define irep(i, b, a) for (int i = (b); i >= (a); --i)
#define minv(v) *min_element(all(v))
#define maxv(v) *max_element(all(v))
#define unq(v) sort(all(v)), (v).erase(unique(all(v)), (v).end())
#define _ios                                                                   \\
  ios::sync_with_stdio(0);                                                     \\
  cin.tie(0);                                                                  \\
  cout.tie(0);
#define endl "\\n"
#define sqr(a) ((a) * (a))
#define sz(a) int(a.size())
#define ff first
#define ss second
#define pb push_back

const double pi = acos(-1.0);
const int mod = 1000000007; // (int)1e9+7
const int maxn = 2000100;

int main() {
  _ios;

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

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

#include <iostream>

using namespace std;

int main() {
  long X;
  long year = 0;
  long yokin = 100;

  cin >> X;

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

  cout << year;
}

Error: TLE

Fixed submission:

#include <iostream>

using namespace std;

int main() {
  int X;
  int a = 100;
  cin >> X;
  int y = 0;
  while (a < X) {
    a *= 1.01;
    y++;
  }

  cout << y;
}