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

#include <iostream>
using namespace std;

int main() {

#ifndef ONLINE_JUDGE
  freopen("input.txt", "r", stdin);
  freopen("output.txt", "w", stdout);
#endif

  // write code hare

  int k;
  int a, b;
  int f = 0;
  cin >> k >> a >> b;

  for (int i = a; i <= b; i++) {
    if (i % k == 0) {
      f = 1;
      break;
    }
  }

  if (f == 1) {
    cout << "OK";
  } else {
    cout << "NG";
  }
}

Error: TLE

Fixed submission:

#include <bits/stdc++.h>
#define FOR(i, a, b) for (ll i = a; i <= b; i++)
#define boost                                                                  \\
  ios::sync_with_stdio(0);                                                     \\
  cin.tie(0);
#define pb push_back
typedef unsigned long long ll;

using namespace std;

int main() {
  boost;
  freopen("input.txt", "r", stdin);
  freopen("output.txt", "w", stdout);
  ll k, a, b, count = 0;
  cin >> k >> a >> b;
  FOR(i, a, b) {
    if (i % k == 0) {
      count += 1;
    }
  }
  if (count >= 1) {
    cout << "OK"
         << "\\n";
  } else {
    cout << "NG"
         << "\\n";
  }
  return 0;
}
Problem p02693 (C++) — buggy submission, verdict: Time Limit Exceeded

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

int main() {
  int k, a, b;
  cin >> k >> a >> b;
  for (ll i = a; i <= b; ++i) {
    if (i % k == 0) {
      cout << "OK" << endl;
      return 0;
    }
  }
  cout << "NG" << endl;
}


Error: TLE

Fixed submission:

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

int main() {
  int k, a, b;
  cin >> k >> a >> b;
  for (ll i = a; i = b; ++i) {
    if (i % k == 0) {
      cout << "OK" << endl;
      return 0;
    }
  }
  cout << "NG" << endl;
}
Problem p02693 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <stdio.h>
int main() {
  int A, B, K, angka = 0;
  scanf("%d", &K);
  scanf("%d %d", &A, &B);        // batas atas batas bawah
  for (int i = A; i <= B; ++i) { // cari tiap angka yang ada di antara batas
    if (i % K == 0) {

      angka = 1;
      break;
    }
  }
  angka ? printf("OK\\n") : printf("NG\\n");

  return 0;
}


Error: TLE

Fixed submission:

#include <stdio.h>

int main() {
  int K, A, B;
  scanf("%d %d %d", &K, &A, &B);

  int hasil;
  for (int i = A; A <= B; i++) {
    if (i % K == 0) {
      hasil++;
    }
  }

  if (hasil != 0) {
    printf("OK");
  } else {
    printf("NG");
  }

  return 0;
}
Problem p02693 (C++) — buggy submission, verdict: Runtime Error

#include <iostream>
using namespace std;
int main() {
  int n, a, b, c;
  cin >> n >> a >> b;
  c = (b / n) - ((a - 1) / n);
  if (c >= 1) {
    cout << "OK" << endl;
  } else {
    cout << "NG" << endl;
  }
  return 0;
}


Error: WA

Fixed submission:

#include <iostream>
using namespace std;
int main() {
  int n, a, b;
  cin >> n >> a >> b;
  int c = (n / b) - (n / (a - 1));
  if (c >= 1) {
    cout << "OK" << endl;
  } else {
    cout << "NG" << endl;
  }
  return 0;
}
Problem p02693 (C++) — buggy submission, verdict: Runtime Error

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

int main() {
  int k, a, b;
  cin >> k >> a >> b;
  int i = b / k;
  if (k * i >= a) {
    cout << "OK" << endl;
  } else {
    cout << "NG" << endl;
  }
  return 0;
}

Error: -6
*** stack smashing detected ***: terminated


Fixed submission:

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

int main() {
  int k;
  int a[1];
  cin >> k;
  for (int i = 0; i < 2; i++) {
    cin >> a[i];
  }
  if (a[1] - a[0] >= k - 1) {
    cout << "OK" << endl;
  } else {
    cout << "NG" << endl;
  }
  return 0;
}
Problem p02693 (C++) — buggy submission, verdict: Runtime Error

#include <iostream>
using namespace std;

int main() {
  int k, a, b;
  cin >> k;
  cin >> a;
  cin >> b;

  if (a - b >= k) {
    cout << "OK";
    return 0;
  }

  for (int i = a; i <= b; i++)
    if (i % k == 0) {
      cout << "OK";
      return 0;
    }

  cout << "NG";
  return 0;
}

Error: 1

Fixed submission:

#include <iostream>
using namespace std;

int main() {
  int k, a, b;
  cin >> k;
  cin >> a;
  cin >> b;

  if (a - b >= k)
    return true;

  for (int i = a; i <= b; i++)
    if (i % k == 0)
      return true;

  return false;
}
Problem p02693 (C++) — buggy submission, verdict: Runtime Error

#include "bits/stdc++.h"
#define EPS 1e-9
using namespace std;
const int N = 1e5, OO = 0x3f3f3f3f;
typedef long long ll;
int main() {
  int a, b, k;
  cin >> k >> a >> b;
  for (int i = a; i <= b; i++)
    if (i % k == 0)
      return cout << "OK", 0;
  cout << "NG";
}

Error: WA

Fixed submission:

#include "bits/stdc++.h"
#define EPS 1e-9
using namespace std;
const int N = 1e5, OO = 0x3f3f3f3f;
typedef long long ll;
int main() {
  int a, b, k;
  for (int i = min(a, b); i <= max(a, b); i++)
    if (i % k == 0)
      return cout << "OK", 0;
  cout << "NG";
}
Problem p02694 (C++) — buggy submission, verdict: Time Limit Exceeded

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

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

Error: TLE

Fixed submission:

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

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

#include <iostream>
using namespace std;
int main() {
  unsigned long long t;
  cin >> t;
  unsigned int i = 0;
  unsigned long long base = 100;
  while (base < t) {
    base *= 1.01;
    i++;
  }
  cout << i << "\\n";
  return 0;
}

Error: TLE

Fixed submission:

#include <iostream>
using namespace std;
int main() {
  unsigned int t;
  cin >> t;
  unsigned int i = 0;
  unsigned int base = 100;
  while (base < t) {
    base *= 1.01;
    i++;
  }
  cout << i << "\\n";
  return 0;
}
Problem p02694 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <bits/stdc++.h>
#define tt this->
#define ll long long
using namespace std;
int main() {
  ll a, b = 100, c = 0;
  cin >> a;
  while (b < a) {
    b = b + (b / 100);
    c++;
  }

  cout << c;

  return 0;
}

/*
▀█████████▄     ▄████████    ▄████████    ▄████████
  ███    ███   ███    ███   ███    ███   ███    ███
  ███    ███   ███    ███   ███    ███   ███    ███
 ▄███▄▄▄██▀    ███    ███  ▄███▄▄▄▄██▀   ███    ███
▀▀███▀▀▀██▄  ▀███████████ ▀▀███▀▀▀▀▀   ▀███████████
  ███    ██▄   ███    ███ ▀███████████   ███    ███
  ███    ███   ███    ███   ███    ███   ███    ███
▄█████████▀    ███    █▀    ███    ███   ███    █▀
                            ███    ███

*/


Error: TLE

Fixed submission:

#include <bits/stdc++.h>
#define this ->tt
#define long long ll
using namespace std;
int main() {
  int a, b = 100, c = 0;
  cin >> a;
  while (b < a) {
    b = b + (b / 100);
    c++;
  }

  cout << c;

  return 0;
}

/*
▀█████████▄     ▄████████    ▄████████    ▄████████
  ███    ███   ███    ███   ███    ███   ███    ███
  ███    ███   ███    ███   ███    ███   ███    ███
 ▄███▄▄▄██▀    ███    ███  ▄███▄▄▄▄██▀   ███    ███
▀▀███▀▀▀██▄  ▀███████████ ▀▀███▀▀▀▀▀   ▀███████████
  ███    ██▄   ███    ███ ▀███████████   ███    ███
  ███    ███   ███    ███   ███    ███   ███    ███
▄█████████▀    ███    █▀    ███    ███   ███    █▀
                            ███    ███

*/
Problem p02694 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  ll x;
  cin >> x;
  ll w = 100;
  ll cnt = 0;
  while (w < x) {
    cnt++;
    w += w / 100;
    // cout << w << endl;
  }
  cout << cnt << "\\n";
  return 0;
}


Error: TLE

Fixed submission:

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  ll x;
  cin >> x;
  ll w = 100;
  ll cnt = 0;
  while (w < x) {
    cnt++;
    w = w * 101;
    w = w / 100;
    // cout << w << endl;
  }
  cout << cnt << "\\n";
  return 0;
}
Problem p02694 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <cstdio>

int main() {
  long int x;
  scanf("%ld", &x);
  long int moto = 100;
  long int ans = 0;
  while (moto < x) {
    ans++;
    double motof = (double)moto;
    moto = (long int)motof * 1.01;
  }
  printf("%ld", ans);
  return 0;
}


Error: TLE

Fixed submission:

#include <cstdio>

int main() {
  long int x;
  scanf("%ld", &x);
  long int moto = 100;
  long int ans = 0;
  while (moto < x) {
    ans++;
    moto = moto * 101 / 100;
  }
  printf("%ld", 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 = 100;
  for (int i = 0; i < 100000; i++) {
    a = a + a / 100;
    if (a >= X) {
      cout << i + 1 << endl;
      return 0;
    }
  }
}


Error: TLE

Fixed submission:

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

int main() {
  long long X;
  cin >> X;
  long long a = 100;
  for (long long i = 0; i < X; i++) {
    a = a * 101 / 100;
    if (a >= X) {
      cout << i + 1 << 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;
}

Error: TLE

Fixed submission:

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

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

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

#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define all(x) (x).begin(), (x).end()
#define SZ(x) ((int)(x).size())
using namespace std;
using lint = long long; //
template <typename T> T sq(T x) { return x * x; }

signed main() {
  lint X;
  cin >> X;
  // cout << X << endl;
  lint A = 100;
  lint year = 0;
  while (A < X) {
    A *= 1.01;
    // cout << A <<endl;
    year++;
  }
  cout << year << endl;
  return 0;
}


Error: TLE

Fixed submission:

#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define all(x) (x).begin(), (x).end()
#define SZ(x) ((int)(x).size())
using namespace std;
using lint = long long; //
template <typename T> T sq(T x) { return x * x; }

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

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

#include <bits/stdc++.h>
#define ll long long int
#define F first
#define S second
const ll mod = 1e9 + 7;
const ll INF = 10000000000000;
#define pb push_back
#define deb(x) cout << '>' << #x << ':' << x << endl;
#define fastio                                                                 \\
  ios_base::sync_with_stdio(0);                                                \\
  cin.tie(0);
using namespace std;
int main() {
  fastio;
  ll n = 0;
  cin >> n;
  ll sum = 100;
  ll c = 0;
  while (sum < n) {
    ll i = sum / 100;
    sum += i;
    ++c;
  }
  cout << c;
  return 0;
}


Error: TLE

Fixed submission:

#include <bits/stdc++.h>
#define ll long long int
#define F first
#define S second
const ll mod = 1e9 + 7;
const ll INF = 10000000000000;
#define pb push_back
#define deb(x) cout << '>' << #x << ':' << x << endl;
#define fastio                                                                 \\
  ios_base::sync_with_stdio(0);                                                \\
  cin.tie(0);
using namespace std;
int main() {
  fastio;
  ll n = 0;
  cin >> n;
  ll sum = 100;
  ll c = 0;
  while (sum < n) {
    sum = sum * 101;
    sum = sum / 100;
    ++c;
  }
  cout << c;
  return 0;
}
Problem p02694 (C++) — buggy submission, verdict: Time Limit Exceeded

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

#define LL long long
#define MOD 1000000007
#define rep(i, n) for (int i = 0; i < (n); i++)

using namespace std;

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

  LL yokin = 100;
  int ans = 0;
  while (1) {
    ans++;
    yokin += yokin * 0.01;
    if (X <= yokin)
      break;
  }
  cout << ans << endl;

  return 0;
}

Error: TLE

Fixed submission:

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

#define LL long long
#define MOD 1000000007
#define rep(i, n) for (int i = 0; i < (n); i++)

using namespace std;

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

  double yokin = 100;
  int ans = 0;
  while (X > yokin) {
    yokin += (int)(yokin * 0.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() {
  uint64_t n;
  uint64_t t = 100;
  uint64_t count = 0;
  cin >> n;
  while (n > t) {
    count++;
    t *= 1.01;
  }
  cout << count << endl;
}

Error: TLE

Fixed submission:

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

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

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main() {
  ll x;
  cin >> x;
  ll res = 100;
  ll ans = 0;
  for (int i = 0;; ++i) {
    if (res >= x)
      break;
    res = res + res / 100;
    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;
typedef long long ll;
int main() {
  ll x;
  cin >> x;
  ll mon = 100;
  ll ans = 0;
  for (int i = 0;; ++i) {
    if (mon >= x)
      break;
    mon = mon * 101 / 100;
    ++ans;
  }
  cout << ans << endl;
  return 0;
}
Problem p02694 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <iostream>
#include <map>
#include <set>
#include <stdio.h>
#include <string>
#include <vector>

using namespace std;

#define ll long long
// #define rep(i, n) for (ll i = 1; i < (n+1); i++)
// #define rep(j, n) for (ll j = 1; j < (n+1); j++)
// #define rep(k, n) for (ll k = 1; k < (n+1); k++)

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


Error: TLE

Fixed submission:

#include <iostream>
#include <map>
#include <set>
#include <stdio.h>
#include <string>
#include <vector>

using namespace std;

#define ll long long
// #define rep(i, n) for (ll i = 1; i < (n+1); i++)
// #define rep(j, n) for (ll j = 1; j < (n+1); j++)
// #define rep(k, n) for (ll k = 1; k < (n+1); k++)

int main() {
  ll K;
  int a = 100;
  cin >> K;
  int year = 0;
  while (a < K) {
    a = a * 1.01;
    // a = float(a);
    // cout << a << endl;
    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 i = 0;
  long long m = 100;
  while (true) {
    if (m >= X)
      break;
    m = m * 1.01;
    i++;
  }
  cout << i << endl;
  return 0;
}

Error: TLE

Fixed submission:

#include <iostream>
using namespace std;
int main() {
  int X;
  cin >> X;
  int i = 0;
  int m = 100;
  while (true) {
    if (m >= X)
      break;
    m = m * 1.01;
    i++;
  }
  cout << i << endl;
  return 0;
}
Problem p02694 (C++) — buggy submission, verdict: Runtime Error

/**
 *author: Ritchie Zhang
 *date:2020/5/2
 **/

#include <stdio.h>
#define LL long long
int main() {
  LL x, y;
  int i;
  scanf("%lld", &x);
  y = 100;
  for (i = 1; i <= 4000; i++) {
    y = y + y * 0.01;
    if (y >= x)
      break;
  }
  printf("%d\\n", i);
  return 0;
}

Error: 0

Fixed submission:

/**
 *author: Ritchie Zhang
 *date:2020/5/2
 **/
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int interest(ll, ll, int);
int main() {
  ll y;
  cin >> y;
  cout << interest(100, y, 0) << endl;
}

int interest(ll x, ll y, int n) {
  if (x < y) {
    x += int(x * 0.01);
    n++;
    interest(x, y, n);
  } else {
    return n;
  }
}
Problem p02694 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <iostream>

using namespace std;

int main() {
  long long x;
  long long m = 100.0;
  long long y = 0;
  cin >> x;

  while (m < x) {
    // m = m * 1.01;
    m += m / 100;
    y++;
  }
  cout << y << endl;

  return 0;
}

Error: TLE

Fixed submission:

#include <iostream>

using namespace std;

int main() {
  long long x;
  int m = 100.0;
  int y = 0;
  cin >> x;

  for (y = 0; m < x; y++) {
    // m = m * 1.01;
    m += m / 100;
  }
  cout << y << endl;

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

#pragma GCC optimize(2)
#include <bits/stdc++.h>
using namespace std;

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

  while (X > a) {
    a += a / 100;
    a /= 1;
    ans++;
  }
  cout << ans << endl;
  return 0;
}


Error: TLE

Fixed submission:

#pragma GCC optimize(2)
#include <bits/stdc++.h>
using namespace std;

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

  while (X > a) {
    a += a / 100;
    a /= 1;
    ans++;
  }
  cout << ans << 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++)

int main() {
  long long X;
  cin >> X;
  long long B = 100; // 預金
  int n = 0;         // n年度

  while (B < X) {
    B += B / 100;
    n++;
  }

  cout << n << endl;

  return 0;
}


Error: TLE

Fixed submission:

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

int main() {
  int64_t x;
  cin >> x;
  int cnt = 0;
  int i = 100;
  while (1) {
    i = 1.01 * i;
    cnt++;
    if (i >= x)
      break;
  }

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

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

#define rep(i, n) for (int i = 0; i < (int)n; i++)
#define reps(i, s, n) for (int i = (int)s; i < (int)n; i++)
#define in(i) std::cin >> i;
#define print(i) std::cout << i;
#define println(i) std::cout << i << std::endl;
using namespace std;

int main() {
  long x, m = 100, i;

  cin >> x;

  for (i = 0; m < x; i++) {
    m = m + (long)(m * 0.01);
  }

  cout << i << endl;

  return 0;
}

Error: TLE

Fixed submission:

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

#define rep(i, n) for (int i = 0; i < (int)n; i++)
#define reps(i, s, n) for (int i = (int)s; i < (int)n; i++)
#define in(i) std::cin >> i;
#define print(i) std::cout << i;
#define println(i) std::cout << i << std::endl;
using namespace std;

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

  cin >> x;

  for (i = 0; m < x; i++) {
    m = m + m * 0.01;
  }

  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 p = 100;
  int cnt = 0;

  while (p < x) {
    p += p / 100;
    cnt++;
  }

  cout << cnt << endl;
  return 0;
}


Error: TLE

Fixed submission:

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

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

  while (p < x) {
    p += p / 100;
    cnt++;
  }

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

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


Error: TLE

Fixed submission:

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

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

#include <bits/stdc++.h>

using namespace std;

using ll = long long;

#define MOD_NUMBER 1000000007

template <class T> void vector_print(vector<T> vec) {
  for (unsigned int i = 0; i < vec.size(); i++) {
    cout << vec.at(i);
    if (i < vec.size() - 1) {
      cout << " ";
    } else if (i == vec.size() - 1) {
      cout << endl;
    }
  }
}

int main() {
  ll x, ans = 0, table = 100;
  cin >> x;
  while (table < x) {
    table = (ll)(table * 1.01);
    ans++;
  }

  cout << ans << endl;

  return 0;
}


Error: TLE

Fixed submission:

#include <bits/stdc++.h>

using namespace std;

using ll = long long;

#define MOD_NUMBER 1000000007

template <class T> void vector_print(vector<T> vec) {
  for (unsigned int i = 0; i < vec.size(); i++) {
    cout << vec.at(i);
    if (i < vec.size() - 1) {
      cout << " ";
    } else if (i == vec.size() - 1) {
      cout << endl;
    }
  }
}

int main() {
  ll x, ans = 0, table = 100;
  cin >> x;
  while (table < x) {
    table = table * 101 / 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 ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
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;
}
const int INF = (1 << 30) - 1;
const ll LINF = (1LL << 60) - 1;

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

  ll now = 100;
  int res = 0;

  while (1) {
    res++;
    now += now / 100;
    if (now >= x)
      break;
  }
  cout << res << endl;
}


Error: TLE

Fixed submission:

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

typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
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;
}
const int INF = (1 << 30) - 1;
const ll LINF = (1LL << 60) - 1;

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

  ll now = 100;
  int res = 0;

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

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

int main() {
  // ここにプログラムを追記
  long X;
  cin >> X;
  long x = 100;
  for (int i = 1;; i++) {
    x += x / 100;
    if (x >= X) {
      cout << i << endl;
      break;
    }
  }
}


Error: TLE

Fixed submission:

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

int main() {
  // ここにプログラムを追記
  int X;
  cin >> X;
  int x = 100;
  for (int i = 1;; i++) {
    x += x / 100;
    if (x >= X) {
      cout << i << endl;
      break;
    }
  }
}
Problem p02694 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <cmath>
#include <iostream>
using namespace std;
int main() {
  long int x, yen = 100;
  int year = 0;
  cin >> x;
  while (yen < x) {
    year++;
    yen = yen * 1.01;
  }
  cout << year << endl;
}

Error: TLE

Fixed submission:

#include <cmath>
#include <iostream>
using namespace std;
int main() {
  long int x, yen = 100;
  int year = 0;
  cin >> x;
  while (yen < x) {
    yen = (int)(yen * 1.01);
    year++;
  }
  cout << year << endl;
}
Problem p02694 (C++) — buggy submission, verdict: Time Limit Exceeded

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

int main() {
  int64_t X, o;
  int k = 0;
  int z;
  o = 100;
  cin >> X;
  while (o < X) {
    o = o + o / 100;
    k = k + 1;
  }
  cout << k << endl;
}

Error: TLE

Fixed submission:

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

int main() {
  int64_t X;
  int k = 0;
  int z;
  int o = 100;
  cin >> X;
  while (o < X) {
    o = o + o / 100;
    k = k + 1;
  }
  cout << k << endl;
}