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

#include <iostream>
using namespace std;

int main() {
  int x, y;
  int a;

  cin >> x >> y;
  while (x != 0 || y != 0) {
    if (x > y) {
      a = x;
      x = y;
      y = a;
    }
    cout << x << " " << y << endl;
    cin >> x >> y;
  }
}


Error: TLE

Fixed submission:

#include <iostream>
using namespace std;

int main() {
  int x, y;
  int a;

  cin >> x >> y;
  while (x != 0 || y != 0) {
    if (x > y) {
      a = x;
      x = y;
      y = a;
      cout << x << " " << y << endl;
      cin >> x >> y;
    }
  }
}
Problem p02397 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <iostream>
using namespace std;
int main() {
  int a, b, emp;
  for (int i = 1;; i++) {
    cin >> a >> b;
    if (a == 0 && b == 0)
      break;
    if (a > b) {
      emp = a;
      a = b;
      b = emp;
      cout << a << " " << b << endl;
    } else
      cout << a << " " << b << endl;
  }
  return 0;
}

Error: TLE

Fixed submission:

#include <iostream>
using namespace std;
int main() {
  int a, b, emp;
  for (int i = 1;; i++) {
    cin >> a >> b;
    if (a > b) {
      emp = a;
      a = b;
      b = emp;
      cout << a << " " << b << endl;
    } else
      cout << a << " " << b << endl;
  }
  return 0;
}
Problem p02397 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <stdbool.h>
#include <stdio.h>
int main(void) {
  int x, y;
  while (1) {
    scanf("%d %d", &x, &y);
    if (x == 0 && y == 0)
      break;
    if (x < y) {
      printf("%d %d\\n", x, y);
    } else {
      printf("%d %d\\n", y, x);
    }
  }
  return 0;
}


Error: TLE

Fixed submission:

#include <stdio.h>
int main(void) {
  int x, y;
  scanf("%d %d", &x, &y);
  while (1) {
    if (x == 0 && y == 0)
      break;
  }
  if (x < y) {
    printf("%d %d\\n", x, y);
  } else {
    printf("%d %d\\n", y, x);
  }
}
Problem p02397 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <iostream>
using namespace std;
int main() {
  int x, y;

  while (1) {
    cin >> x >> y;
    if ((x == 0) && (y == 0))
      break;
    if (x <= y)
      cout << x << " " << y << endl;
    else
      cout << y << " " << x << endl;
  }
  return 0;
}


Error: TLE

Fixed submission:

#include <iostream>
using namespace std;
int main() {
  int x, y;
  cin >> x >> y;
  int i = 1;

  while (i < 3000) {
    if (x == 0 && y == 0)
      break;
    if (x <= y)
      cout << x << " " << y << endl;
    else
      cout << y << " " << x << endl;
  }
  return 0;
}
Problem p02397 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <iostream>
using namespace std;

int main() {
  int x, y;
  while (1) {
    cin >> x >> y;
    if (x < y) {
      cout << x << " " << y << endl;
    } else if (x > y) {
      cout << y << " " << x << endl;
    } else if (x == y && x != 0) {
      cout << x << " " << y << endl;
    } else if (x == 0 && y == 0) {
      break;
    }
  }
  return 0;
}

Error: TLE

Fixed submission:

#include <iostream>
using namespace std;

int main() {
  int x, y;
  while (1) {
    cin >> x >> y;
    if (x < y) {
      if (x == 0 && y == 0) {
        break;
      }
      cout << x << y << endl;
    } else if (x > y) {
      if (x == 0 && y == 0) {
        break;
      }
      cout << y << x << endl;
    } else {
      cout << x << y << endl;
    }
  }
  return 0;
}
Problem p02397 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <iostream>
using namespace std;
int main() {
  int a, b;
  cin >> a >> b;
  while (a != 0 || b != 0) {
    if (a < b)
      cout << a << " " << b << endl;
    else
      cout << b << " " << a << endl;
    cin >> a >> b;
  }
}

Error: TLE

Fixed submission:

#include <iostream>
using namespace std;
int main() {
  int a, b;
  do {
    cin >> a >> b;
    if (a > b)
      cout << b << " " << a << endl;
    else
      cout << a << " " << b << endl;
  } while (a ^ 2 + b ^ 2 != 0);
}
Problem p02398 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <iostream>
using namespace std;

int main() {
  int a, b, c, sum;
  cin >> a >> b >> c;
  sum = 0;

  for (int i = a; i <= b; i++) {
    if (c % i == 0)
      sum++;
  }

  cout << sum << endl;
  return 0;
}

Error: TLE

Fixed submission:

#include <iostream>
using namespace std;

int main() {
  int a, b, c, sum;
  cin >> a >> b >> c;
  sum = 0;

  for (int i = a; a <= b; i++) {
    if (i % c == 0)
      sum++;
  }

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

#include <iostream>
using namespace std;

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

  for (x = a; x <= b; x++) {
    if (c % x == 0) {
      y += 1;
    }
  }

  cout << y << endl;

  return 0;
}

Error: TLE

Fixed submission:

#include <iostream>
using namespace std;

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

  for (x = a; a <= b; x++) {
    if (c % x == 0) {
      y += 1;
    }
  }

  cout << y << endl;

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

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

int main() {

  int a, b, c;

  cin >> a >> b >> c;

  int yakusu = 0;

  for (int i = a; i <= b; i++) {

    if (c % i == 0)
      yakusu++;
  }

  cout << yakusu << endl;

  return 0;
}


Error: WA

Fixed submission:

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

int main() {

  int x, a, b, c, i;

  for (int x = a; x <= b; i++) {

    cin >> a >> b >> c;

    if (c % i == 0)
      x++;
  }

  cout << x << endl;

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

#include <iostream>
using namespace std;

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

  int cnt = 0;
  for (int i = a; i <= b; i++) {
    if (c % i == 0) {
      cnt++;
    }
  }
  cout << cnt << endl;
  return 0;
}


Error: TLE

Fixed submission:

#include <iostream>
using namespace std;

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

  int cnt = 0;
  for (int i = a; i <= b; c++) {
    if (c % i == 0) {
      cnt++;
    }
  }
  cout << cnt << endl;
  return 0;
}
Problem p02398 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <iostream>
using namespace std;
int main() {
  int a;
  int b;
  int c;
  int i;
  int x = 0;
  cin >> a >> b >> c;
  for (i = a; i <= b; i++) {
    if (c % i == 0) {
      x++;
    }
  }
  cout << x << endl;
  return 0;
}


Error: TLE

Fixed submission:

#include <iostream>
using namespace std;
int main() {
  int a;
  int b;
  int c;
  int i;
  int x = 0;
  cin >> a >> b >> c;
  for (i = a; i++; i <= b) {
    if (c % i == 0) {
      x++;
    }
  }
  cout << x << endl;
  return 0;
}
Problem p02398 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <iostream>
using namespace std;
int main() {
  int a, b, c, cnt = 0;
  cin >> a >> b >> c;
  for (int i = a; i <= b; i++) {
    if (c % i == 0)
      cnt++;
  }
  cout << cnt << endl;
  return 0;
}


Error: TLE

Fixed submission:

#include <iostream>
using namespace std;
int main() {
  int a, b, c;
  cin >> a >> b >> c;
  for (int i = a; i <= b; i) {
    if (c % i == 0)
      cout << i << endl;
  }
  return 0;
}
Problem p02398 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <iostream>
using namespace std;

int main() {

  int a, b, c, i, n;

  cin >> a >> b >> c;

  n = 0;

  for (i = a; i <= b; i++) {
    if (c % i == 0)
      n++;
  }

  cout << n << endl;
}

Error: TLE

Fixed submission:

#include <iostream>
using namespace std;

int main() {

  int a, b, c, i, n;

  cin >> a >> b >> c;

  n = 0;

  for (i = a; i = b; i++) {
    if (c % i == 0)
      n++;
  }

  cout << n << endl;
}
Problem p02398 (C++) — buggy submission, verdict: Runtime Error

// class point	の練習（クラスの高度な実装）
#include <iostream>
using namespace std;

int main() {
  int a, b, c;
  int cnt = 0;

  cin >> a >> b >> c;

  for (int i = a; i <= b; i++) {
    if (c % i == 0)
      cnt++;
  }
  cout << cnt << endl;
  return 0;
}


Error: -8

Fixed submission:

// class point	の練習（クラスの高度な実装）
#include <iostream>
using namespace std;

int main() {
  int a, b, c;
  int cnt = 0;

  cin >> a >> b >> c;

  for (int i = a; i <= b; i++) {
    if (c / i % 0)
      cnt++;
  }
  cout << cnt << endl;
  return 0;
}
Problem p02398 (C++) — buggy submission, verdict: Runtime Error

#include <iostream>

using namespace std;

int main() {
  int a, b, c, ans, q;
  int count = 0;

  cin >> a >> b >> c;

  for (int i = 1; i <= c; ++i) {
    if (c % i == 0) {
      for (int j = 0; a + j <= b; ++j) {
        ans = a + j;
        if (i == ans) {
          count = count + 1;
        }
      }
    }
  }
  cout << count << endl;
  cin >> q;
}


Error: -8

Fixed submission:

#include <iostream>

using namespace std;

int main() {
  int a, b, c;
  int count = 0;
  int list[5000];
  int cyaku[5000];
  cin >> a >> b >> c;
  for (int i = a; i < b + 1; i++) {
    list[i] = i;
  }
  for (int j = 0; j <= c; ++j) {
    if (c % j == 0) {
      cyaku[j] = j;
    }
  }
  for (int k = 0; k < 5000; ++k) {
    if (list[k] == cyaku[k]) {
      count = count + 1;
    }
  }
  cout << count;
}
Problem p02398 (C++) — buggy submission, verdict: Runtime Error

#include <iostream>
using namespace std;

int main() {
  int a, b, c, n = 0;
  cin >> a >> b >> c;

  for (int i = a; i <= b; i++) {
    if (c % i == 0)
      n++;
  }

  cout << n << endl;

  return 0;
}


Error: 3

Fixed submission:

#include <iostream>
using namespace std;

int main() {
  int a, b, c, n = 0;
  cin >> a >> b >> c;

  for (int i = a; i <= b; i++) {
    if (c % i == 0)
      n++;
  }

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

#include <iostream>
using namespace std;
#define MAX 10000

int main(void) {
  int a, b, c, count;
  do {
    cin >> a >> b >> c;
  } while (a < 1 || a > MAX || b < 1 || b > MAX || c < 1 || c > MAX || a > b);

  for (int i = a; i <= b; i++) {
    if (c % i == 0)
      count++;
  }
  cout << count << endl;
  return 0;
}

Error: TLE

Fixed submission:

#include <iostream>
using namespace std;
#define MAX 10000

int main(void) {
  int a, b, c, count;
  do {
    cin >> a >> b >> c;
  } while (a < 1 || a > MAX || b < 1 || b > MAX || c < 1 || c > MAX || a > b);

  for (int i = a; a <= b; i++) {
    if (c % i == 0)
      count++;
  }
  cout << count << endl;
  return 0;
}
Problem p02398 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <bits/stdc++.h>

using namespace std;

int main() {

  int a, b, c;
  cin >> a >> b >> c;

  int cnt = 0;
  for (int x = a; x <= b; x++) {
    if (c % x == 0)
      cnt++;
  }

  cout << cnt << endl;
}


Error: TLE

Fixed submission:

#include <bits/stdc++.h>

using namespace std;

int main() {

  while (1) {
    int x, y;
    cin >> x >> y;
    if (x == 0 && y == 0)
      break;

    if (x > y)
      swap(x, y);
    cout << x << " " << y << endl;
  }
}
Problem p02398 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <stdio.h>

int main() {
  int a, b, c, d;
  scanf("%d %d %d %d", &a, &b, &c, &d);
  d = 0;
  for (a; a <= b; a++) {
    if (c % a == 0) {
      d++;
    }
  }
  printf("%d\\n", d);
}


Error: TLE

Fixed submission:

#include <stdio.h>

int main() {
  int a, b, c, d;
  scanf("%d %d %d %d", &a, &b, &c, &d);
  d = 0;
  for (a < b; a++;) {
    if (a % c == 0) {
      d++;
    }
  }
  printf("%d\\n", d);
}
Problem p02398 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <stdio.h>
int main(void) {
  int x, y, z, p, c, t;
  t = 0;
  c = 0;
  scanf("%d %d %d", &x, &y, &z);
  for (p = 0; c < y; p++) {
    c = x;
    c += p;
    if (z % c == 0) {
      t++;
    }
  }
  printf("%d\\n", t);
  return 0;
}

Error: TLE

Fixed submission:

#include <stdio.h>
int main(void) {
  int a, b, c, d, e, r;
  scanf("%d %d %d", &a, &b, &c);
  for (d == 0; a <= b; b++) {
    e == a;
    e += d;
    if (c % e == 0) {
      r++;
    }
  }
  printf("%d", r);
}
Problem p02398 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <iostream>
using namespace std;
int main() {
  int a, b, c, count;
  cin >> a >> b >> c;
  for (int i = a; i <= b; i++) {
    if (c % i == 0) {
      count = count + 1;
    }
  }
  cout << count << endl;
  return 0;
}


Error: TLE

Fixed submission:

#include <iostream>
using namespace std;
int main() {
  int a, b, c, count;
  cin >> a >> b >> c;
  for (int i = a; i <= b; i + 1) {
    if (c % i == 0) {
      count = count + 1;
    }
  }
  cout << count << endl;
  return 0;
}
Problem p02398 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <iostream>
using namespace std;

int main() {
  int a, b, c, i, cnt;
  cin >> a >> b >> c;
  for (i = a; i <= b; i++) {
    if (c % i == 0)
      cnt++;
  }
  cout << cnt << endl;
  return 0;
}

Error: TLE

Fixed submission:

#include <iostream>
using namespace std;

int main() {
  int a, b, c, i, cnt;
  cin >> a >> b >> c;
  for (i = a; a <= b; i++) {
    if (i % c == 0)
      cnt++;
  }
  cout << cnt << endl;
  return 0;
}
Problem p02398 (C++) — buggy submission, verdict: Runtime Error

#include <iostream>
using namespace std;
int main() {
  int a, b, c, x, y;
  cin >> a >> b >> c;
  for (int x = a; x <= b; x++) {
    if (c % x == 0) {
      y++;
    }
  }
  cout << y << endl;
  return 0;
}


Error: WA

Fixed submission:

#include <iostream>
using namespace std;
int main() {
  int a, b, c, x, y;
  for (int x = a; x <= b; x++) {
    cin >> a >> b >> c;
    if (c % x == 0) {
      y++;
    }
  }
  cout << y << endl;
  return 0;
}
Problem p02398 (C++) — buggy submission, verdict: Runtime Error

#include <iostream>
using namespace std;
int main() {
  int a, b, c, t = 0;
  cin >> a >> b >> c;
  for (int i = a; i <= b; i++) {
    if (c % i == 0) {
      t++;
    }
  }
  cout << t << endl;
  return 0;
}

Error: -8

Fixed submission:

#include <bits/stdc++.h>
using namespace std;
int main() {
  int a, b, c, t = 0;
  cin >> a >> b >> c;
  for (int i = a; i <= b; i++) {
    if (i %= 0) {
      t = t + 1;
    }
  }
  cout << t << endl;
  return 0;
}
Problem p02398 (C++) — buggy submission, verdict: Runtime Error

#include <iostream>
using namespace std;
int main() {
  int a, b, c, n = 0;
  cin >> a >> b >> c;
  for (int i = a; i <= b; i++) {
    if (c % i == 0)
      n++;
  }
  cout << n << endl;
  return 0;
}

Error: -8

Fixed submission:

#include <iostream>
using namespace std;
int main() {
  int a, b, c, n = 0;
  cin >> a >> b >> c;
  for (int i = 0; i <= b; i++) {
    if (c % i == 0)
      n++;
  }
  cout << n << endl;
  return 0;
}
Problem p02398 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <iostream>
using namespace std;

int main() {
  int a, b, c;
  int count = 0;
  int i;
  cin >> a >> b >> c;

  for (i = 0; i <= b - a; i++) {
    if (c % (a + i) == 0) {
      count += 1;
    }
  }
  cout << count << endl;
  return 0;
}


Error: TLE

Fixed submission:

#include <iostream>
using namespace std;

int main() {
  int x, y;

  while (1) {
    cin >> x >> y;
    if (x == 0 && y == 0) {
      break;
    } else {
      if (x > y) {
        cout << y << " " << x << endl;
      } else {
        cout << x << " " << y << endl;
      }
    }
  }

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

#include <cstdio>
#include <iostream>
#include <set>
using namespace std;

int main() {
  int a, b, c;
  cin >> a >> b >> c;
  set<int> s;
  for (int i = 1; i <= c; ++i) {
    if (c % i == 0) {
      s.insert(i);
      s.insert(c / i);
    }
  }
  auto it = s.lower_bound(a);
  int ret = 0;
  while (it != s.end() && *it <= b) {
    ++it, ++ret;
  }
  cout << ret << endl;
  return 0;
}

Error: TLE

Fixed submission:

#include <cstdio>
#include <iostream>
#include <set>
#define rep2(x, from, to) for (int x = (from); (x) < (to); (x)++)
#define rep(x, to) rep2(x, 0, to)
using namespace std;

int main() {
  int a, b, c;
  cin >> a >> b >> c;
  set<int> s;
  rep2(i, 1, c) {
    if (c % i == 0) {
      s.insert(i);
      s.insert(c / i);
    }
  }
  auto it = s.lower_bound(a);
  int ret = 0;
  while (*it <= b) {
    ++it, ++ret;
  }
  cout << ret << endl;
  return 0;
}
Problem p02398 (C++) — buggy submission, verdict: Runtime Error

#include <iostream>
using namespace std;

int main() {
  int a, b, c;
  int d = 0;
  int i;
  cin >> a >> b >> c;

  for (i = a; i <= b; i++) {
    if (c % i == 0) {
      d++;
    }
  }
  cout << d << endl;
  return 0;
}

Error: WA

Fixed submission:

#include <iostream>
using namespace std;

int main() {
  int a, b, c, d = 0, i;
  cin >> a >> b >> c;

  for (i == a; i <= b; i++) {
    if (c % i == 0) {
      d++;
    }
    cout << d << endl;
  }
  return 0;
}
Problem p02398 (C++) — buggy submission, verdict: Runtime Error

#include <iostream>
using namespace std;
int main() {
  int a, b, c, n;
  cin >> a >> b >> c;
  n = 0;
  for (int i = a; i <= b; i++) {
    if (c % i != 0)
      continue;
    else
      n++;
  }
  cout << n << endl;
  return 0;
}


Error: TLE

Fixed submission:

#include <iostream>
using namespace std;
int main() {
  int a, b, c, n;
  n = 0;
  for (int i = a; i <= b; i++) {
    if (i % c == 0)
      n = n + 1;
  }
  cout << n << endl;
  return 0;
}
Problem p02398 (C++) — buggy submission, verdict: Time Limit Exceeded

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

int main() {
  int a, b, c, count = 0;
  cin >> a >> b >> c;
  for (int i = a; i <= b; i++)
    if (c % i == 0)
      count++;
  cout << count << endl;
  return 0;
}


Error: TLE

Fixed submission:

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

int main() {
  int a, b, c, count = 0;
  cin >> a >> b >> c;
  for (int i = a; i <= b; a++)
    if (c % i == 0)
      count++;
  cout << count << endl;
  return 0;
}
Problem p02398 (C++) — buggy submission, verdict: Time Limit Exceeded

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

int main() {
  int a, b, c, d;
  cin >> a >> b >> c;

  for (int i = a; i <= b; i++) {
    if (c % i == 0)
      d += 1;
  }
  cout << d << endl;
  return 0;
}

Error: TLE

Fixed submission:

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

int main() {
  int a, b, c, d;
  cin >> a >> b >> c;

  for (; a != b; b++) {
    if (c % b == 0)
      d += 1;
  }
  cout << d << endl;
  return 0;
}
Problem p02398 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <iostream>

using namespace std;

int main(void) {

  int a, b, c;
  int count = 0;

  cin >> a >> b >> c;

  while (a <= b) {
    if (c % a == 0)
      count++;
    a++;
  }

  cout << count << endl;

  return 0;
}

Error: TLE

Fixed submission:

#include <iostream>

using namespace std;

int main(void) {

  int a, b, c;
  int count = 0;

  cin >> a >> b >> c;

  while (a <= b) {
    if (c % a == 0)
      a++;
    count++;
  }

  cout << count << endl;

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

#include <iostream>
using namespace std;
int main() {
  int a, b, c, x, y;

  cin >> a >> b >> c;

  y = 0;
  for (int p = a; p <= b; p++)

  {
    x = c % p;

    if (x == 0) {

      y = y + 1;
    }
  }

  cout << y << endl;

  return 0;
}

Error: TLE

Fixed submission:

#include <iostream>
using namespace std;
int main() {
  int a, b, c, x, y;

  cin >> a >> b >> c;

  for (int p = a; p = b; p++)

  {
    x = c % p;

    if (x = 0) {
      y = y + 1;
    }
  }

  cout << y << endl;
  return 0;
}
Problem p02398 (C++) — buggy submission, verdict: Runtime Error

#include <iostream>
using namespace std;
int main() {
  int a, b, c, j;
  j = 0;
  cin >> a >> b >> c;
  for (int i = 0; i <= b - a; i++) {
    int n = a + i;
    if (c % n == 0) {
      j = j + 1;
    }
  }
  cout << j << endl;
}


Error: WA

Fixed submission:

#include <iostream>
using namespace std;
int main() {
  int a, b, c, i;
  i = a;
  cin >> a >> b >> c;
  while (1) {
    if (i > b)
      break;
    else if (c % i == 0) {
      cout << i << endl;
    }
    i = a++;
  }
  return 0;
}
Problem p02398 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <iostream>
using namespace std;

int main() {
  int a, b, c;
  int count = 0;

  cin >> a >> b >> c;

  for (int i = a; i <= b; i++) {
    if (c % i == 0) {
      count++;
    }
  }
  cout << count << endl;
  return 0;
}

Error: TLE

Fixed submission:

#include <iostream>
using namespace std;

int main() {
  int a, b, c;
  int count = 0;

  cin >> a >> b >> c;

  for (int i = a; a <= b; i++) {
    if (c % i == 0) {
      count++;
    }
  }
  cout << count << endl;
  return 0;
}
Problem p02398 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <iostream>

using namespace std;

int main() {
  int x, y, z;
  int i, l;

  l = 0;

  cin >> x;
  cin >> y;
  cin >> z;

  for (i = x; i <= y; i++) {
    if ((z % i) == 0) {
      l++;
    }
  }

  cout << l << endl;

  return 0;
}

Error: TLE

Fixed submission:

#include <iostream>

using namespace std;

int main() {
  int x, y, z;
  int i, l;

  l = 0;

  cin >> x;
  cin >> y;
  cin >> z;

  for (i = x; i <= y; i++) {
    if ((z % i) == 0) {
      l++;
    }
  }

  cout << l << endl;

  while (1)
    ;

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

#include <iostream>
using namespace std;
int main() {
  int a, b, c;
  int x = 0;
  cin >> a >> b >> c;
  for (int i = a; i <= b; i++) {
    if (c % a == 0)
      x++;
    a++;
  }
  cout << x << endl;
  return 0;
}

Error: -8

Fixed submission:

#include <iostream>
using namespace std;
int main() {
  int a, b, c;
  int x = 0;
  int y = 0;
  cin >> a >> b >> c;
  for (int i = 0; i < b - i; i++) {
    if (c % y == 0)
      x++;
    y += 1;
  }
  cout << x << endl;
  return 0;
}
Problem p02398 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <stdio.h>
int main(void) {
  int cnt = 0, a, b, c;
  scanf("%d%d%d", &a, &b, &c);
  for (int i = a; i <= b; i++) {
    if (c % i == 0) {
      cnt++;
    }
  }
  printf("%d\\n", cnt);
  return 0;
}

Error: TLE

Fixed submission:

#include <stdio.h>
int main(void) {
  int cnt = 0, a, b, c;
  scanf("%d%d%d", &a, &b, &c);
  for (int i = a; a <= b; i++) {
    if (c % i == 0) {
      cnt++;
    }
  }

  printf("%d", cnt);
  return 0;
}
Problem p02398 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <iostream>
using namespace std;
int main() {
  int a, b, c;
  int count = 0;
  cin >> a >> b >> c;
  for (int i = a; i <= b; i++) {
    if (c % i == 0)
      count += 1;
  }
  cout << count << endl;
}


Error: TLE

Fixed submission:

#include <iostream>
using namespace std;
int main() {
  int a, b, c;
  int count = 0;
  cin >> a >> b >> c;
  if (c % a == 0)
    count += 1;
  while (++a != b) {
    if (c % a == 0)
      count++;
  }
  cout << count << endl;
}
Problem p02398 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <iostream>
using namespace std;
int main() {
  int a, b, c;
  cin >> a >> b >> c;
  int i = a;
  int d = 0;
  while (i <= b) {

    if (c % i == 0) {
      d++;
    }
    i++;
  }
  cout << d << endl;

  return 0;
}


Error: TLE

Fixed submission:

#include <iostream>
using namespace std;
int main() {
  int a, b, c;
  cin >> a >> b >> c;
  int i = a;
  int d = 0;
  while (i <= b) {

    if (c % i == 0) {
      d++;
      i++;
    }
  }
  cout << d << endl;

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

#include <iostream>
using namespace std;

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

  int count = 0;
  for (int i = a; i <= b; i++)
    if (c % i == 0)
      count++;

  cout << count << endl;
}


Error: TLE

Fixed submission:

#include <iostream>
using namespace std;

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

  int count = 0;
  for (int i = a; a <= b; i++)
    if (c % i == 0)
      count++;

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

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

int main() {
  int a, b, c, n;
  cin >> a >> b >> c;
  n = 0;

  for (a; a <= b; a++) {
    if (c % a == 0)
      n++;
  }
  cout << n << endl;
}

Error: TLE

Fixed submission:

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

int main() {
  int a, b, c, n;
  cin >> a >> b >> c;
  n = 0;

  for (int i = a; a <= b; i++) {
    if (c % i == 0)
      n++;
  }
  cout << n << endl;
}